


/*
###########################################################################
  Fonction Javascript partagée pour tout le site
  Author : Michel Stockman
  Date : 05/2007
###########################################################################

*/


//////////////////////////////////////
// Gestion de cookies
//////////////////////////////////////

	function ecrire_cookie(nom, valeur) 	{
		var argv=ecrire_cookie.arguments;
		var argc=ecrire_cookie.arguments.length;
		var expires=(argc > 2) ? argv[2] : null;
		var path=(argc > 3) ? argv[3] : null;
		var domain=(argc > 4) ? argv[4] : null;
		var secure=(argc > 5) ? argv[5] : false;
		document.cookie=nom+"="+escape(valeur)+
		((expires==null) ? "" : ("; expires="+expires.toGMTString()))+
		((path==null) ? "" : ("; path="+path))+
		((domain==null) ? "" : ("; domain="+domain))+
		((secure==true) ? "; secure" : "");
	}
	
	function getCookieVal(offset) 	{
		var endstr=document.cookie.indexOf (";", offset);
		if (endstr==-1) endstr=document.cookie.length;
		return unescape(document.cookie.substring(offset, endstr)); 
	}
	function lire_cookie(nom) {
		var arg=nom+"=";
		var alen=arg.length;
		var clen=document.cookie.length;
		var i=0;
		while (i<clen) 	{
			var j=i+alen;
			if (document.cookie.substring(i, j)==arg) return getCookieVal(j);
			i=document.cookie.indexOf(" ",i)+1;
			if (i==0) break;
		}
		return null; 
	}



//////////////////////////////////////
// Gestion de POPUP
//////////////////////////////////////


	// Ouvre une fenêtre libre
	function owf(url) { 
	   var pop = window.open(url,'edit_field', 'width=1024, height=600, scrollbars=yes, resizable=yes, status=yes'); 
	}

	// Ouvre une fenêtre fixe
	function ow(url, width, height) { 
	   var pop = window.open(url,'edit_field', 'width='+width+', height='+height+', scrollbars=no, resizable=yes, status=no'); 
	}

	// Ouvre une image dans une fenêtre séparée
	function openimage(chemin) {
		i1 = new Image;
		i1.src = chemin;
		html = '<HTML><HEAD><TITLE>Image</TITLE></HEAD><BODY LEFTMARGIN=30 MARGINWIDTH=30 TOPMARGIN=30 MARGINHEIGHT=30 bgcolor=#ffffff><CENTER><IMG SRC="'+chemin+'" BORDER=0 NAME=imageTest onLoad="window.resizeTo(document.imageTest.width+10+60,document.imageTest.height+29+120)"></CENTER></BODY></HTML>';
	
		popupImage = window.open('','_blank','toolbar=0,location=0,directories=0,menuBar=0,scrollbars=1,resizable=1,width=100,height=100,top=10,left=10');
		popupImage.document.open();
		popupImage.document.write(html);
		popupImage.document.close()
	};

/*
	// Ouvre une image dans une fenêtre séparée ancienne version
	function openimage(chemin) {
		i1 = new Image;
		i1.src = chemin;
	//	html = '<HTML><HEAD><TITLE>Image</TITLE></HEAD><BODY LEFTMARGIN=0 MARGINWIDTH=0 TOPMARGIN=0 MARGINHEIGHT=0><CENTER><IMG SRC="'+chemin+'" BORDER=0 NAME=imageTest onLoad="window.resizeTo(document.imageTest.width+10,document.imageTest.height+29)"></CENTER><script>;setTimeout(\"self.close();\",30000)\<\/script></BODY></HTML>';
		html = '<HTML><HEAD><TITLE>Image</TITLE></HEAD><BODY LEFTMARGIN=30 MARGINWIDTH=30 TOPMARGIN=30 MARGINHEIGHT=30 bgcolor=#ffffff><CENTER><IMG SRC="'+chemin+'" BORDER=0 NAME=imageTest onLoad="window.resizeTo(document.imageTest.width+10+60,document.imageTest.height+29+120)"></CENTER><script>;setTimeout(\"self.close();\",30000)\<\/script></BODY></HTML>';
	
		popupImage = window.open('','_blank','toolbar=0,location=0,directories=0,menuBar=0,scrollbars=0,resizable=1,width=100,height=100,top=10,left=10');
		popupImage.document.open();
		popupImage.document.write(html);
		popupImage.document.close()
	};
	
*/

