var Sasiya= new SasiyaAjax() var Dox= new SasiyaScript_pre_All(); var SaElX=new SasiyaScript_pre_controls(); var oldb; var SasiyaDocX=document; var SaEleAcceX=document.getElementById; var SaBody=document.getElementsByTagName; var SIE4=document.all var SaIE6andNs6=document.getElementById var SaXn4=document.layers; var SaXReslt; var DomainPath="http://www.2pockets.com/livechat"; function setting_up(id) { /* SaIE6andNs6?SaXReslt=SasiyaDocX.getElementById(id):SIE4?SaXReslt=SasiyaDocX.all[id]:SaXn4?SaXReslt=SasiyaDocX.layers[id]:null; var url=window.location.href.replace(/\//g,"BKB"); url=url.replace(/http\:/g,"MKH");//alert(url) SaXReslt.innerHTML=''; */ } //setting up elements access function SasiyaScript_pre_All() { this.SasiyaElement=function(id) { SaIE6andNs6?SaXReslt=SasiyaDocX.getElementById(id):SIE4?SaXReslt=SasiyaDocX.all[id]:SaXn4?SaXReslt=SasiyaDocX.layers[id]:""; return SaXReslt; } this.SasiyaCrossStyle=function(id) { SaIE6andNs6?SaXReslt=SasiyaDocX.getElementById(id):SIE4?SaXReslt=SasiyaDocX.all[id]:SaXn4?SaXReslt=SasiyaDocX.layers[id]:""; var CrossStyle=SaXReslt.style?SaXReslt.style:SaXReslt; return CrossStyle; } this.SasiyaobCrossStyle=function(SaXReslt) { var CrossStyle=SaXReslt.style?SaXReslt.style:SaXReslt; return CrossStyle; } } function SasiyaScript_pre_controls() { this.SasiyaDisplay=function(id) { var DisObj=Dox.SasiyaCrossStyle(id) DisObj.display=="none"?DisObj.display="":DisObj.display="none"; } this.SasiyaClose=function(id) { var ShObj=id.constructor==String?Dox.SasiyaCrossStyle(id):id; Dox.SasiyaobCrossStyle(ShObj).display="none"; return ShObj; } this.SasiyaXClose=function(id) { var ShObj=id.constructor==String?Dox.SasiyaCrossStyle(id):id; Dox.SasiyaobCrossStyle(ShObj).display=""; return ShObj; } this.SasiyaGetParent=function(id,n) { var ShObj=id.constructor==String? Dox.SasiyaElement(id):id; var TemObj; var DynamicObj=ShObj; for(var i=0;i=0) {curobj=SaElX.SasiyaGetParent(curobj,9);} if(curobj.id.search(/sasiya/i)>=0) {if(curobj.tagName.search(/td/i)>=0){curobj=SaElX.SasiyaGetParent(curobj,4);}//alert(curobj.tagName+"="+curobj.id) if(curobj.id.search("Xasiya")>=0){curobj=SaElX.SasiyaGetParent(curobj,2);} if(!selobj || selobj!=curobj ) { var curobj = (typeof( window.event ) != "undefined" ) ? e.srcElement : e.target; // if(curobj.tagName.search(/table/i)>=0){curobj=SaElX.SasiyaGetParent(curobj,2);selobj=curobj;} if(curobj.tagName.search(/td/i)>=0){curobj=SaElX.SasiyaGetParent(curobj,4);} if(curobj.id.search(/mov/i)>=0) {curobj=SaElX.SasiyaGetParent(curobj,9);} selobj=curobj;setstyle(curobj); } selobj=curobj; if(selobj.tagName.search(/td/i)>=0) { var obvcx=SaElX.SasiyaGetParent(selobj,5) selobj=obvcx;//alert(obvcx.tagName) if(obvcx){SaElX.SasiyaGetParent(selobj,4).style.position="";} } } //document.getElementById("mn").innerHTML=selobj.style.position if (curobj.id.search("sasiya")>=0) {//alert(curobj.tagName) //alert(curobj.id) if(curobj.tagName.search(/table/i)>=0){curobj=SaElX.SasiyaGetParent(curobj,2);selobj=curobj;} mouseover=true; pleft=parseInt(selobj.style.left); ptop=parseInt(selobj.style.top); xcoor=e.clientX; ycoor=e.clientY; document.onmousemove=sasiyamove; return false; } else { return false; } } function sasiyamove(e) { if (e == null) { e = window.event;} if(!selobj){var curobj = (typeof( window.event ) != "undefined" ) ? e.srcElement : e.target; if(curobj.tagName.search(/td/i)>=0){curobj=SaElX.SasiyaGetParent(curobj,4);} if(curobj.id.search(/mov/i)>=0) {curobj=SaElX.SasiyaGetParent(curobj,9);} selobj=curobj;setstyle(curobj);} selobj.style.left=pleft+e.clientX-xcoor+"px"; selobj.style.top=ptop+e.clientY-ycoor+"px"; return false; } function setstyle(fobj) { if(fobj.tagName.search(/td/i)>=0) { var obv=fobj.offsetTop; var obvcx=SaElX.SasiyaGetParent(fobj,5) fobj=obvcx;//alert(obvcx.tagName) var obv1=fobj.offsetTop; if(SaElX.SasiyaGetParent(fobj,2)) { //document.getElementById("mn").innerHTML=SaElX.SasiyaGetParent(fobj,1).tagName if(fobj.tagName.search(/td/i)>=0) { document.body.appendChild(fobj) tdobj=SaElX.SasiyaGetParent(fobj,2);//alert(tdobj.innerHTML) trobj=SaElX.SasiyaGetParent(tdobj,3); trobj.removeChild(tdobj); } } //document.getElementById("mn").innerHTML=fobj.style.position } //alert(fobj.tagName) if(fobj.tagName.search(/table/i)>=0){fobj=SaElX.SasiyaGetParent(fobj,2);} fobj.style.position="fixed";/// if(obvcx){SaElX.SasiyaGetParent(fobj,4).style.position="";} fobj.style.left=fobj.offsetLeft+"px"; fobj.style.top=fobj.offsetTop+"px"; //document.getElementById("mn").innerHTML=fobj.style.position } function sasiyaup(e) { document.onmousemove=null; } function addListener(element, type, expression, bubbling) { bubbling = bubbling || false; if(window.addEventListener) { // Standard element.addEventListener(type, expression, bubbling); return true; } else if(window.attachEvent) { // IE element.attachEvent('on' + type, expression); return true; } else return false; } /////////fetchresult function SasiyaAjax() { this.Connect=function(url,method,params,id) { var xmlHttp; xmlHttp=this.Support(); //alert("ok2") if (xmlHttp==null) { alert ("Please run in Any Browser,it is not browser.") return } xmlHttp.onreadystatechange=function() { if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") { resText=xmlHttp.responseText; SaIE6andNs6?SaXReslt=SasiyaDocX.getElementById(id):SIE4?SaXReslt=SasiyaDocX.all[id]:SaXn4?SaXReslt=SasiyaDocX.layers[id]:null; SaXReslt.value?SaXReslt.value=resText:SaXReslt.innerHTML=resText; } } xmlHttp.open(method.toUpperCase(), url, true); xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); xmlHttp.setRequestHeader("Content-length", params.length); xmlHttp.setRequestHeader("Connection", "close"); xmlHttp.send(params); }, this.Connect_call_back=function(url,method,params,n,call_back) { var xmlHttp; xmlHttp=this.Support(); //alert("ok2") if (xmlHttp==null) { alert ("Please run in Any Browser,it is not browser.") return } xmlHttp.onreadystatechange=function() { if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){resText=xmlHttp.responseText;call_back(resText,n)} } xmlHttp.open(method.toUpperCase(), url, true); xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); xmlHttp.setRequestHeader("Content-length", params.length); xmlHttp.setRequestHeader("Connection", "close"); xmlHttp.send(params); }, this.Support=function() { var objXMLHttp=null if (window.XMLHttpRequest){objXMLHttp=new XMLHttpRequest()} else if (window.ActiveXObject){objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")} return objXMLHttp }, this.Setvalue=function(id,txt) { SaIE6andNs6?SaXReslt=SasiyaDocX.getElementById(id):SIE4?SaXReslt=SasiyaDocX.all[id]:SaXn4?SaXReslt=SasiyaDocX.layers[id]:null; SaXReslt.value?SaXReslt.value=txt:SaXReslt.innerHTML=txt; } } /////////popwinopen var tm; var n=1; var s=0; var lheight=0; var mbv=1; var newsid=0; function opennew() { var url=location.href; setCookie("urlnm",url,1); var op="'width=700,height=710,directories=no,location=no,menubar=no,resizable=no,scrollbars=1,status=no,toolbar=no'" window.open(DomainPath+'/view_departments.php?sid=10','windowname2',op ); } var url=location.href; setCookie("urlnm",url,1); function setCookie(c_name,value,expiredays) {var exdate=new Date();exdate.setDate(exdate.getDate()+expiredays); document.cookie=c_name+ "=" +escape(value)+((expiredays==null) ? "" : ";expires="+exdate.toGMTString()); } function onpop(nid) { if(mbv==1) { //alert("ppppc") newsid=nid; var url=window.location.href.replace(/\//g,"BKB"); url=url.replace(/http\:/g,"MKH"); var url=DomainPath+"/livesupport2008.php?pid="+nid+"&url="+url;//alert(url) var els=document.createElement("div"); els.id="chattag"; Dox.SasiyaElement("livehelpcontainer").appendChild(els); var els1=document.createElement("span"); els1.id="scriptag"; Dox.SasiyaElement("livehelpcontainer").appendChild(els1); var el=document.createElement("script"); el.src=url;//alert(s+"="+mbv) Dox.SasiyaElement("scriptag").innerHTML="";//alert("jk") Dox.SasiyaElement("scriptag").appendChild(el); mbv=2;//alert(url) } else if(s>=1) { if(document.getElementById("chattag").innerHTML!="cancel"){ var url=DomainPath+"/include/chat_setting1.php?op=45&s="+s+"&sid="+newsid;//alert(url) var el=document.createElement("script");//alert(url) el.src=url;//alert(url) Dox.SasiyaElement("scriptag").innerHTML=""; Dox.SasiyaElement("scriptag").appendChild(el); } } tm=setTimeout("onpop("+nid+")",3000); if(document.getElementById("chattag").innerHTML=="cancel"){clearTimeout(tm);document.getElementById("chattag").innerHTML=""} } function calling(text,op) { //alert(text) if(op==2){var tx=text.split("|M|M|");s=tx[0];mbv=3;Dox.SasiyaElement("livehelpcontainer").innerHTML=tx[1];alert(text+"="+text.search(/NoErrorinthisPages/));return;} if(text.search(/NoErrorinthisPages/)<0){return} else{text=text.replace("NoErrorinthisPages","");} var txt=text.split("|SWS|");if(txt.length>=2){ for(var i=0;i=1){chatopen(df[0],df[1],df[2])} } } } function shakwind() { window.innerWidth = screen.width; window.innerHeight = screen.height; window.screenX = 0; window.screenY = 0; alwaysLowered = false; } function chatopen(nmp,ids,idm) { if(Dox.SasiyaElement("AB"+ids)){return;} var gust=nmp.search(/[\d]/); var prwinsh=Dox.SasiyaElement("temppop");//alert(ids+"="+idm) var txvb=Dox.SasiyaElement("chpop1").innerHTML;//alert(txvb) txvb=txvb.replace("NAME",nmp);//txvb=txvb.replace("CID",id); txvb=txvb.replace("XXXXXX6",nmp+ids);txvb=txvb.replace("XXMMM","W"+ids); var txzv=txvb.split("MMMMM"); var frm='