/*
//----------------------------------------------------------------------------
// Copyright (c) 2006-2008 Asymmetric Software - Innovation & Excellence
// Author: Mark Samios
// http://www.asymmetrics.com
//----------------------------------------------------------------------------
// Ajax support functions came from the osCommerce contributions
// References: 
// http://addons.oscommerce.com/info/4144
//----------------------------------------------------------------------------
// Modifications by Asymmetrics
// - Generalized loadXMLDoc to be URL independent
//----------------------------------------------------------------------------
// Script is intended to be used with:
// osCommerce, Open Source E-Commerce Solutions
// Copyright (c) 2003 osCommerce
//----------------------------------------------------------------------------
// Released under the GNU General Public License
//----------------------------------------------------------------------------
*/
//-MS- Ajax support Added
var ajax_req; 
var ajax_target;
function loadXMLDoc(key, url, target) {
   url += key;
   ajax_target = target;
   // Internet Explorer
   try { ajax_req = new ActiveXObject("Msxml2.XMLHTTP"); } 
   catch(e) { 
      try { ajax_req = new ActiveXObject("Microsoft.XMLHTTP"); } 
      catch(oc) { ajax_req = null; } 
   } 

   // Mozailla/Safari 
   if (!ajax_req && typeof XMLHttpRequest != "undefined") { ajax_req = new XMLHttpRequest(); } 

   // Call the processChange() function when the page has loaded 
   if (ajax_req != null) {
      ajax_req.onreadystatechange = processChange; 
      ajax_req.open("GET", url, true); 
      ajax_req.send(null); 
   }
} 

function processChange() { 
  // The page has loaded and the HTTP status code is 200 OK 
  //if (ajax_req.readyState == 4 && ajax_req.status == 200) { 
  if (ajax_req.readyState == 4) { 
    // Write the contents of this URL to the searchResult layer 
    //getObject("quicksearch").innerHTML = ajax_req.responseText;
    cTarget = getObject(ajax_target);
      cTarget.style.display = 'block';
      cTarget.style.visibility = 'visible';

    if( ajax_req.responseText.length > 0 ) {
      cTarget.style.display = 'block';
      cTarget.style.visibility = 'visible';
    } else {
      cTarget.style.display = 'none';
      cTarget.style.visibility = 'hidden';
    }
    cTarget.innerHTML = ajax_req.responseText;
    //getObject(ajax_target).innerHTML = ajax_req.responseText;
  }
} 


function getObject(name) { 
   var ns4 = (document.layers) ? true : false; 
   var w3c = (document.getElementById) ? true : false; 
   var ie4 = (document.all) ? true : false; 

   if (ns4) return eval('document.' + name); 
   if (w3c) return document.getElementById(name); 
   if (ie4) return eval('document.all.' + name); 
   return false; 
}
/*
window.onload = function() { 
   getObject("keywords").focus();
}
*/
//-MS- Ajax support Added EOM
