
function checkRequest()
{

d = document.quotation.contactname.value;d = trim(d);document.quotation.contactname.value=d;
if (d.length==0) {alert(CONTACTNAME);document.quotation.contactname.focus();return false;}

d = document.quotation.companyname.value;d = trim(d);document.quotation.companyname.value=d;
if (d.length==0) {alert(COMPANYNAME);document.quotation.companyname.focus();return false;}

d = document.quotation.positionincompany.value;d = trim(d);document.quotation.positionincompany.value=d;
if (d.length==0) {alert(POSITIONINCOMPANY);document.quotation.positionincompany.focus();return false;}

d = document.quotation.address.value;d = trim(d);document.quotation.address.value=d;
if (d.length==0) {alert(ADDRESS);document.quotation.address.focus();return false;}

d = document.quotation.phone.value;d = trim(d);document.quotation.phone.value=d;
if (d.length==0) {alert(TELEFON);document.quotation.phone.focus();return false;}
  else if (isNaN(d)) {alert(TELEFONVALID);document.quotation.phone.focus();return false;}

d = document.quotation.email.value;d = trim(d);document.quotation.email.value=d;
if (d.length==0) {alert(MAIL);document.quotation.email.focus();return false;}
if (!isValidEmail(d)) {alert(VALIDMAIL);document.quotation.email.focus();return false;}

return true;
}

function trim(sInString) {
  sInString = sInString.replace( /^\s+/g, "" );// strip leading
  return sInString.replace( /\s+$/g, "" );// strip trailing
}
function isValidEmail(str) {

   return (str.indexOf(".") > 2) && (str.indexOf("@") > 0);
 


}

function checkDetailes()
{
d = document.formdetailes.startdate.value;
if (d=='undef') {alert(STARTDATE);document.formdetailes.startdate.focus();return false;}

d = document.formdetailes.lengthofstay.value;
if (d=='undef') {alert(LENGTHOFSTAY);document.formdetailes.lengthofstay.focus();return false;}

return true;

} 