//////////////////////////////////////
// Gestion des iFrame et Resising
//////////////////////////////////////

	function adjustIFrameSize(iframeWindow) {
		// Cette fonction doit être accessible dans la fenêtre parente
		// Pour l'utiliser ajouter dans la page enfant qui sera incluse dans l'iframe le code suivant
		// <body onload="if (parent.adjustIFrameSize) parent.adjustIFrameSize(window);">

		if (iframeWindow.document.height) {
		   var iframeElement = document.getElementById(iframeWindow.name);
		   iframeElement.style.height = iframeWindow.document.height + 20 + 'px';
		   iframeElement.style.width = iframeWindow.document.width + 'px';
		} else if (document.all) {
		   var iframeElement = document.all[iframeWindow.name];
		   if (iframeWindow.document.compatMode && iframeWindow.document.compatMode != 'BackCompat') {
			 iframeElement.style.height = iframeWindow.document.documentElement.scrollHeight + 20 + 'px';
			 iframeElement.style.width = iframeWindow.document.documentElement.scrollWidth + 5 + 'px';
		   } else {
			 iframeElement.style.height = iframeWindow.document.body.scrollHeight + 20 + 'px';
			 iframeElement.style.width = iframeWindow.document.body.scrollWidth + 5 + 'px';
		   }
		}
	}


	// Resize de l'iframe d'insertion de page
	function resize_iframe_go(iframe_name) {
		// Permet de redimentionner un iframe suivant sont contenu	
		try {	
			var oBody	=	inner.document.body;
			var oFrame	=	document.all(iframe_name);
				
			oFrame.style.height = oBody.scrollHeight + (oBody.offsetHeight - oBody.clientHeight);
			// oFrame.style.width = oBody.scrollWidth + (oBody.offsetWidth - oBody.clientWidth);
		} catch(e){
			//An error is raised if the IFrame domain != its container's domain
			// window.status =	'Error: ' + e.number + '; ' + e.description;
		}
	}
	
	function resize_iframe(iframe_name) {
		// Va lancer le resize de l'iframe après x milisecond
		// pour être sûre que le page est affichée avant le resize
		try {	
			if (iframe_name==null || iframe_name == "") iframe_name="inner";
			a = setTimeout("resize_iframe_go('" + iframe_name + "');", 2000);
		} catch(e){
			//An error is raised if the IFrame domain != its container's domain
			// window.status =	'Error: ' + e.number + '; ' + e.description;
		}
	}
	
	function resize_iframe2(iframe_name) {
		// Valeur par défaut
		if (iframe_name==null || iframe_name == "") iframe_name="inner";
		//find the height of the internal page
		var the_height=document.getElementById(iframe_name).contentWindow.document.body.scrollHeight;
		//change the height of the iframe
		document.getElementById(iframe_name).height=the_height;
	}


//////////////////////////////////////
// Gestion de layer à afficher ou cacher
//////////////////////////////////////

	
	// Permet d'afficher ou de cacher des layer pour le système de [panel]
	function switch_layer(id) {
		// Ouverture ou fermeture d'un layer pour les inscription au event
		var mylayer = document.getElementById(id);
		if (mylayer.style.visibility == 'visible') {
			mylayer.style.visibility = 'hidden';
			mylayer.style.display = 'none';
			mylayer.style.height = '0px';
		} else {
			mylayer.style.visibility = 'visible';
			mylayer.style.display = 'block';
			mylayer.style.height = '100%';
		}
	}

	function tab_switch(id) {
		// Utiliser pour swicher d'un onglet à l'autre en mode menu à onglet
		// Suppression des style pour tous les onglet max 20
		try {	
			for (i=1 ; i<=20 ; i++) {
				document.getElementById("li"+i).className='';
				mylayer = document.getElementById("lil"+i);
				mylayer.style.visibility = 'hidden';
				mylayer.style.display = 'none';
				mylayer.style.height = '0px';
			}
		} catch(e){
			// L'erreur arrive quand on est arrivé en fin et on sort
		}
		// Application du style actif pour l'onglet cliqué
		document.getElementById("li"+id).className='active';
		// Affichage de la zone donnée
		switch_layer("lil"+id);
	}



