// JavaScript Document

function valContact1(){

if(document.getElementById("name").value==""){
	alert("Please insert your Name");
	document.getElementById("name").focus();
	return false;
}

if(document.getElementById("phone").value==""){
	alert("Please insert your telephone");
	document.getElementById("phone").focus();
	return false;
}

if(document.getElementById("mail").value==""){
	alert("Please insert your e-mail");
	document.getElementById("mail").focus();
	return false;
	}
	else{
	if(validarEmail(document.getElementById("mail").value) == "no"){
	alert("Please insert your E-mail the following way name@domain.com");	
	document.getElementById("mail").focus();
	return false;	
	}
}
if(document.getElementById("boat").value==""){
	alert("Please insert your Boat Length");
	document.getElementById("boat").focus();
	return false;
}
if(document.getElementById("make").value==""){
	alert("Please insert your Boat make");
	document.getElementById("make").focus();
	return false;
}
if(document.getElementById("year").value==""){
	alert("Please insert your Boat year");
	document.getElementById("year").focus();
	return false;
}








if(document.getElementById("option").value==""){
	alert("please select one option");
	document.getElementById("option").focus();
	return false;
}
if(document.getElementById("option").value == "other")
{
	if(document.getElementById("what").value == "")
	{
		alert("Please tell us more");
		document.getElementById("what").focus();
		return false;
	}
	
}

if(document.getElementById("message").value == "")
{
	alert("Please tell us more about why you need contacted.");	
	document.getElementById("message").focus();
	return false;
}



document.form1.action="contact.php";
document.form1.submit();
}



function changeOption(val){
	if(val=="other"){
		alert("Please tell us more");
		document.getElementById("what_1").style.display="block";
		document.getElementById("what_2").style.display="block";
	}
	else{
		document.getElementById("what_1").style.display="none";
		document.getElementById("what_2").style.display="none";
	}
}


function valContact2(){

if(document.getElementById("name").value==""){
	alert("Please insert your Name");
	document.getElementById("name").focus();
	return false;
}

if(document.getElementById("phone").value==""){
	alert("Please insert your telephone");
	document.getElementById("phone").focus();
	return false;
}

if(document.getElementById("mail").value==""){
	alert("Please insert your e-mail");
	document.getElementById("mail").focus();
	return false;
	}
	else{
	if(validarEmail(document.getElementById("mail").value) == "no"){
	alert("Please insert your E-mail the following way name@domain.com");	
	document.getElementById("mail").focus();
	return false;	
	}
}


document.form1.action="contact2.php";
document.form1.submit();

}



function validarEmail(valor) {
    if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(valor)){
    } 
	else {
   return ("no");
  }
 }
