var rnd			= Math.random() + "";
var pageid		= rnd * 10000000000000000;
// Detect if browser = IE6
version			= 0;
if (navigator.appVersion.indexOf("MSIE")!=-1)
	{
	temp	= navigator.appVersion.split("MSIE");
	version	= parseFloat(temp[1]);
	}
var isIE6		= false;
if(version>0 && version<7)
	isIE6 = true;



/*
	----- SlideShow -----
	Paramètres[0] = nom du DIV
	Paramètres[1] = nb de nouvelles total
	Paramètres[2] = largeur d'une nouvelle
	Paramètres[3] = vitesse max
	Paramètres[4] = vitese min
	Paramètres[5] = degré d'élasticité
	Paramètres[5] = distance de déplacement	
*/


// .o0){ JML : Javascript Micro Library | Version : 5.487 | Last modified : 16.02.2007 | Author: HK510.com }(0o.
function UI1B0(o,s)
{
	this.parent = o;
	this.getObj = function(n,d)
	{
		if(typeof(n)=='object') return n;
		if(typeof(n)=='undefined') return null;
		if(typeof(d)=='string' && this.getObj(d)==null) return null;
		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 = this.getObj(n,d.layers[i].document);
		if(!x && d.getElementById) x=d.getElementById(n);
		return x;
	};
	this.createNew = function(n)
	{
		return this[n] = new UI1B0(this,'{Object:'+n+'}');
	};
	this.addClass = function(n,c,s,o)
	{
		this[n] 	= new c(this,s);
		if(typeof(o)!='undefined' && typeof(o.extendClass)!='undefined')
		{
			this[n].extend 	= o.extendClass;
			this[n].extend(this,s);		
		}else{
			this[n].extend 	= UI1B0;
			this[n].extend(this,s);
		}
		this[n].constructor();
	};
	isset = function(g){return typeof(g)!='undefined';};
	this.toString = function(){return s;};
};
function UI9B5(o)
{
	this.constructor = function()
	{
		this.type		= this.getType();
		this.platform		= this.getPlatform();
	};
	this.getType = function()
	{
		var v = 'others';
		if(document.all && document.getElementById) v = 'ie';
		if(document.all && navigator.userAgent.toLowerCase( ).indexOf("opera") != -1) v = 'opera'; 
		if(!document.all && document.addEventListener) v = 'moz';
		if(navigator.userAgent.toLowerCase().indexOf('firefox')!=-1) v = 'ff';
		if(document.layers) v = 'ns4';
		return v;
	};
	this.getPlatform = function()
	{
		var v = 'others';
		if(navigator.appVersion.indexOf('Mac')!=-1) v = 'mac';
		if(navigator.appVersion.indexOf('Win')!=-1) v = 'win';
		return v;
	};
	this.popup = function(p,w,h,n,l,t,f)
	{
		var n1 	= (l!=null)? l : this.getHCenter(w);
		var n2 	= (t!=null)? t : this.getVCenter(h);
		var f 	= (f==null)? 'scrollbars=yes,toolbar=no,location=no,status=no,menubar=no,resizable=no,dependent=no': f;
		var r 	= null;
		r = window.open(p,n,'width='+w+',height='+h+',top='+n2+',left='+n1+','+f);
		if(r!=null && window.focus) r.window.focus();
		return (r!=null)? r : null;
	};
	this.getHCenter = function(w)
	{
		return (this.getScreenWidth()-w)/2;
	};
	this.getVCenter = function(h)
	{
		return (this.getScreenHeight()-h)/2;
	};
	this.getWidth = function()
	{
		return (this.type=='ie')? document.body.clientWidth : (this.type=='ff')? document.documentElement.clientWidth : window.innerWidth;
	};
	this.getHeight = function()
	{
		return (this.type=='ie')? document.body.clientHeight : (this.type=='ff')?document.documentElement.clientHeight : window.innerHeight;
	};
	this.getScreenWidth = function()
	{
		return screen.width;
	};
	this.getScreenHeight = function()
	{
		return screen.height;
	};
	this.writeJs = function(s)
	{
		var e 	= document.createElement('script');
		e.type	='text/javascript';
		e.text 	= s;
		document.body.appendChild(e);			
	};
	this.writeCss = function(s)
	{
		var e 	= document.createElement('style');
		var t 	= root.browser.type;
		e.type	= 'text/css';
		if(t=='ie'){e.styleSheet.cssText=s;
		}else if(t=='moz'){e.appendChild(document.createTextNode(s));
		}else{e.innerHTML = s;}
		document.getElementsByTagName('head')[0].appendChild(e);		
	};
};
function SK1x4()
{
	this.constructor 	= function()
	{
		this.enable = this.isEnable();
	};
	this.load 		= function(o){this.engine(o,null,'GET');};
	this.send 		= function(o,d){this.engine(o,d,'POST');};
	this.cancel		= function(o){if(typeof(o.connector)!='undefined' && typeof(o.connector.abort)!='undefined') o.connector.abort();}
	this.isEnable		= function()
	{
		return typeof(this.getConnector())!='undefined';
	};
	this.getConnector	= function()
	{
		var o;
		if(window.XMLHttpRequest)
		{
			o = new XMLHttpRequest();
		}else if(window.ActiveXObject){
			try{o = new ActiveXObject("Msxml2.XMLHTTP");}
			catch(e)
			{
				try{o = new ActiveXObject("Microsoft.XMLHTTP");}
				catch(e){}
			}
		}
		return o;
	};
	this.connection 	= function()
	{
		var url;
		var type;
		var onLoad;
		var onError;
		var connector;
		var timeout;
		var validate;

		this.execute = function(h)
		{
			var c = this.connector;
			if(c.readyState==4 && c.status==200)
			{
				clearTimeout(this.timeout);
				this.type 		= h.getType(c.getAllResponseHeaders());
				var t = null;
				if(this.type=='text')	t = c.responseText;
				if(this.type=='xml') 	t = (typeof(c.responseXML.xml)!='undefined')? c.responseXML.xml : c.responseXML;
				if(this.type=='js') 	t = c.responseText;
				if(this.type=='css')	t = c.responseText;
				var r 	= (typeof(this.onLoad)=='function')? this.onLoad(t) :  null;
			}		
		};
	};
	this.engine 		= function(o,d,m)
	{
		var h 		= this;
		o.connector 	= this.getConnector();
		if(typeof(o.connector)=='undefined')
		{
			if(typeof(o.onError)=='function') o.onError('Error -> "+this+"\nXMLHttpRequest/ActiveXObject not supported !');
			return;
		}
		if(typeof(o.url)=='undefined' || typeof(o.url)!='string')
		{
			if(typeof(o.onError)=='function') o.onError('Error -> "+this+"\nUrl is undefined !');
			return;
		}
		if(typeof(o.type)=='undefined') o.type='text';
		if(typeof(o.timeout)!='undefined') clearTimeout(o.timeout);
		o.validate 	= function()
		{
			clearTimeout(o.timeout);			
			if(typeof(o.connector.abort)!='undefined') o.connector.abort();
			if(typeof(o.onError)=='function') o.onError('Error -> "+this+"\nTimeout !\nServer is not responding !');
		};
		o.timeout 	= setTimeout(o.validate,20000,this);
		o.connector.onreadystatechange = function()
		{
			try{o.execute(h);}
			catch(e)
			{
				clearTimeout(o.timeout);
				if(typeof(o.onError)=='function') o.onError('Error -> "+this+"\nTimeout !\nNetwork error !');
			}
		}
		var p = (m=='GET')? null : this.encode(d);
		var t = (m=='GET')? 'text/xml' : 'application/x-www-form-urlencoded';
		o.connector.open(m,o.url,true);
		o.connector.setRequestHeader("Content-Type",t);
		o.connector.send(p);
	};
	this.encode 		= function(o)
	{
		var s = '';
		for(var i in o) s+=i+'='+o[i]+'&';
		return s.substring(0,s.length-1);
	};
	this.decode 		= function(s)
	{
		var a = s.split('&');
		if(typeof(a.length)!='number') return;
		var o = new Object();
		for(var i=0;i<=a.length-1;i++)
		{
			var b 	= a[i].split('=');
			o[b[0]] = b[1];
		}
		return o;
	};	
	this.getType 		= function(s)
	{
		var r = null;
		var s = s.split('Content-Type')[1];
		if(s.indexOf('xml')!=-1) 	r = 'xml';
		if(s.indexOf('text')!=-1) 	r = 'text';
		if(s.indexOf('javascript')!=-1) r = 'js';
		if(s.indexOf('css')!=-1) 	r = 'css';
		return r;
	};	
}
function UI6B6(o)
{
	this.constructor = function()
	{
	};
	this.setProperty = function(t,p,v)
	{
		var o = this.getObj(t);
		if(o==null) return;
		if(typeof(v)=='function')
		{
			var s;
			if(p.indexOf('resize')!=-1){s = (o.addEventListener)?'resize':'onresize';}
			if(p.indexOf('load')!=-1){s = (o.addEventListener)?'load':'onload';}
			if(o.addEventListener) return o.addEventListener(s,v,false);
			if(o.attachEvent && root.browser.type!='opera') return o.attachEvent(s,v);
		}
		return (typeof(o.style[p])!='undefined')? o.style[p] = v : (typeof(o[p])!='undefined')? o[p] = v : null;
	};
	this.getProperty = function(t,p)
	{
		var r = null;
		var o = this.getObj(t);
		if(o==null) return;
		if(p == "offsetLeft" || p == "offsetTop")
		{
			r = this.getOffset(o,p);
		}else if(p == "offsetWidth" || p == "offsetHeight"){
			r = o[p];
		}else{
			r = (typeof(o[p])!='undefined')? o[p] : this.getStyle(o,p);
		}
		return r;
	};
	this.trace  	= function(o,b)
	{
		var s='';
		var r = (typeof(b)!='undefined')?(b)?'<br />':'\n':'\n';
		for(var i in o) s+=i+'='+o[i]+', type = '+ typeof(o[i])+r;
		(r=='<br />')? document.write(s) : alert(s);
	};
	this.getStyle = function(o,p)
	{
		return o.style[p].match('[^px]+');		
	};
	this.getOffset = function(o,p)
	{
		var a = o[p];
		o = o.offsetParent;
		while(o!=null){a+=o[p];o=o.offsetParent;}			
		return a;
	};
	
	this.addItem = function(s0,s1,s2,s3,s4,o1)
	{
		var o2 = document.createElement(s0);
		if(!isset(o2) || o2==null) return null;
		if(s1!=null) this.setProperty(o2,'id',s1);
		if(s2!=null) this.setProperty(o2,'className',s2);
		if(s3!=null) this.setProperty(o2,'innerHTML',s3);
		var o3 = this.getObj(s4);
		if(isset(o1) && o1!=null)
		{
			var o4 = this.getObj(o1.sub);
			var b1 = o1.before;
			var o5 = (b1)? o4 : o4.nextSibling;
			o3.insertBefore(o2,o5);
		}else{
			o3.appendChild(o2);
		}
		return o2;
	};
	this.removeItem = function(s)
	{
		var o1 = this.getObj(s);
		var o2 = o1.parentNode;
		if(o1==null || o2==null) return;
		(o2.removeNode)? o1.removeNode(true) : o2.removeChild(o1);
	};
};
function UI9C8(o)
{
	this.constructor = function()
	{
		this.pageId		= this.generatePageId();
		this.version		= this.getVersion();
	};
	this.generatePageId = function()
	{
		return this.generateUniqueId();
	};
	this.generateUniqueId = function(n)
	{
		var e = (typeof(n)!='undefined' && typeof(n)=='number')?n:3001;
		return new Date(e, 00, 01, 00, 00, 00)-new Date();
	};
	this.create = function(o,b)
	{
		var f 	= o.flash;
		var c	= o.custom;
		var u 	= (f.unique)?'?UID='+this.generateUniqueId():'';
		var e 	= '';
		var r 	= '';
		var s	= '<param name=';
		var a  	= (isset(f.transparent) && f.transparent)? true : false;
		for(var i in c) e+= i+'='+c[i]+'&';
		e	+='pageId='+this.pageId;
		r 	= "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000'"+
			"codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version="+f.version+"' "+
			"width='"+f.width+"' height='"+f.height+"' id='"+f.id+"' align='"+f.align+"' >"+
			s+"'allowScriptAccess' value='sameDomain' /> "+
			s+"'movie' value='"+f.src+u+"' /> "+
			s+"'quality' value='"+f.quality+"' /> "+
			s+"'menu' value='false' /> "+
			s+"'bgcolor' value='"+f.color+"' /> "+
			s+"'FlashVars' value='"+e+"'>";
			r+=(a)? s+"'wmode' value='transparent' />" : "";
			r+="<embed src='"+f.src+u+"' quality='"+f.quality+"' "+
			"FlashVars='"+e+"' bgcolor='"+f.color+"' width='"+f.width+"' height='"+f.height+"' name='"+f.id+"' ";
			r+= (a)? "wmode='transparent'" : "";
			r+="align='"+f.align+"' allowScriptAccess='sameDomain' menu='false' type='application/x-shockwave-flash' "+
			"pluginspage='http://www.macromedia.com/go/getflashplayer' /></object> ";
		if(isset(b) && b)
		{
			return r;
		}else{
			root.obj.setProperty(f.container,'innerHTML',r);			
		}
	};
	this.getVersion = function()
	{
		var e,r,q;
		var n = navigator.plugins;
		var p = 'ShockwaveFlash.ShockwaveFlash';
		if(root.browser.type=='ie' && root.browser.platform=='win')
		{
			try{q=new ActiveXObject(p+".7");r=q.GetVariable("$version").match('\\d');}
			catch(e){try{q=new ActiveXObject(p+".6");r=6;}
			catch(e){try{q=new ActiveXObject(p+".3");r=q.GetVariable("$version").match('\\d');}
			catch(e){}}}
		}
		if(n)
		{
			var s1 	= 'Shockwave Flash';
			var s2 	= ' 2.0';
			var b	= n[s1+s2];
			if(b || n[s1]) r = Number(n[s1+((b)? s2 : '')].description.match('\\d'));
		}
		return r;
	};
};
function UI7G4(o)
{
	this.constructor = function()
	{
	};
	this.create = function(o,f)
	{
		var a1 = arguments;
		var a2 = new Array();
		for(var i=2;i<=a1.length-1;i++) a2[i-2] = a1[i];
        	var r = function()
        	{
        	    return (typeof(f)=='function')? f.apply(o,a2) : (o==null || typeof(o)=='undefined')? window[f].apply(null,a2) : o[f].apply(o,a2);
        	}
	        return r;
	};
};
function UI7J0(o)
{
	this.constructor = function()
	{
		this.r1 	= "\\.[\\D]{3,4}$";
		this.count	= 0;
		this.member 	= new Object();
		this.dump	= new Object();
	};
	this.preload = function()
	{
		this.core(arguments,false);
	};
	this.swap = function()
	{
		this.core(arguments,true);
	};
	this.core = function(a,b)
	{
		for(var i = 0;i<=a.length-1;i++)
		{
			var o = null;
			var e = a[i];
			var s = null;
			var u = null;
			if(typeof(e)=='object')
			{
				o = e;
				s = e.src;
				if(!b) this.push(this.set(e.src,'_o'));
			}
			if(typeof(e)=='string')
			{
				var d = this.extension(e);
				if(d!=null && e.indexOf('|')==-1 && !b) this.push(e);					
				if(d==null || e.indexOf('|')!=-1)
				{
					var g = e.split('|');
					var h = this.getObj(g[0]);
					if(g.length==1 && h!=null)
					{
						o = e;
						s = e.src;
						if(!b) this.push(this.set(e.src,'_o'));						
					}
					if(g.length==2 && h!=null)
					{
						o = h;
						s = h.src;
						u = (this.extension(g[1])!=null)? g[1] : this.set(s,g[1])
						if(!b) this.push(u); 
					}
				}
			}
			if(b)
			{
				var c = this.state(s);
				if(c=='over') u = (u!=null)? u : this.set(s,'');
				if(c=='normal') u = (u!=null)? u : this.set(s,'_o');
				if(u!=null && o!=null) o.src=u;
			}
		}
		
	};
	this.push = function(s)
	{
		if(!this.search(s))
		{
			this.dump[this.count] = s;
			this.count++;
		}
	};
	this.execute = function()
	{
		for(var i in this.dump)
		{
			this.member[i] 		= new Image;
			this.member[i].src 	= this.dump[i];
		}
	};
	this.search = function(u)
	{
		var r = false;
		var o = this.member;
		for(var i in o){if(o[i].src==u){r=true;break;}}
		return r;
	};
	this.set = function(u,s)
	{
		var r = null;
		var t = this.extension(u);
		if(s=='normal') s = '';
		if(s=='over') s = '_o';
		if(s=='active') s = '_a';
		if(u.match('_o.')!=null && r==null) r = '_o'+t;
		if(u.match('_a.')!=null && r==null) r = '_a'+t;
		if(r == null) r = t;
		return u.replace(r,s+t);
	};
	this.state = function(s)
	{
		var r = null;
		var a = new Array(['_o','over'],['_a','active'],['','normal']);
		for(var i= 0;i<=a.length-1;i++){if(s.match(a[i][0]+'.')!=null){r = a[i][1];break;}}
		return r;
	};
	this.extension = function(s)
	{
		return s.match(this.r1);
	};
};
if(!Function.prototype.apply)
{
	Function.prototype.apply = function(o,a)
	{
		var r, e;
		if(!o) var o 	= window;
		if(!a) var a 	= new Array();
		var b 		= new Array();
		for(var i=0;i<a.length;i++) b[i] = 'a['+i+']';
		e = 'o.f(' + b.join(',') + ');';
		o.f = this;
		r = eval(e);
		delete o.f;
		return r;
	}
}
if(!Array.prototype.push)
{
	Array.prototype.push = function()
	{
		var a = arguments;
		var n = this.length;
		for(var i=0;i<=a.length-1;i++) this[n+i] = a[i];
		return this.length;
	};
}
//pour affichage partager dans article
	
