function loginCheck(D,B){if(!D.hasError()){var C=D.getSpecificChildren("user")[0];var H=new HashTable();H.put("username",C.getNickname());var G=D.getSpecificChildren("note")[0].getSpecificChildren("detail")[0];var A=0;var F=0;try{A=parseInt(G.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(G.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)}H.put("nbvisitprofil",G.getValues("user_nbvisualisation"));H.put("nbcommentprofil",G.getValues("user_nbcomment"));H.put("nbvisitmedia",G.getValues("media_nbvisualisation"));H.put("nbcommentmedia",G.getValues("media_nbcomment"));H.put("nbnotemedia",G.getValues("media_nbvote"));H.put("valueNum1",A+F);CW_comwebAjax.loadHtml("html/login/registered.html","registerContainer",H);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(E){if(!E.hasError()){var C=E.getSpecificChildren("session")[0];var H=E.getSpecificChildren("user")[0];var B=H.getUsername();var F=CW_config.serviceId;CW_comwebAjax.loadHtml("html/inscription/inscription2.html","masterPage");CW_util.setSelectDateContent("selectYearInscription2","selectMonthInscription2","selectDayInscription2");CW_util.setCountryListContent("inscription1","user.country");var D=document.forms.inscription1;CW_util.getFormElement(D,"burl").value=CW_config.webappUri;CW_util.getFormElement(D,"subm").value=CW_internationalization.getValue("inscription.mail.subject");CW_util.getFormElement(D,"smail").value=CW_internationalization.getValue("inscription.mail.sender");CW_util.getFormElement(D,"lang.uid").value=CW_internationalization.getUid();CW_util.getFormElement(D,"user.username").value=B;var A=document.getElementById("captchaImage");var G="/comweb/CaptchaService?captcha.width=200&captcha.height=100&captcha.background=FFFFFF&captcha.color=000000&user.login="+B+"&site.uid="+F;A.setAttribute("src",G)}}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"};