// JavaScript Document
//free estimate comfirmation
function gofree_estimate(){
	var myform = document.frmFreeEstimate;
	var ctr = 0;
	if(myform.txtFirstName.value == ""){
		alert("You missed to enter First Name!");
		myform.txtFirstName.focus();
		ctr = 1;
	}
	else if(myform.txtLastName.value == ""){
		alert("You missed to enter Last Name!");
		myform.txtLastName.focus();
		ctr = 1;
	}
	
	else if(myform.txtEmail.value == ""){
		alert("You missed to enter Email Address!");
		myform.txtEmail.focus();
		ctr = 1;
	}
	else if(CheckEmail(myform.txtEmail.value) == false){
		alert("You have to enter a valid Email Address!");
		myform.txtEmail.focus();
		ctr = 1;
	}
	else if(myform.txtTelNo.value == ""){
		alert("You missed to enter Telephone Number!");
		myform.txtTelNo.focus();
		ctr = 1;
	}
	else if(myform.txtSubject.value == ""){
		alert("You missed to enter subject!");
		myform.txtSubject.focus();
		ctr = 1;
	}
	else if(myform.txtMessage.value == ""){
		alert("You missed to enter your message!");
		myform.txtMessage.focus();
		ctr = 1;
	}
	
	if(ctr == 0){
		myform.hidConfirm.value = "goestimate";	
		myform.submit();
	}
}

//send to friend confirmation
function sendtofriend(){
	var myform = document.frmSendtoFriend;
	var ctr = 0;
	
	if(myform.txtName.value == ""){
		alert("Please enter your name!");
		myform.txtName.focus(); ctr = 1;
	}
	else if(myform.txtEmail.value == ""){
		alert("Please enter your email!");
		myform.txtEmail.focus(); ctr = 1;
	}
	else if(CheckEmail(myform.txtEmail.value) == false){
		alert("You have to enter a valid Email Address!");
		myform.txtEmail.focus();
		ctr = 1;
	}
	else if(myform.txtFriendName.value == ""){
		alert("Please enter your friend's name!");
		myform.txtFriendName.focus(); ctr = 1;
	}
	else if(myform.txtFriendEmail.value == ""){
		alert("Please enter your friend's email!");
		myform.txtFriendEmail.focus(); ctr = 1;
	}
	else if(CheckEmail(myform.txtFriendEmail.value) == false){
		alert("You have to enter a valid Email Address!");
		myform.txtFriendEmail.focus();
		ctr = 1;
	}
	else if(myform.txtSubject.value == ""){
		alert("Please enter your subject!");
		myform.txtSubject.focus(); ctr = 1;
	}
	else if(myform.txtMessage.value == ""){
		alert("Please enter your message!");
		myform.txtMessage.focus(); ctr = 1;
	}
	
	if(ctr == 0){
		myform.hidconfirm.value = "sendtofriend";
		myform.submit();
	}
	
	
	
}


//send quote confirmation
function sendquote(){
	var myform = document.frmSendQuote;
	var ctr = 0;
	
	if(myform.txtFirstName.value == ""){
		alert("Please enter your first name!");
		myform.txtFirstName.focus(); ctr = 1;
	}
	else if(myform.txtLastName.value == ""){
		alert("Please enter your last email!");
		myform.txtLastName.focus(); ctr = 1;
	}
	else if(myform.txtEmail.value == ""){
		alert("Please enter your email!");
		myform.txtEmail.focus(); ctr = 1;
	}
	else if(CheckEmail(myform.txtEmail.value) == false){
		alert("You have to enter a valid Email Address!");
		myform.txtEmail.focus();
		ctr = 1;
	}
	else if(myform.txtPhoneNo.value == ""){
		alert("Please enter your phone number!");
		myform.txtPhoneNo.focus(); ctr = 1;
	}
	else if(myform.txtSubject.value == ""){
		alert("Please enter your subject!");
		myform.txtSubject.focus(); ctr = 1;
	}
	else if(myform.txtMessage.value == ""){
		alert("Please enter your message!");
		myform.txtMessage.focus(); ctr = 1;
	}
	
	if(ctr == 0){
		myform.hidconfirm.value = "sendquote";
		myform.submit();
	}
	
}

