var scripturl = "http://onehourclick.com/livehelp/wihchat.cgi";
var useCookies = 1;
var maintimer = 30000;
var checktimer = 10000;
var invitetimer = 420000;
var myimg = 'rep';
var date = new Date();
var counter = date.getTime();
var counter2 = date.getTime();
var loopcount = 1;
var loopcount2 = 1;
var chatstarted = 0;
var testpic = new Image;
var testpicwidth = 0;
var nextyear = new Date();
nextyear.setFullYear(nextyear.getFullYear() + 1);
if (useCookies) document.cookie = 'WUMcheck=' + counter + '; expires=' + nextyear.toGMTString() + '; path=/';
var scrw = 0;
var scrh = 0;
var loopcount = 1;
if (window.screen) {
   scrw = screen.availWidth;
   scrh = screen.availHeight;
}
function WUMimage() {
	document.write ('<a href="javascript: void(0)" onClick="javascript: WUMchatwindow()"><img src="' +
				scripturl + '?action=cookie&img=' + myimg +
				"&date=" + counter +
				"&page=" + escape(document.location) +
				"&referer=" + escape(document.referrer) +
				"&screen=" + scrw + "x" + scrh +
				"&usertime=" + escape(date.toString()) +
				'" name=WUMchat border=0"></a>');
	setTimeout("WUMloop()",maintimer);
}
function WUMmonitor() {
	myImage = new Image();
	myImage.src = scripturl + '?action=cookie&img=' + myimg +
				"&date=" + counter +
				"&page=" + escape(document.location) +
				"&referer=" + escape(document.referrer) +
				"&screen=" + scrw + "x" + scrh +
				"&usertime=" + escape(date.toString());
	counter++;
	loopcount++;
	if (loopcount < 30) {setTimeout("WUMmonitor()",maintimer)}
}
function WUMloop() {
	document.WUMchat.src = scripturl + "?action=cookie&img=" + myimg +
				"&date=" + counter +
				"&page=" + escape(document.location) +
				"&referer=" + escape(document.referrer) +
				"&screen=" + scrw + "x" + scrh +
				"&usertime=" + escape(date.toString());
	counter++;
	loopcount++;
	if (loopcount < 30) {setTimeout("WUMloop()",maintimer)}
}
function WUMcheckchat() {
	testpic = new Image;
	testpic.src = scripturl + "?action=checkchat"+ "&date=" + counter2;
	testpic.onload = WUMtestchat;
	counter2++;
	loopcount2++;
	if (loopcount2 < 90) {setTimeout('WUMcheckchat()',checktimer)}
}
function WUMtestchat() {
	testpicwidth = testpic.width;
	if ((testpicwidth == 2) && (chatstarted == 0)) {
		chatstarted = 1;
		WUMchatme();
	}
	else if ((testpicwidth == 1) && (chatstarted == 1)) {
		chatstarted = 0;
	}
}
function WUMchatme() {
 clearTimeout(invitetTimeout);
	var myWindow = window.open(scripturl + '?action=chatmereq', 'ChatAlert', 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=1,width=220,height=180,left=' + ((scrw - 220)/2) + ',top=' + ((scrh - 180)/2) + '');
	myWindow.focus();
}
function WUMinvite() {
	var myWindow = window.open(scripturl + '?action=invitemereq', 'InviteAlert', 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=1,width=510,height=430,left=' + ((scrw - 510)/2) + ',top=' + ((scrh - 430)/2) + '');
	myWindow.focus();
}
function WUMchatwindow() {
 clearTimeout(invitetTimeout);
	chat = window.open(scripturl + '?action=chat','WUMchatwindow' + counter,'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=510,height=400,left=' + ((scrw - 510)/2) + ',top=' + ((scrh - 400)/2) + '');
	chat.focus();
}
WUMmonitor();
