//=======================================================================
/**********************************************************************************
* Help Center Live! – http://www.helpcenterlive.com *
* by Digital Frontiers, UTO *
***********************************************************************************
* Software Version: Help Center Live! v 2.1.7 *
* Software by: Digital Frontiers, UTO (http://www.helpcenterlive.com) *
* Copyright 2008 by: Digital Frontiers, UTO (http://www.helpcenterlive.com) *
* Support, News, Updates at: http://www.helpcenterlive.com *
***********************************************************************************
* This program is free software; you may redistribute it and/or modify it under *
* the terms of the provided license as published by Digital Frontiers, UTO. *
* *
* This program is distributed in the hope that it is and will be useful, but *
* WITHOUT ANY WARRANTIES; without even any implied warranty of MERCHANTABILITY *
* or FITNESS FOR A PARTICULAR PURPOSE. *
* *
* See the "license.txt" file for details of the Help Center Live! license. *
* The latest version can always be found at http://www.helpcenterlive.com. *
***********************************************************************************
* File Comments: *
* This file is used to track visitors using javascript *
**********************************************************************************/
var LiveConnection1 = new Aardvark('LiveConnection1');
var LiveConnection2 = new Aardvark('LiveConnection2');
function Live() {
this.time = Misc.epoch();
this.start = Misc.epoch();
this.mac = navigator.platform.indexOf('Mac');
this.chatid = '';
this.image_width = 0;
this.initiate_flag = 0;
this.status = 'status_department($departmentid)) { echo('online'); } else { echo('offline'); } ?>';
this.footprint = '&footprint=yes';
this.refurl = document.referrer;
this.page = document.location.toString();
this.useragent = navigator.appName+' - '+navigator.userAgent;
this.online_image = '/live/icon.php?status=online&departmentid=';
this.offline_image = '/live/icon.php?status=offline&departmentid=';
this.chatwin;
this.endchat = false;
this.initiate_accept = function()
{
window.open('/live/request.php?initiate&chatid=', 'initiate_', 'toolbar=no, scrollbars=yes, status=no, location=no, menubar=no, directories=no, width=400, height=400');
document.getElementById('div_initiate').style.visibility = 'hidden';
}
this.initiate_decline = function()
{
this.time = Misc.epoch();
LiveConnection2.add('decline_initiate', '');
LiveConnection2.send('/live/response.php', '', 'reset');
window.setTimeout('document.getElementById(\'div_initiate\').style.visibility = \'hidden\';', 500);
}
this.check = function(variables)
{
var response = '';
if (LiveConnection1.vars.live_) {
response = LiveConnection1.vars.live_;
this.time = Misc.epoch();
var i = 0;
var max = 0;
var action = response.split('|');
max = action.length - 1;
for (i = 0; i < max; ++i) {
switch (action[i]) {
case 'online':
if (this.status == 'offline') {
document.getElementById('image_live').src = this.online_image;
}
this.status = 'online';
break;
case 'offline':
if (this.status == 'online') {
document.getElementById('image_live').src = this.offline_image;
}
this.status = 'offline';
break;
case 'initiate':
this.launch('initiate','');
break;
case 'cobrowse':
parent.window.location.href = '/live/cobrowse.php?changepage';
break;
}
}
}
if ((this.time - this.start) < 7200000) {
window.setTimeout('Live.tracker();', );
}
}
this.tracker = function()
{
this.time = Misc.epoch();
LiveConnection1.add('cobrowse', '');
LiveConnection1.add('live', '');
LiveConnection1.add('departmentid', '');
LiveConnection1.add('page', this.page);
LiveConnection1.add('refurl', this.refurl);
LiveConnection1.add('useragent', this.useragent);
LiveConnection1.add('time', Misc.epoch());
if (this.end_chat) {
LiveConnection1.add('endchat', '');
this.endchat = false;
}
if (this.footprint) {
LiveConnection1.add('footprint', '');
this.footprint = false;
}
LiveConnection1.send('/live/response.php', 'Live.check(variables)', 'reset');
}
this.launch = function(action, departmentid, nick)
{
this.time = Misc.epoch();
if (action == 'initiate') {
if (this.initiate_flag !== 1) {
if (document.getElementById('div_initiate') !== null) {
document.getElementById('div_initiate').style.visibility = 'visible';
window.setTimeout('document.getElementById(\'div_initiate\').style.visibility = \'hidden\';', );
this.initiate_flag = 1;
}
}
} else {
if (departmentid == '') {
if (nick == '') {
this.chatwin = window.open('/live/main.php', 'guest_', 'toolbar=no, scrollbars=yes, status=no, resizable=yes, location=no, menubar=no, directories=no, width=, height=');
} else {
this.chatwin = window.open('/live/main.php?nick='+nick, 'guest_', 'toolbar=no, scrollbars=yes, status=no, resizable=yes, location=no, menubar=no, directories=no, width=, height=');
}
} else {
if (nick == '') {
this.chatwin = window.open('/live/main.php?departmentid='+departmentid, 'guest_', 'toolbar=no, scrollbars=yes, status=no, resizable=yes, location=no, menubar=no, directories=no, width=, height=');
} else {
this.chatwin = window.open('/live/main.php?departmentid='+departmentid+'&nick='+nick, 'guest_', 'toolbar=no, scrollbars=yes, status=no, resizable=yes, location=no, menubar=no, directories=no, width=, height=');
}
}
if (this.chatwin.opener == null) {
this.chatwin.opener = self;
}
}
}
if (this.status == 'online') {
document.write("', '')\" onMouseOver=\"Misc.statusbar('');return true;\" onMouseOut=\"Misc.statusbar('');return true;\">");
} else {
document.write("', '')\" onMouseOver=\"Misc.statusbar('');return true;\" onMouseOut=\"Misc.statusbar('');return true;\">");
}
document.write("', '')\" onMouseOver=\"Misc.statusbar('');return true;\" onMouseOut=\"Misc.statusbar('');return true;\">\" src=\"/live/icon.php?status="+this.status+"&departmentid=\" border=\"0\" id=\"image_live\" />");
}
var Live = new Live();
setTimeout('Live.tracker();', 1000);
//=======================================================================