// Live Help Server Version: 3.26 Rev. 1.
Veuillez nous contacter si vous voulez une nouvelle version - thaison01@gmail.com
// stardevelop.com Live Help International Copyright 2003
// JavaScript Check Status Functions
var server = 'http://frchat.vietnam-voyages.com';
var request = '';
var domain = '.frchat.vietnam-voyages.com';
function currentTime() {
var date = new Date();
return date.getTime();
}
var ns6 = (!document.all && document.getElementById);
var ie4 = (document.all);
var ns4 = (document.layers);
var initiateOpen = 0;
var initiateLoaded = 0;
var infoOpen = 0;
var infoImageLoaded = 0;
var countTracker = 0;
var idleTimeout = 90 * 60 * 1000;
var timeStart = currentTime();
var timeElapsed; var timerLiveHelpInfo; var timerClosingLiveHelpInfo;
var trackingInitalized = 0;
var topMargin = 10;
var leftMargin = 10;
var hAlign = "right";
var vAlign = "top";
var layerHeight = 238;
var layerWidth = 377;
var browserWidth = 0;
var browserHeight = 0;
var windowWidth = 625;
var windowHeight = 425;
var windowLeft = (screen.width - windowWidth) / 2;
var windowTop = (screen.height - windowHeight) / 2;
var size = 'height=' + windowHeight + ',width=' + windowWidth + ',top=' + windowTop + ',left=' + windowLeft;
var trackerStatus = new Image;
var time = currentTime();
var title = escape(document.title);
var referrer;
if (document.referrer.indexOf('') >= 0) {
referrer = '';
} else {
referrer = document.referrer;
}
// stardevelop.com Live Help International Copyright 2003
// JavaScript AJAX Tracking Functions
var TrackingTimer; var InitiateChatTimer; var LiveHelpXMLHTTP = null;
var currentStatus = '';
var statusImagesLiveHelp = new Array();
function urlencode(str) {
var str = escape(str).replace(/[+]/g, '%2B');
str = str.replace(/[\/]/g, '%2F');
return str;
}
function checkXMLHTTP() {
obj = null;
if (window.XMLHttpRequest) {
obj = new XMLHttpRequest();
}
else if (window.ActiveXObject) {
obj = new ActiveXObject("Microsoft.XMLHTTP")
if (!obj) {
try {
obj = new ActiveXObject("Msxml2.XMLHTTP");
} catch(e) {
try {
obj = new ActiveXObject("Microsoft.XMLHTTP");
} catch(e) {
obj = null;
}
}
}
}
return obj;
}
LiveHelpXMLHTTP = checkXMLHTTP();
function LoadXMLTracking(initiateResult) {
var time = currentTime();
LiveHelpXMLHTTP = checkXMLHTTP();
// Run the XML query
if (LiveHelpXMLHTTP.readyState != 0) {
LiveHelpXMLHTTP.abort();
}
if (typeof initiateResult == 'undefined') { initiateResult = '' }
var RequestData = 'JS=1&TIME=' + time + '&DEPARTMENT=&INITIATE=' + initiateResult;
if (trackingInitalized == 0) {
RequestData = 'JS=1&TIME=' + time + '&TITLE=' + urlencode(title) + '&URL=' + urlencode(document.location) + '&REFERRER=' + urlencode(referrer) + '&WIDTH=' + screen.width + '&HEIGHT=' + screen.height + '&COOKIE=&DEPARTMENT=&INITIATE=' + initiateResult;
trackingInitalized = 1;
}
try {
LiveHelpXMLHTTP.open('POST', 'http://frchat.vietnam-voyages.com/livehelp/include/status.php', true);
} catch(e) {
trackingInitalized = 0;
LiveHelpXMLHTTP = null;
OnlineTracker(); return;
}
LiveHelpXMLHTTP.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
LiveHelpXMLHTTP.setRequestHeader("Content-length", RequestData.length);
LiveHelpXMLHTTP.setRequestHeader("Connection", "close");
LiveHelpXMLHTTP.onreadystatechange = function() {
if (LiveHelpXMLHTTP.readyState == 4) {
// Process response as JavaScript
if (LiveHelpXMLHTTP.status == 200) {
eval(LiveHelpXMLHTTP.responseText);
}
}
};
LiveHelpXMLHTTP.send(RequestData);
// If the Site Visitor has been Idle for under the given idleTimeout then run the tracker
timeElapsed = time - timeStart;
if (timeElapsed < idleTimeout) {
window.clearTimeout(TrackingTimer);
TrackingTimer = window.setTimeout('LoadXMLTracking();', 10000);
}
}
function changeStatus(status) {
var statusImage = new Image;
switch (status) {
case 'Online':
statusImageFile = '/livehelp/locale/en/images/online_transparent.gif';
break;
case 'BRB':
statusImageFile = '/livehelp/locale/en/images/online_brb_transparent.gif';
break;
case 'Away':
statusImageFile = '/livehelp/locale/en/images/online_away_transparent.gif';
break;
default:
statusImageFile = '/livehelp/locale/en/images/offline_transparent.gif';
break;
}
var time = currentTime();
if (currentStatus != '' && currentStatus != status) {
for (i = 0; i < statusImagesLiveHelp.length; i++) {
// Determine if there is an alternate image path find IMAGES= variable within statusImagesLiveHelp[i].src
var getImageLocation = statusImagesLiveHelp[i].src.indexOf('IMAGES=');
var getDepartment = statusImagesLiveHelp[i].src.indexOf('DEPARTMENT=');
statusImage.src = statusImageFile;
if (getImageLocation != -1) {
// Load the IMAGES path into a variable
var statusImageDirectory = statusImagesLiveHelp[i].src.substring(getImageLocation + 7);
if (getDepartment == -1) {
var filenamePos = statusImageFile.lastIndexOf('/');
if (filenamePos != -1) {
statusImage.src = statusImageDirectory + statusImageFile.substring(filenamePos + 1) + '?IMAGES=' + statusImageDirectory;
}
}
}
if (getDepartment != -1) {
// Load the DEPARTMENT path into a variable
var department = statusImagesLiveHelp[i].src.substring(getDepartment + 11);
var endRequestPos = department.lastIndexOf('&');
if (endRequestPos != -1) {
statusImage.src = 'http://frchat.vietnam-voyages.com/livehelp/include/status.php?DEPARTMENT=' + department.substring(0, endRequestPos) + '&IMAGES=' + statusImageDirectory;
}
}
statusImagesLiveHelp[i].onload = null;
swapImage(statusImagesLiveHelp[i].name, '', statusImage.src, 1);
}
}
currentStatus = status;
if (status == 'Offline' && trackingInitalized == 0) {
// Do not continously request XML if Offline
window.clearTimeout(TrackingTimer);
}
}
function findObj(n, d) {
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i this.browserHeight) {
this.E = this.Y > 0 ? this.targetY - this.browserHeight : this.targetY + this.browserHeight;
this.Y = this.Y > 0 ? this.browserHeight : -this.browserHeight;
} else {
this.E = this.currentY;
}
if (Math.abs(this.X) > this.browserWidth) {
this.F = this.X > 0 ? this.targetX - this.browserWidth : this.targetX + this.browserWidth;
this.X = this.X > 0 ? this.browserWidth : -this.browserWidth;
} else {
this.F = this.currentX;
}
}
function animate() {
var now = new Date();
var newY = this.Y * Math.sin( this.C * ( now.getTime() - this.D ) ) + this.E;
var newX = this.X * Math.sin( this.C * ( now.getTime() - this.D ) ) + this.F;
newY = Math.round(newY);
newX = Math.round(newX);
if ((this.Y > 0 && newY > this.currentY) || (this.Y < 0 && newY < this.currentY)) {
if (document.getElementById) { document.getElementById('floatLayer').style.top = newY + 'px'; }
else if (document.all) { document.all['floatLayer'].style.pixelTop = newY + 'px'; }
else if (document.layers && document.layers[object] != null) { document.layers['floatLayer'].top = newY + 'px'; }
}
if ((this.X > 0 && newX > this.currentX) || (this.X < 0 && newX < this.currentX)) {
if (document.getElementById) { document.getElementById('floatLayer').style.left = newX + 'px'; }
else if (document.all) { document.all['floatLayer'].style.pixelLeft = newX + 'px'; }
else if (document.layers && document.layers[object] != null) { document.layers['floatLayer'].left = newX + 'px'; }
}
}
function resetLayerLocation() {
var width = 0; var height = 0;
if(typeof(window.innerWidth) == 'number') {
width = window.innerWidth;
height = window.innerHeight;
} else if(document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) {
width = document.documentElement.clientWidth;
height = document.documentElement.clientHeight;
} else if(document.body && (document.body.clientWidth || document.body.clientHeight)) {
width = document.body.clientWidth;
height = document.body.clientHeight;
}
leftMargin = 10; topMargin = 10;
browserWidth = width; browserHeight = height;
if (hAlign == 'right') { leftMargin = width - leftMargin - layerWidth - 20; }
else if (hAlign == 'center') { leftMargin = Math.round((width - 20) / 2) - Math.round(layerWidth / 2); }
if (vAlign == 'bottom') { topMargin = height - topMargin - layerHeight; }
else if (vAlign == 'center') { topMargin = Math.round((height - 20) / 2) - Math.round(layerHeight / 2); }
}
function stopLayer() {
window.clearTimeout(InitiateChatTimer);
if (initiateOpen == 1) {
toggle('floatLayer');
}
initiateLoaded = 0;
}
function acceptInitiateChat() {
if (LiveHelpXMLHTTP != null) {
LoadXMLTracking('Accepted');
} else {
OnlineTracker('Accepted');
}
stopLayer();
}
function declineInitiateChat() {
if (LiveHelpXMLHTTP != null) {
LoadXMLTracking('Declined');
} else {
OnlineTracker('Declined');
}
stopLayer();
}
function resizeEvent(e) {
if (!e) e = window.event;
resetLayerLocation();
return true;
}
window.onresize = resizeEvent;
function checkInitiate(e) {
// Check if site visitor has an Initiate Chat Request Pending for display...
if (!e) var e = window.event;
var imageWidth = this.width; var imageHeight = this.height;
if (imageWidth == 2 && imageHeight == 2) {
displayInitiateChat();
}
return true;
}
function displayInitiateChat() {
if (initiateOpen == 0 || initiateLoaded == 1) {
resetLayerLocation();
if (document.getElementById) {
document.getElementById('floatLayer').style.top = topMargin + 'px'; document.getElementById('floatLayer').style.left = leftMargin + 'px';
} else if (document.all) {
document.all['floatLayer'].style.pixelTop = topMargin + 'px'; document.all['floatLayer'].style.pixelLeft = leftMargin + 'px';
} else if (document.layers) {
document.layers['floatLayer'].top = topMargin + 'px'; layers['floatLayer'].left = leftMargin + 'px';
}
var openingTrackerStatus = new Image;
var time = currentTime();
openingTrackerStatus.src = 'http://frchat.vietnam-voyages.com/livehelp/include/tracker.php?TIME=' + time + '&INITIATE=Opened';
if (document.getElementById) { document.getElementById('floatLayer').location = 'http://frchat.vietnam-voyages.com/livehelp/include/tracker.php?TIME=' + time + '&INITIATE=Opened'; }
else if (document.layers) { document.layers['floatLayer'].location = 'http://frchat.vietnam-voyages.com/livehelp/include/tracker.php?TIME=' + time + '&INITIATE=Opened'; }
else if (document.all) { document.all['floatLayer'].location = 'http://frchat.vietnam-voyages.com/livehelp/include/tracker.php?TIME=' + time + '&INITIATE=Opened'; }
floatRefresh();
toggle('floatLayer');
initiateOpen = 1;
}
}
var winLiveHelp = '';
function openLiveHelp(department) {
if (!winLiveHelp.closed && winLiveHelp.location) {
if (winLiveHelp.focus) {
winLiveHelp.focus();
}
return false;
} else {
// TODO: Remove All # invalid characters
if (typeof department != 'undefined' && department != '') {
winLiveHelp = window.open('http://frchat.vietnam-voyages.com/livehelp/index.php?URL=' + escape(document.location) + '&DEPARTMENT=' + department + '&TITLE=' + urlencode(title) + '&SERVER=http://frchat.vietnam-voyages.com&COOKIE=&LANGUAGE=en', 'LiveHelpGuestWindow', size);
} else {
winLiveHelp = window.open('http://frchat.vietnam-voyages.com/livehelp/index.php?URL=' + escape(document.location) + '&TITLE=' + urlencode(title) + '&SERVER=http://frchat.vietnam-voyages.com&COOKIE=&LANGUAGE=en', 'LiveHelpGuestWindow', size);
}
}
if (winLiveHelp) { winLiveHelp.opener = self; }
}
function OnlineTracker(initiateResult) {
var time = currentTime();
trackerStatus.src = 'http://frchat.vietnam-voyages.com/livehelp/include/tracker.php?TIME=' + time + '&TITLE=' + urlencode(title) + '&URL=' + urlencode(document.location) + '&REFERRER=' + urlencode(referrer) + '&WIDTH=' + screen.width + '&HEIGHT=' + screen.height + '&COOKIE=';
}
if (LiveHelpXMLHTTP != null) {
LoadXMLTracking();
}
else {
OnlineTracker();
}