//////////////////////////////////////
// Gestion des form
//////////////////////////////////////


	// Permet la vérification du code de sécurité code_image ////////////////////////////
	// pour un formulaire standard
	function check_user_form() {
		// Vérification si le code image est correcte sinon erreur
		document.form_formulaire.email_code.style.border='solid #999999 1px';
		document.form_formulaire.email_code.style.background="#ffffff";
		if (  md5(document.form_formulaire.email_code.value) != document.form_formulaire.email_codec.value ) {
//			alert('".caption('Code invalide ou information manquante',"code niet geldig of ontbrekende gegevens","Invalid code or missing information")."'); // constante récupérée 
			document.form_formulaire.email_code.focus();
			document.form_formulaire.email_code.style.background="#ffcccc";
			return;
		}
		// Envoie du post du guestbook
		document.form_formulaire.submit();
	}



//////////////////////////////////////////////////
// Fonction de gestion AJAX HTTP Request
//////////////////////////////////////////////////


	// Fonction de publication d'un article sur le front_end
	function publish_send(id) {
		retour=$.ajax( { url:"./admin/form_ajax_service.php?rand="+Math.random()*99999+"&service=to_production&id="+id, async:false }).responseText; 
		if (retour=='ok') {
			alert('Content Published');
		} else {
			alert('Error : Content not published')
		}
	}
	
	/////////////////////////////////////////////////////////////////////////////////////
	


	var keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";

	// Fonction d'encodage en base 64 pour le passage par XMLHttpRequest
	function encode64(input) {
	   var output = "";
	   var chr1, chr2, chr3;
	   var enc1, enc2, enc3, enc4;
	   var i = 0;
	   do {
		  chr1 = input.charCodeAt(i++);
		  chr2 = input.charCodeAt(i++);
		  chr3 = input.charCodeAt(i++);
		  enc1 = chr1 >> 2;
		  enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
		  enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
		  enc4 = chr3 & 63;
		  if (isNaN(chr2)) {
			 enc3 = enc4 = 64;
		  } else if (isNaN(chr3)) {
			 enc4 = 64;
		  }
		  output = output + keyStr.charAt(enc1) + keyStr.charAt(enc2) + 
			 keyStr.charAt(enc3) + keyStr.charAt(enc4);
	   } while (i < input.length);
	   return output;
	}
	
	
	// Déconvertion d'une chaine en base64 pour restitution HTML Normal
	// Pour convertir le retour de XMLHttpRequest
	function decode64(input) {
	   var output = "";
	   var chr1, chr2, chr3;
	   var enc1, enc2, enc3, enc4;
	   var i = 0;
	   // remove all characters that are not A-Z, a-z, 0-9, +, /, or =
	   input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");
	   do {
		  enc1 = keyStr.indexOf(input.charAt(i++));
		  enc2 = keyStr.indexOf(input.charAt(i++));
		  enc3 = keyStr.indexOf(input.charAt(i++));
		  enc4 = keyStr.indexOf(input.charAt(i++));
		  chr1 = (enc1 << 2) | (enc2 >> 4);
		  chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
		  chr3 = ((enc3 & 3) << 6) | enc4;
		  output = output + String.fromCharCode(chr1);
		  if (enc3 != 64) {
			 output = output + String.fromCharCode(chr2);
		  }
		  if (enc4 != 64) {
			 output = output + String.fromCharCode(chr3);
		  }
	   } while (i < input.length);
	   return output;
	}
	
	//####################################################################################################


	function ajax_form_submit(form_object, url, target) {
		// permet de remplacer l'envoie d'une form normel form.submit()
		// par cette fonction qui envoie la form form_object à la page URL en methode POST
		// et recois le retour dans l'ojet d'ID target.
		// il faut donc placer autour de la form une div pour recevoir le retour
		// ATTENTION la form_object doit être l'object form par un string
		param=form2url(form_object);
		retour=$.ajax( { url: url, cache:false, async:false, data:param }).responseText; 
		$('#'+target).html(retour);
	}
	
	
	function form2url(form) {
		// Création d'un url sur base du contenu d'une form
		// on passe la form en paramètre et elle renvoie un url complet de la form
		// utilisable comme paramètre GET
		// utilisable comme paramètre pour XMLHTTPRequest en mode POST ou GET		
		xparam="";
		for ( i=0; i < form.elements.length; i++) {
			xtype=form.elements[i].type;
			xname=form.elements[i].name;
			// alert(xtype);
			switch (xtype) {
				case "text":
					// idem select - one
				case "hidden":
					// idem select - one
				case "select-one":
					xvalue=form.elements[i].value;
					if (xparam!="") xparam+="&"; 
					xparam+=xname+"="+escape(xvalue);
					break;
				case "radio":
					if (form.elements[i].checked) {
						xvalue=form.elements[i].value;					
						if (xparam!="") xparam+="&"; 
						xparam+=xname+"="+escape(xvalue);
					}
					break;
				case "checkbox":
					if (form.elements[i].checked) {
						xvalue=form.elements[i].value;					
						if (xparam!="") xparam+="&"; 
						xparam+=xname+"="+escape(xvalue);
					}
					break;
				case "textarea":
					xvalue=form.elements[i].innerHTML;
					if (xparam!="") xparam+="&"; 
					xparam+=xname+"="+escape(xvalue);
					break;
			}
		}
		// retour de la valeur
		return xparam;
	}


	//####################################################################################################
	

