// JavaScript Document
<!--

function checkAssistForm() {
	if(document.form.form_firstname.value=="")
	{
		alert('Please enter your first name.');
		document.form.form_firstname.focus();
		return false;
	}
	
	if(document.form.form_lastname.value=="")
	{
		alert('Please enter your last name.');
		document.form.form_lastname.focus();
		return false;
	}
	
	if(document.form.form_phoneday.value=="" || howManyNumbers(document.form.form_phoneday.value) < 10)
	{
		alert('Please enter a valid daytime phone number.');
		document.form.form_phoneday.focus();
		return false;
	}

	if(document.form.form_phoneeve.value=="" || howManyNumbers(document.form.form_phoneeve.value) < 10)
	{
		alert('Please enter a valid evening phone number.');
		document.form.form_phoneeve.focus();
		return false;
	}
	
	if(document.form.form_email.value=="" || checkEmail(document.form.form_email.value) == false)
	{
		alert('Please enter a valid email address.');
		document.form.form_email.focus();
		return false;
	}
	
	if(document.form.form_price.selectedIndex==0)
	{
		alert('Please select desired price range.');
		document.form.form_price.focus();
		return false;
	}

	if(document.form.form_bedrooms.selectedIndex==0)
	{
		alert('Please select desire number of bedrooms.');
		document.form.form_bedrooms.focus();
		return false;
	}	

	if(document.form.form_bathrooms.selectedIndex==0)
	{
		alert('Please select desire number of bathrooms.');
		document.form.form_bathrooms.focus();
		return false;
	}	
	
}	

function checkContactForm() {
	if(document.contact_form.form_fullname.value=="")
	{
		alert('Please enter your name.');
		document.contact_form.form_fullname.focus();
		return false;
	}
	
	if(document.contact_form.form_phoneday.value=="" || howManyNumbers(document.contact_form.form_phoneday.value) < 10)
	{
		alert('Please enter a valid daytime phone number.');
		document.contact_form.form_phoneday.focus();
		return false;
	}

	if(document.contact_form.form_phonealt.value=="" || howManyNumbers(document.contact_form.form_phonealt.value) < 10)
	{
		alert('Please enter a valid alternate phone number.');
		document.contact_form.form_phonealt.focus();
		return false;
	}
	
	if(document.contact_form.form_email.value=="" || checkEmail(document.contact_form.form_email.value) == false)
	{
		alert('Please enter a valid email address.');
		document.contact_form.form_email.focus();
		return false;
	}
	
	if(document.contact_form.form_bedrooms.selectedIndex==0)
	{
		alert('Please select desire number of bedrooms.');
		document.contact_form.form_bedrooms.focus();
		return false;
	}	

	if(document.contact_form.form_bathrooms.selectedIndex==0)
	{
		alert('Please select desire number of bathrooms.');
		document.contact_form.form_bathrooms.focus();
		return false;
	}	

if(document.contact_form.form_price.selectedIndex==0)
	{
		alert('Please select desired price range.');
		document.contact_form.form_price.focus();
		return false;
	}	
}	

function howManyNumbers(thenumber)
{
	var returnNumber = "";
	filteredValues = "01234567890";
	for(i = 0; i<thenumber.length; i++)
	{
		var c = thenumber.charAt(i);
		if(filteredValues.indexOf(c) != -1)
			returnNumber += c;
	}
	return returnNumber.length;
}

function checkEmail(email)
{
	if(email.search(/@/gi) == -1)
		{return false;}
}
	 

function noClick(name) {
	document.getElementById(name).oncontextmenu=new Function("return false");}

// floorplan functions
function showLgFp(fpName) {
	var floorplan = fpName;
	var url = '';
	var fpWidth = '';
	var fpHeight = '';
	
	if (floorplan == 'a') {
		url = 'floorplans/a_lg.jpg';
		fpWidth = 850+25;
		fpHeight = 367+25;
	}

	if (floorplan == 'b') {
		url = 'floorplans/b_lg.jpg';
		fpWidth = 720+25;
		fpHeight = 409+25;
	}
	
	if (floorplan == 'c') {
		url = 'floorplans/c_lg.jpg';
		fpWidth = 720+25;
		fpHeight = 401+25;
	}
	
	if (floorplan == 'd') {
		url = 'floorplans/d_lg.jpg';
		fpWidth = 710+25;
		fpHeight = 523+25;
	}
	
	if (floorplan == 'e') {
		url = 'floorplans/e_lg.jpg';
		fpWidth = 720+25;
		fpHeight = 442+25;
	}	

	if (floorplan == 'f') {
		url = 'floorplans/f_lg.jpg';
		fpWidth = 710+25;
		fpHeight = 407+25;
	}	
	
	if (floorplan == 'g') {
		url = 'floorplans/g_lg.jpg';
		fpWidth = 700+25;
		fpHeight = 460+25;
	}	
	
	if (floorplan == 'h') {
		url = 'floorplans/h_lg.jpg';
		fpWidth = 720+25;
		fpHeight = 438+25;
	}	

if (floorplan == 'j') {
		url = 'floorplans/j_lg.jpg';
		fpWidth = 658+25;
		fpHeight = 482+25;
	}			

	if (floorplan == 'k') {
		url = 'floorplans/k_lg.jpg';
		fpWidth = 700+25;
		fpHeight = 517+25;
	}		
	
	if (floorplan == 'l') {
		url = 'floorplans/l_lg.jpg';
		fpWidth = 750+25;
		fpHeight = 457+25;
	}		
	
	if (floorplan == 'm') {
		url = 'floorplans/m_lg.jpg';
		fpWidth = 750+25;
		fpHeight = 413+25;
	}		
	
	if (floorplan == 'n') {
		url = 'floorplans/n_lg.jpg';
		fpWidth = 865+25;
		fpHeight = 407+25;
	}			

	if (floorplan == 's') {
		url = 'floorplans/s_lg.jpg';
		fpWidth = 700+25;
		fpHeight = 526+25;
	}
	
	window.open(url,floorplan,'width='+fpWidth+',height='+fpHeight).focus();
}

// photo functions
function showLg(photoName) {
	var photo = photoName;
	var url = 'photos/'+photo+'_lg.jpg';
	
	document.images.display.src = url;
}
-->


