function DealVote(pid,answer,did){ var xmlhttp; if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { //document.getElementById("myDivADD"+pid).innerHTML=xmlhttp.responseText; //document.getElementById("myDivADD"+cid).innerHTML='THANKS+'; //alert(xmlhttp.responseXML); var upvotex = xmlhttp.responseXML.getElementsByTagName("votecountyes")[0].firstChild.data; var downvotex = xmlhttp.responseXML.getElementsByTagName("votecountno")[0].firstChild.data; document.getElementById("rateUpN"+pid).innerHTML=upvotex; document.getElementById("rateDownN"+pid).innerHTML=downvotex; } } xmlhttp.open("GET","deal_vote.php?deal_check="+ answer +"&pid="+ pid +"&did="+ did +"&t=" + Math.random(),true); xmlhttp.send(); } function ajcart(pid,answer,type){ var xmlhttp; if (window.XMLHttpRequest){// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); }else{// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function(){ if (xmlhttp.readyState==4 && xmlhttp.status==200){ //cart cost //cart count //cart one up //cart one down //20 //20 var cartcost = xmlhttp.responseXML.getElementsByTagName("cartcost")[0].firstChild.data; var cartcount = xmlhttp.responseXML.getElementsByTagName("cartcount")[0].firstChild.data; //var cartitems = xmlhttp.responseXML.getElementsByTagName("cartitems")[0].firstChild.data; //document.getElementById("cartcostx"+pid).innerHTML=cartcost; //document.getElementById("cartcountx"+pid).innerHTML=cartcount; //document.getElementById('stockbox').contentWindow.document.getElementById("cartcostx"+pid).innerHTML=cartcost; document.getElementById('stockbox').contentWindow.document.getElementById("cartcountx"+pid).innerHTML=' ('+cartcount+')'; //document.getElementById("cartcostx").innerHTML=cartcost; document.getElementById("cartcountx").innerHTML=cartcount; //write to button //then write to main cart item whereever that is.... } } //xmlhttp.open("GET","/ajaxcart/?compare_check="+ answer +"&pid="+ pid +"&did="+ did +"&t=" + Math.random(),true); //?products_id=1947&action=add_product xmlhttp.open("GET","/ajaxcart/?action="+ answer +"&products_id="+ pid +"&type="+ type +"&t=" + Math.random(),true); xmlhttp.send(); } function ajwishlist(pid,answer,type){ var xmlhttp; if (window.XMLHttpRequest){// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); }else{// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function(){ if (xmlhttp.readyState==4 && xmlhttp.status==200){ //cart cost //cart count //cart one up //cart one down //20 //20 var wishlistcount = xmlhttp.responseXML.getElementsByTagName("wishlistcount")[0].firstChild.data; //var cartitems = xmlhttp.responseXML.getElementsByTagName("cartitems")[0].firstChild.data; //document.getElementById("cartcostx"+pid).innerHTML=cartcost; //document.getElementById("cartcountx"+pid).innerHTML=cartcount; document.getElementById("wishlistcountx").innerHTML=wishlistcount; //write to button //then write to main cart item whereever that is.... } } //xmlhttp.open("GET","/ajaxcart/?compare_check="+ answer +"&pid="+ pid +"&did="+ did +"&t=" + Math.random(),true); //?products_id=1947&action=add_product xmlhttp.open("GET","/ajaxcart/?action="+ answer +"&products_id="+ pid +"&type="+ type +"&wishlist=yes&t=" + Math.random(),true); xmlhttp.send(); } function ajcompare(pid,answer,type){ var xmlhttp; if (window.XMLHttpRequest){// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); }else{// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function(){ if (xmlhttp.readyState==4 && xmlhttp.status==200){ //document.getElementById("myDivRES").innerHTML=xmlhttp.responseText; //document.getElementById("myDivADD"+pid).innerHTML='OK+DONE'; var comparecount = xmlhttp.responseXML.getElementsByTagName("comparecount")[0].firstChild.data; document.getElementById("comparecountx").innerHTML=comparecount; } } xmlhttp.open("GET","/ajaxcart/?compare_check="+ answer +"&pid="+ pid +"&type="+ type +"&t=" + Math.random(),true); xmlhttp.send(); }