function form_validate_quote(theform)
{
//Name
        if(trim(document.getElementById("txtContactPerson").value) == "Name" || trim(document.getElementById("txtContactPerson").value)=="")
        {
            var formname = document.getElementById("contact-form");
            formname.txtContactPerson.value = "";
            alert("Please enter Name");
            formname.txtContactPerson.focus();
            return false;
        }
		

//Phone
	if(trim(document.getElementById("txtPhone").value) == "")
		{ 
			var formname = document.getElementById("contact-form");
			formname.txtPhone.value = "";
			alert("Please enter Phone");
			formname.txtPhone.focus();
			return false;
		}
	
	if(trim(document.getElementById("txtPhone").value) != "")
		{
			var formname = document.getElementById("contact-form");
			var phone = formname.txtPhone.value;
			var stripped = phone.replace(/[\(\)\.\-\ ]/g, '');
			//strip out acceptable non-numeric characters
			if (isNaN(parseInt(stripped))) {
			    alert("Invalid Phone Number");
				formname.txtPhone.focus();
				return false;
			}
    	}

//Email
	if(trim(document.getElementById("txtEmail").value) == "Your Email Address" || trim(document.getElementById("txtEmail").value)=="")
		{
			var formname = document.getElementById("contact-form");
			formname.txtEmail.value = "";
			alert("Please enter Email");
			formname.txtEmail.focus();
			return false;
		} 
		
	
	if(trim(document.getElementById("txtEmail").value) != "") 
		{
	     	var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
 	 		//var address = document.forms[form_id].elements[email].value;
			var formname = document.getElementById("contact-form");
			var address = formname.txtEmail.value;
   			if(reg.test(address) == false) 
			{
      			alert('Invalid Email Address');
				formname.txtEmail.focus();
      			return false;
			}  
   		}

//Bedrooms
	if(trim(document.getElementById("numBeds").value) == "")
		{ 
			var formname = document.getElementById("contact-form");
			formname.numBeds.value = "";
			alert("Please select Number of Bedrooms");
			formname.numBeds.focus();
			return false;
			
		}
	
//From
	if(trim(document.getElementById("fromZip").value) == "")
		{ 
			var formname = document.getElementById("contact-form");
			formname.fromZip.value = "";
			alert("Please enter Moving From ZIP Code");
			formname.fromZip.focus();
			return false;
		}
	
	if(trim(document.getElementById("fromZip").value) != "")
		{
			var formname = document.getElementById("contact-form");
			var zip = formname.fromZip.value;
			var stripped = zip.replace(/[\(\)\.\-\ ]/g, '');
			//strip out acceptable non-numeric characters
			if (isNaN(parseInt(stripped))) {
			    alert("Invalid Moving From ZIP Code");
				formname.fromZip.focus();
				return false;
			}
    	}
	   
	if(trim(document.getElementById("fromFloor").value) == "")
		{ 
			var formname = document.getElementById("contact-form");
			formname.fromFloor.value = "";
			alert("Please enter Moving From Floor");
			formname.fromFloor.focus();
			return false;
			
		}
	
	if(trim(document.getElementById("fromType").value) == "")
		{ 
			var formname = document.getElementById("contact-form");
			formname.fromType.value = "";
			alert("Please select Moving From Type");
			formname.fromType.focus();
			return false;
			
		}
	
//To
	if(trim(document.getElementById("toZip").value) == "")
		{ 
			var formname = document.getElementById("contact-form");
			formname.toZip.value = "";
			alert("Please enter Moving To ZIP Code");
			formname.toZip.focus();
			return false;
			
		}
	
	if(trim(document.getElementById("toZip").value) != "")
		{
			var formname = document.getElementById("contact-form");
			var zip = formname.toZip.value;
			var stripped = zip.replace(/[\(\)\.\-\ ]/g, '');
			//strip out acceptable non-numeric characters
			if (isNaN(parseInt(stripped))) {
			    alert("Invalid Moving To ZIP Code");
				formname.toZip.focus();
				return false;
			}
    	}
	   
	if(trim(document.getElementById("toFloor").value) == "")
		{ 
			var formname = document.getElementById("contact-form");
			formname.toFloor.value = "";
			alert("Please enter Moving To Floor");
			formname.toFloor.focus();
			return false;
			
		}
	
	if(trim(document.getElementById("toType").value) == "")
		{ 
			var formname = document.getElementById("contact-form");
			formname.toType.value = "";
			alert("Please select Moving To Type");
			formname.toType.focus();
			return false;
			
		}

//Address
        if(trim(document.getElementById("txtAddress").value) == "")
        {
            var formname = document.getElementById("contact-form");
            formname.txtAddress.value = "";
            alert("Please enter Address");
            formname.txtAddress.focus();
            return false;
        }
		
//Appointment
	if(trim(document.getElementById("txtTime").value) == "")
		{ 
			var formname = document.getElementById("contact-form");
			formname.txtTime.value = "";
			alert("Please enter Appointment Time");
			formname.txtTime.focus();
			return false;
			
		}
	
	return true;
}      

//Misc.
function trim(str)
{
	return str.replace(/^\s+|\s+$/g,"");
}
