function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
// Browser Detect  v2.1.6
// documentation: http://www.dithered.com/javascript/browser_detect/index.html
// license: http://creativecommons.org/licenses/by/1.0/
// code by Chris Nott (chris[at]dithered[dot]com)


function BrowserDetect() {
   var ua = navigator.userAgent.toLowerCase(); 

   // browser engine name
   this.isGecko       = (ua.indexOf('gecko') != -1 && ua.indexOf('safari') == -1);
   this.isAppleWebKit = (ua.indexOf('applewebkit') != -1);

   // browser name
   this.isKonqueror   = (ua.indexOf('konqueror') != -1); 
   this.isSafari      = (ua.indexOf('safari') != - 1);
   this.isOmniweb     = (ua.indexOf('omniweb') != - 1);
   this.isOpera       = (ua.indexOf('opera') != -1); 
   this.isIcab        = (ua.indexOf('icab') != -1); 
   this.isAol         = (ua.indexOf('aol') != -1); 
   this.isIE          = (ua.indexOf('msie') != -1 && !this.isOpera && (ua.indexOf('webtv') == -1) ); 
   this.isMozilla     = (this.isGecko && ua.indexOf('gecko/') + 14 == ua.length);
   this.isFirebird    = (ua.indexOf('firebird/') != -1);
   this.isNS          = ( (this.isGecko) ? (ua.indexOf('netscape') != -1) : ( (ua.indexOf('mozilla') != -1) && !this.isOpera && !this.isSafari && (ua.indexOf('spoofer') == -1) && (ua.indexOf('compatible') == -1) && (ua.indexOf('webtv') == -1) && (ua.indexOf('hotjava') == -1) ) );
   
   // spoofing and compatible browsers
   this.isIECompatible = ( (ua.indexOf('msie') != -1) && !this.isIE);
   this.isNSCompatible = ( (ua.indexOf('mozilla') != -1) && !this.isNS && !this.isMozilla);
   
   // rendering engine versions
   this.geckoVersion = ( (this.isGecko) ? ua.substring( (ua.lastIndexOf('gecko/') + 6), (ua.lastIndexOf('gecko/') + 14) ) : -1 );
   this.equivalentMozilla = ( (this.isGecko) ? parseFloat( ua.substring( ua.indexOf('rv:') + 3 ) ) : -1 );
   this.appleWebKitVersion = ( (this.isAppleWebKit) ? parseFloat( ua.substring( ua.indexOf('applewebkit/') + 12) ) : -1 );
   
   // browser version
   this.versionMinor = parseFloat(navigator.appVersion); 

   // correct version number
   if (this.isGecko && !this.isMozilla) {
      this.versionMinor = parseFloat( ua.substring( ua.indexOf('/', ua.indexOf('gecko/') + 6) + 1 ) );
   }
   else if (this.isMozilla) {
      this.versionMinor = parseFloat( ua.substring( ua.indexOf('rv:') + 3 ) );
   }
   else if (this.isIE && this.versionMinor >= 4) {
      this.versionMinor = parseFloat( ua.substring( ua.indexOf('msie ') + 5 ) );
   }
   else if (this.isKonqueror) {
      this.versionMinor = parseFloat( ua.substring( ua.indexOf('konqueror/') + 10 ) );
   }
   else if (this.isSafari) {
      this.versionMinor = parseFloat( ua.substring( ua.lastIndexOf('safari/') + 7 ) );
   }
   else if (this.isOmniweb) {
      this.versionMinor = parseFloat( ua.substring( ua.lastIndexOf('omniweb/') + 8 ) );
   }
   else if (this.isOpera) {
      this.versionMinor = parseFloat( ua.substring( ua.indexOf('opera') + 6 ) );
   }
   else if (this.isIcab) {
      this.versionMinor = parseFloat( ua.substring( ua.indexOf('icab') + 5 ) );
   }
   
   this.versionMajor = parseInt(this.versionMinor); 
   
   // dom support
   this.isDOM1 = (document.getElementById);
   this.isDOM2Event = (document.addEventListener && document.removeEventListener);
   
   // css compatibility mode
   this.mode = document.compatMode ? document.compatMode : 'BackCompat';

   // platform
   this.isWin    = (ua.indexOf('win') != -1);
   this.isWin32  = (this.isWin && ( ua.indexOf('95') != -1 || ua.indexOf('98') != -1 || ua.indexOf('nt') != -1 || ua.indexOf('win32') != -1 || ua.indexOf('32bit') != -1 || ua.indexOf('xp') != -1) );
   this.isMac    = (ua.indexOf('mac') != -1);
   this.isUnix   = (ua.indexOf('unix') != -1 || ua.indexOf('sunos') != -1 || ua.indexOf('bsd') != -1 || ua.indexOf('x11') != -1)
   this.isLinux  = (ua.indexOf('linux') != -1);
   
   // specific browser shortcuts
   this.isNS4x = (this.isNS && this.versionMajor == 4);
   this.isNS40x = (this.isNS4x && this.versionMinor < 4.5);
   this.isNS47x = (this.isNS4x && this.versionMinor >= 4.7);
   this.isNS4up = (this.isNS && this.versionMinor >= 4);
   this.isNS6x = (this.isNS && this.versionMajor == 6);
   this.isNS6up = (this.isNS && this.versionMajor >= 6);
   this.isNS7x = (this.isNS && this.versionMajor == 7);
   this.isNS7up = (this.isNS && this.versionMajor >= 7);
   
   this.isIE4x = (this.isIE && this.versionMajor == 4);
   this.isIE4up = (this.isIE && this.versionMajor >= 4);
   this.isIE5x = (this.isIE && this.versionMajor == 5);
   this.isIE55 = (this.isIE && this.versionMinor == 5.5);
   this.isIE5up = (this.isIE && this.versionMajor >= 5);
   this.isIE6x = (this.isIE && this.versionMajor == 6);
   this.isIE6up = (this.isIE && this.versionMajor >= 6);
   
   this.isIE4xMac = (this.isIE4x && this.isMac);
}
var browser = new BrowserDetect();


