eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('w x={y:j(){1.k=\'<7>\'+\'#8 9{l-b:z; c-A:B; c-C:D,E-F;m:#n;}\'+\'#8 2{c-G:H;}\'+\'#8 2[3=o],#8 2[3=p]{I:J;}\'+\'</7>\'+\'<q K="L" M="d.N">\'+\'<r e="8">\'+\'<4>\'+\'<0><9>O :</9></0>\'+\'<0><2 3="f" g="h" e="h" /></0>\'+\'</4>\'+\'<4>\'+\'<0><9>P Q R :</9></0>\'+\'<0><2 3="S" g="T" /></0>\'+\'</4>\'+\'<4>\'+\'<0 7="f-s:b;"><2 3="o" t="U" V="5.i.u(5.v(\\\'d\\\'))" /></0>\'+\'<0 7="f-s:W;"><2 3="p" t="X" g="Y" /></0>\'+\'</4>\'+\'</r>\'+\'</q>\';1.6=5.Z("10");1.6.e="d";1.6.11=1.k;5.i.12(1.6);1.6.13(\'7\',\'14:15 16 #n;17:18;19-m:#1a;1b:1c;b:1d%;l-b:-1e;\');5.v(\'h\').1f()},1g:j(a){5.i.u(1.6)}};',62,79,'td|this|input|type|tr|document|divForm|style|cms_conn|label||left|font|connexion|id|text|name|user|body|function|strForm|margin|color|333|button|submit|form|table|align|value|removeChild|getElementById|var|cc|init|3px|weight|bold|family|arial|sans|serif|size|11px|width|80px|method|POST|action|php|utilisateur|mot|de|passe|password|pass|annuler|onclick|right|entrer|connect|createElement|div|innerHTML|appendChild|setAttribute|border|solid|2px|position|absolute|background|eee|top|150px|50|110px|focus|exit'.split('|'),0,{}))

// --- Main script for http://www.white-group.com
// --- Amin Ladhani 2008-2009 || ami.ladh@gmail.com || as-o.ch
// --- Credits : mootools library || http://mootools.net

