function hide(id){document.getElementById(id).style.display="none";}function show(id){document.getElementById(id).style.display="block";}function enable(id){document.getElementById(id).removeAttribute("readonly");}function disable(id){document.getElementById(id).setAttribute("readonly",true);}function toggle(id){if(document.getElementById(id).style.display=="none"||(document.getElementById(id).className=="hidden"&&document.getElementById(id).style.display=="")){show(id);}else{hide(id);}}function getvalue(id){return document.getElementById(id).value;}function setvalue(id,val){return document.getElementById(id).value=val;}function hideDiv(div){div.style.display="none";}function showDiv(div){div.style.display="block";}function checkLogin(){hide("invalidemail");hide("invalidpass");if(document.forms.loginform.email.value.length<10){show("invalidemail");document.forms.loginform.email.focus();return false;}if(document.forms.loginform.password.value.length<6){show("invalidpass");document.forms.loginform.password.focus();return false;}return true;}function isset(variable_name){try{if(typeof(eval(variable_name))!="undefined"){if(eval(variable_name)!=null){return true;}}}catch(e){}return false;}function addEvent(elm,evType,fn,useCapture){if(elm.addEventListener){elm.addEventListener(evType,fn,useCapture);return true;}else{if(elm.attachEvent){var r=elm.attachEvent("on"+evType,fn);return r;}else{elm["on"+evType]=fn;}}}function doVotePoll(theform){hide("poll-answers");show("poll-load");var status=AjaxRequest.submit(theform,{timeout:25000,onTimeout:function(req){show("poll-timeout");hide("poll-load");show("poll-answers");},onSuccess:function(req){document.getElementById("poll-results").innerHTML=req.responseText;show("poll-results");hide("poll-load");},onError:function(req){alert("Erreur HTTP: "+req.statusText+".\nEssayez un autre fois plus tard.");show("poll-answers");hide("poll-load");}});return false;}function removeDiv(elm){elm.parentNode.removeChild(elm);}function cloneBefore(original,copycat){var newthing=document.createElement("div");newthing.innerHTML=original.innerHTML;newthing.style.display="block";copycat.parentNode.insertBefore(newthing,copycat);}function transformToAjax(form,result,noreset,hideafter){var waiting=document.createElement("div");waiting.innerHTML='<img src="/images/loading.gif" alt="" /> Chargement en cours...';form.parentNode.insertBefore(waiting,form);hideDiv(form);if(typeof val!="undefined"){tinyMCE.triggerSave();}if(result===false){if(document.getElementById("formresult")){document.getElementById("formresult").parentNode.removeChild(document.getElementById("formresult"));}var resultant=document.createElement("div");resultant.setAttribute("id","formresult");resultant.className="infomsg";form.parentNode.insertBefore(resultant,form);}else{var resultant=document.getElementById(result);}var status=AjaxRequest.submit(form,{timeout:25000,onTimeout:function(req){alert("Your request timed out. Please try again.");showDiv(form);form.parentNode.removeChild(waiting);},onSuccess:function(req){resultant.innerHTML=req.responseText;if(isset(noreset)&&noreset!==true){form.reset();}if(hideafter===false){showDiv(form);}form.parentNode.removeChild(waiting);},onError:function(req){alert("Your request was not completed. Server response: "+req.statusText);showDiv(form);form.parentNode.removeChild(waiting);}});return false;}function transformToAjax2(params){return transformToAjax(params.form,params.result,params.noreset,params.hideafter);}isDef=function(val){return typeof val!="undefined";};function doOrientSearch(){window.location="/recherche/"+(document.getElementById("search").value);return false;}function startNewsAnimation(num,max,started){if(num>max){num=1;}if(num==1){var prev=max;}else{var prev=num-1;}if(started===false){Effect.Appear("latest_scroll_head");}else{if(prev>0){Effect.BlindUp("latest_scroll_"+prev);}}Effect.BlindDown("latest_scroll_"+(num),{scaleFrom:0,scaleTo:100});window.setTimeout(function(){startNewsAnimation((num+1),max,true);},5000);}function refreshNews(){if(!document.getElementById("latestnews")){return false;}var updateNews=AjaxRequest.get({url:"/ajax/latestNews.php",lastRefresh:lastRefresh,timeout:20000,onSuccess:function(req){var today=new Date();lastRefresh=Math.round(today.getTime()/1000);var response=req.responseText.split("<!-- DATA --/>");if(response.length==2){if(response[1]!="no-update"){document.getElementById("latestnews").innerHTML=response[1];}lastRefresh=response[0];}}});window.setTimeout("refreshNews()",60000);}if(document.getElementById("latestnews")){window.setTimeout("refreshNews()",60000);}function OLJMenu(){var o=this;o.active="menu-1";o.activeExtender="menu-1-extender";o.hover="";o.activeHasFlash=false;o.enforceActiveTab=function(obj){index=obj.id;if(this.hover!=index){return;}this.changeExtender(index);$(this.active).removeClassName("tabOn");if(this.activeHasFlash===true){$(this.active).addClassName("tabOffFlash");}else{$(this.active).addClassName("tabOff");}this.active=index;if(obj.hasClassName("tabOffFlash")===true){this.activeHasFlash=true;$(this.active).removeClassName("tabOffFlash");}else{this.activeHasFlash=false;$(this.active).removeClassName("tabOff");}$(this.active).addClassName("tabOn");};o.setActiveTab=function(obj){this.hover=obj.id;o.enforceActiveTab(obj);};o.setActivePage=function(obj){obj.addClassName("active");};o.changeExtender=function(newmenu){if($(newmenu+"-extender")){$(this.activeExtender).removeClassName("tabOn");$(this.activeExtender).addClassName("tabOff");$(newmenu+"-extender").removeClassName("tabOff");$(newmenu+"-extender").addClassName("tabOn");this.activeExtender=newmenu+"-extender";}};o.deactivate=function(obj){if(this.hover==obj.id){this.hover="";}};}var OLJMenu=new OLJMenu();function AjaxRequest(){var req=new Object();req.binary=false;req.timeout=null;req.generateUniqueUrl=true;req.url=window.location.href;req.method="GET";req.async=true;req.username=null;req.password=null;req.parameters=new Object();req.requestIndex=AjaxRequest.numAjaxRequests++;req.responseReceived=false;req.groupName=null;req.queryString="";req.responseText=null;req.responseXML=null;req.status=null;req.statusText=null;req.aborted=false;req.xmlHttpRequest=null;req.onTimeout=null;req.onLoading=null;req.onLoaded=null;req.onInteractive=null;req.onComplete=null;req.onSuccess=null;req.onError=null;req.onGroupBegin=null;req.onGroupEnd=null;req.xmlHttpRequest=AjaxRequest.getXmlHttpRequest();if(req.xmlHttpRequest==null){return null;}req.xmlHttpRequest.onreadystatechange=function(){if(req==null||req.xmlHttpRequest==null){return;}if(req.xmlHttpRequest.readyState==1){req.onLoadingInternal(req);}if(req.xmlHttpRequest.readyState==2){req.onLoadedInternal(req);}if(req.xmlHttpRequest.readyState==3){req.onInteractiveInternal(req);}if(req.xmlHttpRequest.readyState==4){req.onCompleteInternal(req);}};req.onLoadingInternalHandled=false;req.onLoadedInternalHandled=false;req.onInteractiveInternalHandled=false;req.onCompleteInternalHandled=false;req.onLoadingInternal=function(){if(req.onLoadingInternalHandled){return;}AjaxRequest.numActiveAjaxRequests++;if(AjaxRequest.numActiveAjaxRequests==1&&typeof(window.AjaxRequestBegin)=="function"){AjaxRequestBegin();}if(req.groupName!=null){if(typeof(AjaxRequest.numActiveAjaxGroupRequests[req.groupName])=="undefined"){AjaxRequest.numActiveAjaxGroupRequests[req.groupName]=0;}AjaxRequest.numActiveAjaxGroupRequests[req.groupName]++;if(AjaxRequest.numActiveAjaxGroupRequests[req.groupName]==1&&typeof(req.onGroupBegin)=="function"){req.onGroupBegin(req.groupName);}}if(typeof(req.onLoading)=="function"){req.onLoading(req);}req.onLoadingInternalHandled=true;};req.onLoadedInternal=function(){if(req.onLoadedInternalHandled){return;}if(typeof(req.onLoaded)=="function"){req.onLoaded(req);}req.onLoadedInternalHandled=true;};req.onInteractiveInternal=function(){if(req.onInteractiveInternalHandled){return;}if(typeof(req.onInteractive)=="function"){req.onInteractive(req);}req.onInteractiveInternalHandled=true;};req.onCompleteInternal=function(){if(req.onCompleteInternalHandled||req.aborted){return;}req.onCompleteInternalHandled=true;AjaxRequest.numActiveAjaxRequests--;if(AjaxRequest.numActiveAjaxRequests==0&&typeof(window.AjaxRequestEnd)=="function"){AjaxRequestEnd(req.groupName);}if(req.groupName!=null){AjaxRequest.numActiveAjaxGroupRequests[req.groupName]--;if(AjaxRequest.numActiveAjaxGroupRequests[req.groupName]==0&&typeof(req.onGroupEnd)=="function"){req.onGroupEnd(req.groupName);}}req.responseReceived=true;req.status=req.xmlHttpRequest.status;req.statusText=req.xmlHttpRequest.statusText;if(req.binary===false){req.responseText=req.xmlHttpRequest.responseText;}else{req.responseText="binarydata";}if(req.binary===false){req.responseXML=req.xmlHttpRequest.responseXML;}else{req.responseText="binarydata";}if(typeof(req.onComplete)=="function"){req.onComplete(req);}if(req.xmlHttpRequest.status==200&&typeof(req.onSuccess)=="function"){req.onSuccess(req);}else{if(typeof(req.onError)=="function"){req.onError(req);}}delete req.xmlHttpRequest.onreadystatechange;req.xmlHttpRequest=null;};req.onTimeoutInternal=function(){if(req!=null&&req.xmlHttpRequest!=null&&!req.onCompleteInternalHandled){req.aborted=true;req.xmlHttpRequest.abort();AjaxRequest.numActiveAjaxRequests--;if(AjaxRequest.numActiveAjaxRequests==0&&typeof(window.AjaxRequestEnd)=="function"){AjaxRequestEnd(req.groupName);}if(req.groupName!=null){AjaxRequest.numActiveAjaxGroupRequests[req.groupName]--;if(AjaxRequest.numActiveAjaxGroupRequests[req.groupName]==0&&typeof(req.onGroupEnd)=="function"){req.onGroupEnd(req.groupName);}}if(typeof(req.onTimeout)=="function"){req.onTimeout(req);}delete req.xmlHttpRequest.onreadystatechange;req.xmlHttpRequest=null;}};req.process=function(){if(req.xmlHttpRequest!=null){if(req.generateUniqueUrl&&req.method=="GET"){req.parameters.AjaxRequestUniqueId=new Date().getTime()+""+req.requestIndex;}var content=null;for(var i in req.parameters){if(req.queryString.length>0){req.queryString+="&";}req.queryString+=encodeURIComponent(i)+"="+encodeURIComponent(req.parameters[i]);}if(req.method=="GET"){if(req.queryString.length>0){req.url+=((req.url.indexOf("?")>-1)?"&":"?")+req.queryString;}}req.xmlHttpRequest.open(req.method,req.url,req.async,req.username,req.password);if(req.method=="POST"){if(typeof(req.xmlHttpRequest.setRequestHeader)!="undefined"){req.xmlHttpRequest.setRequestHeader("Content-type","application/x-www-form-urlencoded");}content=req.queryString;}if(req.timeout>0){setTimeout(req.onTimeoutInternal,req.timeout);}req.xmlHttpRequest.send(content);}};req.handleArguments=function(args){for(var i in args){if(typeof(req[i])=="undefined"){req.parameters[i]=args[i];}else{req[i]=args[i];}}};req.getAllResponseHeaders=function(){if(req.xmlHttpRequest!=null){if(req.responseReceived){return req.xmlHttpRequest.getAllResponseHeaders();}alert("Cannot getAllResponseHeaders because a response has not yet been received");}};req.getResponseHeader=function(headerName){if(req.xmlHttpRequest!=null){if(req.responseReceived){return req.xmlHttpRequest.getResponseHeader(headerName);}alert("Cannot getResponseHeader because a response has not yet been received");}};return req;}AjaxRequest.getXmlHttpRequest=function(){if(window.XMLHttpRequest){return new XMLHttpRequest();}else{if(window.ActiveXObject){
/*@cc_on @*/
/*@if (@_jscript_version >= 5)
		try {
			return new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
				return new ActiveXObject("Microsoft.XMLHTTP");
			} catch (E) {
				return null;
			}
		}
		@end @*/
}else{return null;}}};AjaxRequest.isActive=function(){return(AjaxRequest.numActiveAjaxRequests>0);};AjaxRequest.get=function(args){AjaxRequest.doRequest("GET",args);};AjaxRequest.post=function(args){AjaxRequest.doRequest("POST",args);};AjaxRequest.doRequest=function(method,args){if(typeof(args)!="undefined"&&args!=null){var myRequest=new AjaxRequest();myRequest.method=method;myRequest.handleArguments(args);myRequest.process();}};AjaxRequest.submit=function(theform,args){var myRequest=new AjaxRequest();if(myRequest==null){return false;}var serializedForm=AjaxRequest.serializeForm(theform);myRequest.method=theform.method.toUpperCase();myRequest.url=theform.action;myRequest.handleArguments(args);myRequest.queryString=serializedForm;myRequest.process();return true;};AjaxRequest.serializeForm=function(theform){var els=theform.elements;var len=els.length;var queryString="";this.addField=function(name,value){if(queryString.length>0){queryString+="&";}queryString+=encodeURIComponent(name)+"="+encodeURIComponent(value);};for(var i=0;i<len;i++){var el=els[i];if(!el.disabled){switch(el.type){case"text":case"password":case"hidden":case"textarea":this.addField(el.name,el.value);break;case"select-one":if(el.selectedIndex>=0){this.addField(el.name,el.options[el.selectedIndex].value);}break;case"select-multiple":for(var j=0;j<el.options.length;j++){if(el.options[j].selected){this.addField(el.name,el.options[j].value);}}break;case"checkbox":case"radio":if(el.checked){this.addField(el.name,el.value);}break;}}}return queryString;};AjaxRequest.numActiveAjaxRequests=0;AjaxRequest.numActiveAjaxGroupRequests=new Object();AjaxRequest.numAjaxRequests=0;
