this.name='shEAMainWnd'; this.focus(); function initPage() { } //function showPartener() { //$('aPartener').style.display='block'; //} //function hidePartener() { //$('aPartener').style.display='none'; //} //Event.observe(document, 'dom:loaded', exempleClick); function exempleClick(exeId) { var myAjax = new Ajax.Request( '/ajax/astro-exemple.php', { method: 'POST', parameters: { 'exeId': exeId }, onSuccess: function(transport) { var html = transport.responseText; try{ win = new Window( { className: "alphacube", title: "", width:700, height:450, destroyOnClose: true, recenterAuto:false, maximizable: false, minimizable: false, showEffect: Element.show, hideEffect: Element.hide }); win.getContent().update(html); win.showCenter(); }catch (e){ alert(e); } } } ); } function showInfoBox() { $('infoMessageBox').show(); } function hideInfoBox() { $('infoMessageBox').hide(); } function is_valid_email (email){ var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/; if(reg.test(email) == false) { return false; } return true; } function setElementInfo(elemId, val) { if(val){ $(elemId).show(); }else{ $(elemId).hide(); } } function validateForm() { var form = $('i_form'); $('i_error').hide(); var generalErr = 'Completeaza campurile de mai sus, marcate cu rosu.'; var emailErr = 'Introdu o adresa de email corecta.'; $('i_error').update(generalErr); var result = true; var overEighteenChecked = false; $val = $H(form.serialize(true)); $val.each(function(pair){ if (pair.value == 0 || pair.value == -1 || pair.value == '') { $('i_error').show(); if (pair.key != 'tip' && pair.key != 'ora1' && pair.key != 'ora2' && pair.key != 'minut1' && pair.key != 'minut2') { form[pair.key].addClassName('error'); result = false; } if (pair.key == 'ora1' || pair.key == 'ora2' || pair.key == 'minut1' || pair.key == 'minut2') { if (pair.value != -1) { form[pair.key].removeClassName('error'); } else { form[pair.key].addClassName('error'); result = false; } } } else if(pair.key == 'overEighteen') { overEighteenChecked = true; $('spanOverEighteen').removeClassName('error'); } else { if (pair.key != 'forwho[]' && pair.key != 'sex[]'){ if (form[pair.key] && form[pair.key].hasClassName('error')) { form[pair.key].removeClassName('error'); } } } //console.log(pair.key); //console.log(pair.value); }); if(!overEighteenChecked) { $('spanOverEighteen').addClassName('error') result = false; } if (result){ if (!is_valid_email($('i_email1').value)) { $('i_email1').addClassName('error'); $('i_error').update(emailErr); $('i_error').show(); return false; } else { $('i_email1').removeClassName('error'); $('i_error').hide(); } } return result; }