var d = document; function Contact_FcheckForm(f){ if(!FcheckFilled('First name -',f.first_name.value)){ f.first_name.focus();return false; } if(!FcheckFilled('Last name -',f.last_name.value)){ f.last_name.focus();return false; } if(!FcheckEmail('E-mail -',f.email.value)){ f.email.focus(); return false; } if(!FcheckFilled('Phone -',f.phone.value)){ f.phone.focus();return false; } if(!FcheckFilled('Enquiry -',f.enquiry.value)){ f.enquiry.focus();return false; } /**/ return true; } //------------------------------------------------------------------------ function a_plus_b(form) { a=eval(form.a.value) b=eval(form.b.value) c=a+b form.ans.value = c } function a_minus_b(form) { a=eval(form.a.value) b=eval(form.b.value) c=a-b form.ans.value=c } //------------------------------------------------------------------------ function codenameCB(cb, t) { if(cb.checked) { t.disabled=false; } else { t.disabled=true; } } function codename(cb, t, t2) { if(cb.checked) { t.disabled=false; t2.disabled=false; } else { t.disabled=true; t2.disabled=true; } } function codename2(cb, t, t2) { if(cb.checked) { t.disabled=false; t2.disabled=true; } else { t.disabled=true; t2.disabled=false; } } //------------------------------------------------------------------------ function FcheckRadioValue(n,v,vv,nn){ //var r = false; // var i; //for (i = 0; i < v.length; i++){ if (v[nn].checked) { if((isNaN(vv))||(vv=="")){ // if(vv=="")){ alert(n+" has to be numeric!"); return false; }else{ return true; } //r = true; } else { return true; } //} /* if (!r){ alert("Select a value for "+n+" "); return (false); } else { return true; } */ } function Fvalue(n,v,vv){ if(vv.checked){ if((isNaN(v))||(v=="")){ alert(n+" has to be numeric!"); return false; }else{ return true; } } else { return true; } } function Fconfirm(){ var agree=confirm("All data is filled in correct!\nSend now?"); if (agree) return true ; else return false ; } function FcheckFilled(n,v){ if(v==""){ alert(n+" is required!");return false; } else { return true; } } function FcheckMinLength(n,v,num){ if(v.lengthnum){ alert("Max. chars for "+n+" is "+num+" ");return false; } else { return true; } } function FcheckNumber(n,v){ if((isNaN(v))||(v=="")){ alert(n+" has to be numeric!"); return false; }else{ return true; } } function FcheckChars(n,v,num){ if(v.length>num){ alert("Max. chars for "+n+" is "+num+"!\n"+(v.length-num)+" chars to many!");return false; } else { return true; } } function FcheckEmail(n,v){ var a=0 var p=0 for(var i=1;i0){ if (sel < mi) { alert("Min "+mi+" items for "+n+" ");return false; } } if(ma>0){ if (sel > ma) { alert("Max. "+ma+" items for "+n+" ");return false; } } return true; } function FcheckBoxes(n,v,mi,ma){ var sel = false; var i; for (i = 0; i < v.length; i++){ if (v[i].checked) sel++; } if(mi>0){ if (sel < mi) { alert("Min "+mi+" items for "+n+" ");return false; } } if(ma>0){ if (sel > ma) { alert("Max. "+ma+" items for "+n+" ");return false; } } return true; }