var HAUTEUR_FENETRE=550;var LARGEUR_FENETRE=700;var HAUTEUR_FENETRE_LIEN=400;var LARGEUR_FENETRE_LIEN=700;var HAUTEUR_AIDE=350;var LARGEUR_AIDE=800;var activeRequestCount=0;Ajax.Responders.register({onCreate:function(){if(activeRequestCount==0){Element.show("indicator")}activeRequestCount++},onComplete:function(){if(activeRequestCount>0){Element.show("indicator");activeRequestCount--}if(activeRequestCount==0){Element.hide("indicator")}}});function fermerFenetre(){var A=this;A.top.Windows.closeAll()}function getWindowHeight(){var A=0;if(typeof (window.innerHeight)=="number"){A=window.innerHeight}else{if(document.documentElement&&document.documentElement.clientHeight){A=document.documentElement.clientHeight}else{if(document.body&&document.body.clientHeight){A=document.body.clientHeight}}}return A}function afficheAide(C,B){var A=new Window("winAide",{className:"alphacube",width:LARGEUR_AIDE,height:HAUTEUR_AIDE,zIndex:100,resizable:true,draggable:true,destroyOnClose:true,minimizable:false,onClose:neplusafficher(B)});A.setAjaxContent(C+"/"+B+"/aideGlobale",{parameters:{},method:"get",contentType:"text/html",encoding:"iso-8859-1"},true,true)}function fermerAide(){Windows.close("winAide")}function neplusafficher(A){new Ajax.Request("http://"+document.domain+"/profil/nePlusAfficherAide",{method:"post",asynchronous:"false",parameters:{moduleAide:A},onSuccess:fermerAide()})}function hoverImg(){if(document.all&&(IEver=parseFloat(navigator.appVersion.split("MSIE")[1]))&&(IEver>=5.5)&&(IEver<7)&&document.body.filters){var E=Element.readAttribute(this,"id");var C=Element.readAttribute(this.down("span"),"style");var B=new RegExp(E,"g");var A=C.replace(B,E+"hover");this.down("span").setStyle(A)}else{var E=Element.readAttribute(this,"id");var D;var C;if(this.down("img")!=null){D=this.down("img")}else{D=this.down("input")}C=Element.readAttribute(D,"src");var B=new RegExp(E,"g");var A=C.replace(B,E+"Hover");D.setAttribute("src",A)}}function hoverImgOut(){if(document.all&&(IEver=parseFloat(navigator.appVersion.split("MSIE")[1]))&&(IEver>=5.5)&&(IEver<7)&&document.body.filters){var E=Element.readAttribute(this,"id");var C=Element.readAttribute(this.down("span"),"style");var B=new RegExp(E+"hover","g");var A=C.replace(B,E);this.down("span").setStyle(A)}else{var E=Element.readAttribute(this,"id");var D;var C;if(this.down("img")!=null){D=this.down("img")}else{D=this.down("input")}C=Element.readAttribute(D,"src");var B=new RegExp(E+"Hover","g");var A=C.replace(B,E);D.setAttribute("src",A)}}function setpng(A){if(document.all&&(IEver=parseFloat(navigator.appVersion.split("MSIE")[1]))&&(IEver>=5.5)&&(IEver<7)&&document.body.filters&&A){imgName=A.src.toUpperCase();if(imgName.substring(imgName.length-3,imgName.length)=="PNG"){A.outerHTML="<span "+(A.id?"id='"+A.id+"' ":"")+(A.className?"class='"+A.className+"' ":"")+(A.title?'title="'+A.title+'" ':"")+'style="width:'+A.width+"px;height:"+A.height+"px;"+(A.align=="left"?"float:left;":(A.align=="right"?"float:right;":""))+(A.parentElement.href?"cursor:hand;":"")+"display:inline-block;"+A.style.cssText+";filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+A.src+"',sizingMethod='scale');\"></span>"}}}function afficherProfil(B){var A=new Window({className:"alphacube",width:750,height:500,zIndex:100,resizable:false,title:"Profil",showEffect:Effect.BlindDown,hideEffect:Effect.SwitchOff,draggable:true});A.setAjaxContent("http://"+document.domain+"/profil/showLight",{method:"get",parameters:{user_id:B}},true,true)}function reinviter(B,A){var C=new Window({className:"alphacube",width:800,height:600,zIndex:100,resizable:true,title:"Inviter",showEffect:Effect.BlindDown,hideEffect:Effect.SwitchOff,draggable:true});C.setAjaxContent("http://"+document.domain+"/invitation/inviter",{method:"get",parameters:{user_id:B,id_invitation:A}},true,true)}function inviterAmi(A){if(A!=""||($("nbInvit")!=null&&parseInt($("nbInvit").innerHTML)>0)||($("nbInvit")==null)){var B=new Window({className:"alphacube",width:800,height:600,zIndex:100,resizable:true,title:"Inviter",showEffect:Effect.BlindDown,hideEffect:Effect.SwitchOff,draggable:true});if(A==null){A=""}B.setAjaxContent("http://"+document.domain+"/invitation/inviterAmi",{method:"get",parameters:{id_invitation:A}},true,true)}}function init(){if(!document.getElementsByTagName){return false}if(document.all&&(IEver=parseFloat(navigator.appVersion.split("MSIE")[1]))&&(IEver>=5.5)&&(IEver<7)&&document.body.filters){$$(".png").each(function(A){setpng(A)})}else{if($("inscription")!=null){Event.observe($("inscription"),"mouseover",hoverImg);Event.observe($("inscription"),"mouseout",hoverImgOut)}}}function afficherInvitation(E,D,A,C){var B=new Window("winInvitation",{className:"alphacube",width:LARGEUR_FENETRE_LIEN,height:HAUTEUR_FENETRE_LIEN,zIndex:100,resizable:false,draggable:false,destroyOnClose:true,minimizable:false,onClose:fermerFenetre()});B.setAjaxContent("http://"+document.domain+"/arbre/inviter",{method:"get",parameters:{id_individu:E,prenom:D,nom:A,fromArbre:C},encoding:"iso-8859-1"},true,true)}function finInviter(){var A=this;A.top.Windows.closeAll();new Ajax.Request("http://"+document.domain+"/invitation/inviter",{method:"post",asynchronous:"false",parameters:Form.serialize($("formReinvitation")),onSuccess:afficherMessage.bindAsEventListener(A)})}function finInviterPremier(){var A=this;A.top.Windows.closeAll();new Ajax.Request("http://"+document.domain+"/arbre/inviter",{method:"post",asynchronous:"false",parameters:Form.serialize($("formInvitation")),onSuccess:afficherMessage.bindAsEventListener(A)})}function finInviterAmi(){var A=this;A.top.Windows.closeAll();new Ajax.Request("http://"+document.domain+"/invitation/inviterAmi",{method:"post",asynchronous:"false",parameters:Form.serialize($("formInvitationAmi")),onSuccess:afficherMessage.bindAsEventListener(A)})}function afficherMessage(transport){if(transport.responseText.startsWith("[")){var json=eval("("+transport.responseText+")");if(json!=null){var msg=json[0].msg;if(msg!=""){$("msgAlert").innerHTML=msg;new Effect.Appear("alert")}var nbInvit=json[0].nbInvit;if(nbInvit!=""){$("nbInvit").innerHTML=nbInvit}}}}Event.observe(window,"load",init);
