<!--
function valMe(){
	var fname = document.frmQuote.first_name;
	var lname = document.frmQuote.last_name;
	//var address = document.frmQuote.address;
	//var city = document.frmQuote.city;
	//var st = document.frmQuote.state;
	//var country = document.frmQuote.country;
	//var zip = document.frmQuote.zipcode;
	var phone = document.frmQuote.phone;
	//var phone2 = document.frmQuote.phone2;
	//var phone3 = document.frmQuote.phone3;
	var email = document.frmQuote.email;
	//var use = document.frmQuote.usage;
	//var size = document.frmQuote.dimensions;
	//var type = document.frmQuote.00N70000001bDCu[document.frmQuote.00N70000001bDCu.selectedIndex];
	//var bldgwhen = document.frmQuote.bldgdte[document.frmQuote.bldgdte.selectedIndex];
	// Declaring required variables
	var digits = "0123456789";		// non-digit characters which are allowed in phone numbers
	var phoneNumberDelimiters = "()- ";		// characters which are allowed in international phone numbers
	// (a leading + is OK)
	var validWorldPhoneChars = phoneNumberDelimiters + "+";
	// Minimum no of digits in an international phone no.
	var minDigitsInIPhoneNumber = 10;
	
	function validEmail(email) {
	invalidChars = " /:,;"
	
	if (email == "") {// cannot be empty
				return false
	}
	for (i=0; i<invalidChars.length; i++) {	// does it contain any invalid characters?
	badChar = invalidChars.charAt(i)
		if (email.indexOf(badChar,0) > -1) {
			return false
		}
	}
	atPos = email.indexOf("@",1)			// there must be one "@" symbol
		if (atPos == -1) {
			return false
		}
		if (email.indexOf("@",atPos+1) != -1) {	// and only one "@" symbol
			return false
		}
	periodPos = email.indexOf(".",atPos)
		if (periodPos == -1) {			// and at least one "." after the "@"
			return false
		}
		if (periodPos+3 > email.length)	{	// must be at least 2 characters after the "."
			return false
		}
	return true
}
	
	
	function isInteger(s) {   
	var i;
    for (i = 0; i < s.length; i++)
    {   
        // Check that current character is number.
        var c = s.charAt(i);
        if (((c < "0") || (c > "9"))) return false;
    }
    // All characters are numbers.
    return true;
	}

	function stripCharsInBag(s, bag) {   
	var i;
    var returnString = "";
    // Search through string's characters one by one.
    // If character is not in bag, append to returnString.
    for (i = 0; i < s.length; i++)
    {   
        // Check that current character isn't whitespace.
        var c = s.charAt(i);
        if (bag.indexOf(c) == -1) returnString += c;
    }
    return returnString;
	}

	function checkInternationalPhone(strPhone){
	s=stripCharsInBag(strPhone,validWorldPhoneChars);
	return (isInteger(s) && s.length >= minDigitsInIPhoneNumber);
	}
	
	if (fname.value == "") {
		alert("Please enter your first name.");
		fname.focus();
		return false;
	}
	if (lname.value == "") {
		alert("Please enter your last name.");
		lname.focus();
		return false;
	}
	/*if (address.value == "") {
		alert("Please enter your address.");
		address.focus();
		return false;
	}
	if (city.value == "") {
		alert("Please enter the name of your city.");
		city.focus();
		return false;
	}
	if (st.value == "") {
		alert("Please enter the name of your state.");
		st.focus();
		return false;
	}
	if (country.value == "") {
		alert("Pleae enter the name of your country.");
		country.focus();
		return false;
	}
	if (zip.value == ""){
		alert("Please enter a valid zip code.");
		zip.focus();
		zip.select();
		return false;
	}*/

	
	/*if ((phone1.value==null)||(phone1.value=="")||(isNaN(phone1.value))||(phone1.value.length < 3)){
		alert("Please enter your Area Code")
		phone1.focus();
		phone1.select();
		return false;
	}
	if ((phone2.value==null)||(phone2.value=="")||(isNaN(phone2.value))||(phone2.value.length < 3)){
		alert("Please enter your Phone Prefix Number.")
		phone2.focus();
		phone2.select();
		return false;
	}
	if ((phone3.value==null)||(phone3.value=="")||(isNaN(phone3.value))||(phone3.value.length < 4)){
		alert("Please Enter your Number \n\(the last four digits\)");
		phone3.focus();
		phone3.select();
		return false;
	}
	if (checkInternationalPhone(phone1.value+phone2.value+phone3.value)==false){
		alert("Please Enter a Valid Phone Number");
		phone1.select();
		phone1.focus();
		return false;
	}*/
	if (phone.value == ""){
		alert("Please enter your phone number.");
		phone.focus();
		phone.select();
		return false;
	}
	
	if (!validEmail(email.value)) {
	alert("Please enter a valid e-mail address")
	email.focus()
	email.select()
	return false;
	}
	/*if (use.value == "") {
		alert("What will the new building be used for?");
		use.focus();
		return false;
	}
	if (size.value == "") {
		alert("What size building will you need?");
		size.focus();
		return false;
	}
	if (type.value == "") {
		alert("Please select what type of building you would like.");
		document.frmQuote.series.focus();
		return false;
	}
	if (bldgwhen.value == "") {
		alert("Please let us know when you intend to build.");
		document.frmQuote.bldgdte.focus();
		return false;
	}*/
	return true;
	}










