function adjustLayout()
{
  // Get natural heights
  var cHeight = xHeight("centercontent");
  var lHeight = xHeight("leftcontent");
  var rHeight = xHeight("rightcontent");
  
  // Find the maximum height
  var maxHeight = Math.max(cHeight, Math.max(lHeight, rHeight));
  
  // Assign maximum height to all columns
  xHeight("center", maxHeight);
  xHeight("left", maxHeight);
  xHeight("right", maxHeight);
  
  // Show the footer
  xShow("footer");
}
window.onload = function()
{
  xAddEventListener(window, "resize", adjustLayout, false);
  adjustLayout();
}
function checkEmail(myForm) {
if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(myForm.Email.value)){
return (true)
}
alert("Invalid E-mail Address! Please re-enter.")
return (false)
}
function dom(myUrl) { //v2.0
  window.open(myUrl,'','scrollbars=yes,width=350,height=600');
}

function dom2(myUrl) { //v2.0
  window.open(myUrl,'','scrollbars=yes,width=520,height=600');
}
function dom3(myUrl) { //v2.0
  window.open(myUrl,'','scrollbars=yes,width=520,height=400');
}
function dom4(myUrl) { //v2.0
  window.open(myUrl,'','scrollbars=yes,width=470,height=600');
}
function validateForm(objForm)
{
	var szErrorMessage = "You need to enter the following information : \n\n";
	var szEmpty = "";
	var bOk = true;
	
if (objForm.name.value == szEmpty) {bOk = false; szErrorMessage += "your name\n";}
if (objForm.company.value == szEmpty) {bOk = false; szErrorMessage += "your company or organisation\n";}
if (objForm.position.value == szEmpty) {bOk = false; szErrorMessage += "your position\n";}
if (objForm.phone.value == szEmpty) {bOk = false; szErrorMessage += "your telephone number\n";}
if (objForm.email.value == szEmpty) {bOk = false; szErrorMessage += "your email address\n";}
if (objForm.business.value == szEmpty) {bOk = false; szErrorMessage += "your business type\n";}
if (objForm.reason.value == szEmpty) {bOk = false; szErrorMessage += "The reason for your website\n";}
	if (!bOk) {
		alert(szErrorMessage);
	}
	return bOk;
}

//Function to check form is filled in correctly before submitting
function CheckForm () {

	var errorMsg = "";

	//If an e-mail is entered check that the e-mail address is valid
        if (document.frmLogin.email.value == "" || (document.frmLogin.email.value.indexOf("@",0) == -1||document.frmLogin.email.value.indexOf(".",0) == -1)) {
                errorMsg +="\n\t<% = strTxtEmailAddressEnterYourValidEmailAddress %>";

        }

	//Check for a Password
	if (document.frmLogin.password.value==""){
		errorMsg += "\n\t<% = strTxtPassworEnterYourPassword %>";
	}

	//If there is aproblem with the form then display an error
	if (errorMsg != ""){
		msg = "<% = strTxtErrorDisplayLine %>\n\n";
		msg += "<% = strTxtErrorDisplayLine1 %>\n";
		msg += "<% = strTxtErrorDisplayLine2 %>\n";
		msg += "<% = strTxtErrorDisplayLine %>\n\n";
		msg += "<% = strTxtErrorDisplayLine3 %>\n";

		errorMsg += alert(msg + errorMsg + "\n\n");
		return false;
	}

	return true;
}
function validateForm(objForm)
{
	var szErrorMessage = "You need to enter the following information : \n\n";
	var szEmpty = "";
	var bOk = true;
	
if (objForm.name.value == szEmpty) {bOk = false; szErrorMessage += "Your Full Name\n";}
if (objForm.company.value == szEmpty) {bOk = false; szErrorMessage += "Your Company\n";}
if (objForm.phone.value == szEmpty) {bOk = false; szErrorMessage += "Your Phone Number\n";}
if (objForm.email.value == szEmpty) {bOk = false; szErrorMessage += "Your Email Address\n";}
if (objForm.details.value == szEmpty) {bOk = false; szErrorMessage += "Your Enquiry\n";}
	if (!bOk) {
		alert(szErrorMessage);
	}
	return bOk;
}

function validateForm2(objForm)
{
	var szErrorMessage = "You need to enter the following information : \n\n";
	var szEmpty = "";
	var bOk = true;
	
if (objForm.name.value == szEmpty) {bOk = false; szErrorMessage += "Your Name\n";}
if (objForm.phone.value == szEmpty) {bOk = false; szErrorMessage += "Your Phone number\n";}
if (objForm.email.value == szEmpty) {bOk = false; szErrorMessage += "Your Email Address\n";}
if (objForm.securityCode.value == szEmpty) {bOk = false; szErrorMessage += "The secret word\n";}

	if (!bOk) {
		alert(szErrorMessage);
	}
	return bOk;
}
function dom4(myUrl) { //v2.0
  window.open(myUrl,'','scrollbars=no,width=10,height=10');
}