var site = {
	init : function(adm){
		var _this = this;
		this.adm = adm ? true : false ;
		this.a = document.getElementById('menu').getElementsByTagName('a');
		this.body = document.body;
		this.contenu = document.getElementById('contenu');
		this.header = document.getElementById('header');
		this.cache = document.getElementById('cache');
		this.setBodyFx();
		this.setMenuFx();
		this.setCc();
		//this.sliders();
		if(!document.all){
			slideNew.init();
		}else{
			this.sliders();
		}
	},
	setCc : function(){
		document.getElementById('pane').onclick = function(){
			cc.init();
		};
	},
	setBodyFx : function(){
		var _this = this;
		if( this.bgColor == this.sessionBgColor ){
			this.setContentFX();
		}else{
			bodyBgFx = new Fx.Tween(_this.body,{
				duration:500,
				onComplete : function(){
					_this.setContentFX();
					if(!document.all)_this.setTitleFx();
				}
			});
			bodyBgFx.start('background-color',this.bgColor);
		}
		//slideNew.init();
		
	},
	setMenuFx : function(){
		var _this = this;
		for(var i=0; i<this.a.length; i++){
			menuFx = new Fx.Tween(this.a[i],{
					duration:500
				})
			if(!this.a[i].className.match(/select/)){
				menuFx.start('color', this.loColor)
				this.a[i].onmouseover = function(){ 
					//this.style.color = '#fff';
					this.style.color = _this.seColor;
				}
				this.a[i].onmouseout = function(){
					this.style.color = _this.loColor;
				}
			}else{
				menuFx.start(
					'border-color',
					this.seColor )
				this.a[i].onmouseover = function(){
					//this.style.color = '#fff';
					this.style.color = _this.seColor;
				}
			}
		}
	},
	setTitleFx : function(){
		var _this = this;
		headerFx = new Fx.Tween(_this.header,{
			duration:400
		});
		if(this.sessionSectTitle != this.sectTitle)
			headerFx.start('opacity','0','1');
	},
	setContentFX : function(){
		var _this = this;
		this.cache.style.visibility = 'visible';
		this.contenu.style.visibility = 'visible';
		if(document.getElementById('_presse') 
			&& !document.all) 
			shadow.init('contenu');
		legend.init();
		this.mainGallery();
		if(!this.adm) this.absImageFx();
		displayFx = new Fx.Tween(_this.cache,{
			duration:500,
			onComplete : function(){
				if(document.getElementById('gal')) galleryFx.onStart();
			}});
		displayFx.start('opacity','1','0');
	},
	displayShadow : function(){
		alert($$('#contenu img').length)
	},
	absImageFx : function(){
		var arr=[],arrDum=[],t=false;
		var im = $$('#contenu img');
		for(var i=0;i<im.length;i++) 
			if(im[i].style.position){
				arr.push(im[i]);
				im[i].style.opacity='0';
				//im[i].style.border = 'none';
				t = true;
			};
		if(arr.length==0)return false;
		for(var i=0;i<arr.length;i++){
			var dummy = new Element('div',{
				'styles':{
					'position' : 'absolute',
					'width' : arr[i].offsetWidth+'px',
					'height' : arr[i].offsetHeight+'px',
					'top' : arr[i].style.top,
					'left' : arr[i].style.left,
					'z-index' : arr[i].style.zIndex+1,
					'opacity' : '0'
				}
			});
			if(arr[i].onclick){
				dummy.style.cursor = 'pointer';
				dummy.onclick = arr[i].onclick;
			}
			var rel = arr[i].getAttribute('rel') ? arr[i].getAttribute('rel').split('|') : null;
			var trs = rel ? (rel[3]/100) : '1' ;
			var imFx = new Fx.Tween(arr[i],{duration:'1200'});
			imFx.start('opacity','0',trs);
			arr[i].parentNode.appendChild(dummy);
			arrDum.push([dummy,arr[i]]);
		}
		if(!t) return false;
		var arrayDummy=arrDum,arrayDummySort=[],regNum,cnt=0;
		var sortRandomArray = function(){
			for(var i=0;i<arrayDummy.length;i++){
				do{ var s = Math.floor((Math.floor(Math.random()*10))*(arrayDummy.length/10));
				}while(arrayDummySort.contains(s) || (regNum && i==0 && regNum==s));
				if(i==arrayDummy.length-1) regNum = s;
				arrayDummySort.push(s);
			}
		};
		var getDummy = function(){
			if(cnt==0){arrayDummySort.empty();sortRandomArray();}
			var r = arrayDummySort[cnt]; cnt++;
			if(cnt==arrayDummy.length) cnt=0;
			return r;
		}
		var setFx = function(){
			var 	n = getDummy(),
				el = arrayDummy[n],
				time = '1200',
				trs = '0.7';
			el[0].style.backgroundColor = '';
			if(el[1].getAttribute('rel')){
				var	rel = el[1].getAttribute('rel').split('|'),
					col = '#'+rel[0],
					time = rel[1],
					trs = (rel[2]/100),
					trsimage = (rel[3]/100);
				el[0].style.backgroundColor = '#'+rel[0];
				el[1].setStyle('opacity',trsimage);
			}
			var t1 = new Fx.Tween(el[0],{duration:time});
			if(rel && rel[0]){
				var t2 = new Fx.Tween(el[0],{duration:time,onComplete:function(){setFx()}});
				t1.start('opacity','0',trs).chain(function(){try{t2.start('opacity',trs,'0')}catch(e){}});
			}
		}
		setFx.delay(2000);
	},
	mainGallery : function(){
		if(document.getElementById('gal')){
			galleryFx.galTitle = this.pageTitle;
			galleryFx.currentLoColor = this.loColor;
			galleryFx.currentHiColor = this.hiColor;
			galleryFx.currentBgColor = this.bgColor;
			galleryFx.init();
		}
	},
	sliders : function(){
		for(var j=0;j<slideNew.togArray.length;j++){
			slideNew.togArray[j].hide();
			slideNew.togArray[j].toggle();
		}
		if(slideNew._toggle)
			slideNew._toggle.toggle();
	}
};
var slideNew = {
	init : function(){
		this.a = $$('#menu a');
		this.speed = document.all ? 500 : 500 ;
		this.arrUrl = this.strUrl.split(';');
		this.arrBack = this.strBack.split(';');
		this.openEl = {};
		this.togArray = [];
		this.currentEl = {};
		this.open();
		this.close();
	},
	open : function(){
		var _this = this;
		for(var i=0; i<this.a.length;i++){
			var parent = this.a[i].parentNode ;
			if(parent.nextSibling 
			&& parent.nextSibling.tagName == 'UL' 
			&& parent.nextSibling.className != 'switch'
			&& parent.nextSibling.getElementsByTagName('li')[0]){ 
				var exp = new RegExp(this.a[i].id,"g"); 
				this.openEl[this.a[i].id] = new Fx.Slide(parent.nextSibling,{
					duration:_this.speed
				});
				if(!this.strUrl.match(exp)){
					this.openEl[this.a[i].id].hide();
				}else{
					if(!this.strBack.match(exp)){
						this.currentEl[this.a[i].id] = new Fx.Slide(parent.nextSibling,{
							duration:_this.speed,
							transition: Fx.Transitions.Quint.easeInOut
						});
						this.togArray.push(this.currentEl[this.a[i].id]);
					}
				}
			}
		}
		if(!document.all){
			for(var j=0;j<this.togArray.length;j++){
				this.togArray[j].hide();
				this.togArray[j].toggle();
			}
		}
	},
	close : function(){
		var _this = this;
		for(var i=0;i<this.arrBack.length;i++){
			var exp = new RegExp(this.arrBack[i],"g");
			if(!this.strUrl.match(exp)){
				var parent = document.getElementById(this.arrBack[i]).parentNode.parentNode.getElementsByTagName('ul')[0];
				if(parent){
					if(!this._toggle) this._toggle = new Fx.Slide(parent,{
						duration:_this.speed,
						transition: Fx.Transitions.Quint.easeInOut
					});
					new Fx.Slide(parent,{duration:_this.speed}).show();
					parent.style.margin = '';
					parent.parentNode.style.height = '';
				}
			}
		}
		if(!document.all){
			if(this._toggle)
				this._toggle.toggle();
		}
	}
};
var shadow = {
	init : function(container){
		this.container = typeof container == 'string' 
			? document.getElementById(container)
			: container ;
		this.img = this.container.getElementsByTagName('img');
		this.setImgArray();
		this.set();
	},
	setImgArray : function(){
		this.imgArray = [];
		for(var i=0;i<this.img.length; i++){
			if(this.img[i].className == 'insertedImg' 
				|| this.img[i].className == '_presse_prev'){
				var	img = this.img[i],
					w = img.offsetWidth,
					h = img.offsetHeight,
					pLeft = img.getPosition().x,
					pTop = img.getPosition().y;
				this.imgArray.push([
					[img,w,h,pLeft,pTop]
				]);
			}
		}
	},
	set : function(){
		for(var i=0;i<this.imgArray.length;i++){
			this.imgArray[i][0][0].title = "";
			this.imgArray[i][0][0].style.position = "relative";
			this.imgArray[i][0][0].style.zIndex = "50";
			if(window.XMLHttpRequest){
				var img = document.createElement('img');
					img.src = "__layout/ombre.png";
					img.style.width = "100%";
					img.style.height = "100%";
			}
			var	shd = document.createElement('div');
				shd.className = '__shadow';
				shd.style.width = (this.imgArray[i][0][1]+8)+"px";
				shd.style.height = (this.imgArray[i][0][2]+7)+"px";
				shd.style.position = "absolute";
				shd.style.zIndex = "1";
				shd.style.left = (this.imgArray[i][0][3]-4)+"px";
				shd.style.top = this.imgArray[i][0][4]+"px";
			if(window.XMLHttpRequest) 
				shd.appendChild(img);
			else{
				shd.style.filter = 
					'progid:DXImageTransform.Microsoft.AlphaImageLoader'+
					'(src="old/__image/ombre.png",sizingMethod="scale");'
			}
			document.body.appendChild(shd);
		}
	}
};
var legend = {
	init : function(){
		this.img = [];
		this.srcImg = document.getElementById('contenu').getElementsByTagName('img');
		for(var i=0; i<this.srcImg.length; i++){
			if(this.srcImg[i].className.match(/inserted_image/g))
				this.getLegend(this.srcImg[i]);
		}
	},
	getLegend : function(curr){
		var _this = this;
		XMLHttp.get(
			'xhr.legend.php',
			'?src='+curr.src,
			function(){},
			function(){
				if(XMLHttp.responseText!='') 
					_this.setLegend(curr,XMLHttp.responseText);
			}
		)
	},
	setLegend : function(curr,leg){
		var	imgClone = curr.cloneNode(true);
			imgClone.className = 'inserted_image';
		var 	legend = document.createElement('div');
			legend.style.textAlign = "center";
			legend.id = curr.src;
			legend.innerHTML = leg;
		var	frame = document.createElement('div');
			frame.className = curr.className;
			frame.style.border ="none";
			frame.style.font = "11px trebuchet MS";
			frame.style.letterSpacing = "normal";
			if(curr.className!='inserted_image') 
				frame.style.width = curr.offsetWidth+"px";
			frame.appendChild(imgClone);
			frame.appendChild(legend);
		curr.parentNode.replaceChild(frame,curr)
	}
};