// * * * * * * * * * * * * * * * * * * * * * * * * *
var root = new UI1B0(null,'root');
root.addClass('browser',UI9B5,'Browser class');
root.addClass('server',SK1x4,'Server class');
root.addClass('obj',UI6B6,'Object class');
root.addClass('delegate',UI7G4,'Delegate class');
root.addClass('images',UI7J0,'Images class');
root.addClass('flash',UI9C8,'Flash class');
root.obj.setProperty(window,'load',root.delegate.create(root.images,'execute'));

// fade.js
var currentNumero		= "1";
var currentArticle		= "article1";
var currentManchette	= "manchette1";
var anim = false;

function initArticle()
	{
	document.getElementById(currentManchette).style.backgroundColor = "#f4f4f4";
	document.getElementById(currentManchette).style.borderLeft = "solid #fff 1px";
	for(i=2;document.getElementById('article'+i);i++) 
		{
		setOpacity(document.getElementById('article'+i), 0, true);
		}
	};

function ChangeDiv(numero)
	{
	var article		= "article"+numero;
	var manchette	= "manchette"+numero;
	//var img			= "imgArticle"+numero;
	var article_str	= article.toString();
	if(anim==false && article_str!=currentArticle)
		{
		anim = true;
		document.getElementById(article).style.display = "block";
		//var imgSrc = document.getElementById(img).src.toString();
		//var lastChar = imgSrc.charAt(imgSrc.length-1);
		// if lastChar == #, on doit loader l'img pour la 1ere fois
		//if(lastChar=="#")
			//{
			//document.getElementById(img).src = imgArticle_array[numero-1];
			//}
		fadeOut(currentArticle, 100, 0, 20);
		document.getElementById(article).style.visibility = "visible";
		fadeIn(article, 0, 100, 20);
		// Cellule over
		document.getElementById(manchette).style.backgroundColor = "#fff";
		//document.getElementById(manchette).style.borderLeft = "solid #fff 1px";
		// Cellule qu'on lache
		document.getElementById(currentManchette).style.backgroundColor = "#f4f4f4";
		//document.getElementById(currentManchette).style.borderLeft = "solid #e2e2e2 1px";
		currentNumero		= numero;
		currentArticle		= article;
		currentManchette	= manchette;
		}
	};

function setOpacity(obj, opacity, notDisplay)
	{
	obj.style.filter = "alpha(opacity:"+opacity+")";
	obj.style.KHTMLOpacity = opacity/100;
	obj.style.MozOpacity = opacity/100;
	obj.style.opacity = opacity/100;
	if(notDisplay)
		obj.style.display = "none";
	};

function fadeIn(objId, opacity, maxOpacity, transitionTime)
	{
	obj = document.getElementById(objId);
	if (opacity <= maxOpacity)
		{
		setOpacity(obj, opacity, false);
		opacity += transitionTime;
		window.setTimeout("fadeIn('"+objId+"',"+opacity+","+maxOpacity+","+transitionTime+")", 50);
		}
	};

// fct fadeOut()
function fadeOut(objId, opacity, minOpacity, transitionTime)
	{
	obj		= document.getElementById(objId);
	if (opacity >= minOpacity)
		{
		setOpacity(obj, opacity, false);
		opacity -= transitionTime;
		window.setTimeout("fadeOut('"+objId+"',"+opacity+","+minOpacity+","+transitionTime+")", 50);
		}
	else
		{
		obj.style.visibility = "hidden";
		obj.style.display = "none";
		anim = false;
		}
	};

