function trim(s) {
  while (s.substring(0,1) == ' ') {
    s = s.substring(1,s.length);
  }
  while (s.substring(s.length-1,s.length) == ' ') {
    s = s.substring(0,s.length-1);
  }
  return s;
}
function js_check_null_field()
{
	try 
	{
	var company = trim(document.forms[0].txt_company.value);
	var contact = trim(document.forms[0].txt_contact.value);
	var phone = trim(document.forms[0].txt_phone.value);
	var email = trim(document.forms[0].txt_email.value);
	var shipper = trim(document.forms[0].txt_shipper.value);
	var csz_1 = trim(document.forms[0].txt_csz_1.value);
	var consignee = trim(document.forms[0].txt_consignee.value);
	var csz_2 = trim(document.forms[0].txt_csz_2.value);
	var service = trim(document.forms[0].txt_service.value);
	}
	catch (e)
	{
		alert("Form validation error. Please contact webmaster.");
	}
	var msg ="";
	/*if (company.length==0){msg +="company,";}
	if (contact==""){msg +="contact,";}
	if (phone==""){msg +="phone,";}
	if (email==""){msg +="email,";}
	if (shipper==""){msg +="shipper,";}
	if (csz_1==""){msg +="City,State,Zip,";}
	if (consignee==""){msg +="consignee,";}
	if (csz_2==""){msg +="City,Sate,zip";}
	*/
	if ((company=="")
	|| (contact=="")
	|| (phone=="")
	|| (email=="")
	|| (shipper=="")
	|| (csz_1=="")
	|| (consignee=="")
	|| (csz_2=="")
	|| (service=="")) msg = "All fields are required";
	
	if(msg!="")
	{
		alert(msg);
		return false;
	}
	return true;
}


