﻿var xmlHttp1=xmlHttp2=xmlHttp3=false;if (window.XMLHttpRequest) {xmlHttp1 = new XMLHttpRequest();xmlHttp2 = new XMLHttpRequest();xmlHttp3 = new XMLHttpRequest();}else if (window.ActiveXObject) {xmlHttp1 = new ActiveXObject("Microsoft.XMLHTTP");xmlHttp2 = new ActiveXObject("Microsoft.XMLHTTP");xmlHttp3 = new ActiveXObject("Microsoft.XMLHTTP");}else alert("مرورگر شما از تکنولوژي آژاکس پشتيباني نمي کند");function goRecord(link) {xmlHttp1.open("GET", link, true);xmlHttp1.onreadystatechange = function() {preLoad("dvLoading","ProfilesParent");if ((xmlHttp1.readyState == 4) && (xmlHttp1.status == 200)) {var Response = xmlHttp1.responseText;if(Response.split("|")[0]=="Profiles")getElement("Profiles").innerHTML = Response.split("|")[1];unLoad("dvLoading");}else Loading("dvLoading");}; xmlHttp1.send(null);};function preLoad(object,contentId) {var x = ObjectPosition(contentId)[0] + 1;var y = ObjectPosition(contentId)[1] + 1;var w = getElement(contentId).width - 2;var h = getElement(contentId).height - 2;getElement(object).style.left = x;getElement(object).style.top = y ;getElement(object).style.width = w;getElement(object).style.height = h;getElement(object).innerHTML = "<table style='width: 100%; height: 100%'>" +"<tr><td align='center'><img src='Images/LoadingIcons/3.gif'>" +"</td></tr></table>";};function Loading(object) {getElement(object).style.display="block";};function unLoad(object) {getElement(object).style.display="none";};function delRecord(link) {xmlHttp2.open("GET", link, true);xmlHttp2.onreadystatechange = function() {preLoad("dvLoading","ProfilesParent");if ((xmlHttp2.readyState == 4) && (xmlHttp2.status == 200)) {var Response = xmlHttp2.responseText;if(Response.split("|")[0]=="DelProfiles") {getElement("PagerContent").innerHTML = Response.split("|")[1];element = getElement('pgrBtn' + Response.split("|")[2].substring(0,1));if (element) element.onclick();else {getElement("Profiles").removeChild;getElement("PagerContent").removeChild;getElement("ProfilesParent").innerHTML = "هيچ آدرسي ثبت نشده است.";getElement("ProfilesParent").height = "100";}}unLoad("dvLoading");}else Loading("dvLoading");}; xmlHttp2.send(null);};function AddToCart(link,obj) {xmlHttp3.open("GET", link);xmlHttp3.onreadystatechange = function() {var dv = link.toString().substr(link.toString().indexOf("ProductID")+10,link.toString().indexOf("&",29)-39);if ((xmlHttp3.readyState == 4) && (xmlHttp3.status == 200)) {getElement("dvCart").innerHTML = xmlHttp3.responseText;getElement("dvLoad").style.display = "none";} else {getElement("dvLoad").style.left = ObjectPosition(obj)[0];getElement("dvLoad").style.top = ObjectPosition(obj)[1];getElement("dvLoad").style.display="block";}}; xmlHttp3.send(null);}
