function showmenu(elmnt)
{
	document.getElementById(elmnt).style.visibility="visible";
}

function hidemenu(elmnt)
{
	document.getElementById(elmnt).style.visibility="hidden";
}

function showpictures(filename)
{
	window.open(filename,'housepics','directories=0, menubar=0, toolbar=0, height=500, width=675');
}

function gethousepic(file)
{
	document.getElementById("housepicture").src=file;
}

function mybanner()
{
	document.getElementById("bannerimage").src="images/bob_banner2.jpg";
}

function checkcontactform()
{
   name_ok=true;
   if (document.contactform.name.value == "") name_ok=false;
   if (document.contactform.name.value.match("@") == "@") name_ok=false; 
   if (document.contactform.name.value.match("<a href") == "<a href") name_ok=false; 

   address_ok=true;
   if (document.contactform.address.value == "") address_ok=false;
   if (document.contactform.address.value.match("@") == "@") address_ok=false; 
   if (document.contactform.address.value.match("<a href") == "<a href") address_ok=false; 
   if (document.contactform.city.value == "") address_ok=false;
   if (document.contactform.city.value.match("@") == "@") address_ok=false; 
   if (document.contactform.city.value.match("<a href") == "<a href") address_ok=false; 
   if (document.contactform.state.value == "") address_ok=false;
   if (document.contactform.zip.value == "") 
   {
   		address_ok=false;
   }
   else
   {
		if (isNaN(document.contactform.zip.value) == true) 
		{
			address_ok=false;
		}
   }

	phone_ok=true;
	var phone1=document.contactform.dayphone1.value;
	var phone2=document.contactform.dayphone2.value;
	var phone3=document.contactform.dayphone3.value;
   
	if (phone1 == "" || phone2 == "" || phone3 == "") 
	{
		phone_ok=false;
	}
	else
	{
		if (isNaN(phone1) == true) phone_ok=false;
		if (isNaN(phone2) == true) phone_ok=false;
		if (isNaN(phone3) == true) phone_ok=false;
	}
	
	phone1=document.contactform.phone1.value;
	phone2=document.contactform.phone2.value;
	phone3=document.contactform.phone3.value;
   
	if (phone1 == "" || phone2 == "" || phone3 == "") 
	{
		phone_ok=false;
	}
	else
	{
		if (isNaN(phone1) == true) phone_ok=false;
		if (isNaN(phone2) == true) phone_ok=false;
		if (isNaN(phone3) == true) phone_ok=false;
	}

   email_ok=true;
   if (document.contactform.email.value == "") 
	{
		email_ok=false;
	}
	else
	{
		var atpos=document.contactform.email.value.indexOf("@");
		var dotpos=document.contactform.email.value.lastIndexOf(".");
		if (atpos<1 || dotpos-atpos<2) email_ok=false;
	}

   comments_ok=true;
   if (document.contactform.comments.value == "") comments_ok=false;
   if (document.contactform.comments.value.match("@") == "@") comments_ok=false; 
   if (document.contactform.comments.value.match("<a href") == "<a href") comments_ok=false; 

   form_ok=(name_ok && address_ok && phone_ok && email_ok && comments_ok);

   if (form_ok) 
   {
	   	alert("Thank you, I will contact you shortly.");
   }
   else
   {
		alert("The information you provided is not complete, please complete the form with the correct information.");
   }

   return form_ok;
}
