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