/*/////////////////////////////////////////////////////////////// // 2008 Menta Solutions/Frédéric VENOT All rights reserved. // // Use without authorization is strictly prohibited // ///////////////////////////////////////////////////////////////*/ requiredFields=new Array(); requiredFields['fname']=0; requiredFields['lname']=0; requiredFields['Email']=0; //requiredFields['job_category']=0; //requiredFields['job_title']=0; requiredFields['Phone']=0; requiredFields['company']=0; //requiredFields['zip']=0; //requiredFields['industry']=0; //requiredFields['state']=0; //requiredFields['country']=0; function DGEBID(pId){ return document.getElementById(pId); } function Login(){ var AJLOG=new AjaxBox('POST','/commun/login/login_act_login.php','test_login_result',form2ValuesString(document.forms['frmlogin']),'TestLogin();'); AJLOG.XHRPOST(); } function TestLogin(){ if(DGEBID('test_login_result').innerHTML=='1'){ var AJLOAD=new AjaxBox('GET','/user_area.php','user_area_span','',''); AJLOAD.XHRGET(); }else{ DGEBID('login_failed').innerHTML="Error : User unknown"; } } function CanEnableSubmit(){ var count=0; var total=0; for(var curfiled in requiredFields){ count=count+requiredFields[curfiled]; total++ } if(count==total){ document.getElementById("sbmbt").style.opacity=1; document.getElementById("sbmbt").style.cursor="pointer"; return true; } document.getElementById("sbmbt").style.opacity=0.5; document.getElementById("sbmbt").style.cursor=""; return false; } function SendForm(pURLRedirect){ URLRedirect="" if(typeof(pURLRedirect)!="undefined")URLRedirect=pURLRedirect; if(CanEnableSubmit()){ var aSendBox=new AjaxBox('POST','/utilisateur_open_download_session.php','emailExistsAlert',form2ValuesString(document.forms['frmAccount']),'TestInsert(\''+URLRedirect+'\')'); aSendBox.XHRPOST(); } } function TestInsert(pURLRedirect){ URLRedirect="" if(typeof(pURLRedirect)!="undefined")URLRedirect=pURLRedirect; if(DGEBID('emailExistsAlert').innerHTML=='0'){ if(URLRedirect!="")document.location.href=URLRedirect; else window.location.reload() }else{ alert(DGEBID('emailExistsAlert').innerHTML) DGEBID('emailExistsAlert').style.visibility='visible'; DGEBID('emailExistsAlert').style.color="#b00"; DGEBID('emailExistsAlert').style.font="normal normal bold 14px Arial" } } function reg_TestCharMin(pThis,pNumCharMin,pArrayFieldStatus){ TestCharMin(pThis,pNumCharMin,pArrayFieldStatus); CanEnableSubmit(); } function reg_TestEmailField(pThis,pNumCharMin,pArrayFieldStatus){ if(TestMailFormat(DGEBID(pThis.id).value)){ DGEBID('emaildoesnotexists').innerHTML='1' FinalTestEmail(pThis.id); //CheckUnique("email",pThis,'emaildoesnotexists','FinalTestEmail(\''+pThis.id+'\')'); }else{ SetFieldKO(pThis,requiredFields); if(typeof(alertEmailWindoz)!="undefined"){ alertEmailWindoz.Hide(); alertEmailWindoz=undefined; } DGEBID("emailExistsAlert").style.visibility="hidden";} } function FinalTestEmail(pThisID){ pThis=DGEBID(pThisID); //alert(DGEBID('emaildoesnotexists').innerHMTML); if(DGEBID('emaildoesnotexists').innerHTML=='1'){ SetFieldOK(pThis,requiredFields); DGEBID("emailExistsAlert").style.visibility="hidden"; if(typeof(alertEmailWindoz)!="undefined"){ alertEmailWindoz.Hide(); alertEmailWindoz=undefined; } }else{ SetFieldKO(pThis,requiredFields); DGEBID("emailExistsAlert").style.visibility="visible"; alertEmailWindoz=new Windoz("/emailexist.php"); } CanEnableSubmit(); } function reg_TestSelectValueChoosen(pThis){ TestSelectValueChoosen(pThis,requiredFields); CanEnableSubmit(); } function ReqEvaltest(pthis){ DGEBID("requestEvalDiv").style.display="none"; if(pthis.checked){ DGEBID("requestEvalDiv").style.display=""; } }//2012© Copyright Menta Solutions. All rights reserved.