//contact us form
function sendcomment(){
	var myform = document.frmContactUs;
	var ctr = 0;
	
	if(myform.txtName.value == ""){
		alert("Please enter your name!");
		myform.txtName.focus(); ctr = 1;
	}
	else if(myform.txtAddress.value == ""){
		alert("Please enter your address!");
		myform.txtAddress.focus(); ctr = 1;
	}
	else if(myform.txtPhoneNo.value == ""){
		alert("Please enter your phone number!");
		myform.txtPhoneNo.focus(); ctr = 1;
	}
	else if(myform.txtEmail.value == ""){
		alert("Please enter your email!");
		myform.txtEmail.focus(); ctr = 1;
	}
	else if(CheckEmail(myform.txtEmail.value) == false){
		alert("You have to enter a valid Email Address!");
		myform.txtEmail.focus();
		ctr = 1;
	}
	else if(myform.txtMessage.value == ""){
		alert("Please enter your message!");
		myform.txtMessage.focus(); ctr = 1;
	}
	
	if(ctr == 0){
		myform.hidconfirm.value = "sendcomment";
		myform.submit();
	}
	
	
	
}

//res comm form
function sendform(){
	var myform = document.frmPage;
	var ctr = 0;
	
	if(myform.txtName.value == ""){
		alert("Please enter your name!");
		myform.txtName.focus(); ctr = 1;
	}
	else if(myform.txtAddress.value == ""){
		alert("Please enter your address!");
		myform.txtAddress.focus(); ctr = 1;
	}
	else if(myform.txtPhoneNo.value == ""){
		alert("Please enter your phone number!");
		myform.txtPhoneNo.focus(); ctr = 1;
	}
	else if(myform.txtEmail.value == ""){
		alert("Please enter your email!");
		myform.txtEmail.focus(); ctr = 1;
	}
	else if(CheckEmail(myform.txtEmail.value) == false){
		alert("You have to enter a valid Email Address!");
		myform.txtEmail.focus();
		ctr = 1;
	}
	else if(myform.txtMessage.value == ""){
		alert("Please enter your message!");
		myform.txtMessage.focus(); ctr = 1;
	}
	
	if(ctr == 0){
		myform.submit();
	}
	
}

//sign up form for commercial
function com_signup(){
	var myform = document.frmSignUp;
	var ctr = 0; 
	if(myform.txtName.value == ""){
		alert("Please enter your name!");
		myform.txtName.focus(); ctr = 1;
	}
	else if(myform.txtPhoneNo.value == ""){
		alert("Please enter your phone number!");
		myform.txtPhoneNo.focus(); ctr = 1;
	}
	else if(myform.txtEmail.value == ""){
		alert("Please enter your email!");
		myform.txtEmail.focus(); ctr = 1;
	}
	else if(CheckEmail(myform.txtEmail.value) == false){
		alert("You have to enter a valid Email Address!");
		myform.txtEmail.focus();
		ctr = 1;
	}
	
	if(ctr == 0){
		myform.hidConfirm.value = "com_signup";
		myform.submit();
	}
	
}

//sign up form for residential
function res_signup(){
	var myform = document.frmSignUp;
	var ctr = 0; 
	if(myform.txtName.value == ""){
		alert("Please enter your name!");
		myform.txtName.focus(); ctr = 1;
	}
	else if(myform.txtAddress.value == ""){
		alert("Please enter your address!");
		myform.txtAddress.focus(); ctr = 1;
	}
	else if(myform.txtCity.value == ""){
		alert("Please enter your city!");
		myform.txtCity.focus(); ctr = 1;
	}
	else if(myform.cmbState.value == ""){
		alert("Please enter your state!");
		myform.cmbState.focus(); ctr = 1;
	}
	else if(myform.txtPhoneNo.value == ""){
		alert("Please enter your phone number!");
		myform.txtPhoneNo.focus(); ctr = 1;
	}
	else if(myform.txtEmail.value == ""){
		alert("Please enter your email!");
		myform.txtEmail.focus(); ctr = 1;
	}
	else if(CheckEmail(myform.txtEmail.value) == false){
		alert("You have to enter a valid Email Address!");
		myform.txtEmail.focus();
		ctr = 1;
	}
	else if(myform.txtSubject.value == ""){
		alert("Please enter your subject!");
		myform.txtSubject.focus(); ctr = 1;
	}
	else if(myform.txtMessage.value == ""){
		alert("Please enter your message!");
		myform.txtMessage.focus(); ctr = 1;
	}
	
	if(ctr == 0){
		myform.hidConfirm.value = "res_signup";
		myform.submit();
	}
	
}


