
function livechatprecheck(){
	livechatcheckstatus();
	if ((document.body && typeof(document.body.innerHTML)) != 'undefined'){
		livechatrequest();
	} else {
		alert('Sorry, but your browser does not support several features of this system.');
	}
}
function livechatrequest(){
	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;
	livechatwindow=window.open("http://secure.xperiencedays.com/live/UserChat.asp?ref=","XDRoom","toolbar=0,location=0,status=0,menubar=0,scrollbars=1,resizable=1,width=520,height=350,top=" + topPos + ",left=" + leftPos);
	livechatwindow.focus();
}

function livechatcheckstatus(){
	var nt=String(Math.random()).substr(2,10);
	document.getElementById("livechatstatusimg").src='http://secure.xperiencedays.com/live/live.asp?getstatus=1&nt=' + nt + '&testlivechat=' + gup('testlivechat');
	//setTimeout("livechatcheckstatus();", 60000);
}
function gup( name )
{
  name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
  var regexS = "[\\?&]"+name+"=([^&#]*)";
  var regex = new RegExp( regexS );
  var results = regex.exec( window.location.href );
  if( results == null )
    return "";
  else
    return results[1];
}
document.write("<a href='#' onclick='javascript:livechatprecheck()'><img src='http:\/\/secure.xperiencedays.com\/live\/offline.gif' border=0 id=livechatstatusimg><\/a>");
livechatcheckstatus();