WSDOM.Events.add({element:window,type:"load",handler:function(){WSDOM.Console.log("window loaded");ContactForm.behaviour();}});function ContactFormClass(){this.form=WSDOM.Element.parseSelector('form')[0];this.formFieldsWrap=WSDOM.Element.get('contact');this.reqFields=WSDOM.Element.parseSelector('.required',this.formFieldsWrap);this.reqMsg=[];}
ContactFormClass.prototype.behaviour=function(){WSDOM.Behaviour.apply({'#contact .frmSubmit':{'click':function(e,el){WSDOM.Events.cancel(e);this.checkIfReady();el.blur();}.Context(this)}});}
ContactFormClass.prototype.checkIfReady=function(){var rFields=this.reqFields;this.reqMsg=[];for(var i=0;i<rFields.length;i++){if(!rFields[i].value.replace(/ /g,"")){if(0==i){this.reqMsg.push('Please make sure the following field(s) are filled in before submitting this form.');}
var errName=rFields[i].getAttribute('errName');this.reqMsg.push("- "+errName+".")}}
if(0<this.reqMsg.length){alert(this.reqMsg.join("\n"));}else{this.form.submit();}}
var ContactForm=new ContactFormClass()
