function loginCheck(D,B){if(!D.hasError()){var C=D.getSpecificChildren("user")[0];if((new String(B.queryString)).indexOf("action=req.val.ugc")<0&&(new String(B.queryString)).indexOf("action=user.stats")<0){if((parseInt(C.getValues("user.ugc.vald.sts"))!=1)&&(parseInt(C.getValues("user.ugc"))!=1)){showDialog_confirmationCGU(C);return }}var G=new HashTable();G.put("username",C.getNickname());var A=0;var F=0;try{A=parseInt(D.getSpecificChildren("note")[0].getSpecificChildren("detail")[0].getValues("nbmsgs"));if(A=="null"||A==null||A==""){A=0}}catch(E){CW_logger.log(CW_logger.LEVEL_ERROR,"loginCheck can't retrieve the medianbcomment value, error:"+E)}try{F=parseInt(D.getSpecificChildren("note")[0].getSpecificChildren("detail")[0].getValues("nbalerts"));if(F=="null"||F==null||F==""){F=0}}catch(E){CW_logger.log(CW_logger.LEVEL_ERROR,"loginCheck can't retrieve the medianbvote value, error:"+E)}G.put("valueNum1",A+F);CW_comwebAjax.loadHtml("html/login/registered.html","registerContainer",G);refreshUserStat()}}var timmerRefreshUserStat=null;function refreshUserStat(){try{window.clearTimeout(timmerRefreshUserStat)}catch(A){}if(CW_config.hasConnectedUser){timmerRefreshUserStat=window.setTimeout('CW_Action_User.displayUserStat("displayUserStatCallBack")',1000*60*5)}}function displayUserStatCallBack(B,A){loginCheck(B,A);refreshUserStat()}function logout(){var A=new Array();A.push("action=user.logout");CW_comwebAjax.sendRequest("/comweb/user","logoutCallback",null,"login",A)}function registerLoad(){CW_comwebAjax.loadHtml("html/login/register.html","registerContainer")}function inscription1Load(){CW_AjaxPage_Manager.displayPage("inscription")}function inscription1Check(C){if(!C.hasError()){var A=C.getSpecificChildren("session")[0];CW_comwebAjax.loadHtml("html/inscription/inscription2.html","masterPage");CW_util.setSelectDateContent("selectYearInscription2","selectMonthInscription2","selectDayInscription2");CW_util.setCountryListContent("inscription1","user.country");var B=document.forms.inscription1;CW_util.getFormElement(B,"burl").value=CW_config.webappUri;CW_util.getFormElement(B,"subm").value=CW_internationalization.getValue("inscription.mail.subject");CW_util.getFormElement(B,"smail").value=CW_internationalization.getValue("inscription.mail.sender");CW_util.getFormElement(B,"lang.uid").value=CW_internationalization.getUid()}}function inscription2Check(A){if(!A.hasError()){var B=new HashTable();B.put("valueText1",CW_Action_User.inscription1_mail);CW_comwebAjax.loadHtml("html/inscription/inscription3.html","masterPage",B)}}function inscription4Load(){CW_comwebAjax.loadHtml("html/inscription/inscription4.html","masterPage");addHistoryFunction("inscription4Load","Inscription4")}function validFormInscriptionState3(){inscription4Load()}function showProfilDetail(){CW_comwebAjax.loadHtml("html/inscription/inscriptionProfilDetail.html","profilDetailContainer");document.getElementById("profilDetailContainer").style.display="block"};