// JavaScript Document
function showPartner(pid, pageElement)
{
     try {
     req = new XMLHttpRequest(); /* e.g. Firefox */
     } catch(e) {
       try {
       req = new ActiveXObject("Msxml2.XMLHTTP");
  /* some versions IE */
       } catch (e) {
         try {
         req = new ActiveXObject("Microsoft.XMLHTTP");
  /* some versions IE */
         } catch (E) {
          req = false;
         }
       }
     }
	 var myRand = parseInt(Math.random()*999999999999999);
     var newurl =  "admin/ajaxphp/misc.php"+ "?id=" + pid +"&rand=" + myRand;
	 req.onreadystatechange = function() {responseAHAH(pageElement);};
     req.open("GET",newurl,true);
     req.send(null);
}

function cartfunction(prodid, prodname, command, pageElement) {
     try {
     req = new XMLHttpRequest(); /* e.g. Firefox */
     } catch(e) {
       try {
       req = new ActiveXObject("Msxml2.XMLHTTP");
  /* some versions IE */
       } catch (e) {
         try {
         req = new ActiveXObject("Microsoft.XMLHTTP");
  /* some versions IE */
         } catch (E) {
          req = false;
         }
       }
     }
	 var myRand = parseInt(Math.random()*999999999999999);
     var newurl =  "admin/ajaxphp/cart.php"+ "?id=" + prodid + "&command=" + command + "&name=" + prodname +"&rand=" + myRand;
	 req.onreadystatechange = function() {responseAHAH(pageElement);};
     req.open("GET",newurl,true);
     req.send(null);
  }

function callAHAH(url, label, value, pageElement, callMessage) {
     document.getElementById(pageElement).innerHTML = callMessage;
     try {
     req = new XMLHttpRequest(); /* e.g. Firefox */
     } catch(e) {
       try {
       req = new ActiveXObject("Msxml2.XMLHTTP");
  /* some versions IE */
       } catch (e) {
         try {
         req = new ActiveXObject("Microsoft.XMLHTTP");
  /* some versions IE */
         } catch (E) {
          req = false;
         }
       }
     }
	 var myRand = parseInt(Math.random()*999999999999999);
     var newurl = url + "?label=" + label + "&value=" + value + "&rand=" + myRand;
	 req.onreadystatechange = function() {responseAHAH(pageElement);};
     req.open("GET",newurl,true);
     req.send(null);
  }

function responseAHAH(pageElement) {
   var output = '';
   if(req.readyState == 4) {
      if(req.status == 200) {
         output = req.responseText;
         document.getElementById(pageElement).innerHTML = output;
         }
      }
   }

function callconfirm(url, label, value, pageElement, callMessage) {
     document.getElementById(pageElement).innerHTML = callMessage;
     try {
     req = new XMLHttpRequest(); /* e.g. Firefox */
     } catch(e) {
       try {
       req = new ActiveXObject("Msxml2.XMLHTTP");
  /* some versions IE */
       } catch (e) {
         try {
         req = new ActiveXObject("Microsoft.XMLHTTP");
  /* some versions IE */
         } catch (E) {
          req = false;
         }
       }
     }
	 var myRand = parseInt(Math.random()*999999999999999);
     var newurl = url + "&label=" + label + "&value=" + value + "&rand=" + myRand;
	 req.onreadystatechange = function() {responseAHAH(pageElement);};
     req.open("GET",newurl,true);
     req.send(null);
  }
  
function commandLoad(url, label, value, pageElement) {
//alert('url is ' + url + ' label is ' + label + ' value is ' + value + ' pageElement is ' + pageElement);
try {
     req = new XMLHttpRequest(); /* e.g. Firefox */
     } catch(e) {
       try {
       req = new ActiveXObject("Msxml2.XMLHTTP");
  /* some versions IE */
       } catch (e) {
         try {
         req = new ActiveXObject("Microsoft.XMLHTTP");
  /* some versions IE */
         } catch (E) {
          req = false;
         }
       }
     }
	 var myRand = parseInt(Math.random()*999999999999999);
     var newurl = url + "&label=" + label + "&value=" + value + "&rand=" + myRand;
	 req.onreadystatechange = function() {responseAHAH(pageElement);};
     req.open("GET",newurl,true);
     req.send(null);
  }
