function ChangeMenuOptionOver(objMenuOption, strBackgroundColor) {
	objMenuOption.style.backgroundColor = strBackgroundColor;
	objMenuOption.style.color = '#ffffff';
}

function ChangeMenuOptionOut(objMenuOption) {
	objMenuOption.style.backgroundColor = '';
	objMenuOption.style.color = '#000000';
}

function NavigateToPage(strPageName, strQueryString) {
	if(strQueryString == '')
		window.location.href = strPageName;
	else
		window.location.href = strPageName + '?' + strQueryString;
}

function ValidatePostCode(strInputString) {
	test = strInputString; size = test.length
	test = test.toUpperCase(); //Change to uppercase

	while (test.slice(0,1) == " ") //Strip leading spaces
		test = test.substr(1,size-1);size = test.length

	while(test.slice(size-1,size)== " ") //Strip trailing spaces
		test = test.substr(0,size-1);size = test.length

	if (size < 6 || size > 8) {
		alert(test + " is not a valid postcode - wrong length");
		return false;
	}

	if (!(isNaN(test.charAt(0)))) {
		alert(test + " is not a valid postcode"); // - cannot start with a number");
		return false;
	}

	if (isNaN(test.charAt(size-3))) {
		alert(test + " is not a valid postcode"); // - alpha character in wrong position");
		return false;
	}

	if (!(isNaN(test.charAt(size-2)))) {
		alert(test + " is not a valid postcode"); // - number in wrong position");
		return false;
	}

	if (!(isNaN(test.charAt(size-1)))) {
		alert(test + " is not a valid postcode"); // - number in wrong position");
		return false;
	}

	if (!(test.charAt(size-4) == " ")) {
		alert(test + " is not a valid postcode"); // - no space or space in wrong position");
		return false;
	}

	count1 = test.indexOf(" ");count2 = test.lastIndexOf(" ");

	if (count1 != count2) {
		alert(test + " is not a valid postcode"); // - only one space allowed");
		return false;
	}

	return true;
}

function LaunchNewWindow(strPageName, strQueryString, strWindowName, intWindowWidth, intWindowHeight) {
	var intWindowLeftPosition, intWindowTopPosition;

	objNewWindow = null;

	if(strQueryString != '')
		strQueryString = '?' + strQueryString;

	intWindowLeftPosition = Math.floor((screen.width - intWindowWidth) / 2);
	intWindowTopPosition = 25;

	objNewWindow = window.open(strPageName + strQueryString, strWindowName, 'width=' + intWindowWidth + ', height=' + intWindowHeight + ', toolbar=yes, location=no, menubar=no, resizable=yes, scrollbars=yes, screenX=1, screenY=' + intWindowTopPosition + ', left=' + intWindowLeftPosition + ', top=' + intWindowTopPosition);
}

function LaunchScrollingNewWindowWithToolbar(strPageName, strQueryString, strWindowName, intWindowWidth, intWindowHeight) {
	var intWindowLeftPosition, intWindowTopPosition;

	objNewWindow = null;

	if(strQueryString != '')
		strQueryString = '?' + strQueryString;

	intWindowLeftPosition = Math.floor((screen.width - intWindowWidth) / 2);

	objNewWindow = window.open(strPageName + strQueryString, strWindowName, 'width=' + intWindowWidth + ', height=' + intWindowHeight + ', toolbar=yes, location=yes, menubar=no, resizable=yes, scrollbars=yes, screenX=1, screenY=' + intWindowTopPosition + ', left=' + intWindowLeftPosition + ', top=25');
}

function ResizePageContentDIV() {
	var objDIVPageBodyStructure, objTemporyObject;
	var intDIVTop, intDIVHeight;
	
	objDIVPageBodyStructure = document.getElementById('divPageBodyStructure');

	intDIVTop = objDIVPageBodyStructure.offsetTop;
	objTemporyObject = objDIVPageBodyStructure.offsetParent;

	while(objTemporyObject != null) {
		intDIVTop += objTemporyObject.offsetTop;
		objTemporyObject = objTemporyObject.offsetParent;
	}

	if(typeof(window.innerWidth) == 'number')
		intDIVHeight = (window.innerHeight - (intDIVTop + 100));
	else if(document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight))
		intDIVHeight = (document.documentElement.clientHeight - (intDIVTop + 100));
	else if(document.body && (document.body.clientWidth || document.body.clientHeight))
		intDIVHeight = (document.body.clientHeight - (intDIVTop + 100));

	if(intDIVHeight < 300) {
		objDIVPageBodyStructure.style.height = '100%';
		objDIVPageBodyStructure.style.overflow = '';
	}
	else
		 objDIVPageBodyStructure.style.height = intDIVHeight + 'px'
}

function MedicalLogin() {
	NavigateToPage('https://services.hi-techhealth.com/lsl/pages/signon.shtml', '');
}