<!--

/*********************************************/
//  CHANGEMENT TAILLE TYPO
/*********************************************/
/*********************************************/

	// JavaScript Document
	
	function ndeSetTextSize(chgsize,rs) 
	{
		if(!document.getElementById('frame-centre')) return;
				
		var newSize;
		var startSize = parseInt(ndeGetDocTextSize());
		
		if(!startSize) startSize = 9;

		switch(chgsize)
		{
			case 'incr':
			{
				newSize = startSize + 1;
				break;
			}
			
			case 'decr':
			{
				newSize = startSize - 1;
				break;
			}
			
			case 'reset':
			{
				if(rs) newSize = rs;
				else newSize = 9;
				break;
			}
			
			default:
			{
				//newSize = parseInt(ndeReadCookie('nde-textsize',true));
				
				//if(!newSize) newSize = startSize;
				newSize = startSize;
				break;
			}
		}
		
		if(newSize < 8) newSize = 8;
		if(newSize > 13) newSize = 13;
		newSize += 'pt';
		
		//document.documentElement.style.fontSize = newSize;
		//document.body.style.fontSize = newSize;
		
		document.getElementById('frame-centre').style.fontSize=newSize;
		//ndeCreateCookie('nde-textsize',newSize,365,true);
	}
	
	function ndeGetDocTextSize() 
	{
		if(!document.getElementById('frame-centre')) return 0;
		
		var size = 0;
				
		if(document.getElementById('frame-centre').style && document.getElementById('frame-centre').style.fontSize) size = document.getElementById('frame-centre').style.fontSize;
		//else if(typeof(getComputedStyle) != 'undefined') size = getComputedStyle(body,'').getPropertyValue('font-size');
		//else if(body.currentStyle) size = body.currentStyle.fontSize;
		return size;
	}
	
	function ndeCreateCookie(name,value,days,useLang) 
	{
		var langString = (useLang)?ndeGetLang():'';
		
		var cookie = name + langString + '=' + value + ';';
		
		if(days) 
		{
			var date = new Date();
			var ndeMilliSecondsInDay = 86400000; // 24*60*60*1000
			date.setTime(date.getTime() + (days*ndeMilliSecondsInDay));
			cookie += ' expires=' + date.toGMTString() + ';';
		}
		cookie += ' path=/';
		
		document.cookie = cookie;
	}
	
	function ndeReadCookie(name,useLang) 
	{
		var langString = (useLang)?ndeGetLang():'';
		
		var nameEQ = name + langString + '=';
		var ca = document.cookie.split(';');
		
		for(var i=0;i<ca.length;i++) 
		{
			var c = ca[i];
			while(c.charAt(0) == ' ') 
			{
				c = c.substring(1, c.length);
			}
			
			if(c.indexOf(nameEQ) == 0) 
			{
				return c.substring(nameEQ.length,c.length);
			}
		}
		return null;
	}
	
	function ndeSetTheme()
	{
		ndeSetTextSize();
		return true;
	}

	function sp(s,str)
	{
		alert(s)
		p = s.indexOf(str);
		alert(p)
		if(p != -1) return s.substr(0,p);
		return false;
	}
	
	function ndeGetLang()
	{
		var langString = '';
		
		if(document.documentElement)
		{
			langString = document.documentElement.lang;
			if(langString != '')
			{
				langString = '-' + langString;
			}
		}  
		return langString;
	}
	
	 ndeSetTheme();


/*********************************************/
/*********************************************/
/*********************************************/

function ouvrir(ImageFile,width,height)
{ 
var htmlpage= "popup";
var win_opt= "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=no,resizable=0,copyhistory=0,width="+width+",height="+height;
NewWindow= window.open(ImageFile,"theme",win_opt);
NewWindow.focus();
}
function ouvrir2(ImageFile,width,height)
{ 
var htmlpage= "popup";
var win_opt= "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,copyhistory=0,width="+width+",height="+height;
NewWindow= window.open(ImageFile,"theme",win_opt);
NewWindow.focus();
	
}

function ouvrir4(ImageFile,width,height)
{ 
var htmlpage= "popup";
var win_opt= "toolbar=0,location=0,directories=0,status=0,menubar=1,scrollbars=1,resizable=1,copyhistory=0,width="+width+",height="+height;
NewWindow= window.open(ImageFile,"theme",win_opt);
NewWindow.focus();
	
}

function ouvrir3(ImageFile,width,height)
{ 
var htmlpage= "popup";
var win_opt= "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,copyhistory=0,width="+width+",height="+height;
NewWindow= window.open(ImageFile,"theme",win_opt);
NewWindow.focus();
	
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

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];}}
}


function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_findObj(n, d) { //v4.0
  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 && document.getElementById) x=document.getElementById(n); return x;
}

function MM_showHideLayers() { //v3.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; }
}


function count_change(champ,MaxLen)
{
Msg = champ.value;
Msglen= Msg.length;
//maximum length
if (Msglen > MaxLen )
 {
 	champ.value=Msg.substring(0,MaxLen);
	alert("Votre texte ne doit pas dépasser " + MaxLen+" caractères !!")
  } 
//champ.focus(); 
}

function link_popup(lien)
{
	opener.location.href=lien ;
	window.close();
}

function rech_avis()
{
	if (document.formu.sujet.value != "" &&  document.formu.sujet.value != "Rechercher une décision ou un avis" )
	{
		document.formu.action = '/activites/avis/result.php' ;
		document.formu.submit() ;
	}
}

function rech_general()
{
	
	if (document.formu.words.value != "" &&  document.formu.words.value != "Rechercher une information" )
	{
		document.formu.action = '/cgi-bin/htsearch' ;
		document.formu.submit() ;
	}
}

//-->


window.addEvent('domready', function() {

	document.images["myFluxMe"].src='/images2008/teitiere-b1.gif' ;
	
	var counter = 0 ;
	$('fluxme').setOpacity(0);	
	var FluxStart = function() {
		
		counter = counter + 1  ;

		document.images["myFluxMe"].src='/images2008/teitiere-b'+counter+'.gif';	
		$('fluxme').get('tween', {
			property: 'opacity',
			duration:'3000',
			onComplete: function(){
				if (counter == 1 ) FluxOut();
				else FluxOut1();
			}
		}).start(0.8);
	}
	
	
	var FluxStop = function() {
		$('fluxme').get('tween', {
			property: 'opacity',
			duration:'3000',
			onComplete: function(){
				if (counter < 3  )	FluxStart();
			}
		}).start(0);
	}
		
	// duree 10000
	var FluxOut = function() {
		$('fluxme').get('tween', {
			property: 'opacity',
			duration: '5000',
			onComplete: function(){
				$('fluxme').fade(0.7);;
				FluxStop();
			}
		}).start(0.8);
	}

	// duree 4000
	var FluxOut1 = function() {
		$('fluxme').get('tween', {
			property: 'opacity',
			duration: '4000',
			onComplete: function(){
				$('fluxme').fade(0.7);
				FluxStop();
			}
		}).start(0.8);
	}


	FluxStart() ;

	
});