function openTerms(){ var testvar h = 600; if (window.screen) { h = window.screen.availHeight-35; } testvar = "window.open('Privacy.html','Terms','width=640,height="+h+",toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=no,directories=0,status=0,copyhistory=0,minimise=no,maximise=no,left=0,top=0')" eval(testvar) } function getradiovalue(FormElement) { var El=eval("document.SurveyForm."+FormElement); for (var i=0; i < El.length; i++) { if (El[i].checked) { var rad_val = El[i].value; } } return rad_val } function getdropdownvalue(FormElement) { var El=eval("document.SurveyForm."+FormElement); rad_val=El[El.selectedIndex].value return rad_val } function getcheckboxvalue(FormElement,Comparison,TheValues,BooleanType) { var El=eval("document.SurveyForm."+FormElement); myPostedString = new String(","+TheValues+",") myValuesString = new String(","+TheValues+",") if (BooleanType=='&&'){ for (var i=0; i < El.length; i++) { if (El[i].checked&&myPostedString.indexOf(El[i].value)>0) { myValuesString = myValuesString.replace(El[i].value,''); } } myValuesString=myValuesString.replace(/,/g,"") if(myValuesString==""){ return true }else{ return false} } if (BooleanType=='||'){ for (var i=0; i < El.length; i++) { if (El[i].checked&&myPostedString.indexOf(El[i].value)>0) { myValuesString = myValuesString.replace(El[i].value,''); } } if(myValuesString.length 0) && (str.indexOf("@") > 0); } function javavalidate() { var testvar ='' var Tmp='' var MobErr=0 var HomeErr=0 errorindex = 0 document.getElementById("NameTitle").style.backgroundColor='#ffffff'; document.getElementById("FirstName").style.backgroundColor='#ffffff'; document.getElementById("LastName").style.backgroundColor='#ffffff'; document.getElementById("Telephone").style.backgroundColor='#ffffff'; document.getElementById("DOBDay").style.backgroundColor='#ffffff'; document.getElementById("DOBMonth").style.backgroundColor='#ffffff'; document.getElementById("DOBYear").style.backgroundColor='#ffffff'; document.getElementById("Mobile").style.backgroundColor='#ffffff'; document.getElementById("Address1").style.backgroundColor='#ffffff'; document.getElementById("Address2").style.backgroundColor='#ffffff'; document.getElementById("Address3").style.backgroundColor='#ffffff'; document.getElementById("Town").style.backgroundColor='#ffffff'; document.getElementById("County").style.backgroundColor='#ffffff'; document.getElementById("Country").style.backgroundColor='#ffffff'; document.getElementById("Postcode").style.backgroundColor='#ffffff'; document.getElementById("Email").style.backgroundColor='#ffffff'; document.getElementById("ConfirmEmail").style.backgroundColor='#ffffff'; IsEmpty("NameTitle", 'Name Title is blank'); IsEmpty("FirstName", 'First Name is blank'); IsEmpty("LastName", 'Last Name is blank'); Tmp=String(document.AddressForm.Telephone.value).slice(0,2); if(document.AddressForm.Telephone.value.length<10){ HomeErr=1 }else{ if(Tmp!='01'&&Tmp!='08'&&Tmp!='02'){ HomeErr=1 } } Tmp=String(document.AddressForm.Mobile.value).slice(0,2); if(document.AddressForm.Mobile.value.length<10&&document.AddressForm.Mobile.value.length>0||Tmp!='07'){ MobErr=1 } if(HomeErr+MobErr>1){ errorindex=errorindex+1 errorarray[errorindex] = 'Please enter a valid home or mobile phone number' document.getElementById("Telephone").style.backgroundColor='#ffdfe0' document.getElementById("Mobile").style.backgroundColor='#ffdfe0' } if(document.AddressForm.DOBDay.selectedIndex==0||document.AddressForm.DOBMonth.selectedIndex==0||document.AddressForm.DOBYear.selectedIndex==0){ errorindex=errorindex+1 errorarray[errorindex] = 'Please enter a valid date of birth' document.getElementById("DOBDay").style.backgroundColor='#ffdfe0' document.getElementById("DOBMonth").style.backgroundColor='#ffdfe0' document.getElementById("DOBYear").style.backgroundColor='#ffdfe0' } testvar = document.AddressForm.ManualEntry.value; if(testvar =='Y'){ IsEmpty("Address1", 'Address is blank'); IsEmpty("Town", 'Town is blank'); IsEmpty("County", 'County is blank'); IsEmpty("Postcode", 'Postcode is blank'); }else{ if (testvar ==''){ errorindex=errorindex+1 errorarray[errorindex] = 'Please select your address' } } if (document.AddressForm.Email.value!=document.AddressForm.ConfirmEmail.value&&document.AddressForm.Email.value!=''){ errorindex=errorindex+1 errorarray[errorindex] = 'Email address was not confirmed' document.getElementById("Email").style.backgroundColor='#ffdfe0'; document.getElementById("ConfirmEmail").style.backgroundColor='#ffdfe0'; }else{ document.getElementById("Email").style.backgroundColor='#ffffff'; document.getElementById("ConfirmEmail").style.backgroundColor='#ffffff'; } testvar = isValidEmail(document.AddressForm.Email.value) if (testvar == false){ errorindex=errorindex+1 errorarray[errorindex] = 'Email address is not valid or is blank' document.getElementById("Email").style.backgroundColor='#ffdfe0'; }else{ document.getElementById("Email").style.backgroundColor='#ffffff'; } if (document.AddressForm.AcceptTerms.checked==false){ errorindex=errorindex+1 errorarray[errorindex] = 'You must accept our Terms and Conditions to continue' } var errorstring = '' if (errorindex>0){ for(var i=1; i<=errorindex; i++){ errorstring = errorstring + '- ' + errorarray[i] + '\n' } } if (errorindex==0){ return true; } else { alert('Please correct the following problems:\n'+errorstring) return false; } } function checkFields(){ var theForm = document.forms[0] var Err=0 var varOK=0 var OBJ if(document.forms[0].name=="SurveyForm"){ for(i=0; i0){ alert("Please answer all the questions...") return false }else{ return true } } }