/**********************************************************************
 section 1 - form validation
 **********************************************************************/
function Validate(form)
		{
			var msg = "Opps... You need to fill in the whole form.";
			var name = document.forms[0].name.value;
			var email = document.forms[0].email.value;
			var phone = document.forms[0].phone.value;
			var Zip_From = document.forms[0].Zip_From.value;
			var City_To = document.forms[0].City_To.value;
			// check for any space characters that may be input
		  	
		  	if (name == "" || name == null || email == "" || email == null || phone == "" || phone == null || Zip_From == "" || Zip_From == null || City_To == "" || City_To == null)
		  	{
		  		alert (msg);
		  		return false;
		  	}
		}/**********************************************************************
 section 1 - form validation
 **********************************************************************/
 
function  validateNumeric( strValue ) {
/*****************************************************************
DESCRIPTION: Validates that a string contains only valid numbers.

PARAMETERS:
   strValue - String to be tested for validity

RETURNS:
   True if valid, otherwise false.
******************************************************************/
  var objRegExp  =  /(^-?\d\d*\.\d*$)|(^-?\d\d*$)|(^-?\.\d\d*$)/;

  //check for numeric characters
  return objRegExp.test(strValue);
}


function Validate(form)
		{
			var msg = "Opps... You need to fill in the whole form.";
			var fname = document.forms[0].fname.value;
			var name = document.forms[0].name.value;
			var email = document.forms[0].email.value;
			var phone = document.forms[0].phone.value;
			var Zip_From = document.forms[0].Zip_From.value;
			var City_To = document.forms[0].City_To.value;		
			var StateProv_From = document.forms[0].StateProv_From.value;
			var Country_To = document.forms[0].Country_To.value;
			// check for any space characters that may be input
		  	
		  	if (fname == "" || fname == null || name == "" || name == null || email == "" || email == null || phone == "" || phone == null || Zip_From == "" || Zip_From == null || City_To == "" || City_To == null || StateProv_From == "" || StateProv_From == null || Country_To == "" || Country_To == null)
		  	{
		  		alert (msg);
		  		return false;
		  	}
			
			if (validateNumeric(Zip_From.value)==false){
				alert("Please enter numeric values only.")
				Zip_From.value=""
				Zip_From.focus()
				return false
			}
			
			
		}
	
	
function expandcontent(what)
		{
			var theTables = document.getElementsByTagName('table');
			for(x = 0; x < theTables.length; x++)
			{
				if(theTables[x].className == 'switchcontent')
				{
					theTables[x].style.display = 'none';
				}
			}
			document.getElementById(what).style.display = 'block';
		}
		window.onload = function()
		{
			var selectmenu = document.forms['quoteForm'].services.options;
			expandcontent(selectmenu[selectmenu.selectedIndex].value);
		}