// JavaScript Document for Cart /////////// GET MEDIUM IMAGE function pushimage(idOption,idProduct) { var base = "/"; if (idOption=='') return; xmlhttp_image=GetXmlHttpObject(); if (xmlhttp_image==null) { alert ("Browser does not support HTTP Request"); return; } var url=base+"_scripts/getoptionvalue.php"; url=url+"?idOption="+idOption; url=url+"&idProduct="+idProduct; url=url+"&sid="+Math.random(); xmlhttp_image.onreadystatechange=stateChanged; xmlhttp_image.open("GET",url,true); xmlhttp_image.send(null); } /////////// LARGE IMAGE /////////// function pushimage2(idOption,idProduct) { var base = "/"; if (idOption=='') return; xmlhttp_image2=GetXmlHttpObject(); if (xmlhttp==null) { alert ("Browser does not support HTTP Request"); return; } var url=base+"_scripts/getoptionimage.php"; url=url+"?idOption="+idOption; url=url+"&idProduct="+idProduct; url=url+"&sid="+Math.random(); xmlhttp_image2.onreadystatechange=imageChanged; xmlhttp_image2.open("GET",url,true); xmlhttp_image2.send(null); } /////////// OUR PRICE /////////// function updateOurPrice(idOption,idProduct) { var base = "/"; if (idOption=='') { return; } xmlhttp=GetXmlHttpObject(); if (xmlhttp==null) { alert ("Browser does not support HTTP Request"); return; } var url=base+"_scripts/getoptionprice.php"; url=url+"?idOption="+idOption; url=url+"&idProduct="+idProduct; url=url+"&sid="+Math.random(); xmlhttp.onreadystatechange=optionPriceChanged; xmlhttp.open("GET",url,true); xmlhttp.send(null); } /////////// LIST PRICE /////////// function updateListPrice(idOption,idProduct,prodListPrice) { var base = "/"; if (idOption=='') return; xmlhttp_listprice=GetXmlHttpObject(); if (xmlhttp_listprice==null) { alert ("Browser does not support HTTP Request"); return; } var url=base+"_scripts/getoptionlistprice.php"; url=url+"?idOption="+idOption; url=url+"&idProduct="+idProduct; url=url+"&sid="+Math.random(); xmlhttp_listprice.onreadystatechange=optionListPriceChanged(prodListPrice); xmlhttp_listprice.open("GET",url,true); xmlhttp_listprice.send(null); } function stateChanged() { if (xmlhttp_image.readyState==4) { if (xmlhttp_image.responseText!="") document.getElementById("pimage").src = '/images/_prodimages/'+xmlhttp_image.responseText; } } function imageChanged() { if (xmlhttp_image2.readyState==4) { if (xmlhttp_image2.responseText!="") document.getElementById("himage").href = '/images/_prodimages/'+xmlhttp_image2.responseText; } } function optionPriceChanged(){ if (xmlhttp.readyState==4) { var Price = xmlhttp.responseText; // listPrice = xmlhttp4.responseText; document.getElementById("pricing").innerHTML= Price; } } function optionListPriceChanged(prodListPrice){ if (xmlhttp_listprice.readyState==4) { var listPrice = xmlhttp_listprice.responseText; document.getElementById("listPrice").innerHTML= '$'+CurrencyFormatted(listPrice); var orgL; if (listPrice == '' || listPrice == 0.00 || listPrice <= prodListPrice) { listPrice = prodListPrice; document.getElementById("listPrice").style.display = 'none'; } else { document.getElementById("listPrice").style.display = 'block'; } document.getElementById("listPrice").innerHTML= 'List Price : $'+CurrencyFormatted(listPrice); } } function GetXmlHttpObject() { if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari return new XMLHttpRequest(); } if (window.ActiveXObject) { // code for IE6, IE5 return new ActiveXObject("Microsoft.XMLHTTP"); } return null; }