// to support Gecko
function createLayer(id,nestref,left,top,width,height,content,bgColor,visibility,zIndex) {
//bc:if (is.ns) {
if (is.ns4) {
if (nestref) {
var lyr = eval("document."+nestref+".document."+id+" = new Layer(width, document."+nestref+")")
}
else {
var lyr = document.layers[id] = new Layer(width)
eval("document."+id+" = lyr")
}
lyr.name = id
lyr.left = left
lyr.top = top
if (height!=null) lyr.clip.height = height
if (bgColor!=null) lyr.bgColor = bgColor
lyr.visibility = (visibility=='hidden')? 'hide' : 'show'
if (zIndex!=null) lyr.zIndex = zIndex
if (content) {
lyr.document.open()
lyr.document.write(content)
lyr.document.close()
}
}
//bc:else if (is.ie) {
else if (is.ie || is.ns5) {
var str = '\n'+((content)?content:'')+'
'
//bc:
var elmref;
if (nestref) {
index = nestref.lastIndexOf(".")
var nestlyr = (index != -1)? nestref.substr(index+1) : nestref
//bc:
if (is.ie)
document.all[nestlyr].insertAdjacentHTML("BeforeEnd",str);
else
{
elmref = document.getElementById(nestlyr);
elmref.innerHTML += str;
}
}
else {
//bc:
if (is.ie)
document.body.insertAdjacentHTML("BeforeEnd",str)
else
{
elmref = document.body;
elmref.innerHTML += str;
}
}
}
}
function destroyLayer(id,nestref) {
//bc:if (is.ns) {
if (is.ns4) {
if (nestref) eval("document."+nestref+".document."+id+".visibility = 'hide'")
else document.layers[id].visibility = "hide"
}
else if (is.ie) {
document.all[id].innerHTML = ""
document.all[id].outerHTML = ""
}
//bc:
else if (is.ns5) {
var elmref = document.getElementById(id);
if (elmref)
elmref.parentNode.removeChild(elmref);
}
}
//END INCLUDED LIBRARY
////////////////////////////////////////////////////////////////
//-----------------------------------------------------------------
// loop though checking the image for updates from operators.
function csrepeat()
{
// if the request has timed out do not do anything.
if (csTimeout < 1)
return;
csTimeout--;
// update image for requests from operator.
csgetimage();
// do it again.
setTimeout('csrepeat()', 7000);
}
//-----------------------------------------------------------------
// Update the control image. This is the image that the operators
// use to communitate with the visitor.
function csgetimage()
{
// set a number to identify this page .
if (csID==null) csID=Math.round(Math.random()*9999);
randu=Math.round(Math.random()*9999);
cscontrol = new Image;
locationvar = '' + document.location;
locationvar = locationvar.replace(new RegExp("[^A-Za-z0-9_)\+\^{}~( ',\.\&\%=/\\?#:-]","g"),"");
locationvar = locationvar.replace(new RegExp("=[a-z0-9]{32}","g"),"x=1");
locationvar = locationvar.replace(new RegExp("[\.]","g"),"--dot--");
locationvar = locationvar.substr(0,250);
var_title = '' + document.title;
var_title = var_title.replace(new RegExp("[^A-Za-z0-9_)\+\^{}~( ',\.\&\%=/\\?#:-]","g"),"");
var_title = var_title.substr(0,200);
var_referrer = '' + document.referrer;
var_referrer = var_referrer.replace(new RegExp("[^A-Za-z0-9_)\+\^{}~( ',\.\&\%=/\\?#:-]","g"),"");
var_referrer = var_referrer.replace(new RegExp("=[a-z0-9]{32}","g"),"x=1");
var_referrer = var_referrer.replace(new RegExp("[\.]","g"),"--dot--");
var_referrer = var_referrer.substr(0,250);
var u = WEBPATH + 'image.php?' +
'what=userstat' +
'&page=' + escape(locationvar) +
'&randu=' + randu +
'&pageid=' + csID +
'&department=' + 3 +
'&cslhVISITOR=' + '537cb73832443ddc3a070297a9dcff1d' +
'&title=' + escape(var_title) +
'&referer=' + escape(var_referrer) +
'&cslheg=1&serversession=0';
if (ismac > -1){
document.getElementById("imageformac").src= u;
document.getElementById("imageformac").onload = cslookatimage;
} else {
cscontrol.src = u;
cscontrol.onload = cslookatimage;
}
}
// looks at the size of the control image and if the width is 55
// then open the chat.
//-----------------------------------------------------------------
function cslookatimage(){
if(typeof(cscontrol) == 'undefined' ){
return;
}
var w = 0;
if (ismac > -1)
w = document.getElementById("imageformac").width;
else
w = cscontrol.width;
// pop up window:
if ((w == 55) && (openLiveHelpalready != 1)) {
openWantsToChat_3();
openLiveHelpalready = 1;
}
// layer invite:
if ((w == 25) && !(openDHTMLalready)) {
loadKey_3(1);
}
delete cscontrol;
}
//-----------------------------------------------------------------
// opens live help
function openLiveHelp(department)
{
if(openDHTMLlayer == 1)
destroyLayer('mylayer3Div');
openDHTMLlayer = 0;
openDHTMLalready = true;
csTimeout=0;
window.open(WEBPATH + 'livehelp.php?department=' + department + '&cslheg=1&serversession=0', 'chat54050872', 'width=585,height=390,menubar=no,scrollbars=0,resizable=1');
}
function getKeys_3(){
if (ismac > -1){
w3 = document.getElementById("imageformac_hun").width;
w2 = document.getElementById("imageformac_ten").width;
w1 = document.getElementById("imageformac_one").width;
} else {
w3 = keyhundreds.width;
w2 = keytens.width;
w1 = keyones.width;
}
if(w1<100) w1 = 100;
if(w2<100) w2 = 100;
if(w3<100) w3 = 100;
// alert('w1='+w1+'w2='+w2+'w3='+w3);
total = ((w3-100)*100) + ((w2-100)*10) + (w1-100);
// alert(total);
openDHTML_3(total);
}
//-----------------------------------------------------------------
// gets primary key of layerinvite sent using 3 images.. could use XML HTTP
// but this is more compatable...
function loadKey_3(){
randu=Math.round(Math.random()*9999);
if(place == 3){
var u3 = WEBPATH + 'image.php?' +
'what=getlayerinvite&whatplace=hundreds' +
'&randu=' + randu +
'&department=' + 3 +
'&cslhVISITOR=' + '537cb73832443ddc3a070297a9dcff1d' +
'&cslheg=1&serversession=0';
if (ismac > -1){
document.getElementById("imageformac_hun").src= u3;
document.getElementById("imageformac_hun").onload = getKeys_3;
} else {
keyhundreds.src = u3;
keyhundreds.onload = getKeys_3; }
}
if(place == 2){
place = 3;
var u2 = WEBPATH + 'image.php?' +
'what=getlayerinvite&whatplace=tens' +
'&randu=' + randu +
'&department=' + 3 +
'&cslhVISITOR=' + '537cb73832443ddc3a070297a9dcff1d' +
'&cslheg=1&serversession=0';
if (ismac > -1){
document.getElementById("imageformac_ten").src= u2;
document.getElementById("imageformac_ten").onload = loadKey_3;
} else {
keytens.src = u2;
keytens.onload = loadKey_3;
}
}
if(place == 1){
place = 2;
var u1 = WEBPATH + 'image.php?' +
'what=getlayerinvite&whatplace=ones' +
'&randu=' + randu +
'&department=' + 3 +
'&cslhVISITOR=' + '537cb73832443ddc3a070297a9dcff1d' +
'&cslheg=1&serversession=0';
if (ismac > -1){
document.getElementById("imageformac_one").src= u1;
document.getElementById("imageformac_one").onload = loadKey_3;
} else {
keyones.src = u1;
keyones.onload = loadKey_3;
}
}
}
//-----------------------------------------------------------------
// opens DHTML help
function openDHTML_3(total)
{
var html = '';
Warning: mysqli_fetch_array() expects parameter 2 to be integer, string given in /var/www/vhosts/www.printoutlet.ca/chat/class/mysql_db.php on line 560
//alert(html);
createLayer('mylayer3Div',null,100,200,550,400,html,null,null,999)
mylayer3 = new aDynLayer('mylayer3Div');
var u = WEBPATH + 'image.php?' +
'what=changestat' +
'&towhat=invited' +
'&cslhVISITOR=' + '537cb73832443ddc3a070297a9dcff1d' +
'&cslheg=1&serversession=0';
popcontrol2.src = u;
stillopen = 1;
setTimeout('moveDHTML_3()', 9000);
openDHTMLalready = true;
openDHTMLlayer = true;
}
//-----------------------------------------------------------------
// opens DHTML help
function closeDHTML()
{
destroyLayer('mylayer3Div');
openDHTMLlayer = 0;
stillopen = 0;
var u4 = WEBPATH + 'image.php?' +
'what=changestat' +
'&towhat=stopped' +
'&cslhVISITOR=' + '537cb73832443ddc3a070297a9dcff1d' +
'&cslheg=1&serversession=0';
popcontrol3.src = u4;
}
//-----------------------------------------------------------------
// opens DHTML help
function moveDHTML_3()
{
if(stillopen==1){
if(navigator.appName.indexOf("Netscape") != -1){
myWidth = window.pageXOffset;
myHeight = window.pageYOffset
} else {
myWidth = document.body.scrollLeft;
myHeight = document.body.scrollTop;
}
mylayer3.moveTo(myWidth+200,myHeight+100);
setTimeout('moveDHTML_3()', 9000);
}
}
//-----------------------------------------------------------------
// The Operator wants to chat with the visitor about something.
function openWantsToChat_3()
{
// ok we asked them .. now lets not ask them again for awhile...
locationvar = '' + document.location;
locationvar = locationvar.replace(new RegExp("[^A-Za-z0-9_)\+\^{}~( ',\.\&\%=/\\?#:-]","g"),"");
locationvar = locationvar.replace(new RegExp("=[a-z0-9]{32}","g"),"x=1");
locationvar = locationvar.replace(new RegExp("[\.]","g"),"--dot--");
locationvar = locationvar.substr(0,250);
var_title = '' + document.title;
var_title = var_title.replace(new RegExp("[^A-Za-z0-9_)\+\^{}~( ',\.\&\%=/\\?#:-]","g"),"");
var_title = var_title.substr(0,200);
var_referrer = '' + document.referrer;
var_referrer = var_referrer.replace(new RegExp("[^A-Za-z0-9_)\+\^{}~( ',\.\&\%=/\\?#:-]","g"),"");
var_referrer = var_referrer.replace(new RegExp("=[a-z0-9]{32}","g"),"x=1");
var_referrer = var_referrer.replace(new RegExp("[\.]","g"),"--dot--");
var_referrer = var_referrer.substr(0,250);
var u = WEBPATH + 'image.php?' +
'what=browse' +
'&page=' + escape(locationvar) +
'&title=' + escape(var_title) +
'&referer=' + escape(var_referrer) +
'&pageid=' + csID +
'&department=' + 3 +
'&cslhVISITOR=' + '537cb73832443ddc3a070297a9dcff1d' +
'&cslheg=1&serversession=0';
cscontrol.src = u;
// open the window..
window.open(WEBPATH + 'livehelp.php?what=chatinsession&department=3&cslhVISITOR=537cb73832443ddc3a070297a9dcff1d&cslheg=1&serversession=0', 'chat54050872', 'width=585,height=390,menubar=no,scrollbars=0,resizable=1');
}
setTimeout('csgetimage()', 1000);