function ExpandCollapse(divid,imgid,theText,theText2) 
{ 
	if (document.getElementById(divid).className == 'layer_hidden') 
	{ 
		document.getElementById(divid).className = 'layer_text';
		document.getElementById(imgid).src = (theText);
	} 
	else 
	{ 
		document.getElementById(divid).className = 'layer_hidden';
		document.getElementById(imgid).src = (theText2); 
	} 
}

function Calculator_show_hide(divid1,divid2) 
{ 
	document.getElementById(divid1).className = 'layer_hide';
	document.getElementById(divid2).className = 'layer_show';
}

var newwindow;
function popup(url)
{
	newwindow=window.open(url,'name','height=680,width=680');
	if (window.focus) {newwindow.focus()}
}
 
function promotion_form_validator(theForm)
{
	if (theForm.name.value == "")
	{
		alert("Please enter your NAME in the provided field.");
		theForm.name.focus();
		return (false);
	}

	if (theForm.contactnumber.value == "")
	{
		alert("Please enter your CONTACT NUMBER in the provided field.");
		theForm.contactnumber.focus();
		return (false);
	}

	if (theForm.email.value == "")
	{
		alert("Please enter your EMAIL address in the provided field.");
		theForm.email.focus();
		return (false);
	}

	if (theForm.age.value == "*")
	{
		alert("Please choose an Age Group which best describes you.");
		theForm.age.focus();
		return (false);
	}

	if (theForm.rent.value == "*")
	{
		alert("Please choose your Current Home Status");
		theForm.rent.focus();
		return (false);
	}

	if (theForm.priority.value == "*")
	{
		alert("Please choose your Highest Financial Priority");
		theForm.priority.focus();
		return (false);
	}

	with (theForm.email)
	{
		apos=theForm.email.value.indexOf("@")
		dotpos=theForm.email.value.lastIndexOf(".")
		if (apos<1||dotpos-apos<2) 
 		{
			alert("The e-Mail format you eneterd was incorrect. Please try again.");return false
		}
		else 
		{
			return true
		}
	}

}

function subscription_form_validator(theForm)
{
	if (theForm.name.value == "")
	{
		alert("Please enter your NAME in the provided field.");
		theForm.name.focus();
		return (false);
	}

	if (theForm.email.value == "")
	{
		alert("Please enter your EMAIL address in the provided field.");
		theForm.email.focus();
		return (false);
	}

	with (theForm.email)
	{
		apos=theForm.email.value.indexOf("@")
		dotpos=theForm.email.value.lastIndexOf(".")
		if (apos<1||dotpos-apos<2) 
 		{
			alert("The e-Mail format you eneterd was incorrect. Please try again.");return false
		}
		else 
		{
			return true
		}
	}

}

function testimonial_form_validator(theForm)
{
	if (theForm.name.value == "")
	{
		alert("Please enter your NAME in the provided field.");
		theForm.name.focus();
		return (false);
	}

	if (theForm.contactnumber.value == "")
	{
		alert("Please enter your CONTACT NUMBER in the provided field.");
		theForm.contactnumber.focus();
		return (false);
	}

	if (theForm.email.value == "")
	{
		alert("Please enter your EMAIL address in the provided field.");
		theForm.email.focus();
		return (false);
	}

	with (theForm.email)
	{
		apos=theForm.email.value.indexOf("@")
		dotpos=theForm.email.value.lastIndexOf(".")
		if (apos<1||dotpos-apos<2) 
 		{
			alert("The e-Mail format you eneterd was incorrect. Please try again.");return false
		}
		else 
		{
			return true
		}
	}

}

function printpage() 
{
window.print();  
}




