/* Form Validation */ function FV() {} FV.prototype = { YD: YAHOO.util.Dom, YE: YAHOO.util.Event, YA: YAHOO.util.Anim, YC: YAHOO.util.Connect, strength: -1, uidcount: 0, uids: {}, codes: { txt_3409: 'Please enter the required details', txt_3410: 'Please enter your last name', txt_3411: 'Please enter your house name or number', txt_3412: 'Please enter your road or street name', txt_3413: 'Please enter your town or village name', txt_3414: 'Please enter your county', txt_3416: 'Please enter your post code', txt_3419: 'Please enter the required details', txt_3421: 'Please enter your comments'}, init: function() { this.YE.on(this.YD.get('txt_3409'), 'blur', function(event) { var e = event || window.event; if (e.keyCode != 9 && this.value.length > 0) { FV.showStatus(FV.validate('txt_3409', this.value, 'txt_3409'), 'txt_3409', FV.codes.txt_3409,'textinput'); } }); this.YE.on(this.YD.get('txt_3410'), 'blur', function(event) { var e = event || window.event; if (e.keyCode != 9 && this.value.length > 0) { FV.showStatus(FV.validate('txt_3410', this.value, 'txt_3410'), 'txt_3410', FV.codes.txt_3410,'textinput'); } }); this.YE.on(this.YD.get('txt_3411'), 'blur', function(event) { var e = event || window.event; if (e.keyCode != 9 && this.value.length > 0) { FV.showStatus(FV.validate('txt_3411', this.value, 'txt_3411'), 'txt_3411', FV.codes.txt_3411,'textinput'); } }); this.YE.on(this.YD.get('txt_3412'), 'blur', function(event) { var e = event || window.event; if (e.keyCode != 9 && this.value.length > 0) { FV.showStatus(FV.validate('txt_3412', this.value, 'txt_3412'), 'txt_3412', FV.codes.txt_3412,'textinput'); } }); this.YE.on(this.YD.get('txt_3413'), 'blur', function(event) { var e = event || window.event; if (e.keyCode != 9 && this.value.length > 0) { FV.showStatus(FV.validate('txt_3413', this.value, 'txt_3413'), 'txt_3413', FV.codes.txt_3413,'textinput'); } }); this.YE.on(this.YD.get('txt_3414'), 'blur', function(event) { var e = event || window.event; if (e.keyCode != 9 && this.value.length > 0) { FV.showStatus(FV.validate('txt_3414', this.value, 'txt_3414'), 'txt_3414', FV.codes.txt_3414,'textinput'); } }); this.YE.on(this.YD.get('txt_3416'), 'blur', function(event) { var e = event || window.event; if (e.keyCode != 9 && this.value.length > 0) { FV.showStatus(FV.validate('txt_3416', this.value, 'txt_3416'), 'txt_3416', FV.codes.txt_3416,'textinput'); } }); this.YE.on(this.YD.get('txt_3419'), 'blur', function(event) { var e = event || window.event; if (e.keyCode != 9 && this.value.length > 0) { FV.showStatus(FV.validate('txt_3419', this.value, 'txt_3419'), 'txt_3419', FV.codes.txt_3419,'textinput'); } }); this.YE.on(this.YD.get('txt_3421'), 'blur', function(event) { var e = event || window.event; if (e.keyCode != 9 && this.value.length > 0) { FV.showStatus(FV.validate('txt_3421', this.value, 'txt_3421'), 'txt_3421', FV.codes.txt_3421,'textarea_input'); } }); }, validate: function(t, v, n, sl) { switch(t) { case 'txt_3409': var r = new RegExp(".","gi"); break; case 'txt_3410': var r = new RegExp(".","gi"); break; case 'txt_3411': var r = new RegExp(".","gi"); break; case 'txt_3412': var r = new RegExp(".","gi"); break; case 'txt_3413': var r = new RegExp(".","gi"); break; case 'txt_3414': var r = new RegExp(".","gi"); break; case 'txt_3416': var r = new RegExp(".","gi"); break; case 'txt_3419': var r = new RegExp(".","gi"); break; case 'txt_3421': var r = new RegExp(".","gi"); break; } if (r) { if (r.exec(v)) { return true; }else{ return false; } } }, showStatus: function(s, id, m, c) { FV.YD.get('status-'+id).className = 'l'; FV.YD.setStyle('status-'+id, 'opacity', 1); FV.YD.get('status-'+id).innerHTML = ''; clearTimeout(FV.YD.get('status-'+id).statim); FV.YD.get('status-'+id).statim = setTimeout(function() { FV.YD.get(id).className = c; if (s) { FV.YD.get('status-'+id).className = 's'; if (FV.YD.get('strength-'+id)) { FV.YD.get('strength-'+id).style.display = 'block'; FV.YD.get(id).className = c; } }else{ FV.YD.setStyle('status-'+id, 'opacity', 1); FV.YD.get('status-'+id).className = 'f'; FV.YD.get('status-'+id).innerHTML = m; FV.YD.get(id).className = c + ' fail'; } }, 500); return s; }, getType: function(form) { var e = 0; for(i=0;i