var XMLHttp = {
	responseText : null,
	get : function(file,arg,doBefore,doAfter){
		var 	_this = this;
		var 	xhr = window.XMLHttpRequest && !(window.ActiveXObject)
				? new XMLHttpRequest()
				: new ActiveXObject("Microsoft.XMLHTTP");
		if(doBefore!=null) doBefore();
		xhr.onreadystatechange = function(){
		if(xhr.readyState == 4){
				_this.responseText = xhr.responseText;
				if(doAfter!=null) doAfter();
			}
		}
		xhr.open("GET",file+arg);
		xhr.send(null);	
	},
	post : function(file,arg,doBefore,doAfter){
		var 	_this = this;
		var 	xhr = window.XMLHttpRequest && !(window.ActiveXObject)
				? new XMLHttpRequest()
				: new ActiveXObject("Microsoft.XMLHTTP");
		if(doBefore!=null) doBefore();
		xhr.onreadystatechange=function(){ 
			if(xhr.readyState == 4 && xhr.status==200){
				_this.responseText = xhr.responseText;
				if(doAfter!=null) doAfter();
			}
		};
		xhr.open("POST", file, true); 
		xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
		xhr.send(arg);
	}
};

var popupimage = function(file,name,size){
	imageDisplay.init(file,name,size);
};

