document.documentElement.className+=' hasJS';

var $n={
	hasAttr:function(n,a,not){
		if(n.nodeType!=1 && not && this.check(n,not)) return false;
		if(this.check(n,a)) return true;
		return false;
	},
	check:function(n,attr){
		for(var i in attr){
			if(!attr[i].test(n[i]))
				return false;
		}
		return true;
	},
	setAttr:function(attr){
		for(var i in attr){
			attr[i]=(typeof(attr[i])=='string')?new RegExp("\\b"+attr[i]+"\\b"):attr[i];
		}
		return attr;
	},
	getByTagName:function(n,tag){
		return (tag=="*" &&n.all)?n.all:n.getElementsByTagName(tag);
	},
	node:function(n,a,not){
		return this.nodes(n,a,not,true);
	},
	nodes:function(n,a,not,oneNode,arrElms){
		var aRetElms=[];
		if(!a) a={};
		if(typeof a == "string") a={nodeName:a};
		if(a.nodeName && a.nodeName=="*") delete a.nodeName;
		if(a.nodeName instanceof RegExp){
			var elms=this.getByTagName(n,"*");
		}else{
			var elms=arrElms || this.getByTagName(n,(a.nodeName || "*"));
		}
		if(elms.length>0) delete a.nodeName;
		a=this.setAttr(a); not=this.setAttr(not);
		for(var i=0;i<elms.length;i++){
			var x=elms[i];
			if(this.hasAttr(x,a,not)){
				if(oneNode) return x;
				else aRetElms.push(x);
			}
		}
		if(oneNode) return null;
		return aRetElms;
	},
	childs:function(n,a,not){
		return this.nodes(n,a,not,false,n.childNodes);
	},
	firstChild:function(n,a,not){
		return this.nodes(n,a,not,true,n.childNodes);
	},
	lastChild:function(n,a,not){
		var node=this.nodes(n,a,not,false,n.childNodes);
		return node[node.length-1];
	},
	move:function(n,a,not,action){
		a=this.setAttr(a); not=this.setAttr(not);
		do{n=n[action];}while(!this.hasAttr(n,a,not));
		return n;
	},
	previous:function(n,a,not){
		return this.move(n,a,not,"previousSibling");
	},
	next:function(n,a,not){
		return this.move(n,a,not,"nextSibling");
	},
	parent:function(n,a,not){
		return this.move(n,a,not,"parentNode");
	}

}
if(!window.$extend){
	function $extend(original,extended){
		for(var key in (extended || {})) original[key]=extended[key];
		return original;
	};
}
function $protoTypeExtend(original,extended){
	for(var key in (extended || {})){
		if(!original[key]) original[key]=extended[key];
	}
	return original;
};
$protoTypeExtend(Array.prototype,{
	forEach:function(fun){
		var len=this.length;
		if(typeof fun!="function") throw new TypeError();
		var thisp=arguments[1];
		for(var i=0;i<len;i++){
			if(i in this)
				fun.call(thisp,this[i],i,this);
		}
		return this;
	},
	each:function(fun){
		this.forEach.call(this,fun);
		return this;
	},
	map:function(fun){
		var len=this.length;
	    if(typeof fun!="function")
	      throw new TypeError();
	    var res=new Array(len);
	    var thisp=arguments[1];
	    for(var i=0;i<len;i++)
	    {
	      if(i in this)
	        res[i]=fun.call(thisp,this[i],i,this);
	    }
	    return res;
	}
});
$protoTypeExtend(String.prototype,{
	trim:function(){ return this.replace(/^\s+|\s+$/g,'')}
});

var FW=function(){return FW.$.apply(this,arguments)};
FW.browser={
	ie:(document.all && window.print && !window.opera) || false,
	opera:window.opera || false,
	gecko:/Firefox/.test(navigator.userAgent),
	webkit: /AppleWebKit/.test(navigator.userAgent)
};
FW.browser.ie6=(FW.browser.ie && /MSIE [56]/.test(navigator.userAgent)) || false;
FW.browser.ieQuirks=(FW.browser.ie6 && document.compatMode && document.compatMode=="BackCompat") || false;
FW.capabilities={
	check: function(){
		var div=document.createElement("div");
		div.style.width="1000px";
		document.body.appendChild(div);
		this.gotCSS=div.offsetWidth==1000?true:false;
		this.gotImg=true
	}
}
FW.heightStyle=FW.browser.ieQuirks||FW.browser.ie6?'height':'minHeight';
FW.decoration=function(name,attributes,firstChilds,lastChilds,childBeforeAfter){
	firstChilds=FW.strToNodes(firstChilds);
	lastChilds=FW.strToNodes(lastChilds);
	FW.Module(
		'decoration_'+name,
		attributes,
		{initialize:function(elm){FW.createDecorations(elm,firstChilds,lastChilds,childBeforeAfter);}}
	)
}
FW.createDecorations=function(element,firstChilds,lastChilds,childBeforeAfter){
	if(childBeforeAfter){
		childBeforeAfter=FW(element).getElement(childBeforeAfter).el;
		if(childBeforeAfter){
			var parent=childBeforeAfter.parentNode;
			var newChild=childBeforeAfter;
			for(var i=firstChilds.length-1;i>=0;i--){
				newChild=parent.insertBefore(firstChilds[i].cloneNode(true),newChild);
			}
			if(childBeforeAfter.nextSibling){
				i=lastChilds.length-1;
				newChild=childBeforeAfter.nextSibling;
			}else{
				i=lastChilds.length-2;
				newChild=parent.appendChild(lastChilds[lastChilds.length-1].cloneNode(true));
			}
			for(; i>=0; i--){
				newChild=parent.insertBefore(lastChilds[i].cloneNode(true), newChild);
			}
		}
	}else{
		for(var i=lastChilds.length-1;i>=0;i--){
			element.appendChild(lastChilds[i].cloneNode(true));
		}
		for(var i=0;i<firstChilds.length;i++){
			if(!element.firstChild)
				element.appendChild(firstChilds[i].cloneNode(true));
			else
				element.insertBefore(firstChilds[i].cloneNode(true),element.firstChild);
		}
	}
}
FW.strToNodes=function(str){
	if(!str) return [];
	var div=document.createElement('div');
	div.innerHTML=str;
	var returns=[];
	while(div.firstChild)
		returns.push(div.removeChild(div.firstChild));
	return returns;
}
FW.initAttributes=function(attr){
	for(var i in attr) 
		attr[i]=(typeof (attr[i])=='string')?new RegExp("\\b("+attr[i].replace(/,/g,'|')+")\\b"):attr[i];
	return attr;
}
FW.modules=[];
FW.Module=function(moduleName,attributes,modProto){
	if(attributes.nodeName) FW.initializer.addNodeName(attributes.nodeName);
	try {delete attributes.nodeName} catch(e){attributes.nodeName=null}
	attributes=FW.initAttributes(attributes);
	var ModuleObj=function(){
		this.initialize.apply(this,arguments);
	};
	ModuleObj.prototype=modProto;
	FW.modules.push({name:moduleName,attributes:attributes,moduleObject:ModuleObj})
}
FW.initializer={
	nodeNames:[],
	launch:function(parent){
		parent=parent || document.body;
		for(var i=0;i<this.nodeNames.length;i++){
			var nodes=parent.getElementsByTagName(this.nodeNames[i]);
			for(var j=0;j<nodes.length;j++){
				for(var m=0;m<FW.modules.length;m++){
					if(this.check(nodes[j],FW.modules[m].attributes)){
						new FW.modules[m].moduleObject(nodes[j]);
					}
				}
			}
		}
	},
	addNodeName:function(nodeName){
		if(nodeName=='*') return;
		nodeName=nodeName.toLowerCase();
		for(var i=0;i<this.nodeNames.length;i++){
			if(this.nodeNames[i]==nodeName)
				return;
		}
		this.nodeNames.push(nodeName);
	},
	check:function(n,attr){
		for(var i in attr){
			if(attr[i].test(n[i]))
				return true;
		}
		return false;
	}
}
FW.$=function(){
	var aArgs=arguments;
	if(aArgs.length>1 && typeof aArgs[1]=='string'){
		return new FW.Wrap(typeof aArgs[0]=='string'?document.getElementById(aArgs[0]).getElementsByTagName(aArgs[1]):aArgs[0].getElementsByTagName(aArgs[1]));
	}
	else switch(typeof aArgs[0]){
		case 'string':
			return new FW.Wrap(document.getElementById(aArgs[0]));
		case 'object':
			return new FW.Wrap(aArgs[0]);
	}
	return false;
}

