

var timer // used to prevent ajax from executing too fast...

function GetXmlHttpObject()
     {
          var xmlHttp;
          try
          {  
               // Firefox, Opera 8.0+, Safari  
               xmlHttp=new XMLHttpRequest();  
          }
          catch (e)
          {  
               // Internet Explorer  
               try
               {    
                    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");    
               }
               catch (e)
               {    
                    try
                    {      
                         xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");      
                    }
                    catch (e)
                    {      
                         alert("Your browser does not support AJAX!");      
                         return false;      
                    }    
               }  
          }
          return xmlHttp;
     }


function onMouseOverTab(tab)
// this does any requested action upon onmouseover
{
     if( tab.style.backgroundColor=='#ffffff' )
     {
          tab.style.backgroundColor='#FFFF34';
          tab.style.borderBottom='0px';
     }
}


function onMouseOutTab(tab)
// this does any requested action upon onmouseover
{
     if( tab.style.backgroundColor=='#ffff34' )
     {
          tab.style.backgroundColor='#FFFFFF';
          tab.style.borderBottom='1px #5A6984 solid';
     }
}


function ajaxShowSpecs(id)
// this is used on the product page to change the text under the tabs
{
     document.getElementById("specifications").style.backgroundColor='#CCCCCC';
     document.getElementById("options").style.backgroundColor='#FFFFFF';
     document.getElementById("related").style.backgroundColor='#FFFFFF';
     document.getElementById("options").style.borderBottom='1px #5A6984 solid';
     document.getElementById("related").style.borderBottom='1px #5A6984 solid';
     xmlHttp=GetXmlHttpObject();
     if (xmlHttp==null)
     {
          alert ("Your browser does not support AJAX!");
          return;
     } 
     var url="/product_specs.php";
     url=url+"?id="+id;
     url=url+"&sid="+Math.random();
     xmlHttp.onreadystatechange=function()
     {
          if (xmlHttp.readyState==4)
          { 
               document.getElementById("switchable").innerHTML=xmlHttp.responseText;
          }
     }
     xmlHttp.open("GET",url,true);
     xmlHttp.send(null);
}


function ajaxShowOptions(id)
// this is used on the product page to change the text under the tabs
{
     document.getElementById("specifications").style.backgroundColor='#FFFFFF';
     document.getElementById("options").style.backgroundColor='#CCCCCC';
     document.getElementById("related").style.backgroundColor='#FFFFFF';
     document.getElementById("specifications").style.borderBottom='1px #5A6984 solid';
     document.getElementById("related").style.borderBottom='1px #5A6984 solid';
     xmlHttp=GetXmlHttpObject();
     if (xmlHttp==null)
     {
          alert ("Your browser does not support AJAX!");
          return;
     } 
     var url="/product_options.php";
     url=url+"?id="+id;
     url=url+"&sid="+Math.random();
     xmlHttp.onreadystatechange=function()
     {
          if (xmlHttp.readyState==4)
          { 
               document.getElementById("switchable").innerHTML=xmlHttp.responseText;
          }
     }
     xmlHttp.open("GET",url,true);
     xmlHttp.send(null);
}


function ajaxShowRelated(id)
// this is used on the product page to change the text under the tabs
{
     document.getElementById("specifications").style.backgroundColor='#FFFFFF';
     document.getElementById("options").style.backgroundColor='#FFFFFF';
     document.getElementById("related").style.backgroundColor='#CCCCCC';
     document.getElementById("specifications").style.borderBottom='1px #5A6984 solid';
     document.getElementById("options").style.borderBottom='1px #5A6984 solid';
     xmlHttp=GetXmlHttpObject();
     if (xmlHttp==null)
     {
          alert ("Your browser does not support AJAX!");
          return;
     } 
     var url="/product_related.php";
     url=url+"?id="+id;
     url=url+"&sid="+Math.random();
     xmlHttp.onreadystatechange=function()
     {
          if (xmlHttp.readyState==4)
          { 
               document.getElementById("switchable").innerHTML=xmlHttp.responseText;
          }
     }
     xmlHttp.open("GET",url,true);
     xmlHttp.send(null);
}


