function popUp1(URL) {
day = new Date();
id = day.getTime();
if (/msie/i.test (navigator.userAgent))
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=1,resizable=0,width=600,height=350,left=0,top=0');");
else
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=1,resizable=0,width=600,height=350,left=0,top=0');");
}

function server_status()
{
	ip_address=document.getElementById("ip_address").value;
	if (verifyIP(ip_address))
	popUp1('http://www.netwisehosting.co.uk/support/server-status.html?ip_address='+ip_address);
}

function verifyIP (IPvalue) {
	errorString = "";

	var ipPattern = /^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/;
	var ipArray = IPvalue.match(ipPattern);

	if (IPvalue == "0.0.0.0")
		errorString = errorString + 'Please enter a valid IP address.';
	else if (IPvalue == "255.255.255.255")
		errorString = errorString + 'Please enter a valid IP address.';
	if (ipArray == null)
		errorString = errorString + 'Please enter a valid IP address.';
	else {
		for (i = 0; i < 5; i++) {
			thisSegment = ipArray[i];
			if (thisSegment > 255) {
				errorString = errorString + 'Please enter a valid IP address.';
				i = 4;
			}
			if ((i == 0) && (thisSegment > 255)) {
				errorString = errorString + 'Please enter a valid IP address.';
				i = 4;
      		}
   		}
	}
	extensionLength = 3;
	if (errorString == "")
		return true;
	else{
		alert (errorString);
		return false;
	}
}