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