FW.Wrap=function(el){
	this.el=el;
}
FW.Wrap.prototype={
	removeClass: function(sClass){
		var rep=this.el.className.match(' '+sClass)?' '+sClass:sClass;
		this.el.className=this.el.className.replace(rep,'');
		return this;
	},
	addClass: function(sClass){
		if(!this.hasClass(sClass))
			this.el.className+= this.el.className?' '+sClass:sClass;
		return this;
	},
	swapClass: function(sClass1,sClass2){
		this.el.className=this.hasClass(sClass1)?this.el.className.replace(sClass1,sClass2):this.el.className.replace(sClass2,sClass1);
		return this;
	},
	toggleClass: function(sClass){
		this.hasClass(sClass)?this.removeClass(sClass):this.addClass(sClass);
		return this;
	},
	hasClass: function(sClass){
		return typeof sClass=='string'?new RegExp('\\b'+sClass+'\\b').test(this.el.className):sClass.test(this.el.className);
	},
	addEvent: function(evType,func,bCapture){
		if(evType=='domready' && this.el==window)
			FW.event.domready(func);
		document.addEventListener?
			this.el.addEventListener(evType,func,bCapture || false):
			this.el.attachEvent?this.el.attachEvent('on'+evType,func):false;
		return this;
	},
	removeEvent: function(sEvType,fn,bCapture){
		document.addEventListener?
			this.el.removeEventListener(sEvType, fn, bCapture || false):
			this.el.detachEvent?this.el.detachEvent('on'+sEvType,fn):false;
		return this;
	},
	getElement:function(attr,not){
		return new FW.Wrap($n.node(this.el,attr,not));
	},
	getElements:function(attr,not){
		return $n.nodes(this.el,attr,not);
	},
	getParent:function(attr,not){
		var el=$n.parent(this.el,attr,not);
		return el?new FW.Wrap(el):null;
	},
	getNext:function(attr,not){
		var el=$n.next(this.el,attr,not);
		return el?new FW.Wrap(el):null;
	},
	getChildsNodes:function(attr,not){
		return $n.childs(this.el,attr,not);
	},
	getStyle: function(strCssRule){
		var oElm=this.el;
		var strValue="";
		if(document.defaultView && document.defaultView.getComputedStyle){
			try{strValue=document.defaultView.getComputedStyle(oElm, null).getPropertyValue(strCssRule);}catch(e){strValue="";}
		}
		else if(oElm.currentStyle){
			try{
				strCssRule=strCssRule.replace(/\-(\w)/g,function(strMatch,p1){
					return p1.toUpperCase();
				});
				strValue=oElm.currentStyle[strCssRule];
			}catch(e){strValue="";}
		}
		return strValue;
	},
	getIntStyle: function(strCSSRule){
		var val=parseInt(this.getStyle(strCSSRule));
		if(isNaN(val)) val=0;
		return val;
	},
	getVStyle: function(elm){
		return FW.browser.ieQuirks?
			0:
			this.getIntStyle("padding-top")+this.getIntStyle("padding-bottom")+this.getIntStyle("border-top-width")+this.getIntStyle("border-bottom-width");
	},
	getHStyle: function(elm){
		return FW.browser.ieQuirks ?
			0:
			this.getIntStyle("padding-left")+this.getIntStyle("padding-right")+this.getIntStyle("border-left-width")+this.getIntStyle("border-right-width");
	},
	getPosition:function(overflown){
		var obj=this.el;
		var curleft=0,curtop=0;
		if(obj.offsetParent){
			do{
				curleft+=obj.offsetLeft+(overflown?-obj.scrollLeft:0);
				curtop+=obj.offsetTop+(overflown?-obj.scrollTop:0);
			}while(obj=obj.offsetParent);
			return {x:curleft,y:curtop};
		}
	}
}
FW.event={
	domready:function(fn){
		if(window.attachEvent){
			document.write('<script id="ieScriptLoad" defer src="//:"><\/script>');
			document.getElementById('ieScriptLoad').onreadystatechange=function(){
				if(this.readyState=='complete')
					FW.event.init(fn);
			};
		}
		if(document.addEventListener)
			document.addEventListener('DOMContentLoaded',function(){FW.event.init(fn);},false);
		if(navigator.userAgent.search(/WebKit/i)!=-1){
		    FW.event.loadTimer=setInterval(function(){
				if(document.readyState.search(/loaded|complete/i)!=-1)
					FW.event.init(fn);
			},10);
		}
		FW.$(window).addEvent('load',function(){FW.event.init(fn);});
	},
	init: function(fn){
		if(arguments.callee.done) return;
		arguments.callee.done=true;
		if(FW.event.loadTimer) clearInterval(FW.event.loadTimer);
			fn();
	},
	stop: function(e){
		if(e && e.stopPropagation && e.preventDefault){
			e.stopPropagation();
			e.preventDefault();
		}
		else if(e && window.event){
			window.event.cancelBubble=true;
			window.event.returnValue=false;
		}
		return false;
	},
	getSrc: function(e){
		return e.target || e.srcElement;
	},
	relSrc: function(e){
		switch(e.type){
			case 'mouseover':
				return e.relatedTarget || e.fromElement;
			case 'mouseout':
				return e.relatedTarget || e.toElement;
		}
	}
}
FW.$(window).addEvent('domready',function(){FW.initializer.launch()});