function getArgs() {
		
		var zargs = new Object();
		var zquery = location.search.substring(1);
		
		if (zquery != "") {
		document.frmQuote.first_name.focus();
		//alert("Query is " + zquery);
		}
		else {
			zquery = "bldg=0&mdl=0";
			//alert("Query is " + zquery);
			document.frmQuote.first_name.focus();
		}
		var zpairs = zquery.split(",");
		var zhairs = zquery.split("&");
		
		var zfirstpart = "";
		zfirstpart = zhairs[0].split("=");
		//alert(zfirstpart[1]);
		
		var zsecondpart = "";
		zsecondpart = zhairs[1].split("=");
		//alert(zsecondpart[1]);		
							
		var model = zsecondpart[1];
		//alert(firstpart[1]);
		
		var won = "document.frmQuote";
		var too = "00N70000001bDEf";
		var tree = "00N70000001bDBc";
		var fur = "00N70000001bDCu";
		
		//alert(tree);
		
		var wontoo = won + "." + too;
		var wontree = won + "." + tree;
		var wonfur = won + "." + fur;
		
		//alert(wontoo);
		
		if (zfirstpart[1] != "0") {
		//alert("not equal to zero");
		//alert(wontree);
		wontree.value = zfirstpart[1];
		//alert("wontree.value=" + zfirstpart[1]);
		wontoo.value = "Powerbilt Steel Buildings Discount Special";
		}
		else {
			//alert("equal to zero");	
			wontree.value = "";
			wontoo.value = "";
		}
		
		//wonfur[model].selected="selected";
		//alert(model);
		document.writeln("<input name=\"00N70000001bDBc\" type=\"text\" id=\"00N70000001bDBc\" value=\"" + zfirstpart[1] + "\" size=\"30\" autocomplete=\"off\" />");
		document.writeln("</td></tr>");
		document.writeln("<tr><td>&nbsp;</td><td><em>Length x Width x Height</em></td></tr>");
		document.writeln("<tr>");
		document.writeln("<td class=\"argt\"><span class=\"argt\">Building Type:</span></td>");
		document.writeln("<td><select name=\"00N70000001bDCu\" id=\"00N70000001bDCu\">");
		document.writeln("<option> -- Select -- </option>");
		if (model == "1") {
			//alert("a model");
			document.writeln("<option value=\"S-Series\" selected=\"selected\">S-Series</option>");
		}
		if (model == "2") {
			//alert("a model");
			document.writeln("<option value=\"A-Series\" selected=\"selected\">A-Series</option>");
		}
		if (model == "3") {
			document.writeln("<option value=\"P-Series\" selected=\"selected\">P-Series</option>");
		}
		if (model == "4") {
			document.writeln("<option value=\"Q-Series\" selected=\"selected\">Q-Series</option>");
		}		
		document.writeln("<option value=\"A-Series\">A-Series</option>");
		document.writeln("<option value=\"P-Series\">P-Series</option>");
		document.writeln("<option value=\"Q-Series\">Q-Series</option>");
		document.writeln("<option value=\"S-Series\">S-Series</option>");
		document.writeln("</select>");
                        
                        
                        
                        
						
		

}
//-->
