function submitContactForm() { var floc=document.getElementById('formlocation'); var ffname=document.getElementById('formfname'); var flname=document.getElementById('formlname'); var finquiry=document.getElementById('forminquiry'); var fcompany=document.getElementById('formcompany'); var faddress=document.getElementById('formaddress'); var fcity=document.getElementById('formcity'); var fcountry=document.getElementById('formcountry'); var femail=document.getElementById('formemail'); var fphone=document.getElementById('formphone'); var fdescription=document.getElementById('formdescription'); if(floc.value=='') { alert('Please fill in your Location'); floc.focus(); } else if(ffname.value=='' || ffname.value==' ') { alert('Please fill in your first name'); ffname.focus(); } else if(flname.value=='' || flname.value==' ') { alert('Please fill in your last name'); flname.focus(); } else if(finquiry.value=='' || finquiry.value==' ') { alert('Please indicate your reason for contacting us'); finquiry.focus(); } else if(fcompany.value=='' || fcompany.value==' ') { alert('Please fill in your company name'); fcompany.focus(); } else if(faddress.value=='' || faddress.value==' ') { alert('Please fill in your address'); faddress.focus(); } else if(fcity.value=='' || fcity.value==' ') { alert('Please fill in your city'); fcity.focus(); } else if(fcountry.value=='' || fcountry.value==' ') { alert('Please fill in your country'); fcountry.focus(); } else if(femail.value=='' || femail.value==' ') { alert('Please fill in your email address'); femail.focus(); } else if(validateEmail()==false) { alert('Please check your email address'); femail.focus(); } else if(fphone.value=='' || fphone.value==' ') { alert('Please fill in your phone number'); fphone.focus(); } else if(testDescforHtml()==false) { alert('Please remove HTML code from the message field'); fdescription.focus(); } else { document.forms[0].submit(); } } function validateEmail() { var obj=document.getElementById('formemail').value; var lng=obj.length; var atPos=obj.indexOf('@'); var dotPos=obj.indexOf('.'); if(atPos==0 || dotPos==0 || atPos==-1 || dotPos==-1 || atPos==lng-1 || dotPos==lng-1) return false; if(atPos+1==dotPos||dotPos+1==atPos) return false; } function testDescforHtml() { var fdescription=document.getElementById('formdescription').value; if ((fdescription.indexOf('') != '-1') || (fdescription.indexOf('') != '-1') || (fdescription.indexOf('') != '-1') || (fdescription.indexOf('