window.addEvent('domready', function(){
	
//alert('sdfsdf');	
	
	var array = $$('.subColumn');
	
	// var color = el.getStyle('backgroundColor');
	
	var color = "#ffffff";

	//setup form

	$("emailAddress").addEvent("focus", function()
	 {
		 if ($("emailAddress").getProperty("value") == "Email Address  *")
		 {
			$("emailAddress").setProperty("value", "");
		 }
	 });
	
	 $("emailAddress").addEvent("blur", function()
	 {
		 if ($("emailAddress").getProperty("value") == "")
		{
		 $("emailAddress").setProperty("value", "Email Address  *");
		}
	});

	
	$("telephone").addEvent("focus", function()
	 {
		 if ($("telephone").getProperty("value") == "Telephone  *")
		 {
			$("telephone").setProperty("value", "");
		 }
	 });
	
	 $("telephone").addEvent("blur", function()
	 {
	 if ($("telephone").getProperty("value") == "")
		{
			$("telephone").setProperty("value", "Telephone  *");
		}
	 });


	$("fullName").addEvent("focus", function()
	 {
		 if ($("fullName").getProperty("value") == "Full Name *")
		 {
			$("fullName").setProperty("value", "");
		 }
	 });
	
	 $("fullName").addEvent("blur", function()
	 {
		 if ($("fullName").getProperty("value") == "")
			{
			 $("fullName").setProperty("value", "Full Name *");
			}
	 });


	$('contactSubmit').addEvent("click", function()
	{
		return ValidateForm();
	});
 });
	
//Form validation starts here 

function ValidateForm()
{
var msg = "";
//alert(msg);
 
 if ($("emailAddress").getProperty("value") == "Email Address  *" || $("emailAddress").getProperty("value") == "")
 {
 
 $("emailAddress").focus();
 $("emailAddress").morph({ "background-color": ["#b95eff", "#ffffff"] });
 msg = msg + "You must enter an email address\n"
 }  

 if ($("telephone").getProperty("value") == "Telephone  *" || $("telephone").getProperty("value") == "")
 {

 $("telephone").focus();
 $("telephone").morph({ "background-color": ["#b95eff", "#ffffff"] });
 msg = msg + "You must enter a phone number\n"
 }
 
if ($("fullName").getProperty("value") == "Full Name *" || $("fullName").getProperty("value") == "")
 {

 $("fullName").focus();
 $("fullName").morph({ "background-color": ["#b95eff", "#ffffff"] });
 msg = msg + "You must enter your name\n"
 }
 
 if (msg.length > 0)
 {
 //alert(msg);
 return false;
 }

 return true;
} 


