startList = function() {
	
	if( document.getElementById ) {
	
		thehead = document.getElementById("header");

		var iRandSeed = Math.random();

		if( iRandSeed < 0.26 )
			thehead.className = "main_content_area_head1";
		else if( iRandSeed > 0.25 && iRandSeed < 0.51 )
			thehead.className = "main_content_area_head2";
		else if( iRandSeed > 0.5 && iRandSeed < 0.76 )
			thehead.className = "main_content_area_head3";
		else
			thehead.className = "main_content_area_head4"; 

		navRoot = document.getElementById("nav");
		for (i=0; i<navRoot.childNodes.length; i++) {

			node = navRoot.childNodes[i];
			
			if (node.nodeName=="LI") {

				node.onmouseover=function() {
					this.className+=" over";
				}

  				node.onmouseout=function() {
  					this.className=this.className.replace(" over", "");
   				}
   			}  			
  		}
 			 		
 		
 	}
}
window.onload=startList;


function PingRegServer()
{
	var myWindow=window.open('http://services.ical.co.uk:52345','_blank','width=350,height=50','menubar=no,toolbar=no,status=yes,location=no,scrollbars=yes');
}	


function checkNow() {

	window.location.assign("http://services.ical.co.uk:52345");
	var t = setTimeout( "alert(document.body.innerText);", 2000);
}

var xmlhttp;

function performCheck(url) {

	xmlhttp=GetXmlHttpObject();

	if (xmlhttp==null) {
  		alert ("Your browser does not support XMLHTTP!");
  		return;
  	}

	xmlhttp.onreadystatechange=stateChanged;
	xmlhttp.open("GET",url,false);
	xmlhttp.send(null);
}

function GetXmlHttpObject() {

	if (window.XMLHttpRequest) {

		// code for IE7+, Firefox, Chrome, Opera, Safari
  		return new XMLHttpRequest();
  	}

	if (window.ActiveXObject) {

  		// code for IE6, IE5
  		return new ActiveXObject("Microsoft.XMLHTTP");
	}

	return null;
}

function stateChanged() {

	if (xmlhttp.readyState==4) {

  		if (xmlhttp.status==200) {

     		document.getElementById('A1').innerHTML=" " + xmlhttp.status;
   		    document.getElementById('A2').innerHTML=xmlhttp.statusText;
     		}
   		else {

     		document.getElementById('A1').innerHTML=" " + xmlhttp.status;
		    document.getElementById('A2').innerHTML="The registration service is offline.";
		    document.getElementById('A3').innterHTML=xmlhttp.responseText;
    		}
  	}
}