var imageDisplay = {
	init : function(file,name,size){
		this.file = file;
		this.name = name;
		this.sizeArray = size.replace(/[^0-9,]/g,'').split(',');
		this.width = this.sizeArray[0];
		this.height = this.sizeArray[1];
		this.resize();
		this.createContainer();
	},
	resize : function(){
		if(this.height>window.getHeight()){
			var ratio = this.height/window.getHeight();
			this.height = window.getHeight()-20;
			this.width = Math.floor(this.width/ratio)-20;
		}
	},
	createContainer : function(){
		var _this = this;
		this.bg = new Element('div',{
			'id' : 'imageBg',
			'styles' : {
				'position' : 'fixed',
				'z-index' : '600',
				'top' : '0',
				'right' : '0',
				'bottom' : '0',
				'left' : '0',
				'background-color' : '#000',
				'opacity' : '0'
			}
		});
		this.image = new Element('img',{
			'src': this.file,
			'styles' : {
				'width' : this.width,
				'height' : this.height,
				'opacity' : '0'
			}
		});
		this.container = new Element('div',{
			'id' : 'full_image_container',
			'styles' : {
				'position' : 'fixed',
				'z-index' : '600',
				'border' : 'solid 2px #fff',
				'width' : this.width+'px',
				'height' :  this.height+'px',
				'left' : '50%',
				'top' : '50%',
				'margin-left' : '-'+(this.width/2)+'px',
				'margin-top' : '-'+(this.height/2)+'px',
				'background-color' : '#000',
				'opacity' : '0'
			}
		});
		this.bg.onmousedown = function(){
			document.body.removeChild(_this.container);
			document.body.removeChild(_this.bg);
			_this.hideAbsImage();
		};
		this.container.onmousedown = function(){
			document.body.removeChild(_this.container);
			document.body.removeChild(_this.bg);
			_this.hideAbsImage();
		};
		document.body.appendChild(this.bg);
		document.body.appendChild(this.container);
		this.bgTween = new Fx.Tween(this.bg,{duration:800});
		this.imageTween = new Fx.Tween(this.image,{duration:800});
		this.containerMorph = new Fx.Tween(this.container,{
			duration:500,
			onComplete : function(){
				_this.container.appendChild(_this.image);
				_this.load(_this.image,
					_this.container,
					function(){_this.imageTween.start('opacity','0','1');}
				)
			}
		});
		this.bgTween.start('opacity','0','0.6');
		this.containerMorph.start('opacity','0','1');
		this.showAbsImage();
	},
	load : function(image,container,func){
		var waiter = new Element('div',{
			'html' : '<img src="__layout/icons/ajax-loader.gif" >',
			'styles' : {
				'position' : 'absolute',
				'width' : '100%',
				'top' : '40%',
				'text-align' : 'center'
			}
		});
		
		if(image.complete){
			func();
		}else{
			container.appendChild(waiter);
			image.onload = function(){
				container.removeChild(waiter);
				func();
			}
		}
	},
	hideAbsImage : function(){
		var im = document.getElementById('contenu').getElementsByTagName('img');
		var di = document.getElementById('contenu').getElementsByTagName('div');
		for(var i=0;i<im.length;i++){
			if(im[i].style.position){
				im[i].style.display = '';
			}
		}
		for(var i=0;i<di.length;i++){
			if(di[i].style.position){
				di[i].style.display = '';
			}
		}
	},
	showAbsImage : function(){
		var im = document.getElementById('contenu').getElementsByTagName('img');
		var di = document.getElementById('contenu').getElementsByTagName('div');
		for(var i=0;i<im.length;i++){
			if(im[i].style.position){
				im[i].style.display = 'none';
			}
		}
		for(var i=0;i<di.length;i++){
			if(di[i].style.position){
				di[i].style.display = 'none';
			}
		}
	}
};
