/* 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_10534: 'Please enter the required details', txt_10535: 'Please enter the required details', txt_10536: 'Please enter the required details', txt_10537: 'Please enter the required details', txt_10538: 'Please enter the required details', txt_10539: 'Please enter the required details', txt_10540: 'Please enter the required details', txt_10541: 'Please enter the required details', men_10542: 'Please select your gender', men_10543: 'Please select your age group', men_10544: 'Please enter the required details', men_10549: 'Please enter the required details'}, init: function() { this.YE.on(this.YD.get('txt_10534'), 'blur', function(event) { var e = event || window.event; if (e.keyCode != 9 && this.value.length > 0) { FV.showStatus(FV.validate('txt_10534', this.value, 'txt_10534'), 'txt_10534', FV.codes.txt_10534,'textinput'); } }); this.YE.on(this.YD.get('txt_10535'), 'blur', function(event) { var e = event || window.event; if (e.keyCode != 9 && this.value.length > 0) { FV.showStatus(FV.validate('txt_10535', this.value, 'txt_10535'), 'txt_10535', FV.codes.txt_10535,'textinput'); } }); this.YE.on(this.YD.get('txt_10536'), 'blur', function(event) { var e = event || window.event; if (e.keyCode != 9 && this.value.length > 0) { FV.showStatus(FV.validate('txt_10536', this.value, 'txt_10536'), 'txt_10536', FV.codes.txt_10536,'textinput'); } }); this.YE.on(this.YD.get('txt_10537'), 'blur', function(event) { var e = event || window.event; if (e.keyCode != 9 && this.value.length > 0) { FV.showStatus(FV.validate('txt_10537', this.value, 'txt_10537'), 'txt_10537', FV.codes.txt_10537,'textinput'); } }); this.YE.on(this.YD.get('txt_10538'), 'blur', function(event) { var e = event || window.event; if (e.keyCode != 9 && this.value.length > 0) { FV.showStatus(FV.validate('txt_10538', this.value, 'txt_10538'), 'txt_10538', FV.codes.txt_10538,'textinput'); } }); this.YE.on(this.YD.get('txt_10539'), 'blur', function(event) { var e = event || window.event; if (e.keyCode != 9 && this.value.length > 0) { FV.showStatus(FV.validate('txt_10539', this.value, 'txt_10539'), 'txt_10539', FV.codes.txt_10539,'textinput'); } }); this.YE.on(this.YD.get('txt_10540'), 'blur', function(event) { var e = event || window.event; if (e.keyCode != 9 && this.value.length > 0) { FV.showStatus(FV.validate('txt_10540', this.value, 'txt_10540'), 'txt_10540', FV.codes.txt_10540,'textinput'); } }); this.YE.on(this.YD.get('txt_10541'), 'blur', function(event) { var e = event || window.event; if (e.keyCode != 9 && this.value.length > 0) { FV.showStatus(FV.validate('txt_10541', this.value, 'txt_10541'), 'txt_10541', FV.codes.txt_10541,'textinput'); } }); this.YE.on(this.YD.get('men_10542'), 'change', function() { FV.validate('men_10542', this.options.selectedIndex, 'men_10542', true); }); this.YE.on(this.YD.get('men_10542'), 'blur', function() { FV.validate('men_10542', this.options.selectedIndex, 'men_10542', true); }); this.YE.on(this.YD.get('men_10543'), 'change', function() { FV.validate('men_10543', this.options.selectedIndex, 'men_10543', true); }); this.YE.on(this.YD.get('men_10543'), 'blur', function() { FV.validate('men_10543', this.options.selectedIndex, 'men_10543', true); }); this.YE.on(this.YD.get('men_10544'), 'change', function() { FV.validate('men_10544', this.options.selectedIndex, 'men_10544', true); }); this.YE.on(this.YD.get('men_10544'), 'blur', function() { FV.validate('men_10544', this.options.selectedIndex, 'men_10544', true); }); this.YE.on(this.YD.get('men_10549'), 'change', function() { FV.validate('men_10549', this.options.selectedIndex, 'men_10549', true); }); this.YE.on(this.YD.get('men_10549'), 'blur', function() { FV.validate('men_10549', this.options.selectedIndex, 'men_10549', true); }); }, validate: function(t, v, n, sl) { switch(t) { case 'txt_10534': var r = new RegExp(".","gi"); break; case 'txt_10535': var r = new RegExp(".","gi"); break; case 'txt_10536': var r = new RegExp(".","gi"); break; case 'txt_10537': var r = new RegExp(".","gi"); break; case 'txt_10538': var r = new RegExp(".","gi"); break; case 'txt_10539': var r = new RegExp(".","gi"); break; case 'txt_10540': var r = new RegExp(".","gi"); break; case 'txt_10541': var r = new RegExp(".","gi"); break; case 'men_10542': if (this.YD.get(n).options[v].value != '') { if (sl) { this.showStatus(true, n, this.codes.men_10542,'menuinput'); } return true; }else{ this.showStatus(false, n, this.codes.men_10542,'menuinput'); return false; } break; case 'men_10543': if (this.YD.get(n).options[v].value != '') { if (sl) { this.showStatus(true, n, this.codes.men_10543,'menuinput'); } return true; }else{ this.showStatus(false, n, this.codes.men_10543,'menuinput'); return false; } break; case 'men_10544': if (this.YD.get(n).options[v].value != '') { if (sl) { this.showStatus(true, n, this.codes.men_10544,'menuinput'); } return true; }else{ this.showStatus(false, n, this.codes.men_10544,'menuinput'); return false; } break; case 'men_10549': if (this.YD.get(n).options[v].value != '') { if (sl) { this.showStatus(true, n, this.codes.men_10549,'menuinput'); } return true; }else{ this.showStatus(false, n, this.codes.men_10549,'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