/* 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: { men_1447: 'Please enter the required details', men_1446: 'Please enter the required details', txt_1445: 'Please enter the required details', txt_1444: 'Please enter the required details'}, init: function() { this.YE.on(this.YD.get('men_1447'), 'change', function() { FV.validate('men_1447', this.options.selectedIndex, 'men_1447', true); }); this.YE.on(this.YD.get('men_1447'), 'blur', function() { FV.validate('men_1447', this.options.selectedIndex, 'men_1447', true); }); this.YE.on(this.YD.get('men_1446'), 'change', function() { FV.validate('men_1446', this.options.selectedIndex, 'men_1446', true); }); this.YE.on(this.YD.get('men_1446'), 'blur', function() { FV.validate('men_1446', this.options.selectedIndex, 'men_1446', true); }); this.YE.on(this.YD.get('txt_1445'), 'blur', function(event) { var e = event || window.event; if (e.keyCode != 9 && this.value.length > 0) { FV.showStatus(FV.validate('txt_1445', this.value, 'txt_1445'), 'txt_1445', FV.codes.txt_1445,'textinput'); } }); this.YE.on(this.YD.get('txt_1444'), 'blur', function(event) { var e = event || window.event; if (e.keyCode != 9 && this.value.length > 0) { FV.showStatus(FV.validate('txt_1444', this.value, 'txt_1444'), 'txt_1444', FV.codes.txt_1444,'textarea_input'); } }); }, validate: function(t, v, n, sl) { switch(t) { case 'men_1447': if (this.YD.get(n).options[v].value != '') { if (sl) { this.showStatus(true, n, this.codes.men_1447,'menuinput'); } return true; }else{ this.showStatus(false, n, this.codes.men_1447,'menuinput'); return false; } break; case 'men_1446': if (this.YD.get(n).options[v].value != '') { if (sl) { this.showStatus(true, n, this.codes.men_1446,'menuinput'); } return true; }else{ this.showStatus(false, n, this.codes.men_1446,'menuinput'); return false; } break; case 'txt_1445': var r = new RegExp(".","gi"); break; case 'txt_1444': 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