//Show Contact Form
function showForm(action)
{
	//var doc = document.documentElement ? document.documentElement : document.body;
	document.getElementById("simpleForm").style.visibility = action;
	document.getElementById("floatingBlackOut").style.visibility = action;
	//document.getElementById("simpleForm").style.top = doc.scrollTop;
}
function divVis(element, action)
{
	document.getElementById(element).style.visibility = action;
	if (action == 'visible')
	{
		displayProp = 'block';
	}
	else
	{
		displayProp = 'none';
	}
	document.getElementById(element).style.display = displayProp;	
}
//Form Validation 
function ValidateContactForm(form)
{	
	var firstName = form['data[Lead][first]'];
	var lastName = form['data[Lead][last]'];
    var email =  form['data[Person][0][the_value]'];
	var email2 = form['Retype_Email'];
    var phone =  form['data[Person][1][the_value]'];
    var comment =  form['data[Lead][profile]'];
	if (firstName.value == lastName.value)
	{
		window.alert("Sorry" + " " + firstName.value + " " + lastName.value + " " + ", your first name cannot match your last name.");
		firstName.focus();
		return false;
	}
 	if (firstName.value == "")
    {
        window.alert("Please enter your first name.");
        firstName.focus();
        return false;
    }
    if (lastName.value == "")
    {
        window.alert("Please enter your last name.");
        lastName.focus();
        return false;
    }
    if (email.value == "")
    {
        window.alert("Please enter a valid e-mail address.");
        email.focus();
        return false;
    }
	if (email2.value == "")
    {
        window.alert("Please enter a valid e-mail address.");
        email2.focus();
        return false;
    }
	if (email.value != email2.value)
	{
		window.alert("Please make sure both emails are identical.")
		email.focus();
		return false;
	}
    if (email.value.indexOf("@", 0) < 0)
    {
        window.alert("Please enter a valid e-mail address.");
        email.focus();
        return false;
    }
    if (email.value.indexOf(".", 0) < 0)
    {
        window.alert("Please enter a valid e-mail address.");
        email.focus();
        return false;
    }
	if (comment.value == "")
    {
        window.alert("To better serve you, please provide a description or comment.");
        comment.focus();
        return false;
    }
    return true;
}
//End Form Validation

//This is for the home page home search 
function moveDiv(amount)
{
	document.getElementById("homePageBottomText").style.marginTop = amount;	
}