FW.decoration('corners',{nodeName:'div',className:'F6_blockSimple'},'<span class="F6_topCorners"><span class="F6_tl"></span><span class="F6_tr"></span></span>','<span class="F6_bottomCorners"><span class="F6_bl"></span><span class="F6_br"></span></span>',{nodeName:'div',className:'F6_blockInside'});
FW.decoration('sides',{nodeName:'div',className:'blockShadowSimple,blockTabSub'},'<span class="F6_sideL"></span><span class="F6_sideR"></span><span class="F6_sideT"><span class="F6_cornerRight"></span></span>','<span class="F6_sideB"><span class="F6_cornerRight"></span></span>',{nodeName:'div',className:'F6_blockInside'});
FW.decoration('pageCorners',{nodeName:'div',id:'page'},'<span class="pageTop"><span class="F6_cornerRight"></span></span>','<span class="pageBottom"><span class="F6_cornerRight"></span></span>',{nodeName:'div',id:'pageInside'});
function log(txt){
	if(window.console && window.console.firebug && FW.browser.gecko) console.log(txt)
}
function dir(obj){
	if(window.console && window.console.firebug && FW.browser.gecko) console.dir(obj)
}

var Ajax=function(){ this.initialize.apply(this, arguments);};
Ajax.prototype={
	options:{method:'get',url:'',async:true,noCache:true,data:{}},
	constructor:Ajax,
	initialize:function(options){
		var _self=this;
		this.setOptions(options);
		this.xhr=this.getXHR();
		this.xhr.onreadystatechange=function(){
			_self.onReadyStateChange();
		};
	},
	onReadyStateChange:function(fromAsync){
		if(!this.options.async && !fromAsync){return;}
		if(this.xhr.readyState==4){
			if(this.xhr.status==200){
				this.fireEvent('onSuccess');
			}else{
				this.fireEvent('onError');
			}
		}
	},
	send:function(data){
		var o=this.options;
		this.setData(data);
		this.fireEvent('onStart');
		switch(this.options.method.toLowerCase()){
			case "get":
				var url=this.dataStr.length>0?o.url+"?"+this.dataStr:o.url;
				this.xhr.open("GET",this.addNoCache(url),o.async);
				this.xhr.send(null);
				break;
			case "post":
				this.xhr.open("POST",this.addNoCache(o.url),o.async);
				this.xhr.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
				this.xhr.send(this.dataStr);
				break;
			default :
				return false;
		}
		if(!o.async){
			this.onReadyStateChange(true);
		}
	},
	addData:function(data){
		var i;
		if(!data){return;}
		if(typeof data=='string'){
			var dataArr=data.split('&');
			data={};
			for(i=0; i<dataArr.length; i++){
				var vals=dataArr[i].split('=');
				data[vals[0]]=vals[1];
			}
		}
		for(i in data){
			if(data[i]!==null){
				this.options.data[i]=data[i];
			}
		}
	},
	setData:function(data){
		if(typeof data=='string'){
			this.dataStr=data;
		}else{
			this.addData(data);
			var dataArr=[];
			for(var i in this.options.data){
				if(typeof this.options.data[i]!='function'){
					dataArr.push(i+'='+this.options.data[i]);
				}
			}
			this.dataStr=dataArr.join('&');
		}
	},
	addNoCache:function(url){
		if(this.options.noCache){
			if(url.indexOf("?")==-1){
				url+="?";
			} else if(url.charAt(url.length-1)!="&"){
				url+="&";
			}
			url+= "nocache"+parseInt(Math.random()*1000000,10)+"="+parseInt(Math.random()*1000000,10);
		}
		return url;
	},
	fireEvent:function(event){
		if(this.options[event] && typeof this.options[event]=='function'){
			this.options[event](this.xhr);
		}
	},
	getXHR:function(){
		if(window.XMLHttpRequest){
			return new XMLHttpRequest();
		}else{
			if(window.ActiveXObject){
				var x=['Msxml2','Microsoft'];
				for(var i=0; i<x.length; i++){
					try {
						return new ActiveXObject(x[i]+'.XMLHTTP');
					} catch (e){}
				}
			}
		}
		return null;
	},
	setOptions:function(options){
		if(!options){return;}
		var savedOpt=this.options;
		this.options={};
		for(var i in savedOpt) this.options[i]=savedOpt[i];
		for(var i in options) this.options[i]=options[i];
	}
};
var F6_underNavHover={
	init:function(){
		var _self=this;
		this.elms=FW('nav_top').getElements('li');
		this.elms.each(function(el){
			el.F6_underNav=FW(el).getElement({nodeName:'div',className:'F6_underNav'});
			FW(el).addEvent('mouseover',function(e){
				_self.show(el);
			})
			FW(el).addEvent('mouseout',function(e){
				_self.hide(el);
			})
		})
	},
	show:function(el){
		FW(el).addClass('F6_hover');
	},
	hide:function(el){
		FW(el).removeClass('F6_hover');
	}
}
if(FW('nav_top').el) FW.$(window).addEvent('load',function(){F6_underNavHover.init();cleanInput.init('ctn_hd');});
var $layer={
	options:{
		id:'insidePopup',
		templateHTML:[
			'<span class="layerTopCorners"><span></span></span>',
			'<div class="insidePopupContent">',
			'<a href="#" class="close popupCloseButton">__CLOSINGWORDING__</a>',
			'<div>',
			'__CONTENT__',
			'</div>',
			'</div>',
			'<span class="layerBottomCorners"><span></span></span>'
		].join(''),
		styles:{width:'700px'},
		position:'center',
		mask:false,
		maskPosition:null,
		maskClickClose:true,
		content:'',
		contentFrom:null,
		elmToShow:null,
		parent:null,
		fixLayerOnParent:false,
		className:"",
		timerInterval:100,
		offsetTop:10,
		offsetLeft:10,
		closingWording:''
	},
	F6_currentOptions:{},
	resetOptions:function(){this.F6_currentOptions={};$extend(this.F6_currentOptions,this.options);},	
	lastPositions:{},
	open:function(options){
		var _self=this;
		var frag;
		this.close();
		this.resetOptions();
		if(options.styles && options.styles.opacity!=null) options.styles.filter='alpha(opacity='+options.styles.opacity*100+')';
		if(options.contentFrom!=null){
			options.contentFrom=FW(options.contentFrom).el;
			options.content=options.contentFrom.innerHTML
		}
		if(options.elmToShow!=null){
			options.content="";
			this.F6_currentElmId=options.elmToShow;
		}
		if(this.F6_currentOptions.over) this.F6_currentOptions.over=FW(this.F6_currentOptions.over).el;
		for(var i in options){
			if(i!='styles') this.F6_currentOptions[i]=options[i];
		}
		if(options.styles)
			for(var i in options.styles){this.F6_currentOptions.styles[i]=options.styles[i];}
		this.options.lastScrollTop=this.options.offsetTop;
		this.options.lastScrollLeft=this.options.offsetLeft;
		if(!FW(this.F6_currentOptions.id).el)  this.createLayer();
		if(this.F6_currentOptions.mask)  this.createMask();
		this.layer.innerHTML=this.layer.innerHTML.replace(/__CONTENT__/g,this.F6_currentOptions.content).replace(/__CLOSINGWORDING__/,this.F6_currentOptions.closingWording);
		if(this.F6_currentOptions.elmToShow){
			FW(this.F6_currentOptions.elmToShow).el.style.display="block";
		}
		this.correctIE(this.layer);
		this.initActionsButtonsOnLayer();
		this.layer.style.width=this.layer.clientWidth-FW(this.layer).getHStyle()+'px';
		this.setSize();
		this.setPosition();
		this.timerRefresh=setInterval(function(){
			_self.refreshSizeAndPosition()
		},this.options.timerInterval)
		this.lastPositions={scrollLeft:document.documentElement.scrollLeft,scrollTop:document.documentElement.scrollTop}
		this.refreshSizeAndPosition();
		this.layer.style.visibility='visible';
	},
	close:function(){
		if(this.timerRefresh) clearInterval(this.timerRefresh);
		var elmW=FW(this.F6_currentOptions.id);
		if(elmW.el){
			elmW.el.parentNode.removeChild(elmW.el);
		}
		if(this.F6_currentOptions.parent) 
			this.F6_currentOptions.parent.style.height='';
		if(this.mask){
			if(this.mask.$layerIframe) 
				this.mask.$layerIframe.parentNode.removeChild(this.mask.$layerIframe);
			this.mask.parentNode.removeChild(this.mask);
		}
		try{
			delete this.layer;
			delete this.content;
			delete this.mask;
		}catch(e){}
		if(typeof window.CollectGarbage=='function'){
		  CollectGarbage();
		}
		if(this.F6_currentElmId){
			FW(this.F6_currentElmId).el.style.display="none";
			FW(this.F6_currentElmId).removeClass('layered');
			this.F6_currentElmId=null;
		}
	},
	createLayer:function(){
		var layer=document.createElement('div');
		layer.className+=' '+this.F6_currentOptions.className || "";
		layer.id=this.F6_currentOptions.id;
		$extend(layer.style,this.F6_currentOptions.styles);
		$extend(layer.style,{left:0,top:0,display:'block',visibility:'hidden'});
		layer.innerHTML=this.F6_currentOptions.templateHTML;
		if(this.F6_currentOptions.over){
			(this.F6_currentOptions.parent || document.body).appendChild(layer);
			if(this.F6_currentOptions.fixLayerOnParent){
				this.F6_currentOptions.parent.style.position='relative';
			}else 
				this.F6_currentOptions.position='byElement';
		}else 
			document.body.appendChild(layer);
		this.layer=layer;
		FW(this.layer).addEvent('click',function(e){FW.event.stop(e);});
		this.layerContent=FW(layer).getElement({nodeName:'div',className:'insidePopupContent'}).el;
		return this.layer;
	},
	createMask:function(){
		var mask=document.createElement('div');
		this.mask=mask;
		mask.id='insidePopupMask';
		this.correctIE(mask);
		document.body.appendChild(mask);
		if(this.F6_currentOptions.maskClickClose){
			FW(mask).addEvent('click',function(e){
				FW.event.stop(e);
				$layer.close();
			})
		}
	},
	setPosition:function(){
		var styles={};
		var currStyles=this.F6_currentOptions.styles;
		switch(this.F6_currentOptions.position){
			case 'center':
				var parentToUse=window.opera?document.body:document.documentElement;
				var top=(parentToUse.clientHeight-this.layer.offsetHeight)/2+document.documentElement.scrollTop;
				var left=(parentToUse.clientWidth-this.layer.offsetWidth)/2+document.documentElement.scrollLeft;
				if(this.layer.offsetHeight>parentToUse.clientHeight)
					top=(this.lastPositions.scrollTop || 0)+this.options.offsetTop;
				else 
					this.lastPositions.scrollTop=document.documentElement.scrollTop;
				if(this.layer.offsetWidth>parentToUse.clientWidth)
					left=(this.lastPositions.scrollLeft || 0)+this.options.offsetLeft;
				else 
					this.lastPositions.scrollLeft=document.documentElement.scrollLeft
				styles={left:left+'px',top:top+'px'};
				break;
			case 'user' :
				styles={left:currStyles.left,top:currStyles.top}
				break;
			case 'byElement':
				var pos=FW(this.F6_currentOptions.over).getPosition();
				styles={left:pos.x+'px',top:pos.y+'px'};
				break;
			default:
				break;
		}
		$extend(this.layer.style, styles);
	},
	setSize:function(){
		if(!isNaN(parseInt(this.F6_currentOptions.styles.height))){
			this.layer.style.height='auto';
			var inside=FW(this.layer).getElement({nodeName:'div',className:'insidePopupContent'}).el;
			if(this.F6_currentOptions.parent && inside && FW(inside).getStyle('position')!='absolute' && inside.offsetHeight>this.F6_currentOptions.parent.offsetHeight){
				this.F6_currentOptions.parent.style.height=this.layer.offsetHeight+'px';
			} 
			if(this.layer.offsetHeight<parseInt(this.F6_currentOptions.styles.height))
				this.layer.style.height=parseInt(this.F6_currentOptions.styles.height)-FW(this.layer).getVStyle(this.layer)+'px';
		}
	},
	refreshSizeAndPosition:function(){
		var parentToUse=window.opera?document.body:document.documentElement;
		if(
			(this.mask && this.mask.offsetHeight<this.layer.offsetHeight) ||
			this.lastPositions.layerHeight!=this.layer.offsetHeight || 
			this.lastPositions.width!=parentToUse.clientWidth ||  
			this.lastPositions.height!=parentToUse.clientHeight || 
			this.lastPositions.scrollLeft!=document.documentElement.scrollLeft || 
			this.lastPositions.scrollTop!=document.documentElement.scrollTop
		){
			this.setPosition();
			if(this.mask && (this.lastPositions.width!=document.documentElement.clientWidth || this.lastPositions.height!=document.documentElement.clientHeight)){
				var height=(document.body.clientHeight<document.documentElement.clientHeight?document.documentElement.clientHeight:(document.body.scrollHeight>document.documentElement.scrollHeight ?document.body.scrollHeight:document.documentElement.scrollHeight))
				if(!height) height=document.documentElement.scrollHeight;
				$extend(this.mask.style,{height:height+'px',width:document.documentElement.scrollWidth > document.documentElement.clientWidth?document.documentElement.scrollWidth+'px':"100%"});
			}	
			this.lastPositions.layerHeight=this.layer.offsetHeight;
			this.lastPositions.width=parentToUse.clientWidth;
			this.lastPositions.height=parentToUse.clientHeight;
			this.correctIE(this.layer);
			this.correctIE(this.mask);
		}
	},
	initActionsButtonsOnLayer:function(){
		var closeButtons=FW(this.layer).getElements({className:'(close|insidePopupCloseButton)'});
		if(this.F6_currentElmId){
			closeButtons=FW(this.F6_currentElmId).getElements({className:'(close|insidePopupCloseButton)'});
		}
		closeButtons.each(function(btn){
			btn.onclick=function(){
				$layer.close();
				return false;
			}
		})
	},
	correctIE:function(element){
		if(!element) return;
		if(!element.$layerIframe && FW.browser.ie6){
			var ifr=document.createElement('<iframe style="filter:alpha(opacity=0);width:100%;height:100%;position:absolute;top:0;left:0;z-index:-1;">');
			element.$layerIframe=(this.options.maskClickClose && element==this.mask?document.body:element).appendChild(ifr);
			if(element==this.mask)
				element.$layerIframe.style.zIndex=1;
		}
		if(element.$layerIframe)
			element.$layerIframe.style.height=element.offsetHeight+'px';

	}
}
function pngFix(elm, noOverflow){
	elm.style.filter=' ';
	if(!(document.all && window.print && /MSIE [56]/.test(navigator.userAgent))) return;
	var exec=(function(elm, noOverflow, scale){
		return function(){
			var options={ noOverflow:noOverflow};
			var repeat=elm.currentStyle.backgroundRepeat.toLowerCase()=='repeat';
			elm.style.filter=' ';
			if(elm.nodeName.match(/^(IMG|INPUT)$/)){
				if(!elm.src.match(/.*\.png$/)) return;
				elm.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod='image', src='"+elm.src+"')";
				elm.width=elm.offsetWidth;
				elm.height=elm.offsetHeight;
				var url=elm.currentStyle.backgroundImage.match(/^url\(["'](.*\.gif)["']\)$/);
				elm.src=url[1];
				elm.className=elm.className.replace(/pngFix/g,'');
			}
			else {
				if(elm.currentStyle.backgroundImage == "" || elm.currentStyle.backgroundImage=="url()") return;
				var url=elm.currentStyle.backgroundImage.match(/^url\(["'](.*\.png)["']\)$/);
				if(!url || url.length<2) return;
				var pngLayer=document.createElement('i');
				with(pngLayer.style){
					if(options.noOverflow){
						width=elm.offsetWidth+'px';
						height=elm.offsetHeight+'px';
					}else{
						width='32000px';
						height='32000px'; 
					}
					position='absolute';
					zIndex=-1;
					fontSize='1%';
					filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod='"+(options.noOverflow?'crop':'image')+"', src='"+url[1]+"')";
					background='none';
					if(!repeat){
						switch((elm.currentStyle.backgroundPositionX+'').toLowerCase()){
							case 'left':left=0; break; 
							case 'right':right=0; break;
							case 'center':
								left='50%'; 
								setTimeout(function(pngLayer){
									return function(){
										pngLayer.style.marginLeft=-(pngLayer.offsetWidth/2)+'px'; 
									}
								}(pngLayer), 50);
								break;
							default:
								left=elm.F6_currentStyle.backgroundPositionX; 
						}

						switch((elm.F6_currentStyle.backgroundPositionY+'').toLowerCase()){
							case 'top':top=0; break;
							case 'bottom':bottom=0; break;
							case 'center':
								top='50%'; 
								setTimeout(function(pngLayer){
									return function(){
										pngLayer.style.F6_marginTop=-(pngLayer.offsetHeight/2)+'px'; 
									}
								}(pngLayer),100);
								break;
							default:
								top=elm.F6_currentStyle.backgroundPositionY || 0; 
						}
					}else{
						left=0;
						top=0;
					}
				}
				setTimeout(function(elmN, pngLayerN, repeatN){
					return function(){
						if(!elmN || elmN.parentNode || !pngLayerN || !pngLayerN.parentNode) return;
						if(pngLayerN.filters['DXImageTransform.Microsoft.AlphaImageLoader'].sizingMethod=='image'){
							if(pngLayerN.offsetWidth<elmN.offsetWidth && repeatN){
								pngLayerN.filters['DXImageTransform.Microsoft.AlphaImageLoader'].sizingMethod='scale';
							} else if(pngLayerN.offsetWidth>elmN.offsetWidth && elm.F6_currentStyle.backgroundPositionX.match(/^(left|0%|0px|0)$/) || elm.currentStyle.backgroundPositionY.match(/^(top|0%|0px|0)$/)){
								pngLayerN.filters['DXImageTransform.Microsoft.AlphaImageLoader'].sizingMethod='crop';
							}
						}else{pngLayerN.sizingMethod='image';}
						if(elm.currentStyle.width.match(/^(0|[12](%|px)?)$/)){
							pngLayerN.filters['DXImageTransform.Microsoft.AlphaImageLoader'].sizingMethod='image';
						}
						if(pngLayerN.style.right!='auto' && pngLayerN.style.right !='')
							setTimeout(function(){
								pngLayerN.style.right=parseInt(pngLayerN.style.right)-(elm.offsetWidth%2?1:0)+'px';
							},50)
					}
				}(elm,pngLayer,repeat),200);
				with(elm.style){
					position=elm.currentStyle.position=="static" || elm.currentStyle.position==""?'relative':position;
					if(elm.currentStyle.overflow!='auto' && elm.currentStyle.overflow!='hidden') overflow=options.noOverflow?'visible':(elm.currentStyle.width.match(/^(0|[12](%|px)?)$/)?'visible':'hidden');
					backgroundImage='none';
				}
				elm.appendChild(pngLayer);
			}
		}
	})(elm,noOverflow);
	try{
		pngFixLoader.useOnload?pngFixLoader.addFunc(exec):exec();
	} catch(e){};
}
var pngFixLoader={
	useOnload:true,
	functions:[],
	addFunc:function(func){
		pngFixLoader.functions.push(func);
	},
	launch:function(){
		pngFixLoader.useOnload=false;
		var counter=1;
		while(pngFixLoader.functions.length>0){
			pngFixLoader.functions.pop()();
			counter++;
		}
	},
	init:function(){
		if(pngFixLoader.useOnload && window.attachEvent && document.all){
			window.attachEvent('onload',function(){
				setTimeout(pngFixLoader.launch, 100);
			});
		}
	}
}
pngFixLoader.init();
var blocMeteo={
	init:function(elm){
		this.formulaire=FW('formMeteo');
		this.myElm=elm;
		if(!this.formulaire){return;}
		this.remote('/elements/xsl/villesMeteo.xml');
		this.groupForm=this.formulaire.getElement({nodeName:'div',className:'groupForm'});
	},
	setToggle:function(elm){
		var _self=this;
		var link=document.createElement('a');
		link.innerHTML='Modifier';
		link.href='#';
		link.className='preferencesLink';
		link.id='preferencesLink';
		var media=elm.getElement({nodeName:'div',className:'links'});
		media.el.appendChild(link);
		FW(link).addEvent('click',function(e){
			FW.event.stop(e);
			media.el.removeChild(link);
			_self.formulaire.el.style.display='block';
		})
		if(!this.isReturnLink){
			this.returnLink=document.createElement('a');
			this.returnLink.innerHTML='&gt; Annuler';
			this.returnLink.href='#';
			this.returnLink.className='returnLink';
			FW('formMeteo').el.appendChild(this.returnLink);
			this.isReturnLink=true;
		}
		FW(this.returnLink).addEvent('click',function(e){
			FW.event.stop(e);
			_self.formulaire.el.style.display='none';
			media.el.appendChild(link);
		})
	},
	remote:function(myUrl){
		var _self=this;
		new Ajax({
			url:myUrl,
			onSuccess:function(xhr){
				_self.delForm();
				_self.createForm(XMLF.xml2obj(xhr.responseXML));
			}
		}).send();
	},
	delForm:function(){
		this.groupForm.el.innerHTML='';
	},
	createForm:function(obj){
		var _self=this;
		var regions=obj.pays.region;
		var regionLabel=document.createElement('label');
		regionLabel.innerHTML='Choisissez votre r&eacute;gion';
		var regionSelect=document.createElement('select');
		regions.each(function(region){
			var newOption=document.createElement('option');
			newOption.innerHTML=region.attr.name;
			regionSelect.appendChild(newOption);
		})
		this.groupForm.el.appendChild(regionLabel);
		this.groupForm.el.appendChild(regionSelect);
		var villeLabel=document.createElement('label');
		villeLabel.innerHTML='Choisissez votre ville';
		var villeSelect=document.createElement('select');
		this.groupForm.el.appendChild(villeLabel);
		this.groupForm.el.appendChild(villeSelect);
		_self.populateVille(obj, 0, villeSelect);
		FW(regionSelect).addEvent('change',function(){
			var index=regionSelect.selectedIndex;
			villeSelect.innerHTML='';
			_self.populateVille(obj,index,villeSelect);
		})
		this.setToggle(this.myElm);
	},
	populateVille:function(obj,index,villeSelect){		
		var villes=obj.pays.region[index].ville;
		villes.each(function(ville){
			var newOption=document.createElement('option');
			newOption.innerHTML=ville.name;
			newOption.value=ville.id;
			villeSelect.appendChild(newOption);
		})
	}
}
FW(window).addEvent('load', function(){
	if(FW('meteo_widget').el) blocMeteo.init(FW('meteo_widget'));
	if(FW('nav_top').el) F6_underNavHover.init();
	if(FW('nav_top').el) cleanInput.init('ctn_hd');
	if(FW('F6_popup').el) cleanInput.init('F6_popup');
});
function setCookie(cookieName,value,expiredays){
    var exdate=new Date();
	exdate.setDate(exdate.getDate()+expiredays);
	document.cookie=cookieName+ "=" +escape(value)+ ((expiredays==null)?"":";expires="+exdate.toGMTString())
	document.cookie+=("; path=/"); 
	document.cookie+=("; domain=laposte.net"); 
}
function remoteMeteo(elm){
	var myUrl="/elements/includes/bloc_meteo/meteo.jsp";
	var cityValue=FW('formMeteo').getElements('select')[1].value;
	var parametres='?ville='+cityValue;
	new Ajax({
		url:myUrl+parametres,
		onSuccess:function(xhr){
			var mea=FW('mea_meteo');
			mea.el.innerHTML='';
			mea.el.innerHTML=xhr.responseText;
			FW('formMeteo').el.style.display='none';
			setCookie('villemeteo',cityValue, 365);
			blocMeteo.setToggle(FW('mea_meteo'));
		}
	}).send();
	return false;
}
var XMLF={
	xml2obj:function(node, arrayForcedNodes){
		var arrayForced=arrayForcedNodes?new RegExp('\\b('+arrayForcedNodes.join('|')+')\\b'):null;
		var x2o=XMLF.xml2obj;
		var obj={};
		var xmlNodes=0;
		for(var i=0; i<node.childNodes.length; i++){
			var n=node.childNodes[i];
			var name=n.nodeName;
			if(n.nodeType==1){
				xmlNodes++;
				if(obj[name]==null){
					var tmpObj=x2o(n,arrayForcedNodes);
					obj[name]=arrayForced && name.match(arrayForced)?[tmpObj]:tmpObj;
				}else{
					if(!(obj[name] instanceof Array)){
						obj[name]=[obj[name]];
					}
					obj[name].push(x2o(n,arrayForcedNodes));
				}
			}
		}
		if(xmlNodes==0){
			var val=XMLF.getContent(node);
			if(!val){
				if(node.attributes.length==0){
					val='';
				}else{
					var val=XMLF.getAttributes(node);
				}
			} else if(val.match(/^\s*true|false\s*$/)){
				val=eval(val);
			}
			return val;
		}else if(node.attributes && node.attributes.length>0){
			obj.attr=XMLF.getAttributes(node);
		}
		return obj
	},
	getContent:function(node){
		var str=[];
		for(var i=0;i<node.childNodes.length;i++){
			str.push(node.childNodes[i].nodeValue);
		}
		return str.join('');
	},
	getAttributes:function(node){
		var val={};
		for(var i=0;i<node.attributes.length;i++){
			var attr=node.attributes[i];
			val[attr.nodeName]=attr.nodeValue;
		}
		return val;
	}
}
var cleanInput={
	init:function(container){
		var _self=this;
		this.elms=FW(container).getElements({nodeName:'input',className:'cleanInput'});
		this.elms.each(function(elm, index){
			var defaultValue=(FW(elm).el.id!='searchGoogle')?FW(elm).el.value:'';
			FW(elm).addEvent('focus',function(){
				_self.onFocus(defaultValue, FW(elm));
			});
			FW(elm).addEvent('blur',function(){
				_self.onBlur(defaultValue, FW(elm));
			});
			_self.addEnterToNext(FW(elm),_self.elms,index);
		});
	},	
	onFocus:function(defaultValue,currentObject){
		if(currentObject.el.value==defaultValue || currentObject.el.value==''){
			currentObject.el.value='';
		}
	},
	onBlur:function(defaultValue,currentObject){
		if(currentObject.el.value==defaultValue || currentObject.el.value==''){
			currentObject.el.value=defaultValue;
		}
	},
	addEnterToNext:function(currentObject,tabInput,index){
		if(currentObject.el.className.match(/toNextInput/g)){
			currentObject.addEvent('keydown',function(e){
				if(e.keyCode==13){
					FW.event.stop(e);
					tabInput[index+1].focus();
				}
			});
		}
	}
}
FW.Module("searchScroll", 
	{nodeName:"div",className:"resultatRecherche"}, 
	{
		initialize: function(elm){
			this.elm=elm;
			this.viewable=elm.className.match(/resultsBy_[0-9]/)[0].split("_")[1];
			this.btnUp=FW(elm).getElement({nodeName:"a",className:"btnUp"}).el;
			this.btnDw=FW(elm).getElement({nodeName:"a",className:"btnDown"}).el;
			this.table=FW(elm).getElement({nodeName:"table",className:"searchResults"}).el;
			this.ctn=FW(elm).getElement({nodeName:"div",className:"scrollCtn"}).el;
			this.trs=this.table.rows;
			this.size2apply=0;
			for(var i=0,l=this.trs.length;i<l;i++){
				if(this.trs[i].offsetHeight > this.size2apply) this.size2apply=this.trs[i].offsetHeight;
			}
			for(var i=0,l=this.trs.length;i<l;i++){
				var first=this.trs[i].firstChild;
				if(first.nodeType == 3) first=this.trs[i].childNodes[1];
				first.style.height=this.size2apply+"px";
			}
			this._height=this.viewable*this.size2apply;
			this.ctn.style.height=this._height+"px";
			this.ctn.style.overflow="hidden";
			this.maxScroll=this.ctn.scrollHeight-this._height;
			this.btnUp.onclick=function(scope){
				return function(){
					if(!this.className.match(/inactive/)) scope.scroll(-1);
					return false;
				}
			}(this);
			this.btnDw.onclick=function(scope){
				return function(){
					if(!this.className.match(/inactive/)) scope.scroll(1);
					return false;
				}
			}(this);
			this.check();
		},
		scroll: function(sens){
			if(!this.TO){
				this.conf={};
				this.conf.endVal=this.ctn.scrollTop+(this.size2apply*sens);
			}
			else {
				clearInterval(this.TO);
				this.conf.endVal+=(this.size2apply*sens);
			}
			this.conf.startTime=new Date().getTime();
			this.conf.startVal=this.ctn.scrollTop;
			this.conf.step=(this.conf.endVal - this.conf.startVal)/500;
			this.engine();
		},
		engine:function(){
			this.TO=setInterval(
				function(obj){
					return function(){
						var currentTime=new Date().getTime();
						obj.ctn.scrollTop=obj.conf.startVal+(currentTime-obj.conf.startTime)*obj.conf.step;
						if(currentTime>=obj.conf.startTime+500){
							clearInterval(obj.TO);
							obj.TO=null;
							obj.ctn.scrollTop=obj.conf.endVal;
							obj.check();
						}
					}
				}(this)
			,40);			
		},
		check: function(){
			if(this.ctn.scrollTop<this.size2apply){
				this.elm.scrollTop=0;
				this.btnUp.className+=" inactive";
				this.btnDw.className=this.btnDw.className.replace(/inactive/g,"");
			}
			else if(this.maxScroll-this.ctn.scrollTop<this.size2apply){
				this.elm.scrollTop=this.elm.scrollHeight;
				this.btnDw.className+=" inactive";
				this.btnUp.className=this.btnUp.className.replace(/inactive/g,"");
			}
			else {
				this.btnDw.className=this.btnDw.className.replace(/inactive/g,"");
				this.btnUp.className=this.btnUp.className.replace(/inactive/g,"");
			}
		}
		
	}
);
FW.tabs=[];
FW.Module(
	'blockTabs', 
	{nodeName:'div',className:'F6_blockTabs,blockTabSub'},  
	{
		initialize:function(block){
			var self=this;
			this.tabs=FW(block).getElement({nodeName:'ul',className:'F6_tabs'}).getElements('li');
			this.tabsContent=FW(block).getElement({nodeName:'div',className:'body'}).getChildsNodes({nodeName:'div',className:'tabCtn'});
			this.tabs.each(function(tab, index){
				var a=FW(tab).getElement('a',{className:'nochange'});
				if(tab.className.match('F6_current')) self.F6_currentTab=index;
				if(a.el && !FW(tab).hasClass('nochange')){
					tab.onclick=function(){
						self.changeTab(index);
					};
					a.el.onclick=function(){
						tab.onclick();
						return false;
					};
				}
			});
			this.changeTab(self.F6_currentTab);
		},
		changeTab:function(choosenIndex){
			this.tabs.each(function(tab, index){FW(tab).removeClass('F6_current');});
			this.tabsContent.each(function(tab, index){FW(tab).removeClass('tabCurrent');});
			FW(this.tabs[choosenIndex]).addClass('F6_current');
			FW(this.tabsContent[choosenIndex]).addClass('tabCurrent');
		}
	}
);
FW.colResize={
	colsId:['main','rightCol'],
	colsIdInside:[],
	colsClassInside:['','rightColInside'],
	colsInsidesByClass:[],
	timer:40,
	colsContainer:'content',
	elementNeededToRun:'',
	cols:[],
	colsInside:[],
	lastHeights:[],
	init:function(){
		var self=this;
		this.colsContainer=document.getElementById(this.colsContainer); 
		if(!this.colsContainer) return;
		this.colsId.each(function(colId, i){
			var col=colId!=null?document.getElementById(colId):null;
			self.cols.push(col);
			self.colsInsidesByClass.push(self.colsClassInside[i]==''?null:FW(col).getElements({nodeName:'div',className:self.colsClassInside[i]}));
		});
		this.checker();		
		var timer=setInterval(function(){self.checker()},this.timer); 
	},
	checker:function(){
		if(this.resizing) return;
		if(this.cssIsDisabled()) return;
		var colsHeight=this.cols.map(function(col){
			return col?col.offsetHeight:0;
		});
		if(this.lastHeights.join('')!=colsHeight.join('')){
			this.resize();
			this.lastHeights=this.cols.map(function(col){
				return col?col.offsetHeight:0;
			});
		}
	},
	resize:function(){	
		this.resizing=true;
		var self=this;
		this.cols.each(function(col,idx){
			if(col){
				var elm=self.colsInside[idx] || self.colsInsidesByClass[idx] || col;
				elm=elm instanceof Array?elm:[elm];
				elm.each(function(elm){
					elm.style[FW.heightStyle]=0;
				});
			}
		});
		var containerHeight=self.colsContainer.scrollHeight;
		this.cols.each(function(col,idx){
			if(col){
				if(col.offsetHeight!=containerHeight){
					self.resizeBlocks(self.colsInside[idx] || self.colsInsidesByClass[idx] || col, containerHeight-col.offsetHeight);
				}
			}
		});
		this.resizing=false;
	},
	resizeBlocks:function(blocks, sizeToAdd){
		if(blocks.length==0) return;
		if(!(blocks instanceof Array)) blocks=[blocks];
		var size=parseInt(sizeToAdd/blocks.length,10);
		blocks.each(function(elm){
			elm.style[FW.heightStyle]=elm.offsetHeight+size-(FW.ieQuirks?0:FW(elm).getIntStyle('padding-bottom')+FW(elm).getIntStyle('padding-top'))+'px';
		});
		blocks[blocks.length-1].style[FW.heightStyle]=parseInt(blocks[blocks.length-1].style[FW.heightStyle] ,10)+(sizeToAdd%blocks.length)+'px';
	},
	cssIsDisabled:function(){
		if(!this.cssCheckElement){
			this.cssCheckElement=document.createElement('span');
			document.body.appendChild(this.cssCheckElement);
			this.cssCheckElement.id='cssChecker'; 
			var s=this.cssCheckElement.style;
			s.backgroundColor='red';
			s.height=0;
			s.overflow='hidden';
		};
		return this.cssCheckElement.style.backgroundColor!='red'
	}
};
FW(window).addEvent('load',function(){FW.colResize.init();})
FW.Module('scrollH',
	{nodeName:'div',className:'F6_scroll'},
	{
		initialize:function(elm){
			var _self=this;
			this.elm=FW(elm);
			this.speed=500;
			this.infinite=elm.className.match(/infiniteScroll/)?true:false;
			this.viewable=elm.className.match(/viewable_[0-9]*/)?elm.className.match(/viewable_[0-9]*/)[0].split('_')[1]:3;
			this.ul=FW(this.elm.getElements({nodeName:'ul',className:'scrollingContainer'})[0]);
			this.mask=this.elm.getElements({nodeName:'div',className:'F6_scrollMask'})[0];
			this.W=this.mask.offsetWidth;
			this.lis=this.elm.getElements({nodeName:'li',className:'scrollingElms'});
			this.btnL=FW(this.elm.getElements({nodeName:'a',className:'F6_btnLeft'})[0]);
			this.btnR=FW(this.elm.getElements({nodeName:'a',className:'F6_btnRight'})[0]);
			var li=FW(this.lis[0]);
			this.liDelta=li.getHStyle()+li.getIntStyle('margin-right')+li.getIntStyle('margin-left');
			this.liSize=(this.W/this.viewable);
			this.lis.each(function(el){
				el.style.width=_self.liSize-_self.liDelta+"px";
			});
			this.mask.style.width=(this.liSize*this.viewable)+"px";
			this.ul.el.style.width=(Math.round(this.liSize)*this.lis.length)+"px";
			this.mask.scrollLeft=0;
			this.maxScroll=this.mask.scrollWidth-this.mask.offsetWidth;
			this.btnL.addEvent("click",function(obj){
				return function(e){
					FW.event.stop(e);
					obj.dispatch(-1);
					return false;
				}
			}(this));
			this.btnR.addEvent("click",function(obj){
				return function(e){
					FW.event.stop(e);
					obj.dispatch(1);
					return false;
				}
			}(this));
		},
		fixIE: function(){
			if(FW.browser.ie6){
				this.mask.scrollLeft=Math.floor(this.mask.scrollLeft/this.liSize)*this.liSize;
			}
		},
		scroll: function(sens){
			if(!this.TO){
				this.conf={};
				this.conf.endVal=this.mask.scrollLeft+(this.liSize*sens);
			}else {
				clearInterval(this.TO);
				this.conf.endVal+=(this.liSize*sens);
			}
			this.conf.startTime=new Date().getTime();
			this.conf.startVal=this.mask.scrollLeft;
			this.conf.step=(this.conf.endVal-this.conf.startVal)/500;
			this.engine();
		},
		engine:function(){
			this.TO=setInterval(
				function(obj){
					return function(){
						var currentTime=new Date().getTime();
						obj.mask.scrollLeft=obj.conf.startVal+(currentTime-obj.conf.startTime)*obj.conf.step;
						if( currentTime>=obj.conf.startTime+500){
							clearInterval(obj.TO);
							obj.TO=null;
							obj.mask.scrollLeft=obj.conf.endVal;
							obj.check();
							obj.fixIE();
						}
					}
				}(this)
			,40);			
		},
		dispatch: function(sens){
			if(this.mask.scrollLeft==0){
				switch(parseInt(sens)){
					case 1:
						this.scroll(sens);
						break;
					case -1:
						var frag=document.createDocumentFragment();
						frag.appendChild(this.lis[this.lis.length-1]);
						this.ul.el.insertBefore(frag, this.lis[0]);
						this.mask.scrollLeft=this.liSize;
						this.scroll(sens);
						this.lis=this.elm.getElements({nodeName:'li',className:'scrollingElms'});
						break;
				}
			}else if(this.mask.scrollLeft==this.maxScroll || this.maxScroll-this.mask.scrollLeft<this.liSize){
				switch(parseInt(sens)){
					case -1:
						this.scroll(sens);
						break;
					case 1:
						var frag=document.createDocumentFragment();
						frag.appendChild(this.lis[0]);
						this.ul.el.appendChild(frag);
						this.mask.scrollLeft=this.maxScroll-this.liSize;
						this.scroll(sens);
						this.lis=this.elm.getElements({nodeName:'li',className:'scrollingElms'});
						break;
				}
			}else {this.scroll(sens)}
		},
		check:function(){}
	}
);
function detectFlash(){
	if( navigator.mimeTypes.length > 0 ){
		return navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin!=null;
		var a=navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin.description;
		a=a.replace(/[a-zA-Z ]/g, "")
		a=a.split(".")[0]
	}else if(window.ActiveXObject){
		try{new ActiveXObject("ShockwaveFlash.ShockwaveFlash"); return true;}
		catch(oError){return false;}
	}
	else{return false;}
}
FW.$(window).addEvent('load', function(){
	if(FW("layerHomeCtn").el!=null){
		FW("layerHomeCtn").el.style.visibility="visible";		
		FW("layerHomeCtn").el.style.display="none";		
	}
	setTimeout(function(){
		if(FW("layerIframeCtn").el!=null){
			FW("layerIframeCtn").el.style.visibility="visible";		
			FW("layerIframeCtn").el.style.display="none";		
		}		
	},2000)
});
function affichebtn()
	{
		document.getElementById("span_connexion").innerHTML = '<span><input type="submit" onclick="xt_med(\'C\',\'1\',\'bloc_de_login::connexion\',\'N\');afficheloader();" value="connexion"></span>';
	}

function afficheloader()
	{
		document.getElementById("span_connexion").innerHTML = '<span style="padding-left:15px"><center><img src="/img/ajax-loader.gif" alt="veuillez patienter, la connexion au webmail est en cours..." title="veuillez patienter, la connexion au webmail est en cours..." ></center></span>';
		delai();
	}

function delai(){

		setTimeout("affichebtn()",9000);
	}

function affichebtn2()
	{
		document.getElementById("span_connexion").innerHTML = '<span class="F6_btn"><input type="submit" onclick="xt_med(\'C\',\'1\',\'bloc_de_login::connexion\',\'N\');afficheloader();" value="connexion"></span>';
	}

function afficheloader2()
	{
		document.getElementById("span_connexion").innerHTML = '<span style="padding-left:15px"><center><img src="http://www.laposte.net/img/ajax-loader.gif" alt="veuillez patienter, la connexion au webmail est en cours..." title="veuillez patienter, la connexion au webmail est en cours..." ></center></span>';
		delai2();
	}

function delai2(){

		setTimeout("affichebtn2()",9000);
	}
function affichebtn3()
        {
                document.getElementById("span_connexion2").innerHTML = '<span class="F6_btn"><input type="submit" onclick="xt_med(\'C\',\'1\',\'bloc_de_login::connexion\',\'N\');afficheloader();" value="connexion"></span>';
        }

function afficheloader3()
        {
                document.getElementById("span_connexion2").innerHTML = '<span style="padding-left:15px"><center><img src="/img/ajax-loader.gif" alt="veuillez patienter, la connexion au webmail est en cours..." title="veuillez patienter, la connexion au webmail est en cours..." ></center></span>';
                delai3();
        }

function delai3(){

                setTimeout("affichebtn3()",9000);
        }

