/* 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_3874: 'Please enter the required details', txt_3875: 'Please enter the required details', txt_3876: 'Please enter the required details'}, init: function() { this.YE.on(this.YD.get('txt_3874'), 'blur', function(event) { var e = event || window.event; if (e.keyCode != 9 && this.value.length > 0) { FV.showStatus(FV.validate('txt_3874', this.value, 'txt_3874'), 'txt_3874', FV.codes.txt_3874,'textinput'); } }); this.YE.on(this.YD.get('txt_3875'), 'blur', function(event) { var e = event || window.event; if (e.keyCode != 9 && this.value.length > 0) { FV.showStatus(FV.validate('txt_3875', this.value, 'txt_3875'), 'txt_3875', FV.codes.txt_3875,'textinput'); } }); this.YE.on(this.YD.get('txt_3876'), 'blur', function(event) { var e = event || window.event; if (e.keyCode != 9 && this.value.length > 0) { FV.showStatus(FV.validate('txt_3876', this.value, 'txt_3876'), 'txt_3876', FV.codes.txt_3876,'textarea_input'); } }); }, validate: function(t, v, n, sl) { switch(t) { case 'txt_3874': var r = new RegExp(".","gi"); break; case 'txt_3875': var r = new RegExp(".","gi"); break; case 'txt_3876': 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