/*
###########################################################################
  Fonction Video
###########################################################################

*/


/**
 * SWFObject v1.5: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
 *
 * SWFObject is (c) 2007 Geoff Stearns and is released under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 *
 */

if(typeof deconcept=="undefined"){var deconcept=new Object();}if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a){if(!document.getElementById){return;}this.DETECT_KEY=_a?_a:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(_1){this.setAttribute("swf",_1);}if(id){this.setAttribute("id",id);}if(w){this.setAttribute("width",w);}if(h){this.setAttribute("height",h);}if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true;}if(c){this.addParam("bgcolor",c);}var q=_7?_7:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var _c=(_8)?_8:window.location;this.setAttribute("xiRedirectUrl",_c);this.setAttribute("redirectUrl","");if(_9){this.setAttribute("redirectUrl",_9);}};deconcept.SWFObject.prototype={useExpressInstall:function(_d){this.xiSWFPath=!_d?"expressinstall.swf":_d;this.setAttribute("useExpressInstall",true);},setAttribute:function(_e,_f){this.attributes[_e]=_f;},getAttribute:function(_10){return this.attributes[_10];},addParam:function(_11,_12){this.params[_11]=_12;},getParams:function(){return this.params;},addVariable:function(_13,_14){this.variables[_13]=_14;},getVariable:function(_15){return this.variables[_15];},getVariables:function(){return this.variables;},getVariablePairs:function(){var _16=new Array();var key;var _18=this.getVariables();for(key in _18){_16[_16.length]=key+"="+_18[key];}return _16;},getSWFHTML:function(){var _19="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath);}_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\"";_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";var _1a=this.getParams();for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}var _1c=this.getVariablePairs().join("&");if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath);}_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\">";_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";var _1d=this.getParams();for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}var _1f=this.getVariablePairs().join("&");if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}_19+="</object>";}return _19;},write:function(_20){if(this.getAttribute("useExpressInstall")){var _21=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var n=(typeof _20=="string")?document.getElementById(_20):_20;n.innerHTML=this.getSWFHTML();return true;}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}return false;}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var _23=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var axo=1;var _26=3;while(axo){try{_26++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_26);_23=new deconcept.PlayerVersion([_26,0,0]);}catch(e){axo=null;}}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}}return _23;};deconcept.PlayerVersion=function(_29){this.major=_29[0]!=null?parseInt(_29[0]):0;this.minor=_29[1]!=null?parseInt(_29[1]):0;this.rev=_29[2]!=null?parseInt(_29[2]):0;};deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.major<fv.major){return false;}if(this.major>fv.major){return true;}if(this.minor<fv.minor){return false;}if(this.minor>fv.minor){return true;}if(this.rev<fv.rev){return false;}return true;};deconcept.util={getRequestParameter:function(_2b){var q=document.location.search||document.location.hash;if(_2b==null){return q;}if(q){var _2d=q.substring(1).split("&");for(var i=0;i<_2d.length;i++){if(_2d[i].substring(0,_2d[i].indexOf("="))==_2b){return _2d[i].substring((_2d[i].indexOf("=")+1));}}}return "";}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var _2f=document.getElementsByTagName("OBJECT");for(var i=_2f.length-1;i>=0;i--){_2f[i].style.display="none";for(var x in _2f[i]){if(typeof _2f[i][x]=="function"){_2f[i][x]=function(){};}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true;}}if(!document.getElementById&&document.all){document.getElementById=function(id){return document.all[id];};}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;

/*
###########################################################################
  Fonction pour l'HTML Scroll
###########################################################################

*/
	
	
	/***********************************************
	* Pausing up-down scroller- © Dynamic Drive (www.dynamicdrive.com)
	* This notice MUST stay intact for legal use
	* Visit http://www.dynamicdrive.com/ for this script and 100s more.
	***********************************************/
	
	function pausescroller(content, divId, divClass, delay){
		this.content=content //message array content
		this.tickerid=divId //ID of ticker div to display information
		this.delay=delay //Delay between msg change, in miliseconds.
		this.mouseoverBol=0 //Boolean to indicate whether mouse is currently over scroller (and pause it if it is)
		this.hiddendivpointer=1 //index of message array for hidden div
		document.write('<div id="'+divId+'" class="'+divClass+'" style="position: relative; overflow: hidden"><div class="innerDiv" style="position: absolute; width: 100%" id="'+divId+'1">'+content[0]+'</div><div class="innerDiv" style="position: absolute; width: 100%; visibility: hidden" id="'+divId+'2">'+content[1]+'</div></div>')
		var scrollerinstance=this
		if (window.addEventListener) //run onload in DOM2 browsers
		window.addEventListener("load", function(){scrollerinstance.initialize()}, false)
		else if (window.attachEvent) //run onload in IE5.5+
		window.attachEvent("onload", function(){scrollerinstance.initialize()})
		else if (document.getElementById) //if legacy DOM browsers, just start scroller after 0.5 sec
		setTimeout(function(){scrollerinstance.initialize()}, 500)
	}
	
	// -------------------------------------------------------------------
	// initialize()- Initialize scroller method.
	// -Get div objects, set initial positions, start up down animation
	// -------------------------------------------------------------------
	
	pausescroller.prototype.initialize=function(){
		this.tickerdiv=document.getElementById(this.tickerid)
		this.visiblediv=document.getElementById(this.tickerid+"1")
		this.hiddendiv=document.getElementById(this.tickerid+"2")
		this.visibledivtop=parseInt(pausescroller.getCSSpadding(this.tickerdiv))
		//set width of inner DIVs to outer DIV's width minus padding (padding assumed to be top padding x 2)
		this.visiblediv.style.width=this.hiddendiv.style.width=this.tickerdiv.offsetWidth-(this.visibledivtop*2)+"px"
		this.getinline(this.visiblediv, this.hiddendiv)
		this.hiddendiv.style.visibility="visible"
		var scrollerinstance=this
		document.getElementById(this.tickerid).onmouseover=function(){scrollerinstance.mouseoverBol=1}
		document.getElementById(this.tickerid).onmouseout=function(){scrollerinstance.mouseoverBol=0}
		if (window.attachEvent) //Clean up loose references in IE
		window.attachEvent("onunload", function(){scrollerinstance.tickerdiv.onmouseover=scrollerinstance.tickerdiv.onmouseout=null})
		setTimeout(function(){scrollerinstance.animateup()}, this.delay)
	}
	
	
	// -------------------------------------------------------------------
	// animateup()- Move the two inner divs of the scroller up and in sync
	// -------------------------------------------------------------------
	
	pausescroller.prototype.animateup=function(){
		var scrollerinstance=this
		if (parseInt(this.hiddendiv.style.top)>(this.visibledivtop+5)){
			this.visiblediv.style.top=parseInt(this.visiblediv.style.top)-5+"px"
			this.hiddendiv.style.top=parseInt(this.hiddendiv.style.top)-5+"px"
			setTimeout(function(){scrollerinstance.animateup()}, 40)
		} else{
			this.getinline(this.hiddendiv, this.visiblediv)
			this.swapdivs()
			setTimeout(function(){scrollerinstance.setmessage()}, this.delay)
		}
	}
	
	// -------------------------------------------------------------------
	// swapdivs()- Swap between which is the visible and which is the hidden div
	// -------------------------------------------------------------------
	
	pausescroller.prototype.swapdivs=function(){
		var tempcontainer=this.visiblediv
		this.visiblediv=this.hiddendiv
		this.hiddendiv=tempcontainer
	}
	
	pausescroller.prototype.getinline=function(div1, div2){
		div1.style.top=this.visibledivtop+"px"
		div2.style.top=Math.max(div1.parentNode.offsetHeight, div1.offsetHeight)+"px"
	}
	
	// -------------------------------------------------------------------
	// setmessage()- Populate the hidden div with the next message before it's visible
	// -------------------------------------------------------------------
	
	pausescroller.prototype.setmessage=function(){
		var scrollerinstance=this
		if (this.mouseoverBol==1) { //if mouse is currently over scoller, do nothing (pause it)
			setTimeout(function(){scrollerinstance.setmessage()}, 100)
		} else { 
			var i=this.hiddendivpointer
			var ceiling=this.content.length
			this.hiddendivpointer=(i+1>ceiling-1)? 0 : i+1
			this.hiddendiv.innerHTML=this.content[this.hiddendivpointer]
			this.animateup()
		}
	}
	
	pausescroller.getCSSpadding=function(tickerobj){ //get CSS padding value, if any
		if (tickerobj.currentStyle) {
			return tickerobj.currentStyle["paddingTop"]
		} else if (window.getComputedStyle) { //if DOM2
			return window.getComputedStyle(tickerobj, "").getPropertyValue("padding-top")
		} else {
			return 0;
		}
	}
	

//============================================================-->
//======== Gestion des div de survole ===============-->
//============================================================-->


	var cX = 0; var cY = 0; var rX = 0; var rY = 0;
	
	function UpdateCursorPosition(e){ 
		cX = e.pageX; cY = e.pageY;
	}
	
	function UpdateCursorPositionDocAll(e){ 
		cX = event.clientX; cY = event.clientY;
	}
	
	if(document.all) { 
		document.onmousemove = UpdateCursorPositionDocAll; 
	} else { 
		document.onmousemove = UpdateCursorPosition; 
	}

	
	function AssignPosition(d) {
		if(self.pageYOffset) {
			rX = self.pageXOffset;
			rY = self.pageYOffset;
		} else if(document.documentElement && document.documentElement.scrollTop) {
			rX = document.documentElement.scrollLeft;
			rY = document.documentElement.scrollTop;
		} else if(document.body) {
			rX = document.body.scrollLeft;
			rY = document.body.scrollTop;
		}
		if(document.all) {
			cX += rX; 
			cY += rY;
		}
		d.style.left = (cX+10) + "px";
		d.style.top = (cY+10) + "px";
	}
	
	
	function HideContent(d) {
		if(d.length < 1) { 
			return; 
		}
		document.getElementById(d).style.display = "none";
	}
	
	
	function ShowContent(d) {
		if(d.length < 1) { 
			return; 
		}
		var dd = document.getElementById(d);
		AssignPosition(dd);
		dd.style.display = "block";
	}
	
<!--============================================================-->
	
