
url = document.location.href;
vUrl= url.split("/");
url = url.replace(vUrl[vUrl.length-1], "");
url = url.replace(vUrl[vUrl.length-2]+"/", "");
//alert(url+"proactive.asp");
vDontBother = "";

//.......................................................................
var isIE = document.all?true:false;
var capa = null;
var _IE_ = navigator.userAgent.indexOf("MSIE") != -1; // Si es IE 
if (!isIE) document.captureEvents(Event.MOUSEMOVE);
document.onmousemove = getMousePosition;
//document.onmouseup = liberaCapa();
//-----------------------------------------------------------
var capa = null; // Almacena la capa que se mueve 
var _IE_ = navigator.userAgent.indexOf("MSIE") != -1; // Si es IE 
/* 
* Libera la capa del movimiento 
*/ 
function liberaCapa() { 
capa = null; 
} 

function clickCapa(e, obj) { 
capa = document.getElementById('divMove'); 
if (_IE_) { 
difX = e.offsetX; 
difY = e.offsetY; 
} else { 
difX = e.layerX; 
difY = e.layerY; 
}
}
function getMousePosition(event) { 
if (capa != null) { 
//document.getElementById('divMove').style.top = (event.clientY-difY-200)+"px"; 
//document.getElementById('divMove').style.left = (event.clientX-difX-200)+"px";
	if (!(_IE_)){
		document.getElementById('divMove').style.top = (event.clientY-25)+"px";  
		document.getElementById('divMove').style.left = (event.clientX-300)+"px"; 
		document.getElementById('divMove').focus();
	}
} 
}
//----------------------------------------------------------
function xlaALSprecheck(){
	if ((document.body && typeof(document.body.innerHTML)) != 'undefined'){
		xlaALSrequest();
	} else {
		alert('Sorry, but your browser does not support several features of this system.');
	}
}
function xlaALSrequest(){
	var w = 640, h = 480;
	if (document.all || document.layers) {
	   w = screen.availWidth;
	   h = screen.availHeight;
	}
	var leftPos = (w-520)/2, topPos = (h-350)/2;
	xlaALSwindow=window.open("http://www.assettrader.co.uk/support/UserPreChat.asp?ref=","ALSRoom","toolbar=0,location=0,status=0,menubar=0,scrollbars=1,resizable=1,width=520,height=350,top=" + topPos + ",left=" + leftPos);
	xlaALSwindow.focus();
}

function xlaALScheckstatus(){
	var nt=String(Math.random()).substr(2,10);
	reloadProactive();
	//document.getElementById("xlaALSstatusimg").src='http://www.assettrader.co.uk/support/als.asp?getstatus=1&nt=' + nt;
	//document.getElementById('divTest').src = 'http://backhoe-loaders.assettrader.eux/support/test.asp';
}
function newAjax(){
var xmlhttp=false;
try {
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (E) {
xmlhttp = false;
}
}
if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
xmlhttp = new XMLHttpRequest();
}
return xmlhttp;
} 
function reloadProactive()
{
	var nt=String(Math.random()).substr(2,10);
	//document.getElementById('divProactive2').innerHTML = ''

	var objAjax = newAjax()
	objAjax.open("GET", url+"support/proactive.asp?nt="+nt+vDontBother)
	objAjax.onreadystatechange = function(){
		if (objAjax.readyState == 4){
			document.getElementById('divProactive2').innerHTML = objAjax.responseText;
			if (document.getElementById('divProactive'))
			 if (document.getElementById('divProactive').style.display == "block")
			 		clearInterval(idTime);
			}
		}
		objAjax.send(null);
}
//document.getElementById('divProactive2').style.display = "NONE";
document.write("<a href='#' onclick='javascript:xlaALSprecheck()'><img src='http:\/\/www.assettrader.co.uk\/support\/files\/hidePicture.png' border=0 id=xlaALSstatusimg><\/a><div id='divMove' style='position: absolute; top: -220px; left: 7px;'><div id='divProactive2'><\/div><\/div>");
//---------------------------------------------------------------------------

//---------------------------------------------------------------------------