function showAnswerHideOthers(div_to_show,class_to_hide,container){
	
	var divs = document.getElementById(container).getElementsByTagName('div');
	
	for (var i=0 ; i<divs.length ; i++){
		if (divs[i].className == class_to_hide)divs[i].style.display = 'none';
	}

	if (div_to_show.style.display == 'block'){
		div_to_show.style.display = 'none';
	}else{
		div_to_show.style.display = 'block';
	}

}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

<!--//--><![CDATA[//><!--
	function get_elt(id) {
		  var itm = null;
		  if (document.getElementById) {
			itm = document.getElementById(id);
		  } else if (document.all){
			itm = document.all[id];
		  } else if (document.layers){
			itm = document.layers[id];
		  }
		return itm
	}
//--><!]]>

function showDivHideOthers(id){
		
	var divs = document.getElementById('content_type_paragraphe_titre').getElementsByTagName('div');
	
	for (var i=0 ; i<divs.length ; i++){
		//if (divs[i].class == 'contenu')divs[i].style.display='none';
		if (divs[i].className == 'contenu')divs[i].style.display='none';
	}
	
	document.getElementById('contenu'+id).style.display='block';
	
}


function showDivHideOthers2(id){
	
	var currentId = "";
	if ( document.getElementById("currentId") != undefined) {
		currentId = document.getElementById("currentId").value;
	}
	
	if ( currentId != "" && document.getElementById('contenu'+currentId) != undefined ) {
		document.getElementById('contenu'+currentId).style.display='none';
	}
	
	document.getElementById("currentId").value = id;
	document.getElementById('contenu'+id).style.display='block';

}


