/* 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_6893: 'Please enter the required details', txt_6897: 'Please enter the required details', men_7032: 'Please enter the required details', txt_6898: 'Please enter the required details'}, init: function() { this.YE.on(this.YD.get('txt_6893'), 'blur', function(event) { var e = event || window.event; if (e.keyCode != 9 && this.value.length > 0) { FV.showStatus(FV.validate('txt_6893', this.value, 'txt_6893'), 'txt_6893', FV.codes.txt_6893,'textinput'); } }); this.YE.on(this.YD.get('txt_6897'), 'blur', function(event) { var e = event || window.event; if (e.keyCode != 9 && this.value.length > 0) { FV.showStatus(FV.validate('txt_6897', this.value, 'txt_6897'), 'txt_6897', FV.codes.txt_6897,'textinput'); } }); this.YE.on(this.YD.get('men_7032'), 'change', function() { FV.validate('men_7032', this.options.selectedIndex, 'men_7032', true); }); this.YE.on(this.YD.get('men_7032'), 'blur', function() { FV.validate('men_7032', this.options.selectedIndex, 'men_7032', true); }); this.YE.on(this.YD.get('txt_6898'), 'change', function() { var e = event || window.event; FV.validate('txt_6898', this.checked, 'txt_6898', true); }); }, validate: function(t, v, n, sl) { switch(t) { case 'txt_6893': var r = new RegExp(".","gi"); break; case 'txt_6897': var r = new RegExp("[a-zA-Z0-9+%-._]+@[a-zA-Z0-9.\\-_]+\\.[a-zA-Z]{2,4}","gi"); break; case 'men_7032': if (this.YD.get(n).options[v].value != '') { if (sl) { this.showStatus(true, n, this.codes.men_7032,'menuinput'); } return true; }else{ this.showStatus(false, n, this.codes.men_7032,'menuinput'); return false; } break; case 'txt_6898': if (this.YD.get(n).checked != false) { this.showStatus(true, n, this.codes.txt_6898,'checkboxField'); return false; }else{ this.showStatus(false, n, this.codes.txt_6898,'checkboxField'); return true; } 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