//alert(document.cookie.indexOf('SupportAlive')) //var sCookie = OnCheck(); //var uid = escape( sCookie ); var uid = ""; var orgid = "1"; var HOST = "www.arenaopen.com/SupportAliveClient/"; var HOST1 = "www.arenaopen.com/SAT/"; var CampainPage = "about:blank"; var Lng = "tr"; var PID = CreateID(); var isLoadedImage = true ; var HostImg ; var bEndSession = false ; var SupportDivName = "SupDiv1"; var bDivVisible = false; var m_bMoveDiv = false; var m_bClosed = false; var LeftBorder = 20 ; var RightBorder = 0 ; var Step = 1 ; var Left = 0 ; var omsg = ""; var Top = 0 ; var Width = 0 ; var Direction = "right"; var hcControlImage ; var ishcControlImageAdded = false; var brsn = navigator.appName; var brsp = navigator.platform; var brsc = navigator.appCodeName; var brsv = navigator.appVersion; var p = document.URL; function set_uid(x) { uid = x; } function AcceptInvite() { SupportOp( '', Lng, document.referrer, true, '' ); HideDiv(SupportDivName); } function CheckImages() { var w = HostImg.width; var h = HostImg.height; if (w == 0) return; HandleWidthHeight(w,h); } function CheckTrackingLoop() { if (isLoadedImage) { if ( document.body ) { if (!ishcControlImageAdded) { hcControlImage = document.createElement('IMG'); hcControlImage.style.visibility = "hidden"; document.body.appendChild(hcControlImage); ishcControlImageAdded = true ; } if ( document.getElementById("sa") ) { if ( document.getElementById("sa").sr== "true" ) { SendTrackingRequest(); setTimeout('CheckTrackingLoop()', 30000); } else { return; } } else return; } else { setTimeout('CheckTrackingLoop()', 1000); } } } function CreateDiv(Left, Top) { if(!document.all.tags("DIV")(SupportDivName)) { var innerHTML = "" ; innerHTML += "
" ; innerHTML += ""; else innerHTML += "Invite_en.jpg'>"; innerHTML += ""; innerHTML += "" innerHTML += "" ; innerHTML += ""; innerHTML += ""; innerHTML += " LeftBorder) { document.all.tags("DIV")(SupportDivName).style.left = Left - Step + "px" ; Left = Left - Step ; setTimeout("MoveDivToLeft()", 50) ; } else { MoveDivToRight() ; } } } function MoveDivToRight() { Direction = "right"; if(m_bMoveDiv) { if(Left < (document.body.offsetWidth - Width - 40)) { document.all.tags("DIV")(SupportDivName).style.left = Left + Step + "px" ; Left = Left + Step ; setTimeout("MoveDivToRight()", 50) ; } else { MoveDivToLeft() ; } } } function OnCheck() { var MyCookie = LoadImage(); //alert( MyCookie + " " + MyCookie.length ); if(MyCookie.length == 30 ) { var bCheck=false; for( i=0;i<30;i++) { iCh = MyCookie.charCodeAt(i); if( ((iCh >=48) && (iCh <=57)) || ((iCh >=65) && (iCh <=90)) ) { bCheck = true; } else { bCheck = false; break; } } if(bCheck) { isDefinedCookie = true ; return MyCookie.substring(0,30); } } MyCookie = CreateID(); setCookie('SupportAlive=' + MyCookie ); isDefinedCookie = true ; return MyCookie; } function OnInviteDivLoad() { document.all.tags("table")(String(SupportDivName + "_tbl")).style.borderStyle="Solid"; document.all.tags("table")(String(SupportDivName + "_tbl")).style.borderWidth="1px"; document.all.tags("table")(String(SupportDivName + "_tbl")).style.borderColor="#333333"; document.all.tags("table")(String(SupportDivName + "_tbl")).style.filter="progid:DXImageTransform.Microsoft.dropshadow(OffX=2, OffY=2, Color='#999999', Positive='true')"; } function RejectInvite() { var now = new Date(); var img = new Image(); var link = HOST1 + 'RejectInvite.aspx?&oid=' + orgid + '&uid=' + uid + '&nowtime=' + escape(now.getTime()); img.src = link ; HideDiv(SupportDivName); } function ReplaceText(t) { t = t.split("<").join("$$$k"); t = t.split(">").join("$$$b"); t = t.split("+").join("$$$p"); t = encodeURIComponentNew( t ); return t; } function SendChatRequest( lng, r, bNewWindow, subject, type, sExtraParams ) { var p = document.location + ""; if ( r.length <= 0 ) r = document.referrer; if ( lng == "tr" ) { omsg = "Üzgünüz, a+b şu an size yardımcı olamıyoruz.%0ASorularınız için " + "offlinefromscript@supportalive.com adresine e-posta gönderebilirsiniz."; } else { omsg = "Sorry, we cannot halp you at this time.%0AFor your questions " + "please send an email to offlinefromscript@supportalive.com."; } omsg = ReplaceText( omsg ); var sLocation = HOST + "Default.aspx?uid=" + uid + "&orgid=" + orgid + "&t=" + type + "&brsn=" + navigator.appName + "&brsp=" + navigator.platform + "&p=" + p.split("?")[0].split("#")[0] + "&r=" + r.split("?")[0].split("#")[0] + "&s=" + ReplaceText( subject ) + "&omsg=" + omsg + "&l=" + lng; if ( sExtraParams.length > 0 ) sLocation += sExtraParams; if ( bNewWindow ) { window.open( sLocation, "SupportAliveChat", "height=480, width=640, left=80, top=80, location=no, menubar=no, resizable=yes, scrollbars=no, titlebar=yes, status=yes", true ); } else { window.location = sLocation; } } function SendEndVisit( type ) { document.body.removeChild(hcControlImage); hcControlImage = document.createElement('IMG'); hcControlImage.style.visibility = "hidden"; document.body.appendChild(hcControlImage); var now = new Date(); var link = HOST1 + 'VisitEnd.aspx?oid=' + orgid + '&uid=' + uid + '&e=' + type + '&pid=' + PID + '&nowtime=' + escape(now.getTime()); hcControlImage.src = link; Delay(); } function SendTrackingRequest() { var now = new Date(); isLoadedImage = false ; HostImg = new Image(); HostImg.onload = CheckImages ; var link = HOST1 + 'WebForm1.aspx?' + 'uid=' + uid + '&brsn=' + escape(navigator.appName) + '&brsp=' + escape(navigator.platform) + '&p=' + escape(document.location) + '&pid=' + PID + '&r=' + escape(document.referrer) + '&org_id=' + orgid + '&nowtime=' + now.getTime(); HostImg.src = link; } function setCookie(txt) { today = new Date; today.setDate(today.getDate()+365); document.cookie = txt + ';path=/;expires=' + today.toGMTString(); } function ShowDiv(bMoveDiv) { if ( !m_bClosed ) { m_bMoveDiv = bMoveDiv; document.all.tags("DIV")(SupportDivName).style.display = "Block" ; if(bMoveDiv) { arrLeft = document.all.tags("DIV")(SupportDivName).style.left.split("px") ; arrWidth = document.all.tags("DIV")(SupportDivName).style.width.split("px") ; Left = Number(arrLeft[0]) ; Width = Number(arrWidth[0]) ; RightBorder = (document.body.offsetWidth - Width - 40) ; if ( Direction == "right" ) MoveDivToRight(); else MoveDivToLeft(); } bDivVisible = true; } } function StopDiv() { m_bMoveDiv = false ; } function SupportDpt( DptID, lng, r, bNewWindow, subject ) { var sExtraParams = "&dptid=" + DptID; SendChatRequest( lng, r, bNewWindow, subject, '1', sExtraParams ); } function SupportOrg( lng, r, bNewWindow, subject ) { SendChatRequest( lng, r, bNewWindow, subject, '0', '' ); } function SupportOp( sOpMail, lng, r, bNewWindow, subject ) { var sExtraParams = "&opm=" + sOpMail; SendChatRequest( lng, r, bNewWindow, subject, '2', sExtraParams ); } function Unload() { //alert( window.screenLeft ); if ( document.getElementById("sa") ) { if ( document.getElementById("sa").sr== "true" ) { if ( window.screenLeft == 10004 ) { SendEndVisit( "1" ); } else { SendEndVisit( "0" ); } } } } function utf8(wide) { var c, s; var enc = ""; var i = 0; while(i=0xDC00 && c<0xE000) continue; if (c>=0xD800 && c<0xDC00) { if (i>=wide.length) continue; s = wide.charCodeAt(i++); if (s<0xDC00 || c>=0xDE00) continue; c = ((c-0xD800)<<10)+(s-0xDC00)+0x10000; } // output value if (c<0x80) enc += String.fromCharCode(c); else if (c<0x800) enc += String.fromCharCode(0xC0+(c>>6),0x80+(c&0x3F)); else if (c<0x10000) enc += String.fromCharCode(0xE0+(c>>12),0x80+(c>>6&0x3F),0x80+(c&0x3F)); else enc += String.fromCharCode(0xF0+(c>>18),0x80+(c>>12&0x3F),0x80+(c>>6&0x3F),0x80+(c&0x3F)); } return enc; } var hexchars = "0123456789ABCDEF"; function toHex(n) { return hexchars.charAt(n>>4)+hexchars.charAt(n & 0xF); } var okURIchars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_-"; function encodeURIComponentNew(s) { var s = utf8(s); var c; var enc = ""; for (var i= 0; i=0) { HOST = "https://" + HOST; HOST1 = "https://" + HOST1; } else { HOST = "http://" + HOST; HOST1 = "http://" + HOST1; } window.attachEvent("onunload", Unload); window.attachEvent("onload", CheckTrackingLoop);