//V1-2-20120123
var CYKIA_slideshow = function(element, params) {
	YUI().use("node","event","event-base","anim","datatype",function(Y) {

		var lock = false;
		var elts;
		var ready = false;
		var selectedIndex = 0;
		var x = Y.one('#'+element).getXY(element)[0];
		var y = Y.one('#'+element).getXY(element)[1];			
		var autoPlay = true;
		var w = params.width;//Element width
		var h = params.height;//Element height
		var a = 'alpha';//Transition effect
		var d = 1;
		var e = 'easeOut';
		var t = 5;//Time sleeping
		var c = '+1';//Action
		var z = 1000;
		var p = '';//Index of element to display

		//Parameters
		if (params.autoplay)
			autoplay = params.autoplay;
		if (params.duration)
			d = params.duration;
		if (params.easing)
			e = params.easing;			
		if (params.effect)
			a = params.effect;		
		if (params.sleep)
			t = params.sleep;			
		if (params.action)
			c = params.action;

		var setEffect = function(effect) {
			a = effect;
		} 

		var goBack = function() {
			c = '-1';
		}

		var goNext = function() {
			c = '+1';
		}

		var goTo = function(index) {
			p = index;
		}

		var play = function() {
			autoPlay = true;
		}

		var pause = function() {
			autoPlay = false;
		}

		var unlock = function() {
			setTimeout(function() {lock=false;go()},1000*t);
		} 
		var init = Y.on('domready', 
			function() {	   					
				//Container		
				Y.one('#'+element+' div.slideshow_elts').setStyle('width', w+'px');
				Y.one('#'+element+' div.slideshow_elts').setStyle('height', h+'px');
			
				//Elements
				elts = Y.all('#'+element+' div.slideshow_elt').getDOMNodes();

				Y.all('#'+element+' div.slideshow_elt').each(function(node) {
					node.setStyle('width', w+'px')
					node.setStyle('height', h+'px')
					node.setAttribute('id', element+'_elt_'+Y.all('#'+element+' div.slideshow_elt').indexOf(node));
				});
				Y.one('#'+element+' div.slideshow_elt').setStyle('display', 'block');
			
				//Masks
				Y.all('#'+element+' div.slideshow_mask').each(function(node){node.setStyle('width', w+'px')});
				Y.all('#'+element+' div.slideshow_mask').each(function(node){node.setStyle('height', h+'px')});

				
				//Buttons			
				Y.all('#'+element+' .slideshow_button').each(function(button) {
					if (button.hasClass('slideshow_button_move2top')) {
						button.on('click', function() { 
				    			setEffect('move2top');
						});
					} else if (button.hasClass('slideshow_button_move2bottom')) {
						button.on('click', function() { 
				    			setEffect('move2bottom');
						});
					} else if (button.hasClass('slideshow_button_move2left')) {
						button.on('click', function() { 
				    			setEffect('move2left');
						});
					} else if (button.hasClass('slideshow_button_move2right')) {
						button.on('click', function() { 
				    			setEffect('move2right');
						});
					} else if (button.hasClass('slideshow_button_alpha')) {
						button.on('click', function() { 
				    			setEffect('alpha');
						});
					} else if (button.hasClass('slideshow_button_back')) {
						button.on('click', function() { 
				    			goBack();
						});
					} else if (button.hasClass('slideshow_button_next')) {
						button.on('click', function() { 
				    			goNext();
						});
					} else if (button.hasClass('slideshow_button_play')) {
						button.on('click', function() { 
				    			play();
						});
					} else if (button.hasClass('slideshow_button_pause')) {
						button.on('click', function() { 
				    			pause();
						});
					}
				});

				//Index buttons
				Y.all('#'+element+' .slideshow_index').each(function(button) {
					button.setAttribute('id', element+'_index_'+Y.all('#'+element+' .slideshow_index').indexOf(button));
					if (Y.all('#'+element+' .slideshow_index').indexOf(button)==0)
						button.addClass('slideshow_index_on');
					else
						button.addClass('slideshow_index_off');
					button.on('click', function() { 
				    			goTo(this.getAttribute('id').replace(element+'_index_',''));
					});
				});
				ready = true;

				if (autoPlay)
					setTimeout(function() {go();},1000*t);
	 		}
	 	);

		var go = function() {
			if (ready && elts.length>1 && c!='') {	
				if (!lock) {	
						lock=true;	
						var from = Y.one('#'+element+'_elt_'+selectedIndex);
						var to;
						if (p!='') {
							to = Y.one('#'+element+'_elt_'+p);
							selectedIndex=Y.DataType.Number.parse(p);	
							p='';
						} else if (c=='+1') {
							if (selectedIndex+1==elts.length) {//Last element
								to = Y.one('#'+element+'_elt_0');
								selectedIndex=0;
							} else {
								to = Y.one('#'+element+'_elt_'+(selectedIndex+1));
								selectedIndex++;
							}
						} else if (c=='-1') {
							if (selectedIndex+1==1) {//First element
								to = Y.one('#'+element+'_elt_'+(elts.length-1));
								selectedIndex=elts.length-1;
							} else {
								to = Y.one('#'+element+'_elt_'+(selectedIndex-1));
								selectedIndex--;
							}	
						}		

						Y.all('#'+element+' .slideshow_index').each(function(button) {
							button.removeClass('slideshow_index_on');
							button.addClass('slideshow_index_off');
							if (button.getAttribute('id').replace(element+'_index_','')==selectedIndex) {
								button.removeClass('slideshow_index_off');
								button.addClass('slideshow_index_on');
							}
						});
						transition(from, to);
				} else if (autoPlay) {
					setTimeout(function() {go();},500*t);
				}

			}		
		};

		var transition = function(from, to) {
			if (a=='movedown') {
				to.setStyle('left', '0');
				to.setStyle('top', -h);
				to.setStyle('opacity', '1');
				to.setStyle('display', 'block');
				var anim1 = new Y.Anim({node: from, from: {top: 0}, to: {top: h}, duration: d,  easing: e});
				var anim2 = new Y.Anim({node: to, from: {top: -h}, to: {top: 0} , duration: d,  easing: e});
				anim2.on('end', function() {unlock();});
				anim1.run();
				anim2.run();
			} else if (a=='moveup') {
				to.setStyle('left', '0');
				to.setStyle('top', h);
				to.setStyle('opacity', '1');
				to.setStyle('display', 'block');
				var anim1 = new Y.Anim({node: from, from: {top: 0}, to: {top: -h}, duration: d,  easing: e});
				var anim2 = new Y.Anim({node: to, from: {top: h}, to: {top: 0} , duration: d,  easing: e});
				anim2.on('end', function() {unlock();});
				anim1.run();
				anim2.run();
			} else if (a=='moveleft') {
				to.setStyle('left', w);
				to.setStyle('top', '0');
				to.setStyle('opacity', '1');
				to.setStyle('display', 'block');
				var anim1 = new Y.Anim({node: from, from: {left: 0}, to: {left: w}, duration: d,  easing: e});
				var anim2 = new Y.Anim({node: to, from: {left: -w}, to: {left: 0} , duration: d,  easing: e});
				anim2.on('end', function() {unlock();});
				anim1.run();
				anim2.run();
			} else if (a=='moveright') {
				to.setStyle('left', -w);
				to.setStyle('top', '0');
				to.setStyle('opacity', '1');
				to.setStyle('display', 'block');
				var anim1 = new Y.Anim({node: from, from: {left: 0}, to: {left: -w}, duration: d,  easing: e});
				var anim2 = new Y.Anim({node: to, from: {left: w}, to: {left: 0} , duration: d,  easing: e});
				anim2.on('end', function() {unlock();});
				anim1.run();
				anim2.run();
			} else if (a=='alpha') {
				to.setStyle('left', '0');
				to.setStyle('top', '0');
				to.setStyle('opacity', '0');
				to.setStyle('display', 'block');
				var anim1 = new Y.Anim({node: from, from: {opacity: 1}, to: {opacity: 0}, duration: d,  easing: e});
				var anim2 = new Y.Anim({node: to, from: {opacity: 0}, to: {opacity: 1} , duration: d,  easing: e});
				anim2.on('end', function() {unlock();});
				anim1.run();
				anim2.run();
			} else if (a=='accordeonright') {
				to.setStyle('left', -w);
				to.setStyle('top', '0');
				to.setStyle('opacity', '1');
				to.setStyle('display', 'block');
				var anim1 = new Y.Anim({node: from, from: {left: 0}, to: {left: -w}, duration: d/2,  easing: e});
				var anim2 = new Y.Anim({node: to, from: {left: -w}, to: {left: 0} , duration: d/2,  easing: e});
				anim1.on('end', function() {anim2.run();});
				anim2.on('end', function() {unlock();});
				anim1.run();
			} else if (a=='accordeonleft') {
				to.setStyle('left', -w);
				to.setStyle('top', '0');
				to.setStyle('opacity', '1');
				to.setStyle('display', 'block');
				var anim1 = new Y.Anim({node: from, from: {left: 0}, to: {left: w}, duration: d/2,  easing: e});
				var anim2 = new Y.Anim({node: to, from: {left: w}, to: {left: 0} , duration: d/2,  easing: e});
				anim1.on('end', function() {anim2.run();});
				anim2.on('end', function() {unlock();});
				anim1.run();
			} else if (a=='accordeontop') {
				to.setStyle('left', '0');
				to.setStyle('top', h);
				to.setStyle('opacity', '1');
				to.setStyle('display', 'block');
				var anim1 = new Y.Anim({node: from, from: {top: 0}, to: {top: h}, duration: d/2,  easing: e});
				var anim2 = new Y.Anim({node: to, from: {top: h}, to: {top: 0} , duration: d/2,  easing: e});
				anim1.on('end', function() {anim2.run();});
				anim2.on('end', function() {unlock();});
				anim1.run();
			} else if (a=='accordeonbottom') {
				to.setStyle('left', '0');
				to.setStyle('top', -h);
				to.setStyle('opacity', '1');
				to.setStyle('display', 'block');
				var anim1 = new Y.Anim({node: from, from: {top: 0}, to: {top: -h}, duration: d/2,  easing: e});
				var anim2 = new Y.Anim({node: to, from: {top: -h}, to: {top: 0} , duration: d/2,  easing: e});
				anim1.on('end', function() {anim2.run();});
				anim2.on('end', function() {unlock();});
				anim1.run();
			} else if (a=='unrollright') {
				to.setStyle('width', w);
				to.setStyle('left', -w);
				to.setStyle('top', '0');
				to.setStyle('opacity', '1');
				to.setStyle('display', 'block');			
				to.setStyle('height', h);
				to.setStyle('z-index', z+2);
				from.setStyle('z-index', z+1);
				var anim1 = new Y.Anim({node: to, from: {left: -w}, to: {left: 0}, duration: d/2,  easing: e});
				anim1.on('end', function() {
					from.setStyle('z-index', z);
					from.setStyle('left', -w);
					from.setStyle('top', '0');
					from.setStyle('display', 'none');
					to.setStyle('z-index', z+1);
					unlock();
				});
				anim1.run();
			}
		}
	});
}

