var InfosBrowser = {"isApiciusGuy":false,"isRobot":false,"isGoogleBot":false,"isMsnBot":false,"isSlurp":false,"isAmaya":false,"isChrome":false,"isGaleon":false,"isIcab":false,"isIceCat":false,"isIceweasel":false,"isIe":false,"isFirebird":false,"isFirefox":false,"isFirefoxShiretoko":false,"isKonqueror":false,"isLynx":false,"isMozilla":false,"isMsnBrowser":false,"isNetscape":false,"isNetPositive":false,"isOmniWeb":false,"isOpera":false,"isPhoenix":false,"isSafari":false,"isMobile":false,"isAndroid":false,"isBlackBerry":false,"isIphone":false,"isIpod":false,"isNokia":false,"isNokiaS60":false,"isOperaMini":false,"isPalmOs":false,"isPocketInternetExplorer":false,"isWindowsPhone":false,"isTablette":false,"isAndroidTablette":false,"isIpad":false,"isWindowsTablette":false,"isW3cValidator":false,"isWebTv":false,"isPlatformAndroid":false,"isPlatformApple":false,"isPlatformBeos":false,"isPlatformBlackBerry":false,"isPlatformFreeBsd":false,"isPlatformIpad":false,"isPlatformIphone":false,"isPlatformIpod":false,"isPlatformLinux":false,"isPlatformNetBsd":false,"isPlatformNokia":false,"isPlatformOpenBsd":false,"isPlatformOpenSolaris":false,"isPlatformOs2":false,"isPlatformSunOs":false,"isPlatformWindows":false,"isPlatformWindowsCE":false,"browser":"unknown","platform":"unknown","version":"unknown"};
/*
 * jQuery UI Effects 1.8.7
 *
 * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Effects/
 */
jQuery.effects||function(f,j){function n(c){var a;if(c&&c.constructor==Array&&c.length==3)return c;if(a=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(c))return[parseInt(a[1],10),parseInt(a[2],10),parseInt(a[3],10)];if(a=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(c))return[parseFloat(a[1])*2.55,parseFloat(a[2])*2.55,parseFloat(a[3])*2.55];if(a=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(c))return[parseInt(a[1],
16),parseInt(a[2],16),parseInt(a[3],16)];if(a=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(c))return[parseInt(a[1]+a[1],16),parseInt(a[2]+a[2],16),parseInt(a[3]+a[3],16)];if(/rgba\(0, 0, 0, 0\)/.exec(c))return o.transparent;return o[f.trim(c).toLowerCase()]}function s(c,a){var b;do{b=f.curCSS(c,a);if(b!=""&&b!="transparent"||f.nodeName(c,"body"))break;a="backgroundColor"}while(c=c.parentNode);return n(b)}function p(){var c=document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle,
a={},b,d;if(c&&c.length&&c[0]&&c[c[0]])for(var e=c.length;e--;){b=c[e];if(typeof c[b]=="string"){d=b.replace(/\-(\w)/g,function(g,h){return h.toUpperCase()});a[d]=c[b]}}else for(b in c)if(typeof c[b]==="string")a[b]=c[b];return a}function q(c){var a,b;for(a in c){b=c[a];if(b==null||f.isFunction(b)||a in t||/scrollbar/.test(a)||!/color/i.test(a)&&isNaN(parseFloat(b)))delete c[a]}return c}function u(c,a){var b={_:0},d;for(d in a)if(c[d]!=a[d])b[d]=a[d];return b}function k(c,a,b,d){if(typeof c=="object"){d=
a;b=null;a=c;c=a.effect}if(f.isFunction(a)){d=a;b=null;a={}}if(typeof a=="number"||f.fx.speeds[a]){d=b;b=a;a={}}if(f.isFunction(b)){d=b;b=null}a=a||{};b=b||a.duration;b=f.fx.off?0:typeof b=="number"?b:b in f.fx.speeds?f.fx.speeds[b]:f.fx.speeds._default;d=d||a.complete;return[c,a,b,d]}function m(c){if(!c||typeof c==="number"||f.fx.speeds[c])return true;if(typeof c==="string"&&!f.effects[c])return true;return false}f.effects={};f.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor",
"borderTopColor","borderColor","color","outlineColor"],function(c,a){f.fx.step[a]=function(b){if(!b.colorInit){b.start=s(b.elem,a);b.end=n(b.end);b.colorInit=true}b.elem.style[a]="rgb("+Math.max(Math.min(parseInt(b.pos*(b.end[0]-b.start[0])+b.start[0],10),255),0)+","+Math.max(Math.min(parseInt(b.pos*(b.end[1]-b.start[1])+b.start[1],10),255),0)+","+Math.max(Math.min(parseInt(b.pos*(b.end[2]-b.start[2])+b.start[2],10),255),0)+")"}});var o={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,
0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,
211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]},r=["add","remove","toggle"],t={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};f.effects.animateClass=function(c,a,b,
d){if(f.isFunction(b)){d=b;b=null}return this.each(function(){f.queue(this,"fx",function(){var e=f(this),g=e.attr("style")||" ",h=q(p.call(this)),l,v=e.attr("className");f.each(r,function(w,i){c[i]&&e[i+"Class"](c[i])});l=q(p.call(this));e.attr("className",v);e.animate(u(h,l),a,b,function(){f.each(r,function(w,i){c[i]&&e[i+"Class"](c[i])});if(typeof e.attr("style")=="object"){e.attr("style").cssText="";e.attr("style").cssText=g}else e.attr("style",g);d&&d.apply(this,arguments)});h=f.queue(this);l=
h.splice(h.length-1,1)[0];h.splice(1,0,l);f.dequeue(this)})})};f.fn.extend({_addClass:f.fn.addClass,addClass:function(c,a,b,d){return a?f.effects.animateClass.apply(this,[{add:c},a,b,d]):this._addClass(c)},_removeClass:f.fn.removeClass,removeClass:function(c,a,b,d){return a?f.effects.animateClass.apply(this,[{remove:c},a,b,d]):this._removeClass(c)},_toggleClass:f.fn.toggleClass,toggleClass:function(c,a,b,d,e){return typeof a=="boolean"||a===j?b?f.effects.animateClass.apply(this,[a?{add:c}:{remove:c},
b,d,e]):this._toggleClass(c,a):f.effects.animateClass.apply(this,[{toggle:c},a,b,d])},switchClass:function(c,a,b,d,e){return f.effects.animateClass.apply(this,[{add:a,remove:c},b,d,e])}});f.extend(f.effects,{version:"1.8.7",save:function(c,a){for(var b=0;b<a.length;b++)a[b]!==null&&c.data("ec.storage."+a[b],c[0].style[a[b]])},restore:function(c,a){for(var b=0;b<a.length;b++)a[b]!==null&&c.css(a[b],c.data("ec.storage."+a[b]))},setMode:function(c,a){if(a=="toggle")a=c.is(":hidden")?"show":"hide";
return a},getBaseline:function(c,a){var b;switch(c[0]){case "top":b=0;break;case "middle":b=0.5;break;case "bottom":b=1;break;default:b=c[0]/a.height}switch(c[1]){case "left":c=0;break;case "center":c=0.5;break;case "right":c=1;break;default:c=c[1]/a.width}return{x:c,y:b}},createWrapper:function(c){if(c.parent().is(".ui-effects-wrapper"))return c.parent();var a={width:c.outerWidth(true),height:c.outerHeight(true),"float":c.css("float")},b=f("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",
background:"transparent",border:"none",margin:0,padding:0});c.wrap(b);b=c.parent();if(c.css("position")=="static"){b.css({position:"relative"});c.css({position:"relative"})}else{f.extend(a,{position:c.css("position"),zIndex:c.css("z-index")});f.each(["top","left","bottom","right"],function(d,e){a[e]=c.css(e);if(isNaN(parseInt(a[e],10)))a[e]="auto"});c.css({position:"relative",top:0,left:0})}return b.css(a).show()},removeWrapper:function(c){if(c.parent().is(".ui-effects-wrapper"))return c.parent().replaceWith(c);
return c},setTransition:function(c,a,b,d){d=d||{};f.each(a,function(e,g){unit=c.cssUnit(g);if(unit[0]>0)d[g]=unit[0]*b+unit[1]});return d}});f.fn.extend({effect:function(c){var a=k.apply(this,arguments),b={options:a[1],duration:a[2],callback:a[3]};a=b.options.mode;var d=f.effects[c];if(f.fx.off||!d)return a?this[a](b.duration,b.callback):this.each(function(){b.callback&&b.callback.call(this)});return d.call(this,b)},_show:f.fn.show,show:function(c){if(m(c))return this._show.apply(this,arguments);
else{var a=k.apply(this,arguments);a[1].mode="show";return this.effect.apply(this,a)}},_hide:f.fn.hide,hide:function(c){if(m(c))return this._hide.apply(this,arguments);else{var a=k.apply(this,arguments);a[1].mode="hide";return this.effect.apply(this,a)}},__toggle:f.fn.toggle,toggle:function(c){if(m(c)||typeof c==="boolean"||f.isFunction(c))return this.__toggle.apply(this,arguments);else{var a=k.apply(this,arguments);a[1].mode="toggle";return this.effect.apply(this,a)}},cssUnit:function(c){var a=this.css(c),
b=[];f.each(["em","px","%","pt"],function(d,e){if(a.indexOf(e)>0)b=[parseFloat(a),e]});return b}});f.easing.jswing=f.easing.swing;f.extend(f.easing,{def:"easeOutQuad",swing:function(c,a,b,d,e){return f.easing[f.easing.def](c,a,b,d,e)},easeInQuad:function(c,a,b,d,e){return d*(a/=e)*a+b},easeOutQuad:function(c,a,b,d,e){return-d*(a/=e)*(a-2)+b},easeInOutQuad:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a+b;return-d/2*(--a*(a-2)-1)+b},easeInCubic:function(c,a,b,d,e){return d*(a/=e)*a*a+b},easeOutCubic:function(c,
a,b,d,e){return d*((a=a/e-1)*a*a+1)+b},easeInOutCubic:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a+b;return d/2*((a-=2)*a*a+2)+b},easeInQuart:function(c,a,b,d,e){return d*(a/=e)*a*a*a+b},easeOutQuart:function(c,a,b,d,e){return-d*((a=a/e-1)*a*a*a-1)+b},easeInOutQuart:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a*a+b;return-d/2*((a-=2)*a*a*a-2)+b},easeInQuint:function(c,a,b,d,e){return d*(a/=e)*a*a*a*a+b},easeOutQuint:function(c,a,b,d,e){return d*((a=a/e-1)*a*a*a*a+1)+b},easeInOutQuint:function(c,
a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a*a*a+b;return d/2*((a-=2)*a*a*a*a+2)+b},easeInSine:function(c,a,b,d,e){return-d*Math.cos(a/e*(Math.PI/2))+d+b},easeOutSine:function(c,a,b,d,e){return d*Math.sin(a/e*(Math.PI/2))+b},easeInOutSine:function(c,a,b,d,e){return-d/2*(Math.cos(Math.PI*a/e)-1)+b},easeInExpo:function(c,a,b,d,e){return a==0?b:d*Math.pow(2,10*(a/e-1))+b},easeOutExpo:function(c,a,b,d,e){return a==e?b+d:d*(-Math.pow(2,-10*a/e)+1)+b},easeInOutExpo:function(c,a,b,d,e){if(a==0)return b;if(a==
e)return b+d;if((a/=e/2)<1)return d/2*Math.pow(2,10*(a-1))+b;return d/2*(-Math.pow(2,-10*--a)+2)+b},easeInCirc:function(c,a,b,d,e){return-d*(Math.sqrt(1-(a/=e)*a)-1)+b},easeOutCirc:function(c,a,b,d,e){return d*Math.sqrt(1-(a=a/e-1)*a)+b},easeInOutCirc:function(c,a,b,d,e){if((a/=e/2)<1)return-d/2*(Math.sqrt(1-a*a)-1)+b;return d/2*(Math.sqrt(1-(a-=2)*a)+1)+b},easeInElastic:function(c,a,b,d,e){c=1.70158;var g=0,h=d;if(a==0)return b;if((a/=e)==1)return b+d;g||(g=e*0.3);if(h<Math.abs(d)){h=d;c=g/4}else c=
g/(2*Math.PI)*Math.asin(d/h);return-(h*Math.pow(2,10*(a-=1))*Math.sin((a*e-c)*2*Math.PI/g))+b},easeOutElastic:function(c,a,b,d,e){c=1.70158;var g=0,h=d;if(a==0)return b;if((a/=e)==1)return b+d;g||(g=e*0.3);if(h<Math.abs(d)){h=d;c=g/4}else c=g/(2*Math.PI)*Math.asin(d/h);return h*Math.pow(2,-10*a)*Math.sin((a*e-c)*2*Math.PI/g)+d+b},easeInOutElastic:function(c,a,b,d,e){c=1.70158;var g=0,h=d;if(a==0)return b;if((a/=e/2)==2)return b+d;g||(g=e*0.3*1.5);if(h<Math.abs(d)){h=d;c=g/4}else c=g/(2*Math.PI)*Math.asin(d/
h);if(a<1)return-0.5*h*Math.pow(2,10*(a-=1))*Math.sin((a*e-c)*2*Math.PI/g)+b;return h*Math.pow(2,-10*(a-=1))*Math.sin((a*e-c)*2*Math.PI/g)*0.5+d+b},easeInBack:function(c,a,b,d,e,g){if(g==j)g=1.70158;return d*(a/=e)*a*((g+1)*a-g)+b},easeOutBack:function(c,a,b,d,e,g){if(g==j)g=1.70158;return d*((a=a/e-1)*a*((g+1)*a+g)+1)+b},easeInOutBack:function(c,a,b,d,e,g){if(g==j)g=1.70158;if((a/=e/2)<1)return d/2*a*a*(((g*=1.525)+1)*a-g)+b;return d/2*((a-=2)*a*(((g*=1.525)+1)*a+g)+2)+b},easeInBounce:function(c,
a,b,d,e){return d-f.easing.easeOutBounce(c,e-a,0,d,e)+b},easeOutBounce:function(c,a,b,d,e){return(a/=e)<1/2.75?d*7.5625*a*a+b:a<2/2.75?d*(7.5625*(a-=1.5/2.75)*a+0.75)+b:a<2.5/2.75?d*(7.5625*(a-=2.25/2.75)*a+0.9375)+b:d*(7.5625*(a-=2.625/2.75)*a+0.984375)+b},easeInOutBounce:function(c,a,b,d,e){if(a<e/2)return f.easing.easeInBounce(c,a*2,0,d,e)*0.5+b;return f.easing.easeOutBounce(c,a*2-e,0,d,e)*0.5+d*0.5+b}})}(jQuery);

/*
 * jQuery UI Effects Drop 1.8.7
 *
 * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Effects/Drop
 *
 * Depends:
 *	jquery.effects.core.js
 */
(function(c){c.effects.drop=function(d){return this.queue(function(){var a=c(this),h=["position","top","left","opacity"],e=c.effects.setMode(a,d.options.mode||"hide"),b=d.options.direction||"left";c.effects.save(a,h);a.show();c.effects.createWrapper(a);var f=b=="up"||b=="down"?"top":"left";b=b=="up"||b=="left"?"pos":"neg";var g=d.options.distance||(f=="top"?a.outerHeight({margin:true})/2:a.outerWidth({margin:true})/2);if(e=="show")a.css("opacity",0).css(f,b=="pos"?-g:g);var i={opacity:e=="show"?1:
0};i[f]=(e=="show"?b=="pos"?"+=":"-=":b=="pos"?"-=":"+=")+g;a.animate(i,{queue:false,duration:d.duration,easing:d.options.easing,complete:function(){e=="hide"&&a.hide();c.effects.restore(a,h);c.effects.removeWrapper(a);d.callback&&d.callback.apply(this,arguments);a.dequeue()}})})}})(jQuery);

/*
 * jQuery UI Effects Clip 1.8.7
 *
 * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Effects/Clip
 *
 * Depends:
 *	jquery.effects.core.js
 */
(function(b){b.effects.clip=function(e){return this.queue(function(){var a=b(this),i=["position","top","left","height","width"],f=b.effects.setMode(a,e.options.mode||"hide"),c=e.options.direction||"vertical";b.effects.save(a,i);a.show();var d=b.effects.createWrapper(a).css({overflow:"hidden"});d=a[0].tagName=="IMG"?d:a;var g={size:c=="vertical"?"height":"width",position:c=="vertical"?"top":"left"};c=c=="vertical"?d.height():d.width();if(f=="show"){d.css(g.size,0);d.css(g.position,c/2)}var h={};h[g.size]=
f=="show"?c:0;h[g.position]=f=="show"?0:c/2;d.animate(h,{queue:false,duration:e.duration,easing:e.options.easing,complete:function(){f=="hide"&&a.hide();b.effects.restore(a,i);b.effects.removeWrapper(a);e.callback&&e.callback.apply(a[0],arguments);a.dequeue()}})})}})(jQuery);

/*
 * FancyBox - jQuery Plugin
 * Simple and fancy lightbox alternative
 *
 * Examples and documentation at: http://fancybox.net
 *
 * Copyright (c) 2008 - 2010 Janis Skarnelis
 * That said, it is hardly a one-person project. Many people have submitted bugs, code, and offered their advice freely. Their support is greatly appreciated.
 *
 * Version: 1.3.4 (11/11/2010)
 * Requires: jQuery v1.3+
 *
 * Dual licensed under the MIT and GPL licenses:
 *   http://www.opensource.org/licenses/mit-license.php
 *   http://www.gnu.org/licenses/gpl.html
 */

;(function($) {
	var tmp, loading, overlay, wrap, outer, content, close, title, nav_left, nav_right,

		selectedIndex = 0, selectedOpts = {}, selectedArray = [], currentIndex = 0, currentOpts = {}, currentArray = [],

		ajaxLoader = null, imgPreloader = new Image(), imgRegExp = /\.(jpg|gif|png|bmp|jpeg)(.*)?$/i, swfRegExp = /[^\.]\.(swf)\s*$/i,

		loadingTimer, loadingFrame = 1,

		titleHeight = 0, titleStr = '', start_pos, final_pos, busy = false, fx = $.extend($('<div/>')[0], { prop: 0 }),

		isIE6 = $.browser.msie && $.browser.version < 7 && !window.XMLHttpRequest,

		/*
		 * Private methods
		 */

		_abort = function() {
			loading.hide();

			imgPreloader.onerror = imgPreloader.onload = null;

			if (ajaxLoader) {
				ajaxLoader.abort();
			}

			tmp.empty();
		},

		_error = function() {
			if (false === selectedOpts.onError(selectedArray, selectedIndex, selectedOpts)) {
				loading.hide();
				busy = false;
				return;
			}

			selectedOpts.titleShow = false;

			selectedOpts.width = 'auto';
			selectedOpts.height = 'auto';

			tmp.html( '<p id="fancybox-error">The requested content cannot be loaded.<br />Please try again later.</p>' );

			_process_inline();
		},

		_start = function() {
			var obj = selectedArray[ selectedIndex ],
				href,
				type,
				title,
				str,
				emb,
				ret;

			_abort();

			selectedOpts = $.extend({}, $.fn.fancybox.defaults, (typeof $(obj).data('fancybox') == 'undefined' ? selectedOpts : $(obj).data('fancybox')));

			ret = selectedOpts.onStart(selectedArray, selectedIndex, selectedOpts);

			if (ret === false) {
				busy = false;
				return;
			} else if (typeof ret == 'object') {
				selectedOpts = $.extend(selectedOpts, ret);
			}

			title = selectedOpts.title || (obj.nodeName ? $(obj).attr('title') : obj.title) || '';

			if (obj.nodeName && !selectedOpts.orig) {
				selectedOpts.orig = $(obj).children("img:first").length ? $(obj).children("img:first") : $(obj);
			}

			if (title === '' && selectedOpts.orig && selectedOpts.titleFromAlt) {
				title = selectedOpts.orig.attr('alt');
			}

			href = selectedOpts.href || (obj.nodeName ? $(obj).attr('href') : obj.href) || null;

			if ((/^(?:javascript)/i).test(href) || href == '#') {
				href = null;
			}

			if (selectedOpts.type) {
				type = selectedOpts.type;

				if (!href) {
					href = selectedOpts.content;
				}

			} else if (selectedOpts.content) {
				type = 'html';

			} else if (href) {
				if (href.match(imgRegExp)) {
					type = 'image';

				} else if (href.match(swfRegExp)) {
					type = 'swf';

				} else if ($(obj).hasClass("iframe")) {
					type = 'iframe';

				} else if (href.indexOf("#") === 0) {
					type = 'inline';

				} else {
					type = 'ajax';
				}
			}

			if (!type) {
				_error();
				return;
			}

			if (type == 'inline') {
				obj	= href.substr(href.indexOf("#"));
				type = $(obj).length > 0 ? 'inline' : 'ajax';
			}

			selectedOpts.type = type;
			selectedOpts.href = href;
			selectedOpts.title = title;

			if (selectedOpts.autoDimensions) {
				if (selectedOpts.type == 'html' || selectedOpts.type == 'inline' || selectedOpts.type == 'ajax') {
					selectedOpts.width = 'auto';
					selectedOpts.height = 'auto';
				} else {
					selectedOpts.autoDimensions = false;
				}
			}

			if (selectedOpts.modal) {
				selectedOpts.overlayShow = true;
				selectedOpts.hideOnOverlayClick = false;
				selectedOpts.hideOnContentClick = false;
				selectedOpts.enableEscapeButton = false;
				selectedOpts.showCloseButton = false;
			}

			selectedOpts.padding = parseInt(selectedOpts.padding, 10);
			selectedOpts.margin = parseInt(selectedOpts.margin, 10);

			tmp.css('padding', (selectedOpts.padding + selectedOpts.margin));

			$('.fancybox-inline-tmp').unbind('fancybox-cancel').bind('fancybox-change', function() {
				$(this).replaceWith(content.children());
			});

			switch (type) {
				case 'html' :
					tmp.html( selectedOpts.content );
					_process_inline();
				break;

				case 'inline' :
					if ( $(obj).parent().is('#fancybox-content') === true) {
						busy = false;
						return;
					}

					$('<div class="fancybox-inline-tmp" />')
						.hide()
						.insertBefore( $(obj) )
						.bind('fancybox-cleanup', function() {
							$(this).replaceWith(content.children());
						}).bind('fancybox-cancel', function() {
							$(this).replaceWith(tmp.children());
						});

					$(obj).appendTo(tmp);

					_process_inline();
				break;

				case 'image':
					busy = false;

					$.fancybox.showActivity();

					imgPreloader = new Image();

					imgPreloader.onerror = function() {
						_error();
					};

					imgPreloader.onload = function() {
						busy = true;

						imgPreloader.onerror = imgPreloader.onload = null;

						_process_image();
					};

					imgPreloader.src = href;
				break;

				case 'swf':
					selectedOpts.scrolling = 'no';

					str = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="' + selectedOpts.width + '" height="' + selectedOpts.height + '"><param name="movie" value="' + href + '"></param>';
					emb = '';

					$.each(selectedOpts.swf, function(name, val) {
						str += '<param name="' + name + '" value="' + val + '"></param>';
						emb += ' ' + name + '="' + val + '"';
					});

					str += '<embed src="' + href + '" type="application/x-shockwave-flash" width="' + selectedOpts.width + '" height="' + selectedOpts.height + '"' + emb + '></embed></object>';

					tmp.html(str);

					_process_inline();
				break;

				case 'ajax':
					busy = false;

					$.fancybox.showActivity();

					selectedOpts.ajax.win = selectedOpts.ajax.success;

					ajaxLoader = $.ajax($.extend({}, selectedOpts.ajax, {
						url	: href,
						data : selectedOpts.ajax.data || {},
						error : function(XMLHttpRequest, textStatus, errorThrown) {
							if ( XMLHttpRequest.status > 0 ) {
								_error();
							}
						},
						success : function(data, textStatus, XMLHttpRequest) {
							var o = typeof XMLHttpRequest == 'object' ? XMLHttpRequest : ajaxLoader;
							if (o.status == 200) {
								if ( typeof selectedOpts.ajax.win == 'function' ) {
									ret = selectedOpts.ajax.win(href, data, textStatus, XMLHttpRequest);

									if (ret === false) {
										loading.hide();
										return;
									} else if (typeof ret == 'string' || typeof ret == 'object') {
										data = ret;
									}
								}

								tmp.html( data );
								_process_inline();
							}
						}
					}));

				break;

				case 'iframe':
					_show();
				break;
			}
		},

		_process_inline = function() {
			var
				w = selectedOpts.width,
				h = selectedOpts.height;

			if (w.toString().indexOf('%') > -1) {
				w = parseInt( ($(window).width() - (selectedOpts.margin * 2)) * parseFloat(w) / 100, 10) + 'px';

			} else {
				w = w == 'auto' ? 'auto' : w + 'px';
			}

			if (h.toString().indexOf('%') > -1) {
				h = parseInt( ($(window).height() - (selectedOpts.margin * 2)) * parseFloat(h) / 100, 10) + 'px';

			} else {
				h = h == 'auto' ? 'auto' : h + 'px';
			}

			tmp.wrapInner('<div style="width:' + w + ';height:' + h + ';overflow: ' + (selectedOpts.scrolling == 'auto' ? 'auto' : (selectedOpts.scrolling == 'yes' ? 'scroll' : 'hidden')) + ';position:relative;"></div>');

			selectedOpts.width = tmp.width();
			selectedOpts.height = tmp.height();

			_show();
		},

		_process_image = function() {
			selectedOpts.width = imgPreloader.width;
			selectedOpts.height = imgPreloader.height;

			$("<img />").attr({
				'id' : 'fancybox-img',
				'src' : imgPreloader.src,
				'alt' : selectedOpts.title
			}).appendTo( tmp );

			_show();
		},

		_show = function() {
			var pos, equal;

			loading.hide();

			if (wrap.is(":visible") && false === currentOpts.onCleanup(currentArray, currentIndex, currentOpts)) {
				$.event.trigger('fancybox-cancel');

				busy = false;
				return;
			}

			busy = true;

			$(content.add( overlay )).unbind();

			$(window).unbind("resize.fb scroll.fb");
			$(document).unbind('keydown.fb');

			if (wrap.is(":visible") && currentOpts.titlePosition !== 'outside') {
				wrap.css('height', wrap.height());
			}

			currentArray = selectedArray;
			currentIndex = selectedIndex;
			currentOpts = selectedOpts;

			if (currentOpts.overlayShow) {
				overlay.css({
					'background-color' : currentOpts.overlayColor,
					'opacity' : currentOpts.overlayOpacity,
					'cursor' : currentOpts.hideOnOverlayClick ? 'pointer' : 'auto',
					'height' : $(document).height()
				});

				if (!overlay.is(':visible')) {
					if (isIE6) {
						$('select:not(#fancybox-tmp select)').filter(function() {
							return this.style.visibility !== 'hidden';
						}).css({'visibility' : 'hidden'}).one('fancybox-cleanup', function() {
							this.style.visibility = 'inherit';
						});
					}

					overlay.show();
				}
			} else {
				overlay.hide();
			}

			final_pos = _get_zoom_to();

			_process_title();

			if (wrap.is(":visible")) {
				$( close.add( nav_left ).add( nav_right ) ).hide();

				pos = wrap.position(),

				start_pos = {
					top	 : pos.top,
					left : pos.left,
					width : wrap.width(),
					height : wrap.height()
				};

				equal = (start_pos.width == final_pos.width && start_pos.height == final_pos.height);

				content.fadeTo(currentOpts.changeFade, 0.3, function() {
					var finish_resizing = function() {
						content.html( tmp.contents() ).fadeTo(currentOpts.changeFade, 1, _finish);
					};

					$.event.trigger('fancybox-change');

					content
						.empty()
						.removeAttr('filter')
						.css({
							'border-width' : currentOpts.padding,
							'width'	: final_pos.width - currentOpts.padding * 2,
							'height' : selectedOpts.autoDimensions ? 'auto' : final_pos.height - titleHeight - currentOpts.padding * 2
						});

					if (equal) {
						finish_resizing();

					} else {
						fx.prop = 0;

						$(fx).animate({prop: 1}, {
							 duration : currentOpts.changeSpeed,
							 easing : currentOpts.easingChange,
							 step : _draw,
							 complete : finish_resizing
						});
					}
				});

				return;
			}

			wrap.removeAttr("style");

			content.css('border-width', currentOpts.padding);

			if (currentOpts.transitionIn == 'elastic') {
				start_pos = _get_zoom_from();

				content.html( tmp.contents() );

				wrap.show();

				if (currentOpts.opacity) {
					final_pos.opacity = 0;
				}

				fx.prop = 0;

				$(fx).animate({prop: 1}, {
					 duration : currentOpts.speedIn,
					 easing : currentOpts.easingIn,
					 step : _draw,
					 complete : _finish
				});

				return;
			}

			if (currentOpts.titlePosition == 'inside' && titleHeight > 0) {
				title.show();
			}

			content
				.css({
					'width' : final_pos.width - currentOpts.padding * 2,
					'height' : selectedOpts.autoDimensions ? 'auto' : final_pos.height - titleHeight - currentOpts.padding * 2
				})
				.html( tmp.contents() );

			wrap
				.css(final_pos)
				.fadeIn( currentOpts.transitionIn == 'none' ? 0 : currentOpts.speedIn, _finish );
		},

		_format_title = function(title) {
			if (title && title.length) {
				if (currentOpts.titlePosition == 'float') {
					return '<table id="fancybox-title-float-wrap" cellpadding="0" cellspacing="0"><tr><td id="fancybox-title-float-left"></td><td id="fancybox-title-float-main">' + title + '</td><td id="fancybox-title-float-right"></td></tr></table>';
				}

				return '<div id="fancybox-title-' + currentOpts.titlePosition + '">' + title + '</div>';
			}

			return false;
		},

		_process_title = function() {
			titleStr = currentOpts.title || '';
			titleHeight = 0;

			title
				.empty()
				.removeAttr('style')
				.removeClass();

			if (currentOpts.titleShow === false) {
				title.hide();
				return;
			}

			titleStr = $.isFunction(currentOpts.titleFormat) ? currentOpts.titleFormat(titleStr, currentArray, currentIndex, currentOpts) : _format_title(titleStr);

			if (!titleStr || titleStr === '') {
				title.hide();
				return;
			}

			title
				.addClass('fancybox-title-' + currentOpts.titlePosition)
				.html( titleStr )
				.appendTo( 'body' )
				.show();

			switch (currentOpts.titlePosition) {
				case 'inside':
					title
						.css({
							'width' : final_pos.width - (currentOpts.padding * 2),
							'marginLeft' : currentOpts.padding,
							'marginRight' : currentOpts.padding
						});

					titleHeight = title.outerHeight(true);

					title.appendTo( outer );

					final_pos.height += titleHeight;
				break;

				case 'over':
					title
						.css({
							'marginLeft' : currentOpts.padding,
							'width'	: final_pos.width - (currentOpts.padding * 2),
							'bottom' : currentOpts.padding
						})
						.appendTo( outer );
				break;

				case 'float':
					title
						.css('left', parseInt((title.width() - final_pos.width - 40)/ 2, 10) * -1)
						.appendTo( wrap );
				break;

				default:
					title
						.css({
							'width' : final_pos.width - (currentOpts.padding * 2),
							'paddingLeft' : currentOpts.padding,
							'paddingRight' : currentOpts.padding
						})
						.appendTo( wrap );
				break;
			}

			title.hide();
		},

		_set_navigation = function() {
			if (currentOpts.enableEscapeButton || currentOpts.enableKeyboardNav) {
				$(document).bind('keydown.fb', function(e) {
					if (e.keyCode == 27 && currentOpts.enableEscapeButton) {
						e.preventDefault();
						$.fancybox.close();

					} else if ((e.keyCode == 37 || e.keyCode == 39) && currentOpts.enableKeyboardNav && e.target.tagName !== 'INPUT' && e.target.tagName !== 'TEXTAREA' && e.target.tagName !== 'SELECT') {
						e.preventDefault();
						$.fancybox[ e.keyCode == 37 ? 'prev' : 'next']();
					}
				});
			}

			if (!currentOpts.showNavArrows) {
				nav_left.hide();
				nav_right.hide();
				return;
			}

			if ((currentOpts.cyclic && currentArray.length > 1) || currentIndex !== 0) {
				nav_left.show();
			}

			if ((currentOpts.cyclic && currentArray.length > 1) || currentIndex != (currentArray.length -1)) {
				nav_right.show();
			}
		},

		_finish = function () {
			if (!$.support.opacity) {
				content.get(0).style.removeAttribute('filter');
				wrap.get(0).style.removeAttribute('filter');
			}

			if (selectedOpts.autoDimensions) {
				content.css('height', 'auto');
			}

			wrap.css('height', 'auto');

			if (titleStr && titleStr.length) {
				title.show();
			}

			if (currentOpts.showCloseButton) {
				close.show();
			}

			_set_navigation();

			if (currentOpts.hideOnContentClick)	{
				content.bind('click', $.fancybox.close);
			}

			if (currentOpts.hideOnOverlayClick)	{
				overlay.bind('click', $.fancybox.close);
			}

			$(window).bind("resize.fb", $.fancybox.resize);

			if (currentOpts.centerOnScroll) {
				$(window).bind("scroll.fb", $.fancybox.center);
			}

			if (currentOpts.type == 'iframe') {
				$('<iframe id="fancybox-frame" name="fancybox-frame' + new Date().getTime() + '" frameborder="0" hspace="0" ' + ($.browser.msie ? 'allowtransparency="true""' : '') + ' scrolling="' + selectedOpts.scrolling + '" src="' + currentOpts.href + '"></iframe>').appendTo(content);
			}

			wrap.show();

			busy = false;

			$.fancybox.center();

			currentOpts.onComplete(currentArray, currentIndex, currentOpts);

			_preload_images();
		},

		_preload_images = function() {
			var href,
				objNext;

			if ((currentArray.length -1) > currentIndex) {
				href = currentArray[ currentIndex + 1 ].href;

				if (typeof href !== 'undefined' && href.match(imgRegExp)) {
					objNext = new Image();
					objNext.src = href;
				}
			}

			if (currentIndex > 0) {
				href = currentArray[ currentIndex - 1 ].href;

				if (typeof href !== 'undefined' && href.match(imgRegExp)) {
					objNext = new Image();
					objNext.src = href;
				}
			}
		},

		_draw = function(pos) {
			var dim = {
				width : parseInt(start_pos.width + (final_pos.width - start_pos.width) * pos, 10),
				height : parseInt(start_pos.height + (final_pos.height - start_pos.height) * pos, 10),

				top : parseInt(start_pos.top + (final_pos.top - start_pos.top) * pos, 10),
				left : parseInt(start_pos.left + (final_pos.left - start_pos.left) * pos, 10)
			};

			if (typeof final_pos.opacity !== 'undefined') {
				dim.opacity = pos < 0.5 ? 0.5 : pos;
			}

			wrap.css(dim);

			content.css({
				'width' : dim.width - currentOpts.padding * 2,
				'height' : dim.height - (titleHeight * pos) - currentOpts.padding * 2
			});
		},

		_get_viewport = function() {
			return [
				$(window).width() - (currentOpts.margin * 2),
				$(window).height() - (currentOpts.margin * 2),
				$(document).scrollLeft() + currentOpts.margin,
				$(document).scrollTop() + currentOpts.margin
			];
		},

		_get_zoom_to = function () {
			var view = _get_viewport(),
				to = {},
				resize = currentOpts.autoScale,
				double_padding = currentOpts.padding * 2,
				ratio;

			if (currentOpts.width.toString().indexOf('%') > -1) {
				to.width = parseInt((view[0] * parseFloat(currentOpts.width)) / 100, 10);
			} else {
				to.width = currentOpts.width + double_padding;
			}

			if (currentOpts.height.toString().indexOf('%') > -1) {
				to.height = parseInt((view[1] * parseFloat(currentOpts.height)) / 100, 10);
			} else {
				to.height = currentOpts.height + double_padding;
			}

			if (resize && (to.width > view[0] || to.height > view[1])) {
				if (selectedOpts.type == 'image' || selectedOpts.type == 'swf') {
					ratio = (currentOpts.width ) / (currentOpts.height );

					if ((to.width ) > view[0]) {
						to.width = view[0];
						to.height = parseInt(((to.width - double_padding) / ratio) + double_padding, 10);
					}

					if ((to.height) > view[1]) {
						to.height = view[1];
						to.width = parseInt(((to.height - double_padding) * ratio) + double_padding, 10);
					}

				} else {
					to.width = Math.min(to.width, view[0]);
					to.height = Math.min(to.height, view[1]);
				}
			}

			to.top = parseInt(Math.max(view[3] - 20, view[3] + ((view[1] - to.height - 40) * 0.5)), 10);
			to.left = parseInt(Math.max(view[2] - 20, view[2] + ((view[0] - to.width - 40) * 0.5)), 10);

			return to;
		},

		_get_obj_pos = function(obj) {
			var pos = obj.offset();

			pos.top += parseInt( obj.css('paddingTop'), 10 ) || 0;
			pos.left += parseInt( obj.css('paddingLeft'), 10 ) || 0;

			pos.top += parseInt( obj.css('border-top-width'), 10 ) || 0;
			pos.left += parseInt( obj.css('border-left-width'), 10 ) || 0;

			pos.width = obj.width();
			pos.height = obj.height();

			return pos;
		},

		_get_zoom_from = function() {
			var orig = selectedOpts.orig ? $(selectedOpts.orig) : false,
				from = {},
				pos,
				view;

			if (orig && orig.length) {
				pos = _get_obj_pos(orig);

				from = {
					width : pos.width + (currentOpts.padding * 2),
					height : pos.height + (currentOpts.padding * 2),
					top	: pos.top - currentOpts.padding - 20,
					left : pos.left - currentOpts.padding - 20
				};

			} else {
				view = _get_viewport();

				from = {
					width : currentOpts.padding * 2,
					height : currentOpts.padding * 2,
					top	: parseInt(view[3] + view[1] * 0.5, 10),
					left : parseInt(view[2] + view[0] * 0.5, 10)
				};
			}

			return from;
		},

		_animate_loading = function() {
			if (!loading.is(':visible')){
				clearInterval(loadingTimer);
				return;
			}

			$('div', loading).css('top', (loadingFrame * -40) + 'px');

			loadingFrame = (loadingFrame + 1) % 12;
		};

	/*
	 * Public methods
	 */

	$.fn.fancybox = function(options) {
		if (!$(this).length) {
			return this;
		}

		$(this)
			.data('fancybox', $.extend({}, options, ($.metadata ? $(this).metadata() : {})))
			.unbind('click.fb')
			.bind('click.fb', function(e) {
				e.preventDefault();

				if (busy) {
					return;
				}

				busy = true;

				$(this).blur();

				selectedArray = [];
				selectedIndex = 0;

				var rel = $(this).attr('rel') || '';

				if (!rel || rel == '' || rel === 'nofollow') {
					selectedArray.push(this);

				} else {
					selectedArray = $("a[rel=" + rel + "], area[rel=" + rel + "]");
					selectedIndex = selectedArray.index( this );
				}

				_start();

				return;
			});

		return this;
	};

	$.fancybox = function(obj) {
		var opts;

		if (busy) {
			return;
		}

		busy = true;
		opts = typeof arguments[1] !== 'undefined' ? arguments[1] : {};

		selectedArray = [];
		selectedIndex = parseInt(opts.index, 10) || 0;

		if ($.isArray(obj)) {
			for (var i = 0, j = obj.length; i < j; i++) {
				if (typeof obj[i] == 'object') {
					$(obj[i]).data('fancybox', $.extend({}, opts, obj[i]));
				} else {
					obj[i] = $({}).data('fancybox', $.extend({content : obj[i]}, opts));
				}
			}

			selectedArray = jQuery.merge(selectedArray, obj);

		} else {
			if (typeof obj == 'object') {
				$(obj).data('fancybox', $.extend({}, opts, obj));
			} else {
				obj = $({}).data('fancybox', $.extend({content : obj}, opts));
			}

			selectedArray.push(obj);
		}

		if (selectedIndex > selectedArray.length || selectedIndex < 0) {
			selectedIndex = 0;
		}

		_start();
	};

	$.fancybox.showActivity = function() {
		clearInterval(loadingTimer);

		loading.show();
		loadingTimer = setInterval(_animate_loading, 66);
	};

	$.fancybox.hideActivity = function() {
		loading.hide();
	};

	$.fancybox.next = function() {
		return $.fancybox.pos( currentIndex + 1);
	};

	$.fancybox.prev = function() {
		return $.fancybox.pos( currentIndex - 1);
	};

	$.fancybox.pos = function(pos) {
		if (busy) {
			return;
		}

		pos = parseInt(pos);

		selectedArray = currentArray;

		if (pos > -1 && pos < currentArray.length) {
			selectedIndex = pos;
			_start();
		} else if (currentOpts.cyclic && currentArray.length > 1) {
			selectedIndex = pos >= currentArray.length ? 0 : currentArray.length - 1;
			_start();
		}

		return;
	};

	$.fancybox.cancel = function() {
		if (busy) {
			return;
		}

		busy = true;

		$.event.trigger('fancybox-cancel');

		_abort();

		selectedOpts.onCancel(selectedArray, selectedIndex, selectedOpts);

		busy = false;
	};

	// Note: within an iframe use - parent.$.fancybox.close();
	$.fancybox.close = function() {
		if (busy || wrap.is(':hidden')) {
			return;
		}

		busy = true;

		if (currentOpts && false === currentOpts.onCleanup(currentArray, currentIndex, currentOpts)) {
			busy = false;
			return;
		}

		_abort();

		$(close.add( nav_left ).add( nav_right )).hide();

		$(content.add( overlay )).unbind();

		$(window).unbind("resize.fb scroll.fb");
		$(document).unbind('keydown.fb');

		content.find('iframe').attr('src', isIE6 && /^https/i.test(window.location.href || '') ? 'javascript:void(false)' : 'about:blank');

		if (currentOpts.titlePosition !== 'inside') {
			title.empty();
		}

		wrap.stop();

		function _cleanup() {
			overlay.fadeOut('fast');

			title.empty().hide();
			wrap.hide();

			$.event.trigger('fancybox-cleanup');

			content.empty();

			currentOpts.onClosed(currentArray, currentIndex, currentOpts);

			currentArray = selectedOpts	= [];
			currentIndex = selectedIndex = 0;
			currentOpts = selectedOpts	= {};

			busy = false;
		}

		if (currentOpts.transitionOut == 'elastic') {
			start_pos = _get_zoom_from();

			var pos = wrap.position();

			final_pos = {
				top	 : pos.top ,
				left : pos.left,
				width :	wrap.width(),
				height : wrap.height()
			};

			if (currentOpts.opacity) {
				final_pos.opacity = 1;
			}

			title.empty().hide();

			fx.prop = 1;

			$(fx).animate({ prop: 0 }, {
				 duration : currentOpts.speedOut,
				 easing : currentOpts.easingOut,
				 step : _draw,
				 complete : _cleanup
			});

		} else {
			wrap.fadeOut( currentOpts.transitionOut == 'none' ? 0 : currentOpts.speedOut, _cleanup);
		}
	};

	$.fancybox.resize = function() {
		if (overlay.is(':visible')) {
			overlay.css('height', $(document).height());
		}

		$.fancybox.center(true);
	};

	$.fancybox.center = function() {
		var view, align;

		if (busy) {
			return;
		}

		align = arguments[0] === true ? 1 : 0;
		view = _get_viewport();

		if (!align && (wrap.width() > view[0] || wrap.height() > view[1])) {
			return;
		}

		wrap
			.stop()
			.animate({
				'top' : parseInt(Math.max(view[3] - 20, view[3] + ((view[1] - content.height() - 40) * 0.5) - currentOpts.padding)),
				'left' : parseInt(Math.max(view[2] - 20, view[2] + ((view[0] - content.width() - 40) * 0.5) - currentOpts.padding))
			}, typeof arguments[0] == 'number' ? arguments[0] : 200);
	};

	$.fancybox.init = function() {
		if ($("#fancybox-wrap").length) {
			return;
		}

		$('body').append(
			tmp	= $('<div id="fancybox-tmp"></div>'),
			loading	= $('<div id="fancybox-loading"><div></div></div>'),
			overlay	= $('<div id="fancybox-overlay"></div>'),
			wrap = $('<div id="fancybox-wrap"></div>')
		);

		outer = $('<div id="fancybox-outer"></div>')
			.append('<div class="fancybox-bg" id="fancybox-bg-n"></div><div class="fancybox-bg" id="fancybox-bg-ne"></div><div class="fancybox-bg" id="fancybox-bg-e"></div><div class="fancybox-bg" id="fancybox-bg-se"></div><div class="fancybox-bg" id="fancybox-bg-s"></div><div class="fancybox-bg" id="fancybox-bg-sw"></div><div class="fancybox-bg" id="fancybox-bg-w"></div><div class="fancybox-bg" id="fancybox-bg-nw"></div>')
			.appendTo( wrap );

		outer.append(
			content = $('<div id="fancybox-content"></div>'),
			close = $('<a id="fancybox-close"></a>'),
			title = $('<div id="fancybox-title"></div>'),

			nav_left = $('<a href="javascript:;" id="fancybox-left"><span class="fancy-ico" id="fancybox-left-ico"></span></a>'),
			nav_right = $('<a href="javascript:;" id="fancybox-right"><span class="fancy-ico" id="fancybox-right-ico"></span></a>')
		);

		close.click($.fancybox.close);
		loading.click($.fancybox.cancel);

		nav_left.click(function(e) {
			e.preventDefault();
			$.fancybox.prev();
		});

		nav_right.click(function(e) {
			e.preventDefault();
			$.fancybox.next();
		});

		if ($.fn.mousewheel) {
			wrap.bind('mousewheel.fb', function(e, delta) {
				if (busy) {
					e.preventDefault();

				} else if ($(e.target).get(0).clientHeight == 0 || $(e.target).get(0).scrollHeight === $(e.target).get(0).clientHeight) {
					e.preventDefault();
					$.fancybox[ delta > 0 ? 'prev' : 'next']();
				}
			});
		}

		if (!$.support.opacity) {
			wrap.addClass('fancybox-ie');
		}

		if (isIE6) {
			loading.addClass('fancybox-ie6');
			wrap.addClass('fancybox-ie6');

			$('<iframe id="fancybox-hide-sel-frame" src="' + (/^https/i.test(window.location.href || '') ? 'javascript:void(false)' : 'about:blank' ) + '" scrolling="no" border="0" frameborder="0" tabindex="-1"></iframe>').prependTo(outer);
		}
	};

	$.fn.fancybox.defaults = {
		padding : 10,
		margin : 40,
		opacity : false,
		modal : false,
		cyclic : false,
		scrolling : 'auto',	// 'auto', 'yes' or 'no'

		width : 560,
		height : 340,

		autoScale : true,
		autoDimensions : true,
		centerOnScroll : false,

		ajax : {},
		swf : { wmode: 'transparent' },

		hideOnOverlayClick : true,
		hideOnContentClick : false,

		overlayShow : true,
		overlayOpacity : 0.7,
		overlayColor : '#777',

		titleShow : true,
		titlePosition : 'float', // 'float', 'outside', 'inside' or 'over'
		titleFormat : null,
		titleFromAlt : false,

		transitionIn : 'fade', // 'elastic', 'fade' or 'none'
		transitionOut : 'fade', // 'elastic', 'fade' or 'none'

		speedIn : 300,
		speedOut : 300,

		changeSpeed : 300,
		changeFade : 'fast',

		easingIn : 'swing',
		easingOut : 'swing',

		showCloseButton	 : true,
		showNavArrows : true,
		enableEscapeButton : true,
		enableKeyboardNav : true,

		onStart : function(){},
		onCancel : function(){},
		onComplete : function(){},
		onCleanup : function(){},
		onClosed : function(){},
		onError : function(){}
	};

	$(document).ready(function() {
		$.fancybox.init();
	});

})(jQuery);
/**
 * jQuery.ScrollTo - Easy element scrolling using jQuery.
 * Copyright (c) 2007-2009 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com
 * Dual licensed under MIT and GPL.
 * Date: 5/25/2009
 * @author Ariel Flesler
 * @version 1.4.2
 *
 * http://flesler.blogspot.com/2007/10/jqueryscrollto.html
 */
;(function(d){var k=d.scrollTo=function(a,i,e){d(window).scrollTo(a,i,e)};k.defaults={axis:'xy',duration:parseFloat(d.fn.jquery)>=1.3?0:1};k.window=function(a){return d(window)._scrollable()};d.fn._scrollable=function(){return this.map(function(){var a=this,i=!a.nodeName||d.inArray(a.nodeName.toLowerCase(),['iframe','#document','html','body'])!=-1;if(!i)return a;var e=(a.contentWindow||a).document||a.ownerDocument||a;return d.browser.safari||e.compatMode=='BackCompat'?e.body:e.documentElement})};d.fn.scrollTo=function(n,j,b){if(typeof j=='object'){b=j;j=0}if(typeof b=='function')b={onAfter:b};if(n=='max')n=9e9;b=d.extend({},k.defaults,b);j=j||b.speed||b.duration;b.queue=b.queue&&b.axis.length>1;if(b.queue)j/=2;b.offset=p(b.offset);b.over=p(b.over);return this._scrollable().each(function(){var q=this,r=d(q),f=n,s,g={},u=r.is('html,body');switch(typeof f){case'number':case'string':if(/^([+-]=)?\d+(\.\d+)?(px|%)?$/.test(f)){f=p(f);break}f=d(f,this);case'object':if(f.is||f.style)s=(f=d(f)).offset()}d.each(b.axis.split(''),function(a,i){var e=i=='x'?'Left':'Top',h=e.toLowerCase(),c='scroll'+e,l=q[c],m=k.max(q,i);if(s){g[c]=s[h]+(u?0:l-r.offset()[h]);if(b.margin){g[c]-=parseInt(f.css('margin'+e))||0;g[c]-=parseInt(f.css('border'+e+'Width'))||0}g[c]+=b.offset[h]||0;if(b.over[h])g[c]+=f[i=='x'?'width':'height']()*b.over[h]}else{var o=f[h];g[c]=o.slice&&o.slice(-1)=='%'?parseFloat(o)/100*m:o}if(/^\d+$/.test(g[c]))g[c]=g[c]<=0?0:Math.min(g[c],m);if(!a&&b.queue){if(l!=g[c])t(b.onAfterFirst);delete g[c]}});t(b.onAfter);function t(a){r.animate(g,j,b.easing,a&&function(){a.call(this,n,b)})}}).end()};k.max=function(a,i){var e=i=='x'?'Width':'Height',h='scroll'+e;if(!d(a).is('html,body'))return a[h]-d(a)[e.toLowerCase()]();var c='client'+e,l=a.ownerDocument.documentElement,m=a.ownerDocument.body;return Math.max(l[h],m[h])-Math.min(l[c],m[c])};function p(a){return typeof a=='object'?a:{top:a,left:a}}})(jQuery);
/*
 * jQuery history plugin
 *
 * The MIT License
 *
 * Copyright (c) 2006-2009 Taku Sano (Mikage Sawatari)
 * Copyright (c) 2010 Takayuki Miwa
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */

(function($) {
    var locationWrapper = {
        put: function(hash, win) {
            (win || window).location.hash = this.encoder(hash);
        },
        get: function(win) {
            var hash = ((win || window).location.hash).replace(/^#/, '');
            try {
                return $.browser.mozilla ? hash : decodeURIComponent(hash);
            }
            catch (error) {
                return hash;
            }
        },
        encoder: encodeURIComponent
    };

    var iframeWrapper = {
        id: "__jQuery_history",
        init: function() {
            var html = '<iframe id="'+ this.id +'" style="display:none" src="javascript:false;" />';
            $("body").prepend(html);
            return this;
        },
        _document: function() {
            return $("#"+ this.id)[0].contentWindow.document;
        },
        put: function(hash) {
            var doc = this._document();
            doc.open();
            doc.close();
            locationWrapper.put(hash, doc);
        },
        get: function() {
            return locationWrapper.get(this._document());
        }
    };

    function initObjects(options) {
        options = $.extend({
                unescape: false
            }, options || {});

        locationWrapper.encoder = encoder(options.unescape);

        function encoder(unescape_) {
            if(unescape_ === true) {
                return function(hash){ return hash; };
            }
            if(typeof unescape_ == "string" &&
               (unescape_ = partialDecoder(unescape_.split("")))
               || typeof unescape_ == "function") {
                return function(hash) { return unescape_(encodeURIComponent(hash)); };
            }
            return encodeURIComponent;
        }

        function partialDecoder(chars) {
            var re = new RegExp($.map(chars, encodeURIComponent).join("|"), "ig");
            return function(enc) { return enc.replace(re, decodeURIComponent); };
        }
    }

    // public base interface
    var _ = {
        appState: undefined,
        callback: undefined,
        init:  function(callback, options) {},
        check: function() {},
        load:  function(hash) {}
    };
    $.history = _;

    var SimpleImpl = {
        init: function(callback, options) {
            initObjects(options);
            _.callback = callback;
            var current_hash = locationWrapper.get();
            _.appState = current_hash;
            //HACK: Commenter le callback. Appelé depuis le chargePage, provoque un nouvel appel à chargePage
            //_.callback(current_hash);
            setInterval(_.check, 100);
        },
        check: function() {
            var current_hash = locationWrapper.get();
            if(current_hash != _.appState) {
                _.appState = current_hash;
                _.callback(current_hash);
            }
        },
        load: function(hash) {
            if(hash != _.appState) {
                locationWrapper.put(hash);
                _.appState = hash;
                //HACK: Commenter le callback. Appelé depuis le chargePage, provoque un nouvel appel à chargePage
                //_.callback(hash);
            }
        }
    };

    var IframeImpl = {
        init: function(callback, options) {
            initObjects(options);
            _.callback = callback;
            var current_hash = locationWrapper.get();
            _.appState = current_hash;
            iframeWrapper.init().put(current_hash);
            //HACK: Commenter le callback. Appelé depuis le chargePage, provoque un nouvel appel à chargePage
            //_.callback(current_hash);
            setInterval(_.check, 100);
        },
        check: function() {
            var iframe_hash = iframeWrapper.get(),
                location_hash = locationWrapper.get();

            if (location_hash != iframe_hash) {
                if (location_hash == _.appState) {    // user used Back or Forward button
                    _.appState = iframe_hash;
                    locationWrapper.put(iframe_hash);
                    _.callback(iframe_hash);
                } else {                              // user loaded new bookmark
                    _.appState = location_hash;
                    iframeWrapper.put(location_hash);
                    _.callback(location_hash);
                }
            }
        },
        load: function(hash) {
            if(hash != _.appState) {
                locationWrapper.put(hash);
                iframeWrapper.put(hash);
                _.appState = hash;
                //HACK: Commenter le callback. Appelé depuis le chargePage, provoque un nouvel appel à chargePage
                //_.callback(hash);
            }
        }
    };

    if($.browser.msie && ($.browser.version < 8 || document.documentMode < 8)) {
        $.extend(_, IframeImpl);
    } else {
        $.extend(_, SimpleImpl);
    }
})(jQuery);

var $j = jQuery.noConflict(); 
//Définition des évènements pour repsonseHTML.js
$j(document).bind('onLoadHtmlCompleted', function(evt, ajaxObject, data) { } );
$j(document).bind('onBeforeAjaxCall', function(evt, ajaxObject) { } );
$j(document).bind('onAfterChargePageCall', function(evt, page, pUrl, pBoolean) { } );

//Définition des évènements pour fonctions.js
//Animation d'intro
$j(document).bind('onBeforeHideIntro', function(evt, tampon_navig) { } );
$j(document).bind('onAfterHideIntro', function(evt, tampon_navig, duree_loading, duree_regardee, regardee_completement) { } );
//Speedsearch
$j(document).bind('onBeforeSearchCall', function(evt, SearchOptions) { } );

//Définition des évènements pour fonctions/emailingauto.js
$j(document).bind('onBesforeSpeedmailingSubscribe', function(evt, data, isNewsletter) { } );
$j(document).bind('onBesforeSpeedmailingUnsubscribe', function(evt, data, isNewsletter) { } );
$j(document).bind('onAfterSpeedmailingSubscribe', function(evt, response) { } );
$j(document).bind('onAfterSpeedmailingUnsubscribe', function(evt, response) { } );

//Définition des évènements pour fonctions/offresspeciales.js
$j(document).bind('onClickOnMoreView', function(evt, $linkMoreView, options) { } );
$j(document).bind('onErrorFormEnvoiAmi', function(evt, response, error) { } );
$j(document).bind('onSuccessFormEnvoiAmi', function(evt, data) { } );
$j(document).bind('onChangePageOfOS', function(evt, tabElmtToShow, tabElmtToHide) { } );
$j(document).bind('onApplyFiltersOrSorts', function(evt) { } );
var modeDebug = false;

/**
*@desc Permet d'ajouter des évènements au window.onload
*Usage : addLoadEvent(function(){maFonction(monParam)});
*@param string fonction à ajouter
*/
var addLoadEvent = function(func) {
    /*if(typeof window.addEventListener != 'undefined')
    {
        //.. gecko, safari, konqueror and standard
        window.addEventListener('load', func, false);
    }
    else if(typeof document.addEventListener != 'undefined')
    {
        //.. opera
        document.addEventListener('load', func, false);
    }
    else if(typeof window.attachEvent != 'undefined')
    {
        //.. win/ie
        window.attachEvent('onload', func);
    }
    //** remove this condition to degrade older browsers
    else
    {
        //.. mac/ie5 and anything else that gets this far
        if(typeof window.onload == 'function')
        {
            var existing = onload;
            window.onload = function()
            {
                existing();
                func;
            };
        }
        else
        {
            window.onload = func;
        }
    }*/
    $j(document).ready(func);
};

/**
*@desc Permet d'ajouter des évènements au window.onresize
*Usage : addResizeEvent(function(){maFonction(monParam)});
*@param string fonction à ajouter
*/
var addResizeEvent = function(func) {
    var oldonresize = window.onresize;
    if (typeof window.onresize != 'function') {
        window.onresize = func;
    } else {
        window.onresize = function() {
            if (oldonresize) {
                oldonresize();
            }
            func();
        }
    }
};

/**
*@desc Permet de connaitre le navigateur
*@return string Nom du navigateur
*/
var navigateur=function() {
	var strChUserAgent = navigator.userAgent;
	var intSplitStart = strChUserAgent.indexOf("(", 0);
	var intSplitEnd = strChUserAgent.indexOf(")", 0);
	var strChStart = strChUserAgent.substring(0, intSplitStart);
	var strChMid = strChUserAgent.substring(intSplitStart, intSplitEnd);
	var strChEnd = strChUserAgent.substring(intSplitEnd);

    if(strChMid.indexOf("MSIE 8") != -1)
    {    return "IE8";  }
	if(strChMid.indexOf("MSIE 7") != -1)
	{	return "IE7";  }
	else if(strChMid.indexOf("MSIE 6") != -1)
	{	return "IE6";  }
    else if(strChMid.indexOf("MSIE 6") != -1)
    {    return "IE";  }
	else if(strChEnd.indexOf("Firefox/2") != -1)
	{	return "Firefox2";  }
	else if(strChEnd.indexOf("Firefox") != -1)
	{	return "Firefox";  }
	else if(strChEnd.indexOf("Netscape/7") != -1)
	{	return "NS7";  }
	else if(strChEnd.indexOf("Netscape") != -1)
	{	return "NS";  }
	else if(strChStart.indexOf("Opera/9") != -1)
	{	return "Opera9";  }
	else if(strChStart.indexOf("Opera") != -1)
	{	return "Opera";  }
	else if(strChEnd.indexOf("Safari") != -1)
	{	return "Safari";  }
	else
	{	return "Autre";  }
};

/**
*@desc Permet de faire fonctionnner les transparences des fichiers png � partir de IE5.5
*/
var correctPNG=function() {
    var browser = navigateur();
    if (browser.indexOf("IE6") != -1) {
        for(var i=0; i<document.images.length; i++) {
            var img = document.images[i];
            var imgName = img.src.toUpperCase();
            if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
            {
                //var dimensionImage = getNaturalDimension(img);
                var imgID = (img.id) ? "id='" + img.id + "' " : ""
                var imgClass = (img.className) ? "class='" + img.className + "' " : ""
                var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
                var imgStyle = "display:inline-block;" + img.style.cssText
                if (img.align == "left") imgStyle = "float:left;" + imgStyle
                if (img.align == "right") imgStyle = "float:right;" + imgStyle
                if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
                var strNewHTML = "<span " + imgID + imgClass + imgTitle
                + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
                + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
                + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>"
                img.outerHTML = strNewHTML
                i = i-1
            }
        }
    }
};
$j(document).ready(function() {
    correctPNG();
});
$j(document).bind('onLoadHtmlCompleted', function(evt) {
    correctPNG();
});

/**
*@desc Pour ajouter le site aux favoris (IE7, Firefox)
*@param string pLibelle Libellé du site
*@param string pUrl domaine
*/
var libelleFavoris = '';
var ajouterFavoris = function(pLibelle, pUrl) {
    siteURL = window.location.href != "" ? window.location.href : pUrl;
    siteNOM = libelleFavoris != "" ? libelleFavoris : pLibelle;

    /*-- MESSAGE --*/
    function myMessage (raccourciClavier) {
        alert ("Utilisez '" + raccourciClavier + "'\npour ajouter " + siteNOM + " dans vos favoris !");
    }

    /*-- TRAITEMENT DES NAVIGATEURS --*/

    //Konqueror
    if (navigator.userAgent.indexOf('Konqueror') >= 0) {
    /*Test a effectuer avant tout les autres car repond TRUE aux differents tests sans pouvoir les exploiter*/
        myMessage("CTRL + B");
    }
    else if (window.sidebar) {
        /* Netscape 6+ ; Mozilla, FireFox et compagnie (K-Meleon ...) */
        window.sidebar.addPanel(siteNOM,siteURL,"");
    }
    else if (window.external) {
        /* Internet Explorer 4+, et ses d�riv�s (Crazy Browser, Avent Browser ...) */
        window.external.AddFavorite(siteURL,siteNOM);
    }
    else if (document.all && (navigator.userAgent.indexOf('Win') < 0)) {
        /* Internet Explorer Mac */
        myMessage("POMME + D");
    }
    else if (window.opera && window.print) {
        /* Opera 6+ */
        myMessage("CTRL + T");
    }
    else if (document.layers) {
        /* Netsccape 4 */
        myMessage("CTRL + D");
    }
    else if (navigator.userAgent.indexOf('Safari') >= 0) {
        /* Safari */
        myMessage("POMME + D ou CTRL + D");
    }
    else alert ("Cette fonction n'est pas disponible pour votre navigateur.");
};

/**
*@desc print_r javascript
*@param array array
*@param string pUrl domaine
*@return string
*/
var print_r = function( array, return_val ) {
    // http://kevin.vanzonneveld.net
    // +   original by: Michael White (http://crestidg.com)
    // +   improved by: Ben Bryan
    // *     example 1: print_r(1, true);
    // *     returns 1: 1
    var output = "", pad_char = " ", pad_val = 4;
    var formatArray = function (obj, cur_depth, pad_val, pad_char) {
        if (cur_depth > 0) {
            cur_depth++;
        }

        var base_pad = repeat_char(pad_val*cur_depth, pad_char);
        var thick_pad = repeat_char(pad_val*(cur_depth+1), pad_char);
        var str = "";

        if (obj instanceof Array || obj instanceof Object) {
            str += "Array\n" + base_pad + "(\n";
            for (var key in obj) {
                if (obj[key] instanceof Array) {
                    str += thick_pad + "["+key+"] => "+formatArray(obj[key], cur_depth+1, pad_val, pad_char);
                } else {
                    str += thick_pad + "["+key+"] => " + obj[key] + "\n";
                }
            }
            str += base_pad + ")\n";
        } else {
            str = obj.toString();
        }

        return str;
    };

    var repeat_char = function (len, pad_char) {
        var str = "";
        for(var i=0; i < len; i++) {
            str += pad_char;
        };
        return str;
    };
    output = formatArray(array, 0, pad_val, pad_char);

    if (return_val !== true) {
        document.write("<pre>" + output + "</pre>");
        return true;
    } else {
        return output;
    }
};

/**
*@desc Permet de cacher la div (divIntro) contenant l'intro flash
*@param integer duree_loading Durée de chargement de l'anim d'intro
*@param integer duree_regardee Durée de visionnage de l'anim d'intro
*@param bool regardee_completement true si l'anim a été regardée complètement
*/
var hide_intro = function (duree_loading, duree_regardee, regardee_completement, manageByDisplay) {
    if (typeof (document.getElementById('divIntro')) != 'undefined') {
        var paramEvt = {
            tampon_navig: typeof (tampon_navig) != 'undefined' ? tampon_navig : null,
            useTamponNavig: true
        };

        $j(document).trigger('onBeforeHideIntro', [paramEvt]);

        if (typeof (manageByDisplay) != 'undefined' && manageByDisplay == true) {
            $j('#intro').hide();
            $j('#divIntro').hide();
        } else {
            $j('#divIntro').remove();

            //pansement pour lemascandille. La suppression de l'intro, pose un problème avec les fonctions externalInterface
            $j('body').append('<div id="intro" style="display:none"></div>');
            document.getElementById('intro').SetReturnValue = function (arg1) { }
        }


        if (paramEvt.useTamponNavig) {
            var divAnim = document.getElementById(idDivAnim);
            if (divAnim != null) {
                divAnim.innerHTML = paramEvt.tampon_navig;
            }
        }
        if (document.getElementById('ConteneurQuicksearch') != null) {
            document.getElementById('ConteneurQuicksearch').outerHTML = tampon_qs;
        }
        $j('html').css('overflow', '');
        $j('body').css('overflow', '');
        /*var htmlElement = document.getElementsByTagName('html')[0];
        htmlElement.style.overflow = '';
        if (document.body) {
            document.body.style.overflow = "";
        }*/

        if (modeDebug) {
            alert('duree_loading : ' + duree_loading);
            alert('duree_regardee : ' + duree_regardee);
            alert('regardee_completement : ' + regardee_completement);
        }

        if (duree_loading != undefined) {
            if (duree_regardee == undefined) { duree_regardee = 0; }
            if (regardee_completement == undefined) { regardee_completement = 0; }

            envoiStatsAnim(duree_loading, duree_regardee, regardee_completement);
        }

        $j(document).trigger('onAfterHideIntro', [duree_loading, duree_regardee, regardee_completement, paramEvt]);

        $j('a:first').focus();
    }
};


/**
*@desc Permet d'envoyer les stats fournies par l'anim d'intro, à un script PHP, pour l'enregistrement en base
*@param integer duree_loading Durée de chargement de l'anim d'intro
*@param integer duree_regardee Durée de visionnage de l'anim d'intro
*@param bool regardee_completement true si l'anim a été regardée complètement
*/
var envoiStatsAnim = function(duree_loading, duree_regardee, regardee_completement)
{
    var success = function(data){};
    if (modeDebug) {
        success = function(data) {
            alert(data);
        }
    }

    var adresseURL = document.URL.split('/');
    $j.ajax({
       url: '/apicius_plateforme2/' + version_master + '/intro/stats.php?lang=' + adresseURL[3] + '&duree_loading=' + duree_loading + '&duree_regardee=' + duree_regardee + '&regardee_completement=' + regardee_completement,
       type : 'GET',
       success : success
    });
};

/**
*@desc Permet de rechercher les mots saisis par l'internaute dans des blocs E-news
*@param string mots
*/
var speedsearch = function(modeSearch, mots, exact, aumoins, aucun, langue)
{
	if(document.getElementById('ResultSearch')) {
		document.getElementById('ResultSearch').innerHTML = '';
	}
    if (!exact && !aumoins && !aucun && !langue) {      //Recherche simple
        //Trim de la valeur envoyée
        mots = mots.replace(/^\s+|\s+$/g, "");
        if (mots != "") {
            var SearchOptions = {
                scrollId : 'displayed'
            };
            $j(document).trigger('onBeforeSearchCall', [ SearchOptions]);
            var retour = chargePage('speed-search-texte.php?advancedsearch='+(modeSearch == 'advanced' ? 1 : 0)+'&s_q=' + mots, 0, false, SearchOptions.scrollId)
        }
    } else {                                            //Recherche avancée
        //Trim de la valeur envoyée
        mots = mots.replace(/^\s+|\s+$/g, "");
        exact = exact.replace(/^\s+|\s+$/g, "");
        aumoins = aumoins.replace(/^\s+|\s+$/g, "");
        aucun = aucun.replace(/^\s+|\s+$/g, "");

        if (mots + exact + aumoins + aucun != "") {
            var SearchOptions = {
                scrollId : 'displayed'
            };
            $j(document).trigger('onBeforeSearchCall', [ SearchOptions]);
            var retour = chargePage('speed-search-texte.php?advancedsearch='+(modeSearch == 'advanced' ? 1 : 0)+'&s_q=' + mots + '&s_eqp=' + exact + '&s_oq=' + aumoins + '&s_eq=' + aucun + '&s_lg=' + langue, 0, false, SearchOptions.scrollId)
        }
    }
    //Pour ne pas valider le formulaire
    return false;
}

/**
*@desc Permet d'afficher l'heure et qu'elle se rafraichisse
*/
var heureLocale = null;
var intervalleHeureLocale = null;
var refreshTime = function(heure, intervalleSeconde) {
	objectHtmlLocalTime = document.getElementById('localTime');
	if(objectHtmlLocalTime) {
		if(typeof(heure) == 'string') {
			heureTab = heure.split(':');
			heureLocale = new Date();
			if(heureTab.length == 2) {
				heureLocale.setHours(heureTab[0], heureTab[1]);
			} else if(heureTab.length == 3) {
				heureLocale.setHours(heureTab[0], heureTab[1], heureTab[2]);
			}
		}
		if(typeof(intervalleSeconde) == 'number') {
			intervalleHeureLocale = intervalleSeconde;
		}
		heureLocale.setSeconds(heureLocale.getSeconds() + intervalleHeureLocale);

		var  h = heureLocale.getHours();
		if (h<10) {h = "0" + h}

		var m = '';
		if(intervalleHeureLocale <= 60) {
			m = heureLocale.getMinutes();
			if (m<10) {m = "0" + m}
			m = ":" + m;
		}

		var s = '';
		if(intervalleHeureLocale <= 1) {
			s = heureLocale.getSeconds();
			if (s<10) {s = "0" + s}
			s = ":" + s;
		}

		objectHtmlLocalTime.innerHTML = h+m+s;

		setTimeout("refreshTime()", intervalleHeureLocale * 1000);
	}
};

var getFileName = function(){
    //création d'un tableau avec comme valeurs les chaînes de caractères compris entre les slashs. On renvoie ensuite la dernière valeur de ce tableau
    var pURL = document.location.href.split('\/').pop();

    //si dans la chaîne il y a un ? on crée un tableau et on renvoie la dernière valeur
    if (pURL.indexOf('?') != -1)
    {
        pURL= (pURL.split('?')).pop();
    }//fin if

    //si dans la chaîne il y a un # on crée un tableau et on renvoie la dernière valeur
    if (pURL.indexOf('#') != -1)
    {
        pURL= (pURL.split('#')).pop();
    }//fin if

    return pURL;
};

if (!document.getElementsByClassName){
    document.getElementsByClassName = function(className, tag, elm){
        var testClass = new RegExp("(^|\\s)" + className + "(\\s|$)");
        var tag = tag || "*";
        var elm = elm || document;
        var elements = (tag == "*" && elm.all)? elm.all : elm.getElementsByTagName(tag);
        var returnElements = [];
        var current;
        var length = elements.length;
        for(var i=0; i<length; i++){
            current = elements[i];
            if(testClass.test(current.className)){
                returnElements.push(current);
            }
        }
        return returnElements;
    }
}
// Fonction a utiliser si vous souhaiter envoyer des infos vers Flash
var emetteurVersFlash = function(nomPage) {
    var doc_flash ;
    
   /* var doc_flash = swfobject.getObjectById("navigation");*/
    
    if(/*!doc_flash && */document.getElementById("navigation"))
    {
        if (navigator.appName.indexOf("Microsoft") != -1)
        {
            doc_flash = window["navigation"];
        }
        else
        {
            if (document["navigation"].length != undefined)
            {
                doc_flash = document["navigation"][1];
            }
            else
            {
                doc_flash = document["navigation"];
            }
        }        
    }
    
    if(doc_flash && doc_flash.recepteurDepuisJavascript) {
        doc_flash.recepteurDepuisJavascript(nomPage);
    }
};


// Fonction a utiliser si vous souhaitez renvoyer des infos depuis Flash
var recepteurDepuisFlash = function(pParam) {
};


//v1.0
//Copyright 2006 Adobe Systems, Inc. All rights reserved.
//Attention ce n'est pas la fonction d'orige elle à été hacké par Ghislain et Jean pour le support de la molette sous IE
var flashmousewheel=function(e){
   nav = navigateur();
   if(nav.indexOf("IE")!=-1){ document.body.scrollTop-=e.wheelDelta/2; }
 }

function AC_AddExtension(src, ext)
{
  if (src.indexOf('?') != -1)
    return src.replace(/\?/, ext+'?'); 
  else 
    return src + ext;   
}

function AC_Generateobj(objAttrs, params, embedAttrs) 
{
  var str = '<object onmousewheel="flashmousewheel(event);"';
  for (var i in objAttrs)
    str += i + '="' + objAttrs[i] + '" ';
  str += '>';
  for (var i in params)
    str += '<param name="' + i + '" value="' + params[i] + '" /> ';
  str += '<embed ';
  for (var i in embedAttrs) {
    str += i + '="' + embedAttrs[i] + '" ';
  }
  str += ' ></embed></object>';
  document.write(str);
}

function AC_FL_RunContent(){
  var ret = 
    AC_GetArgs
    (  arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
     , "application/x-shockwave-flash"
    );
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}

function AC_SW_RunContent(){
  var ret = 
    AC_GetArgs
    (  arguments, ".dcr", "src", "clsid:166B1BCA-3F9C-11CF-8075-444553540000"
     , null
    );
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}

function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
  var ret = new Object();
  ret.embedAttrs = new Object();
  ret.params = new Object();
  ret.objAttrs = new Object();
  for (var i=0; i < args.length; i=i+2){
    var currArg = args[i].toLowerCase();    

    switch (currArg){	
      case "classid":
        break;
      case "name":
      case "pluginspage":
        ret.embedAttrs[args[i]] = args[i+1];
        break;
      case "src":
      case "movie":	
        args[i+1] = AC_AddExtension(args[i+1], ext);
        ret.embedAttrs["src"] = args[i+1];
        ret.params[srcParamName] = args[i+1];
        break;
      case "onafterupdate":
      case "onbeforeupdate":
      case "onblur":
      case "oncellchange":
      case "onclick":
      case "ondblClick":
      case "ondrag":
      case "ondragend":
      case "ondragenter":
      case "ondragleave":
      case "ondragover":
      case "ondrop":
      case "onfinish":
      case "onfocus":
      case "onhelp":
      case "onmousedown":
      case "onmouseup":
      case "onmouseover":
      case "onmousemove":
      case "onmouseout":
      case "onkeypress":
      case "onkeydown":
      case "onkeyup":
      case "onload":
      case "onlosecapture":
      case "onpropertychange":
      case "onreadystatechange":
      case "onrowsdelete":
      case "onrowenter":
      case "onrowexit":
      case "onrowsinserted":
      case "onstart":
      case "onscroll":
      case "onbeforeeditfocus":
      case "onactivate":
      case "onbeforedeactivate":
      case "ondeactivate":
      case "type":
      case "id":
      case "codebase":
        ret.objAttrs[args[i]] = args[i+1];
        break;
      case "width":
      case "height":
      case "align":
      case "vspace": 
      case "hspace":
      case "class":
      case "title":
      case "accesskey":
      case "tabindex":
        ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
        break;
      default:
        ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
    }
  }
  ret.objAttrs["classid"] = classid;
  if (mimeType) ret.embedAttrs["type"] = mimeType;
  return ret;
}

/*	SWFObject v2.2 <http://code.google.com/p/swfobject/> 
	is released under the MIT License <http://www.opensource.org/licenses/mit-license.php> 
*/
var swfobject=function(){var D="undefined",r="object",S="Shockwave Flash",W="ShockwaveFlash.ShockwaveFlash",q="application/x-shockwave-flash",R="SWFObjectExprInst",x="onreadystatechange",O=window,j=document,t=navigator,T=false,U=[h],o=[],N=[],I=[],l,Q,E,B,J=false,a=false,n,G,m=true,M=function(){var aa=typeof j.getElementById!=D&&typeof j.getElementsByTagName!=D&&typeof j.createElement!=D,ah=t.userAgent.toLowerCase(),Y=t.platform.toLowerCase(),ae=Y?/win/.test(Y):/win/.test(ah),ac=Y?/mac/.test(Y):/mac/.test(ah),af=/webkit/.test(ah)?parseFloat(ah.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,X=!+"\v1",ag=[0,0,0],ab=null;if(typeof t.plugins!=D&&typeof t.plugins[S]==r){ab=t.plugins[S].description;if(ab&&!(typeof t.mimeTypes!=D&&t.mimeTypes[q]&&!t.mimeTypes[q].enabledPlugin)){T=true;X=false;ab=ab.replace(/^.*\s+(\S+\s+\S+$)/,"$1");ag[0]=parseInt(ab.replace(/^(.*)\..*$/,"$1"),10);ag[1]=parseInt(ab.replace(/^.*\.(.*)\s.*$/,"$1"),10);ag[2]=/[a-zA-Z]/.test(ab)?parseInt(ab.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}}else{if(typeof O.ActiveXObject!=D){try{var ad=new ActiveXObject(W);if(ad){ab=ad.GetVariable("$version");if(ab){X=true;ab=ab.split(" ")[1].split(",");ag=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}}catch(Z){}}}return{w3:aa,pv:ag,wk:af,ie:X,win:ae,mac:ac}}(),k=function(){if(!M.w3){return}if((typeof j.readyState!=D&&j.readyState=="complete")||(typeof j.readyState==D&&(j.getElementsByTagName("body")[0]||j.body))){f()}if(!J){if(typeof j.addEventListener!=D){j.addEventListener("DOMContentLoaded",f,false)}if(M.ie&&M.win){j.attachEvent(x,function(){if(j.readyState=="complete"){j.detachEvent(x,arguments.callee);f()}});if(O==top){(function(){if(J){return}try{j.documentElement.doScroll("left")}catch(X){setTimeout(arguments.callee,0);return}f()})()}}if(M.wk){(function(){if(J){return}if(!/loaded|complete/.test(j.readyState)){setTimeout(arguments.callee,0);return}f()})()}s(f)}}();function f(){if(J){return}try{var Z=j.getElementsByTagName("body")[0].appendChild(C("span"));Z.parentNode.removeChild(Z)}catch(aa){return}J=true;var X=U.length;for(var Y=0;Y<X;Y++){U[Y]()}}function K(X){if(J){X()}else{U[U.length]=X}}function s(Y){if(typeof O.addEventListener!=D){O.addEventListener("load",Y,false)}else{if(typeof j.addEventListener!=D){j.addEventListener("load",Y,false)}else{if(typeof O.attachEvent!=D){i(O,"onload",Y)}else{if(typeof O.onload=="function"){var X=O.onload;O.onload=function(){X();Y()}}else{O.onload=Y}}}}}function h(){if(T){V()}else{H()}}function V(){var X=j.getElementsByTagName("body")[0];var aa=C(r);aa.setAttribute("type",q);var Z=X.appendChild(aa);if(Z){var Y=0;(function(){if(typeof Z.GetVariable!=D){var ab=Z.GetVariable("$version");if(ab){ab=ab.split(" ")[1].split(",");M.pv=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}else{if(Y<10){Y++;setTimeout(arguments.callee,10);return}}X.removeChild(aa);Z=null;H()})()}else{H()}}function H(){var ag=o.length;if(ag>0){for(var af=0;af<ag;af++){var Y=o[af].id;var ab=o[af].callbackFn;var aa={success:false,id:Y};if(M.pv[0]>0){var ae=c(Y);if(ae){if(F(o[af].swfVersion)&&!(M.wk&&M.wk<312)){w(Y,true);if(ab){aa.success=true;aa.ref=z(Y);ab(aa)}}else{if(o[af].expressInstall&&A()){var ai={};ai.data=o[af].expressInstall;ai.width=ae.getAttribute("width")||"0";ai.height=ae.getAttribute("height")||"0";if(ae.getAttribute("class")){ai.styleclass=ae.getAttribute("class")}if(ae.getAttribute("align")){ai.align=ae.getAttribute("align")}var ah={};var X=ae.getElementsByTagName("param");var ac=X.length;for(var ad=0;ad<ac;ad++){if(X[ad].getAttribute("name").toLowerCase()!="movie"){ah[X[ad].getAttribute("name")]=X[ad].getAttribute("value")}}P(ai,ah,Y,ab)}else{p(ae);if(ab){ab(aa)}}}}}else{w(Y,true);if(ab){var Z=z(Y);if(Z&&typeof Z.SetVariable!=D){aa.success=true;aa.ref=Z}ab(aa)}}}}}function z(aa){var X=null;var Y=c(aa);if(Y&&Y.nodeName=="OBJECT"){if(typeof Y.SetVariable!=D){X=Y}else{var Z=Y.getElementsByTagName(r)[0];if(Z){X=Z}}}return X}function A(){return !a&&F("6.0.65")&&(M.win||M.mac)&&!(M.wk&&M.wk<312)}function P(aa,ab,X,Z){a=true;E=Z||null;B={success:false,id:X};var ae=c(X);if(ae){if(ae.nodeName=="OBJECT"){l=g(ae);Q=null}else{l=ae;Q=X}aa.id=R;if(typeof aa.width==D||(!/%$/.test(aa.width)&&parseInt(aa.width,10)<310)){aa.width="310"}if(typeof aa.height==D||(!/%$/.test(aa.height)&&parseInt(aa.height,10)<137)){aa.height="137"}j.title=j.title.slice(0,47)+" - Flash Player Installation";var ad=M.ie&&M.win?"ActiveX":"PlugIn",ac="MMredirectURL="+O.location.toString().replace(/&/g,"%26")+"&MMplayerType="+ad+"&MMdoctitle="+j.title;if(typeof ab.flashvars!=D){ab.flashvars+="&"+ac}else{ab.flashvars=ac}if(M.ie&&M.win&&ae.readyState!=4){var Y=C("div");X+="SWFObjectNew";Y.setAttribute("id",X);ae.parentNode.insertBefore(Y,ae);ae.style.display="none";(function(){if(ae.readyState==4){ae.parentNode.removeChild(ae)}else{setTimeout(arguments.callee,10)}})()}u(aa,ab,X)}}function p(Y){if(M.ie&&M.win&&Y.readyState!=4){var X=C("div");Y.parentNode.insertBefore(X,Y);X.parentNode.replaceChild(g(Y),X);Y.style.display="none";(function(){if(Y.readyState==4){Y.parentNode.removeChild(Y)}else{setTimeout(arguments.callee,10)}})()}else{Y.parentNode.replaceChild(g(Y),Y)}}function g(ab){var aa=C("div");if(M.win&&M.ie){aa.innerHTML=ab.innerHTML}else{var Y=ab.getElementsByTagName(r)[0];if(Y){var ad=Y.childNodes;if(ad){var X=ad.length;for(var Z=0;Z<X;Z++){if(!(ad[Z].nodeType==1&&ad[Z].nodeName=="PARAM")&&!(ad[Z].nodeType==8)){aa.appendChild(ad[Z].cloneNode(true))}}}}}return aa}function u(ai,ag,Y){var X,aa=c(Y);if(M.wk&&M.wk<312){return X}if(aa){if(typeof ai.id==D){ai.id=Y}if(M.ie&&M.win){var ah="";for(var ae in ai){if(ai[ae]!=Object.prototype[ae]){if(ae.toLowerCase()=="data"){ag.movie=ai[ae]}else{if(ae.toLowerCase()=="styleclass"){ah+=' class="'+ai[ae]+'"'}else{if(ae.toLowerCase()!="classid"){ah+=" "+ae+'="'+ai[ae]+'"'}}}}}var af="";for(var ad in ag){if(ag[ad]!=Object.prototype[ad]){af+='<param name="'+ad+'" value="'+ag[ad]+'" />'}}aa.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+ah+">"+af+"</object>";N[N.length]=ai.id;X=c(ai.id)}else{var Z=C(r);Z.setAttribute("type",q);for(var ac in ai){if(ai[ac]!=Object.prototype[ac]){if(ac.toLowerCase()=="styleclass"){Z.setAttribute("class",ai[ac])}else{if(ac.toLowerCase()!="classid"){Z.setAttribute(ac,ai[ac])}}}}for(var ab in ag){if(ag[ab]!=Object.prototype[ab]&&ab.toLowerCase()!="movie"){e(Z,ab,ag[ab])}}aa.parentNode.replaceChild(Z,aa);X=Z}}return X}function e(Z,X,Y){var aa=C("param");aa.setAttribute("name",X);aa.setAttribute("value",Y);Z.appendChild(aa)}function y(Y){var X=c(Y);if(X&&X.nodeName=="OBJECT"){if(M.ie&&M.win){X.style.display="none";(function(){if(X.readyState==4){b(Y)}else{setTimeout(arguments.callee,10)}})()}else{X.parentNode.removeChild(X)}}}function b(Z){var Y=c(Z);if(Y){for(var X in Y){if(typeof Y[X]=="function"){Y[X]=null}}Y.parentNode.removeChild(Y)}}function c(Z){var X=null;try{X=j.getElementById(Z)}catch(Y){}return X}function C(X){return j.createElement(X)}function i(Z,X,Y){Z.attachEvent(X,Y);I[I.length]=[Z,X,Y]}function F(Z){var Y=M.pv,X=Z.split(".");X[0]=parseInt(X[0],10);X[1]=parseInt(X[1],10)||0;X[2]=parseInt(X[2],10)||0;return(Y[0]>X[0]||(Y[0]==X[0]&&Y[1]>X[1])||(Y[0]==X[0]&&Y[1]==X[1]&&Y[2]>=X[2]))?true:false}function v(ac,Y,ad,ab){if(M.ie&&M.mac){return}var aa=j.getElementsByTagName("head")[0];if(!aa){return}var X=(ad&&typeof ad=="string")?ad:"screen";if(ab){n=null;G=null}if(!n||G!=X){var Z=C("style");Z.setAttribute("type","text/css");Z.setAttribute("media",X);n=aa.appendChild(Z);if(M.ie&&M.win&&typeof j.styleSheets!=D&&j.styleSheets.length>0){n=j.styleSheets[j.styleSheets.length-1]}G=X}if(M.ie&&M.win){if(n&&typeof n.addRule==r){n.addRule(ac,Y)}}else{if(n&&typeof j.createTextNode!=D){n.appendChild(j.createTextNode(ac+" {"+Y+"}"))}}}function w(Z,X){if(!m){return}var Y=X?"visible":"hidden";if(J&&c(Z)){c(Z).style.visibility=Y}else{v("#"+Z,"visibility:"+Y)}}function L(Y){var Z=/[\\\"<>\.;]/;var X=Z.exec(Y)!=null;return X&&typeof encodeURIComponent!=D?encodeURIComponent(Y):Y}var d=function(){if(M.ie&&M.win){window.attachEvent("onunload",function(){var ac=I.length;for(var ab=0;ab<ac;ab++){I[ab][0].detachEvent(I[ab][1],I[ab][2])}var Z=N.length;for(var aa=0;aa<Z;aa++){y(N[aa])}for(var Y in M){M[Y]=null}M=null;for(var X in swfobject){swfobject[X]=null}swfobject=null})}}();return{registerObject:function(ab,X,aa,Z){if(M.w3&&ab&&X){var Y={};Y.id=ab;Y.swfVersion=X;Y.expressInstall=aa;Y.callbackFn=Z;o[o.length]=Y;w(ab,false)}else{if(Z){Z({success:false,id:ab})}}},getObjectById:function(X){if(M.w3){return z(X)}},embedSWF:function(ab,ah,ae,ag,Y,aa,Z,ad,af,ac){var X={success:false,id:ah};if(M.w3&&!(M.wk&&M.wk<312)&&ab&&ah&&ae&&ag&&Y){w(ah,false);K(function(){ae+="";ag+="";var aj={};if(af&&typeof af===r){for(var al in af){aj[al]=af[al]}}aj.data=ab;aj.width=ae;aj.height=ag;var am={};if(ad&&typeof ad===r){for(var ak in ad){am[ak]=ad[ak]}}if(Z&&typeof Z===r){for(var ai in Z){if(typeof am.flashvars!=D){am.flashvars+="&"+ai+"="+Z[ai]}else{am.flashvars=ai+"="+Z[ai]}}}if(F(Y)){var an=u(aj,am,ah);if(aj.id==ah){w(ah,true)}X.success=true;X.ref=an}else{if(aa&&A()){aj.data=aa;P(aj,am,ah,ac);return}else{w(ah,true)}}if(ac){ac(X)}})}else{if(ac){ac(X)}}},switchOffAutoHideShow:function(){m=false},ua:M,getFlashPlayerVersion:function(){return{major:M.pv[0],minor:M.pv[1],release:M.pv[2]}},hasFlashPlayerVersion:F,createSWF:function(Z,Y,X){if(M.w3){return u(Z,Y,X)}else{return undefined}},showExpressInstall:function(Z,aa,X,Y){if(M.w3&&A()){P(Z,aa,X,Y)}},removeSWF:function(X){if(M.w3){y(X)}},createCSS:function(aa,Z,Y,X){if(M.w3){v(aa,Z,Y,X)}},addDomLoadEvent:K,addLoadEvent:s,getQueryParamValue:function(aa){var Z=j.location.search||j.location.hash;if(Z){if(/\?/.test(Z)){Z=Z.split("?")[1]}if(aa==null){return L(Z)}var Y=Z.split("&");for(var X=0;X<Y.length;X++){if(Y[X].substring(0,Y[X].indexOf("="))==aa){return L(Y[X].substring((Y[X].indexOf("=")+1)))}}}return""},expressInstallCallback:function(){if(a){var X=c(R);if(X&&l){X.parentNode.replaceChild(l,X);if(Q){w(Q,true);if(M.ie&&M.win){l.style.display="block"}}if(E){E(B)}}a=false}}}}();
/**
 * Fichier inclu pour gérer l'historique navigateur avec Ajax
 * Fait le 26/05/2009 par Frédérik BOBET
 */


/**
 * Fonction qui récupère l'ancre ajoutée par le gestionnaire d'historique (#histoire-tradition.php)
 * @param {String} url adresse url contenant l'ancre (http://www.aide1.fr/fr/restaurant.php#histoire-tradition.php)
 * @return (String) histoire-tradition.php
 */
var getAjaxAnchor = function(url) 
{ 
    if( url.length == 0 ) return ""; 
    var sharp = url.lastIndexOf("#"); 
    if( sharp == -1 ) return ""; 
    var page = url.substr(sharp+1,url.length); 
    return page; 
}; 

/**
 * Fonction qui récupère le début de l'url (http://www.aide1.fr/fr)
 * @param {String} url adresse url complète
 * @return (String) http://www.aide1.fr/fr
 */
var getBaseFolder = function(url)
{
    var arrayUrl = url.split("/");
    arrayUrl.pop();
    return arrayUrl.join("/");
};

/**
 * Fonction qui test si le format de str est bien [String].php
 * @param {String} str
 * @return (Boolean) Résultat du test isPagePhp
 */
var isPagePhp = function(str)
{ 
    var arrayPage = str.split("\.");
    if(arrayPage.length != 2) return false;
    if(arrayPage[1] != 'php') return false;
    return true;
};

var url = window.location.href;
var pagePhp = getAjaxAnchor(url);
if(pagePhp != "" && isPagePhp(pagePhp)){
    var urlRedirect = getBaseFolder(url)+"/"+pagePhp;
    
    //Récupération des paramètres GET
    if(url.indexOf('?') != -1) {
        var paramsGET = url.substring(url.indexOf('?') + 1, url.lastIndexOf("#"));        
        urlRedirect += '?' + paramsGET
    }
    
    window.location.href = urlRedirect;
} 







//*********** juste avant le <body>: placer le code suivant (entete_typeX.php)(remplacer les informations compte et email si nécessaire):
//<script type="text/javascript">
//    var _Pagename     = "<?=affiche_titre_pdv()?>";
//    var _Compte     = "compte";
//    var _fma        = "email";
//    var fcn="fs"+_Compte;var fid="";var exdate=new Date();_fstart=exdate.getTime();charSet="";if(document.cookie.length>0){fcs=document.cookie.indexOf(fcn+"=");if(fcs!=-1){fcs=fcs+fcn.length+1;fce=document.cookie.indexOf(";",fcs);if(fce==-1)fce=document.cookie.length;fid=unescape(document.cookie.substring(fcs,fce));}}if(fid==""){for (var i=1;i<20;++i){charSet="0abc1def2ijk3lmn4opq5rst6uvw7xyz89";fid=fid+charSet.charAt(Math.floor(Math.random()*(charSet.length-0))+0);}exdate.setDate(exdate.getDate()+365);document.cookie=fcn+"="+escape(fid)+((365==null) ? "" : ";expires="+exdate.toGMTString());}
//    document.write("<img id='perferencement_simple' src='http://www.efficienttraffic.com/config/statv3.php?Lg="+_Compte+"&page="+_Pagename+"&us="+escape(location.href)+"&reso_w="+screen.width+"&reso_h="+screen.height+"&color="+screen.colorDepth+"&referer="+escape(window.document.referrer)+"&idfs="+fid+"&fma="+_fma+"' style='visibility:hidden;width:0px;height:0px;border:none;postion:absolute;'>");
//</script>
//
//*********** juste avant le </body> placer le code suivant (pied_typeX.php):
//<script type="text/javascript">
//    _fdt=new Date;_fend=_fdt.getTime();_ftc=(_fend-_fstart)/1000;
//    document.write("<img id='perferencement_rebond' src='http://www.efficienttraffic.com/config/statv3_off.php?Lg="+_Compte+"&ftc="+_ftc+"' style='visibility:hidden;width:0px;height:0px;border:none;postion:absolute;'>");
//</script>
//

var perferencement = {
    reload_tag_simple: function(_Pagename){
        var fcn="fs"+_Compte;var fid="";var exdate=new Date();_fstart=exdate.getTime();charSet="";if(document.cookie.length>0){fcs=document.cookie.indexOf(fcn+"=");if(fcs!=-1){fcs=fcs+fcn.length+1;fce=document.cookie.indexOf(";",fcs);if(fce==-1)fce=document.cookie.length;fid=unescape(document.cookie.substring(fcs,fce));}}if(fid==""){for (var i=1;i<20;++i){charSet="0abc1def2ijk3lmn4opq5rst6uvw7xyz89";fid=fid+charSet.charAt(Math.floor(Math.random()*(charSet.length-0))+0);}exdate.setDate(exdate.getDate()+365);document.cookie=fcn+"="+escape(fid)+((365==null) ? "" : ";expires="+exdate.toGMTString());}
        document.getElementById("perferencement_simple").src = "http://www.efficienttraffic.com/config/statv3.php?Lg="+_Compte+"&page="+_Pagename+"&us="+escape(location.href)+"&reso_w="+screen.width+"&reso_h="+screen.height+"&color="+screen.colorDepth+"&referer="+escape(window.document.referrer)+"&idfs="+fid+"&fma="+_fma+"&Dummy="+Math.random();    
    },
    reload_tag_rebond: function(){
        _fdt=new Date;_fend=_fdt.getTime();_ftc=(_fend-_fstart)/1000;
        document.getElementById("perferencement_rebond").src = "http://www.efficienttraffic.com/config/statv3_off.php?Lg="+_Compte+"&ftc="+_ftc+"&Dummy="+Math.random();    
    }
}

$j(document).bind('onLoadHtmlCompleted', function(evt, ajaxObject, data) {   
    //si perferencement: on déclenche l'appel des fonctions
    if(typeof(_Compte)!= "undefined" && typeof(_Pagename)!="undefined"){
        var titleperf =  data.favori.split("-");
        perferencement.reload_tag_simple(titleperf[1]).substring(0,titleperf.length-1);
        setTimeout( perferencement.reload_tag_rebond, 70);
    }
});
//Fonction d'appel des pages E-NEWS et Tracking
var pop = function(pLien, id_track, pBoolean,QuickEdit) {
    var taille = GetWindowSize();
    lyteflash(pLien,taille[0],taille[1]);
    //Click(id_track);
    if(typeof(QuickEdit)!='undefined' && typeof(quickedit)!='undefined'){
        //variable déclarée globale dans les header (header_static.php) quand on est authentidfied
        quickedit=true;
    }
    if (!pBoolean) return pBoolean; 
    
} 

var lyteflash = function(url,width,height) {

   var objLink = document.createElement('a');
   objLink.setAttribute('href',url);
   objLink.setAttribute('rel','lyteframe');
   objLink.setAttribute('rev','width:'+width+';height:'+height+';')          
   myLytebox.start(objLink, false, true);

}

var isset=function(variable){
  if ( typeof(variable) != "undefined" ) {
    return true;
  }
  else {
    return false;
  }
}

/*
Fonction de détection de la taille interne de la fenêtre
*/
GetWindowSize = function() {
        w = window;
        //var popLargeur = 680;
        //var popHauteur = 500;
        if(typeof(popLargeur) != "undefined" && typeof(popHauteur) != "undefined")
        {
          var width = popLargeur != '' && popLargeur>0 ? popLargeur : 680;
          var height = popHauteur != '' && popLargeur>0 ? popHauteur : 500;
        }
        else
        {
          var width = 680;
          var height = 500;
        }
        width = width + 4;
        return [width, height]
}


/*
var xmlhttp = false;
if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
    xmlhttp = new XMLHttpRequest();
}
*/
function Click(a) {
    if (a != 0) {
        fragment_url = '/clic.php?sort='+a;
        xmlhttp.open("GET", fragment_url);
        xmlhttp.onreadystatechange = function() {
            if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
                tmp = xmlhttp.responseText;
            }
        }
        xmlhttp.send(null);
    }
}

 
//***********************************************************************************************************************************/
//    LyteBox v3.22
//
//     Author: Markus F. Hay
//  Website: http://www.dolem.com/lytebox
//       Date: October 2, 2007
//    License: Creative Commons Attribution 3.0 License (http://creativecommons.org/licenses/by/3.0/)
// Browsers: Tested successfully on WinXP with the following browsers (using no DOCTYPE and Strict/Transitional/Loose DOCTYPES):
//                * Firefox: 2.0.0.7, 1.5.0.12
//                * Internet Explorer: 7.0, 6.0 SP2, 5.5 SP2
//                * Opera: 9.23
//
// Releases: For up-to-date and complete release information, visit http://www.dolem.com/forum/showthread.php?tid=62
//                * v3.22 (10/02/07)
//                * v3.21 (09/30/07)
//                * v3.20 (07/12/07)
//                * v3.10 (05/28/07)
//                * v3.00 (05/15/07)
//                * v2.02 (11/13/06)
//
//   Credit: LyteBox was originally derived from the Lightbox class (v2.02) that was written by Lokesh Dhakar. For more
//             information please visit http://huddletogether.com/projects/lightbox2/
//***********************************************************************************************************************************/
Array.prototype.removeDuplicates = function () { for (var i = 1; i < this.length; i++) { if (this[i][0] == this[i-1][0]) { this.splice(i,1); } } }
Array.prototype.empty = function () { for (var i = 0; i <= this.length; i++) { this.shift(); } }
String.prototype.trim = function () { return this.replace(/^\s+|\s+$/g, ''); }

var nb_popenews = 0;



function LyteBox() {
    /*** Start Global Configuration ***/
        this.theme                = 'grey';    // themes: grey (default), red, green, blue, gold
        this.hideFlash            = false;        // controls whether or not Flash objects should be hidden
        this.outerBorder        = true;        // controls whether to show the outer grey (or theme) border
        this.resizeSpeed        = 10;        // controls the speed of the image resizing (1=slowest and 10=fastest)
        this.maxOpacity            = 60;        // higher opacity = darker overlay, lower opacity = lighter overlay
        this.navType            = 1;        // 1 = "Prev/Next" buttons on top left and left (default), 2 = "<< prev | next >>" links next to image number
        this.autoResize            = true;        // controls whether or not images should be resized if larger than the browser window dimensions
        this.doAnimations        = false;        // controls whether or not "animate" Lytebox, i.e. resize transition between images, fade in/out effects, etc.
        
        this.borderSize            = 0;        // if you adjust the padding in the CSS, you will need to update this variable -- otherwise, leave this alone...
    /*** End Global Configuration ***/
    
    /*** Configure Slideshow Options ***/
        this.slideInterval        = 4000;        // Change value (milliseconds) to increase/decrease the time between "slides" (10000 = 10 seconds)
        this.showNavigation        = true;        // true to display Next/Prev buttons/text during slideshow, false to hide
        this.showClose            = true;        // true to display the Close button, false to hide
        this.showDetails        = true;        // true to display image details (caption, count), false to hide
        this.showPlayPause        = true;        // true to display pause/play buttons next to close button, false to hide
        this.autoEnd            = false;        // true to automatically close Lytebox after the last image is reached, false to keep open
        this.pauseOnNextClick    = false;    // true to pause the slideshow when the "Next" button is clicked
        this.pauseOnPrevClick     = true;        // true to pause the slideshow when the "Prev" button is clicked
    /*** End Slideshow Configuration ***/
    
    if(this.resizeSpeed > 10) { this.resizeSpeed = 10; }
    if(this.resizeSpeed < 1) { resizeSpeed = 1; }
    this.resizeDuration = (11 - this.resizeSpeed) * 0.15;
    this.resizeWTimerArray        = new Array();
    this.resizeWTimerCount        = 0;
    this.resizeHTimerArray        = new Array();
    this.resizeHTimerCount        = 0;
    this.showContentTimerArray    = new Array();
    this.showContentTimerCount    = 0;
    this.overlayTimerArray        = new Array();
    this.overlayTimerCount        = 0;
    this.imageTimerArray        = new Array();
    this.imageTimerCount        = 0;
    this.timerIDArray            = new Array();
    this.timerIDCount            = 0;
    this.slideshowIDArray        = new Array();
    this.slideshowIDCount        = 0;
    this.imageArray     = new Array();
    this.activeImage = null;
    this.slideArray     = new Array();
    this.activeSlide = null;
    this.frameArray     = new Array();
    this.activeFrame = null;
    this.checkFrame();
    this.isSlideshow = false;
    this.isLyteframe = true;
    /*@cc_on
        /*@if (@_jscript)
            this.ie = (document.all && !window.opera) ? true : false;
        /*@else @*/
            this.ie = false;
        /*@end
    @*/
    this.ie7 = (this.ie && window.XMLHttpRequest);
    this.ie8 = (navigator.appVersion.indexOf("MSIE 8.0")!=-1);   
    this.initialize();
}
LyteBox.prototype.initialize = function() {
    this.updateLyteboxItems();
    var objBody = this.doc.getElementsByTagName("body").item(0);    
    if (this.doc.getElementById('lbOverlay')) {
        objBody.removeChild(this.doc.getElementById("lbOverlay"));
        objBody.removeChild(this.doc.getElementById("lbMain"));
        
    }
    
    var objOverlay = this.doc.createElement("div");
        objOverlay.setAttribute('id','lbOverlay');
        objOverlay.setAttribute('className', this.theme);
        objOverlay.setAttribute('class', this.theme);
        if ((this.ie && !this.ie7) || (this.ie7 && this.doc.compatMode == 'BackCompat')) {
            objOverlay.style.position = 'absolute';
        }
        objOverlay.style.display = 'none';
        objBody.appendChild(objOverlay);
        
    var objLytebox = this.doc.createElement("div");
        objLytebox.setAttribute('id','lbMain');
        objLytebox.style.display = 'none';
        objBody.appendChild(objLytebox);
        
    var objDetailsContainer = this.doc.createElement("div");
        objDetailsContainer.setAttribute('id','lbDetailsContainer');
        objDetailsContainer.setAttribute('className', 'dialog_content dialog_nw dialog_ne');
        objDetailsContainer.setAttribute('class', 'dialog_content dialog_nw dialog_ne');
        objLytebox.appendChild(objDetailsContainer); 
        
    var objOuterContainer = this.doc.createElement("div");
        objOuterContainer.setAttribute('id','lbOuterContainer');
        objOuterContainer.setAttribute('className', 'dialog_content dialog_sw dialog_se');
        objOuterContainer.setAttribute('class', 'dialog_content dialog_sw dialog_se');
        objLytebox.appendChild(objOuterContainer);
        
    var objIframeContainer = this.doc.createElement("div");
        objIframeContainer.setAttribute('id','lbIframeContainer');
        objIframeContainer.style.display = 'none';
        objOuterContainer.appendChild(objIframeContainer);
        
    var objIframe = this.doc.createElement("iframe");
        objIframe.setAttribute('id','lbIframe');
        objIframe.setAttribute('name','lbIframe');
        objIframe.setAttribute('frameborder',0); 
        objIframe.style.display = 'none';
        objIframeContainer.appendChild(objIframe);
        
    var objImageContainer = this.doc.createElement("div");
        objImageContainer.setAttribute('id','lbImageContainer');
        objOuterContainer.appendChild(objImageContainer);
        
    var objLyteboxImage = this.doc.createElement("img");
        objLyteboxImage.setAttribute('id','lbImage');
        objImageContainer.appendChild(objLyteboxImage);
        
    var objLoading = this.doc.createElement("div");
        objLoading.setAttribute('id','lbLoading');
        objOuterContainer.appendChild(objLoading);
              
    var objDetailsData =this.doc.createElement("div");
        objDetailsData.setAttribute('id','lbDetailsData');
        objDetailsData.setAttribute('className', 'dialog_content');
        objDetailsData.setAttribute('class', 'dialog_content');
        objDetailsContainer.appendChild(objDetailsData);
        
    var objDetails = this.doc.createElement("div");
        objDetails.setAttribute('id','lbDetails');
        objDetailsData.appendChild(objDetails);
    var objCaption = this.doc.createElement("span");
        objCaption.setAttribute('id','lbCaption');
        objDetails.appendChild(objCaption);
    var objHoverNav = this.doc.createElement("div");
        objHoverNav.setAttribute('id','lbHoverNav');
        objImageContainer.appendChild(objHoverNav);
    var objBottomNav = this.doc.createElement("div");
        objBottomNav.setAttribute('id','lbBottomNav');
        objBottomNav.setAttribute('className', 'dialog_close');
        objBottomNav.setAttribute('class', 'dialog_close');
        objDetailsData.appendChild(objBottomNav);
    var objPrev = this.doc.createElement("a");
        objPrev.setAttribute('id','lbPrev');
        objPrev.setAttribute('className', this.theme);
        objPrev.setAttribute('class', this.theme);
        objPrev.setAttribute('href','#');
        objHoverNav.appendChild(objPrev);
    var objNext = this.doc.createElement("a");
        objNext.setAttribute('id','lbNext');
        objNext.setAttribute('className', this.theme);
        objNext.setAttribute('class', this.theme);
        objNext.setAttribute((this.ie && !this.ie8 ? 'className' : 'class'), this.theme);
        objNext.setAttribute('href','#');
        objHoverNav.appendChild(objNext);
    var objNumberDisplay = this.doc.createElement("span");
        objNumberDisplay.setAttribute('id','lbNumberDisplay');
        objDetails.appendChild(objNumberDisplay);
    var objNavDisplay = this.doc.createElement("span");
        objNavDisplay.setAttribute('id','lbNavDisplay');
        objNavDisplay.style.display = 'none';
        objDetails.appendChild(objNavDisplay);
    
    var objCloseGlobal = this.doc.createElement("span");
        objCloseGlobal.setAttribute('id','lbCloseGlobal');
        objCloseGlobal.setAttribute('className', 'dialog_close');
        objCloseGlobal.setAttribute('class', 'dialog_close');
        objBottomNav.appendChild(objCloseGlobal);
    
    
    var objClose = this.doc.createElement("a");
        objClose.setAttribute('id','lbClose');
        objClose.setAttribute('className', this.theme);
        objClose.setAttribute('class', this.theme);
        objClose.setAttribute('href','#');
        objCloseGlobal.appendChild(objClose);
    var objCloseText = this.doc.createElement("a");
        objCloseText.setAttribute('id','lbCloseText');
        objCloseText.setAttribute('href','#');
        objCloseGlobal.appendChild(objCloseText);
    var objPause = this.doc.createElement("a");
        objPause.setAttribute('id','lbPause');
        objPause.setAttribute('className', this.theme);
        objPause.setAttribute('class', this.theme);
        objPause.setAttribute('href','#');
        objPause.style.display = 'none';
        objBottomNav.appendChild(objPause);
    var objPlay = this.doc.createElement("a");
        objPlay.setAttribute('id','lbPlay');
        objPlay.setAttribute('className', this.theme);
        objPlay.setAttribute('class', this.theme);
        objPlay.setAttribute('href','#');
        objPlay.style.display = 'none';
        objBottomNav.appendChild(objPlay);
        
};
LyteBox.prototype.updateLyteboxItems = function() {    
    //var anchors = (this.isFrame) ? window.parent.frames[window.name].document.getElementsByTagName('a') : document.getElementsByTagName('a');
    var anchors = document.getElementsByTagName('a');
    for (var i = 0; i < anchors.length; i++) {
        var anchor = anchors[i];
        var relAttribute = String(anchor.getAttribute('rel'));
        if (anchor.getAttribute('href')) {
            if (relAttribute.toLowerCase().match('lytebox')) {
                anchor.onclick = function () { myLytebox.start(this, false, false); return false; }
            } else if (relAttribute.toLowerCase().match('lyteshow')) {
                anchor.onclick = function () { myLytebox.start(this, true, false); return false; }
            } else if (relAttribute.toLowerCase().match('lyteframe')) {
                anchor.onclick = function () { myLytebox.start(this, false, true); return false; }
            }
        }
    }
};
LyteBox.prototype.start = function(imageLink, doSlide, doFrame) {
    if (this.ie && !this.ie7) {    this.toggleSelects('hide');    }
    if (this.hideFlash) { this.toggleFlash('hide'); }
    this.isLyteframe = (doFrame ? true : false);
    var pageSize    = this.getPageSize();
    var objOverlay    = this.doc.getElementById('lbOverlay');
    var objBody        = this.doc.getElementsByTagName("body").item(0);
    objOverlay.style.height = pageSize[1] + "px";
    objOverlay.style.display = '';
    this.appear('lbOverlay', (this.doAnimations ? 0 : this.maxOpacity));
    var anchors = (this.isFrame) ? window.parent.frames[window.name].document.getElementsByTagName('a') : document.getElementsByTagName('a');
    if (this.isLyteframe) {
        this.frameArray = [];
        this.frameNum = 0;
        var taille = GetWindowSize(popLargeur,popHauteur);
        if ((imageLink.getAttribute('rel') == 'lyteframe')) {
            var rev = imageLink.getAttribute('rev');
            this.frameArray.push(new Array(imageLink.getAttribute('href'), imageLink.getAttribute('title'), (rev == null || rev == '' ? 'width: '+taille[0]+'; height: '+taille[1]+'; scrolling: auto;' : rev)));
        } else {
            if (imageLink.getAttribute('rel').indexOf('lyteframe') != -1) {
                for (var i = 0; i < anchors.length; i++) {
                    var anchor = anchors[i];
                    if (anchor.getAttribute('href') && (anchor.getAttribute('rel') == imageLink.getAttribute('rel'))) {
                        var rev = anchor.getAttribute('rev');
                        this.frameArray.push(new Array(anchor.getAttribute('href'), anchor.getAttribute('title'), (rev == null || rev == '' ? 'width: '+taille[0]+'; height: '+taille[1]+'; scrolling: auto;' : rev)));
                    }
                }
                this.frameArray.removeDuplicates();
                while(this.frameArray[this.frameNum][0] != imageLink.getAttribute('href')) { this.frameNum++; }
            }
        }
    } else {
        this.imageArray = [];
        this.imageNum = 0;
        this.slideArray = [];
        this.slideNum = 0;
        if ((imageLink.getAttribute('rel') == 'lytebox')) {
            this.imageArray.push(new Array(imageLink.getAttribute('href'), imageLink.getAttribute('title')));
        } else {
            if (imageLink.getAttribute('rel').indexOf('lytebox') != -1) {
                for (var i = 0; i < anchors.length; i++) {
                    var anchor = anchors[i];
                    if (anchor.getAttribute('href') && (anchor.getAttribute('rel') == imageLink.getAttribute('rel'))) {
                        this.imageArray.push(new Array(anchor.getAttribute('href'), anchor.getAttribute('title')));
                    }
                }
                this.imageArray.removeDuplicates();
                while(this.imageArray[this.imageNum][0] != imageLink.getAttribute('href')) { this.imageNum++; }
            }
            if (imageLink.getAttribute('rel').indexOf('lyteshow') != -1) {
                for (var i = 0; i < anchors.length; i++) {
                    var anchor = anchors[i];
                    if (anchor.getAttribute('href') && (anchor.getAttribute('rel') == imageLink.getAttribute('rel'))) {
                        this.slideArray.push(new Array(anchor.getAttribute('href'), anchor.getAttribute('title')));
                    }
                }
                this.slideArray.removeDuplicates();
                while(this.slideArray[this.slideNum][0] != imageLink.getAttribute('href')) { this.slideNum++; }
            }
        }
    }
    var object = this.doc.getElementById('lbMain');
    object.style.top = (this.getPageScroll() + (pageSize[3] / 20)) + "px";
    object.style.display = '';
    if (!this.outerBorder) {
        //this.doc.getElementById('lbOuterContainer').style.border = 'none';
        //this.doc.getElementById('lbDetailsContainer').style.border = 'none';
    } else {
        //this.doc.getElementById('lbOuterContainer').style.borderBottom = '';
        //this.doc.getElementById('lbOuterContainer').setAttribute((this.ie && !this.ie8 ? 'className' : 'class'), 'dialog_content dialog_e');
    }
    //this.doc.getElementById('lbOverlay').onclick = function() { myLytebox.end(); return false; }
    this.doc.getElementById('lbMain').onclick = function(e) {
        var e = e;
        if (!e) {
            if (window.parent.frames[window.name] && (parent.document.getElementsByTagName('frameset').length <= 0)) {
                e = window.parent.window.event;
            } else {
                e = window.event;
            }
        }
        var id = (e.target ? e.target.id : e.srcElement.id);
        //if (id == 'lbMain') { myLytebox.end(); return false; }
    }
    this.doc.getElementById('lbClose').onclick = function() { myLytebox.end(); return false; }
    this.doc.getElementById('lbCloseText').onclick = function() { myLytebox.end(); return false; }
    this.doc.getElementById('lbPause').onclick = function() { myLytebox.togglePlayPause("lbPause", "lbPlay"); return false; }
    this.doc.getElementById('lbPlay').onclick = function() { myLytebox.togglePlayPause("lbPlay", "lbPause"); return false; }    
    this.isSlideshow = doSlide;
    this.isPaused = (this.slideNum != 0 ? true : false);
    if (this.isSlideshow && this.showPlayPause && this.isPaused) {
        this.doc.getElementById('lbPlay').style.display = '';
        this.doc.getElementById('lbPause').style.display = 'none';
    }
    if (this.isLyteframe) {
        this.changeContent(this.frameNum);
    } else {
        if (this.isSlideshow) {
            this.changeContent(this.slideNum);
        } else {
            this.changeContent(this.imageNum);
        }
    }
};
LyteBox.prototype.changeContent = function(imageNum) {
    if (this.isSlideshow) {
        for (var i = 0; i < this.slideshowIDCount; i++) { window.clearTimeout(this.slideshowIDArray[i]); }
    }
    this.activeImage = this.activeSlide = this.activeFrame = imageNum;
    if (!this.outerBorder) {
        //this.doc.getElementById('lbOuterContainer').style.border = 'none';
        //this.doc.getElementById('lbDetailsContainer').style.border = 'none';
    } else {
        //this.doc.getElementById('lbOuterContainer').style.borderBottom = '';
        //this.doc.getElementById('lbOuterContainer').setAttribute((this.ie && !this.ie8 ? 'className' : 'class'), 'dialog_content dialog_e');
    }
    this.doc.getElementById('lbLoading').style.display = '';
    this.doc.getElementById('lbImage').style.display = 'none';
    this.doc.getElementById('lbIframe').style.display = 'none';
    this.doc.getElementById('lbPrev').style.display = 'none';
    this.doc.getElementById('lbNext').style.display = 'none';
    this.doc.getElementById('lbIframeContainer').style.display = 'none';
    //this.doc.getElementById('lbDetailsContainer').style.display = 'none';
    this.doc.getElementById('lbNumberDisplay').style.display = 'none';
    if (this.navType == 2 || this.isLyteframe) {
        object = this.doc.getElementById('lbNavDisplay');
        object.innerHTML = '&nbsp;&nbsp;&nbsp;<span id="lbPrev2_Off" style="display: none;" class="' + this.theme + '">&laquo; prev</span><a href="#" id="lbPrev2" class="' + this.theme + '" style="display: none;">&laquo; prev</a> <b id="lbSpacer" class="' + this.theme + '">||</b> <span id="lbNext2_Off" style="display: none;" class="' + this.theme + '">next &raquo;</span><a href="#" id="lbNext2" class="' + this.theme + '" style="display: none;">next &raquo;</a>';
        object.style.display = 'none';
    }
    if (this.isLyteframe) {
        var iframe = myLytebox.doc.getElementById('lbIframe');
        var styles = this.frameArray[this.activeFrame][2];
        var aStyles = styles.split(';');
        for (var i = 0; i < aStyles.length; i++) {
            if (aStyles[i].indexOf('width:') >= 0) {
                var w = aStyles[i].replace('width:', '');
                iframe.width = w.trim();
            } else if (aStyles[i].indexOf('height:') >= 0) {
                var h = aStyles[i].replace('height:', '');
                iframe.height = h.trim();
            } else if (aStyles[i].indexOf('scrolling:') >= 0) {
                var s = aStyles[i].replace('scrolling:', '');
                iframe.scrolling = s.trim();
            } else if (aStyles[i].indexOf('border:') >= 0) {
                // Not implemented yet, as there are cross-platform issues with setting the border (from a GUI standpoint)
                //var b = aStyles[i].replace('border:', '');
                //iframe.style.border = b.trim();
            }
        }
        this.resizeContainer(parseInt(iframe.width), parseInt(iframe.height));
    } else {
        imgPreloader = new Image();
        imgPreloader.onload = function() {
            var imageWidth = imgPreloader.width;
            var imageHeight = imgPreloader.height;
            if (myLytebox.autoResize) {
                var pagesize = myLytebox.getPageSize();
                var x = pagesize[2] - 150;
                var y = pagesize[3] - 150;
                if (imageWidth > x) {
                    imageHeight = Math.round(imageHeight * (x / imageWidth));
                    imageWidth = x; 
                    if (imageHeight > y) { 
                        imageWidth = Math.round(imageWidth * (y / imageHeight));
                        imageHeight = y; 
                    }
                } else if (imageHeight > y) { 
                    imageWidth = Math.round(imageWidth * (y / imageHeight));
                    imageHeight = y; 
                    if (imageWidth > x) {
                        imageHeight = Math.round(imageHeight * (x / imageWidth));
                        imageWidth = x;
                    }
                }
            }
            var lbImage = myLytebox.doc.getElementById('lbImage')
            lbImage.src = (myLytebox.isSlideshow ? myLytebox.slideArray[myLytebox.activeSlide][0] : myLytebox.imageArray[myLytebox.activeImage][0]);
            lbImage.width = imageWidth;
            lbImage.height = imageHeight;
            myLytebox.resizeContainer(imageWidth, imageHeight);
            imgPreloader.onload = function() {};
        }
        imgPreloader.src = (this.isSlideshow ? this.slideArray[this.activeSlide][0] : this.imageArray[this.activeImage][0]);
    }
};
LyteBox.prototype.resizeContainer = function(imgWidth, imgHeight) {
    this.wCur = this.doc.getElementById('lbOuterContainer').offsetWidth;
    this.hCur = this.doc.getElementById('lbOuterContainer').offsetHeight;
    this.xScale = (((imgWidth  + (this.borderSize * 2)) / this.wCur) * 100);
    this.yScale = ((imgHeight  + (this.borderSize * 2)) / this.hCur) * 100;
    var wDiff = (this.wCur - this.borderSize * 2) - imgWidth;
    var hDiff = (this.hCur - this.borderSize * 2) - imgHeight;
    if (!(hDiff == 0)) {
        this.hDone = false;
        this.resizeH('lbOuterContainer', this.hCur, imgHeight, this.getPixelRate(this.hCur, imgHeight));
    } else {
        this.hDone = true;
    }
    if (!(wDiff == 0)) {
        this.wDone = false;
        this.resizeW('lbOuterContainer', this.wCur, imgWidth + this.borderSize*2, this.getPixelRate(this.wCur, imgWidth));
    } else {
        this.wDone = true;
    }
    if ((hDiff == 0) && (wDiff == 0)) {
        if (this.ie){ this.pause(250); } else { this.pause(100); } 
    }
    offsetIE = 0;
    if(this.ie){
        offsetIE = 2;
    }
    this.doc.getElementById('lbPrev').style.height = imgHeight + "px";
    this.doc.getElementById('lbNext').style.height = imgHeight + "px";
    this.doc.getElementById('lbDetailsContainer').style.width = (imgWidth - offsetIE + (this.borderSize * 2) + (this.ie && this.doc.compatMode == "BackCompat" && this.outerBorder ? 2 : 0)) + "px";
    if(typeof(largeur_pourcent) != "undefined")
    {
      if(largeur_pourcent == 1)
      {
        this.doc.getElementById('lbDetailsContainer').style.width = imgWidth + "%";
        this.doc.getElementById('lbOuterContainer').style.width = imgWidth + "%";
        this.doc.getElementById('lbIframe').style.width = "100%";
      }
    }
    /*POSITIONNEMENT VERTICAL*/
    if(typeof(hauteur_pourcent) != "undefined")
    {
      if(hauteur_pourcent == 1)
      {
        var windowHeight = 0;
        if (typeof window.innerWidth != 'undefined'){
          windowHeight = window.innerHeight
        }
        else if (
          typeof document.documentElement != 'undefined' && 
          typeof document.documentElement.clientHeight != 'undefined' &&
          document.documentElement.clientHeight != 0)
        {
        // IE6 in standards compliant mode (i.e. with a valid doctype as the first line in the document)
          windowHeight = document.documentElement.clientHeight
        }
        else{
          windowHeight = document.getElementsByTagName('body')[0].clientHeight
        }
      
      var finalHeight =  windowHeight * (imgHeight/100) + "px";
        this.doc.getElementById('lbOuterContainer').style.height = finalHeight;
        this.doc.getElementById('lbIframe').style.height = finalHeight;
        /*
        if(typeof(decalage_top) == "undefined")
        {
          //Calcul du décalage depuis le haut pour centrer la pop dans l'espace vertical disponible
          var percenttop = ((document.body.clientHeight-(document.body.clientHeight*(imgHeight/100)))/2)-30;
          if(percenttop>0 && percenttop<500)
          {
            this.doc.getElementById('lbMain').style.top = percenttop + "px";
          }
        }*/
      }
    }
    else
    {
      /*
      if(typeof(decalage_top) == "undefined")
      {
        //Calcul du décalage depuis le haut pour centrer la pop dans l'espace vertical disponible
        var percenttop = ((document.body.clientHeight-imgHeight)/2)-30;
        if(percenttop>0 && percenttop<500)
        {
          this.doc.getElementById('lbMain').style.top = percenttop + "px";
        }
      }
      */
    }
    
    if(typeof(decalage_top) != "undefined")
    {
      if(decalage_top>=0 && decalage_top<500)
      {
        this.doc.getElementById('lbMain').style.top = decalage_top + "px";
      }
    }

    

    this.showContent();
};
LyteBox.prototype.showContent = function() {
    if (this.wDone && this.hDone) {
        for (var i = 0; i < this.showContentTimerCount; i++) { window.clearTimeout(this.showContentTimerArray[i]); }
        if (this.outerBorder) {
            //this.doc.getElementById('lbOuterContainer').style.borderBottom = 'none';
        }
        this.doc.getElementById('lbLoading').style.display = 'none';
        if (this.isLyteframe) {
            this.doc.getElementById('lbIframe').style.display = '';
            this.appear('lbIframe', (this.doAnimations ? 0 : 100));
        } else {
            this.doc.getElementById('lbImage').style.display = '';
            this.appear('lbImage', (this.doAnimations ? 0 : 100));
            this.preloadNeighborImages();
        }
        if (this.isSlideshow) {
            if(this.activeSlide == (this.slideArray.length - 1)) {
                if (this.autoEnd) {
                    this.slideshowIDArray[this.slideshowIDCount++] = setTimeout("myLytebox.end('slideshow')", this.slideInterval);
                }
            } else {
                if (!this.isPaused) {
                    this.slideshowIDArray[this.slideshowIDCount++] = setTimeout("myLytebox.changeContent("+(this.activeSlide+1)+")", this.slideInterval);
                }
            }
            this.doc.getElementById('lbHoverNav').style.display = (this.showNavigation && this.navType == 1 ? '' : 'none');
            this.doc.getElementById('lbClose').style.display = (this.showClose ? '' : 'none');
            this.doc.getElementById('lbDetails').style.display = (this.showDetails ? '' : 'none');
            this.doc.getElementById('lbPause').style.display = (this.showPlayPause && !this.isPaused ? '' : 'none');
            this.doc.getElementById('lbPlay').style.display = (this.showPlayPause && !this.isPaused ? 'none' : '');
            this.doc.getElementById('lbNavDisplay').style.display = (this.showNavigation && this.navType == 2 ? '' : 'none');
        } else {
            this.doc.getElementById('lbHoverNav').style.display = (this.navType == 1 && !this.isLyteframe ? '' : 'none');
            if ((this.navType == 2 && !this.isLyteframe && this.imageArray.length > 1) || (this.frameArray.length > 1 && this.isLyteframe)) {
                this.doc.getElementById('lbNavDisplay').style.display = '';
            } else {
                this.doc.getElementById('lbNavDisplay').style.display = 'none';
            }
            this.doc.getElementById('lbClose').style.display = '';
            this.doc.getElementById('lbDetails').style.display = '';
            this.doc.getElementById('lbPause').style.display = 'none';
            this.doc.getElementById('lbPlay').style.display = 'none';
        }
        this.doc.getElementById('lbImageContainer').style.display = (this.isLyteframe ? 'none' : '');
        this.doc.getElementById('lbIframeContainer').style.display = (this.isLyteframe ? '' : 'none');
        try {                 
            this.doc.getElementById('lbIframe').src = this.frameArray[this.activeFrame][0];
            this.doc.getElementById('lbIframe').frameBorder = '0';
        } catch(e) { }
    } else {
        this.showContentTimerArray[this.showContentTimerCount++] = setTimeout("myLytebox.showContent()", 200);
    }
};   
LyteBox.prototype.updateDetails = function() {
    var object = this.doc.getElementById('lbCaption');
    var sTitle = (this.isSlideshow ? this.slideArray[this.activeSlide][1] : (this.isLyteframe ? this.frameArray[this.activeFrame][1] : this.imageArray[this.activeImage][1]));
    object.style.display = '';
    object.innerHTML = (sTitle == null ? '' : sTitle);
    this.updateNav();
    this.doc.getElementById('lbDetailsContainer').style.display = '';
    //Gestion du bouton fermer/close
    object = this.doc.getElementById('lbCloseText');
    object.innerHTML = '<span>'+popBoutonFermeture+'</span>';
    //FIN
    object = this.doc.getElementById('lbNumberDisplay');
    if (this.isSlideshow && this.slideArray.length > 1) {
        object.style.display = '';
        object.innerHTML = "Image " + eval(this.activeSlide + 1) + " of " + this.slideArray.length;
        this.doc.getElementById('lbNavDisplay').style.display = (this.navType == 2 && this.showNavigation ? '' : 'none');
    } else if (this.imageArray.length > 1 && !this.isLyteframe) {
        object.style.display = '';
        object.innerHTML = "Image " + eval(this.activeImage + 1) + " of " + this.imageArray.length;
        this.doc.getElementById('lbNavDisplay').style.display = (this.navType == 2 ? '' : 'none');
    } else if (this.frameArray.length > 1 && this.isLyteframe) {
        object.style.display = '';
        object.innerHTML = "Page " + eval(this.activeFrame + 1) + " of " + this.frameArray.length;
        this.doc.getElementById('lbNavDisplay').style.display = '';
    } else {
        this.doc.getElementById('lbNavDisplay').style.display = 'none';
    }
    this.appear('lbDetailsContainer', (this.doAnimations ? 0 : 100));
};
LyteBox.prototype.updateNav = function() {
    if (this.isSlideshow) {
        if (this.activeSlide != 0) {
            var object = (this.navType == 2 ? this.doc.getElementById('lbPrev2') : this.doc.getElementById('lbPrev'));
                object.style.display = '';
                object.onclick = function() {
                    if (myLytebox.pauseOnPrevClick) { myLytebox.togglePlayPause("lbPause", "lbPlay"); }
                    myLytebox.changeContent(myLytebox.activeSlide - 1); return false;
                }
        } else {
            if (this.navType == 2) { this.doc.getElementById('lbPrev2_Off').style.display = ''; }
        }
        if (this.activeSlide != (this.slideArray.length - 1)) {
            var object = (this.navType == 2 ? this.doc.getElementById('lbNext2') : this.doc.getElementById('lbNext'));
                object.style.display = '';
                object.onclick = function() {
                    if (myLytebox.pauseOnNextClick) { myLytebox.togglePlayPause("lbPause", "lbPlay"); }
                    myLytebox.changeContent(myLytebox.activeSlide + 1); return false;
                }
        } else {
            if (this.navType == 2) { this.doc.getElementById('lbNext2_Off').style.display = ''; }
        }
    } else if (this.isLyteframe) {
        if(this.activeFrame != 0) {
            var object = this.doc.getElementById('lbPrev2');
                object.style.display = '';
                object.onclick = function() {
                    myLytebox.changeContent(myLytebox.activeFrame - 1); return false;
                }
        } else {
            this.doc.getElementById('lbPrev2_Off').style.display = '';
        }
        if(this.activeFrame != (this.frameArray.length - 1)) {
            var object = this.doc.getElementById('lbNext2');
                object.style.display = '';
                object.onclick = function() {
                    myLytebox.changeContent(myLytebox.activeFrame + 1); return false;
                }
        } else {
            this.doc.getElementById('lbNext2_Off').style.display = '';
        }        
    } else {
        if(this.activeImage != 0) {
            var object = (this.navType == 2 ? this.doc.getElementById('lbPrev2') : this.doc.getElementById('lbPrev'));
                object.style.display = '';
                object.onclick = function() {
                    myLytebox.changeContent(myLytebox.activeImage - 1); return false;
                }
        } else {
            if (this.navType == 2) { this.doc.getElementById('lbPrev2_Off').style.display = ''; }
        }
        if(this.activeImage != (this.imageArray.length - 1)) {
            var object = (this.navType == 2 ? this.doc.getElementById('lbNext2') : this.doc.getElementById('lbNext'));
                object.style.display = '';
                object.onclick = function() {
                    myLytebox.changeContent(myLytebox.activeImage + 1); return false;
                }
        } else {
            if (this.navType == 2) { this.doc.getElementById('lbNext2_Off').style.display = ''; }
        }
    }
    this.enableKeyboardNav();
};
LyteBox.prototype.enableKeyboardNav = function() { document.onkeydown = this.keyboardAction; };
LyteBox.prototype.disableKeyboardNav = function() { document.onkeydown = ''; };
LyteBox.prototype.keyboardAction = function(e) {
    var keycode = key = escape = null;
    keycode    = (e == null) ? event.keyCode : e.which;
    key        = String.fromCharCode(keycode).toLowerCase();
    escape  = (e == null) ? 27 : e.DOM_VK_ESCAPE;
    if ((key == 'x') || (key == 'c') || (keycode == escape)) {
        myLytebox.end();
    } else if ((key == 'p') || (keycode == 37)) {
        if (myLytebox.isSlideshow) {
            if(myLytebox.activeSlide != 0) {
                myLytebox.disableKeyboardNav();
                myLytebox.changeContent(myLytebox.activeSlide - 1);
            }
        } else if (myLytebox.isLyteframe) {
            if(myLytebox.activeFrame != 0) {
                myLytebox.disableKeyboardNav();
                myLytebox.changeContent(myLytebox.activeFrame - 1);
            }
        } else {
            if(myLytebox.activeImage != 0) {
                myLytebox.disableKeyboardNav();
                myLytebox.changeContent(myLytebox.activeImage - 1);
            }
        }
    } else if ((key == 'n') || (keycode == 39)) {
        if (myLytebox.isSlideshow) {
            if(myLytebox.activeSlide != (myLytebox.slideArray.length - 1)) {
                myLytebox.disableKeyboardNav();
                myLytebox.changeContent(myLytebox.activeSlide + 1);
            }
        } else if (myLytebox.isLyteframe) {
            if(myLytebox.activeFrame != (myLytebox.frameArray.length - 1)) {
                myLytebox.disableKeyboardNav();
                myLytebox.changeContent(myLytebox.activeFrame + 1);
            }
        } else {
            if(myLytebox.activeImage != (myLytebox.imageArray.length - 1)) {
                myLytebox.disableKeyboardNav();
                myLytebox.changeContent(myLytebox.activeImage + 1);
            }
        }
    }
};
LyteBox.prototype.preloadNeighborImages = function() {
    if (this.isSlideshow) {
        if ((this.slideArray.length - 1) > this.activeSlide) {
            preloadNextImage = new Image();
            preloadNextImage.src = this.slideArray[this.activeSlide + 1][0];
        }
        if(this.activeSlide > 0) {
            preloadPrevImage = new Image();
            preloadPrevImage.src = this.slideArray[this.activeSlide - 1][0];
        }
    } else {
        if ((this.imageArray.length - 1) > this.activeImage) {
            preloadNextImage = new Image();
            preloadNextImage.src = this.imageArray[this.activeImage + 1][0];
        }
        if(this.activeImage > 0) {
            preloadPrevImage = new Image();
            preloadPrevImage.src = this.imageArray[this.activeImage - 1][0];
        }
    }
};
LyteBox.prototype.togglePlayPause = function(hideID, showID) {
    if (this.isSlideshow && hideID == "lbPause") {
        for (var i = 0; i < this.slideshowIDCount; i++) { window.clearTimeout(this.slideshowIDArray[i]); }
    }
    this.doc.getElementById(hideID).style.display = 'none';
    this.doc.getElementById(showID).style.display = '';
    if (hideID == "lbPlay") {
        this.isPaused = false;
        if (this.activeSlide == (this.slideArray.length - 1)) {
            this.end();
        } else {
            this.changeContent(this.activeSlide + 1);
        }
    } else {
        this.isPaused = true;
    }
};
LyteBox.prototype.end = function(caller) {
    if (this.isLyteframe) {
         //this.initialize();
         document.getElementById('lbIframe').src = 'about:blank';
    }
    var closeClick = (caller == 'slideshow' ? false : true);
    if (this.isSlideshow && this.isPaused && !closeClick) { return; }
    this.disableKeyboardNav();
    this.doc.getElementById('lbMain').style.display = 'none';
    this.fade('lbOverlay', (this.doAnimations ? this.maxOpacity : 0));
    this.toggleSelects('visible');
    if (this.hideFlash) { this.toggleFlash('visible'); }
    if (this.isSlideshow) {
        for (var i = 0; i < this.slideshowIDCount; i++) { window.clearTimeout(this.slideshowIDArray[i]); }
    }
    if(typeof(quickedit)!='undefined' ){
        if(quickedit==true){
            window.location.href=window.location.href;
        }
    }
    
};
LyteBox.prototype.checkFrame = function() {
    if (window.parent.frames[window.name] && (parent.document.getElementsByTagName('frameset').length <= 0)) {
        this.isFrame = true;
        this.lytebox = "window.parent." + window.name + ".myLytebox";
        this.doc = parent.document;
    } else {
        this.isFrame = false;
        this.lytebox = "myLytebox";
        this.doc = document;
    }
};
LyteBox.prototype.getPixelRate = function(cur, img) {
    var diff = (img > cur) ? img - cur : cur - img;
    if (diff >= 0 && diff <= 100) { return 10; }
    if (diff > 100 && diff <= 200) { return 15; }
    if (diff > 200 && diff <= 300) { return 20; }
    if (diff > 300 && diff <= 400) { return 25; }
    if (diff > 400 && diff <= 500) { return 30; }
    if (diff > 500 && diff <= 600) { return 35; }
    if (diff > 600 && diff <= 700) { return 40; }
    if (diff > 700) { return 45; }
};
LyteBox.prototype.appear = function(id, opacity) {
    var object = this.doc.getElementById(id).style;
    object.opacity = (opacity / 100);
    object.MozOpacity = (opacity / 100);
    object.KhtmlOpacity = (opacity / 100);
    object.filter = "alpha(opacity=" + (opacity + 10) + ")";
    if (opacity == 100 && (id == 'lbImage' || id == 'lbIframe')) {
        try { object.removeAttribute("filter"); } catch(e) {}    /* Fix added for IE Alpha Opacity Filter bug. */
        this.updateDetails();
    } else if (opacity >= this.maxOpacity && id == 'lbOverlay') {
        for (var i = 0; i < this.overlayTimerCount; i++) { window.clearTimeout(this.overlayTimerArray[i]); }
        return;
    } else if (opacity >= 100 && id == 'lbDetailsContainer') {
        try { object.removeAttribute("filter"); } catch(e) {}    /* Fix added for IE Alpha Opacity Filter bug. */
        for (var i = 0; i < this.imageTimerCount; i++) { window.clearTimeout(this.imageTimerArray[i]); }
        this.doc.getElementById('lbOverlay').style.height = this.getPageSize()[1] + "px";
    } else {
        if (id == 'lbOverlay') {
            this.overlayTimerArray[this.overlayTimerCount++] = setTimeout("myLytebox.appear('" + id + "', " + (opacity+20) + ")", 1);
        } else {
            this.imageTimerArray[this.imageTimerCount++] = setTimeout("myLytebox.appear('" + id + "', " + (opacity+10) + ")", 1);
        }
    }
};
LyteBox.prototype.fade = function(id, opacity) {
    var object = this.doc.getElementById(id).style;
    object.opacity = (opacity / 100);
    object.MozOpacity = (opacity / 100);
    object.KhtmlOpacity = (opacity / 100);
    object.filter = "alpha(opacity=" + opacity + ")";
    if (opacity <= 0) {
        try {
            object.display = 'none';
        } catch(err) { }
    } else if (id == 'lbOverlay') {
        this.overlayTimerArray[this.overlayTimerCount++] = setTimeout("myLytebox.fade('" + id + "', " + (opacity-20) + ")", 1);
    } else {
        this.timerIDArray[this.timerIDCount++] = setTimeout("myLytebox.fade('" + id + "', " + (opacity-10) + ")", 1);
    }
};
LyteBox.prototype.resizeW = function(id, curW, maxW, pixelrate, speed) {
    if (!this.hDone) {
        this.resizeWTimerArray[this.resizeWTimerCount++] = setTimeout("myLytebox.resizeW('" + id + "', " + curW + ", " + maxW + ", " + pixelrate + ")", 100);
        return;
    }
    var object = this.doc.getElementById(id);
    var timer = speed ? speed : (this.resizeDuration/2);
    var newW = (this.doAnimations ? curW : maxW);
    object.style.width = (newW) + "px";
    if (newW < maxW) {
        newW += (newW + pixelrate >= maxW) ? (maxW - newW) : pixelrate;
    } else if (newW > maxW) {
        newW -= (newW - pixelrate <= maxW) ? (newW - maxW) : pixelrate;
    }
    this.resizeWTimerArray[this.resizeWTimerCount++] = setTimeout("myLytebox.resizeW('" + id + "', " + newW + ", " + maxW + ", " + pixelrate + ", " + (timer+0.02) + ")", timer+0.02);
    if (parseInt(object.style.width) == maxW) {
        this.wDone = true;
        for (var i = 0; i < this.resizeWTimerCount; i++) { window.clearTimeout(this.resizeWTimerArray[i]); }
    }
};
LyteBox.prototype.resizeH = function(id, curH, maxH, pixelrate, speed) {
    var timer = speed ? speed : (this.resizeDuration/2);
    var object = this.doc.getElementById(id);
    var newH = (this.doAnimations ? curH : maxH);
    object.style.height = (newH) + "px";
    if (newH < maxH) {
        newH += (newH + pixelrate >= maxH) ? (maxH - newH) : pixelrate;
    } else if (newH > maxH) {
        newH -= (newH - pixelrate <= maxH) ? (newH - maxH) : pixelrate;
    }
    this.resizeHTimerArray[this.resizeHTimerCount++] = setTimeout("myLytebox.resizeH('" + id + "', " + newH + ", " + maxH + ", " + pixelrate + ", " + (timer+.02) + ")", timer+.02);
    if (parseInt(object.style.height) == maxH) {
        this.hDone = true;
        for (var i = 0; i < this.resizeHTimerCount; i++) { window.clearTimeout(this.resizeHTimerArray[i]); }
    }
};
LyteBox.prototype.getPageScroll = function() {
    if (self.pageYOffset) {
        return this.isFrame ? parent.pageYOffset : self.pageYOffset;
    } else if (this.doc.documentElement && this.doc.documentElement.scrollTop){
        return this.doc.documentElement.scrollTop;
    } else if (document.body) {
        return this.doc.body.scrollTop;
    }
};
LyteBox.prototype.getPageSize = function() {    
    var xScroll, yScroll, windowWidth, windowHeight;
    if (window.innerHeight && window.scrollMaxY) {
        xScroll = this.doc.scrollWidth;
        yScroll = (this.isFrame ? parent.innerHeight : self.innerHeight) + (this.isFrame ? parent.scrollMaxY : self.scrollMaxY);
    } else if (this.doc.body.scrollHeight > this.doc.body.offsetHeight){
        xScroll = this.doc.body.scrollWidth;
        yScroll = this.doc.body.scrollHeight;
    } else {
        xScroll = this.doc.getElementsByTagName("html").item(0).offsetWidth;
        yScroll = this.doc.getElementsByTagName("html").item(0).offsetHeight;
        xScroll = (xScroll < this.doc.body.offsetWidth) ? this.doc.body.offsetWidth : xScroll;
        yScroll = (yScroll < this.doc.body.offsetHeight) ? this.doc.body.offsetHeight : yScroll;
    }
    if (self.innerHeight) {
        windowWidth = (this.isFrame) ? parent.innerWidth : self.innerWidth;
        windowHeight = (this.isFrame) ? parent.innerHeight : self.innerHeight;
    } else if (document.documentElement && document.documentElement.clientHeight) {
        windowWidth = this.doc.documentElement.clientWidth;
        windowHeight = this.doc.documentElement.clientHeight;
    } else if (document.body) {
        windowWidth = this.doc.getElementsByTagName("html").item(0).clientWidth;
        windowHeight = this.doc.getElementsByTagName("html").item(0).clientHeight;
        windowWidth = (windowWidth == 0) ? this.doc.body.clientWidth : windowWidth;
        windowHeight = (windowHeight == 0) ? this.doc.body.clientHeight : windowHeight;
    }
    var pageHeight = (yScroll < windowHeight) ? windowHeight : yScroll;
    var pageWidth = (xScroll < windowWidth) ? windowWidth : xScroll;
    return new Array(pageWidth, pageHeight, windowWidth, windowHeight);
};
LyteBox.prototype.toggleFlash = function(state) {
    var objects = this.doc.getElementsByTagName("object");
    for (var i = 0; i < objects.length; i++) {
        objects[i].style.visibility = (state == "hide") ? 'hidden' : 'visible';
    }
    var embeds = this.doc.getElementsByTagName("embed");
    for (var i = 0; i < embeds.length; i++) {
        embeds[i].style.visibility = (state == "hide") ? 'hidden' : 'visible';
    }
    if (this.isFrame) {
        for (var i = 0; i < parent.frames.length; i++) {
            try {
                objects = parent.frames[i].window.document.getElementsByTagName("object");
                for (var j = 0; j < objects.length; j++) {
                    objects[j].style.visibility = (state == "hide") ? 'hidden' : 'visible';
                }
            } catch(e) { }
            try {
                embeds = parent.frames[i].window.document.getElementsByTagName("embed");
                for (var j = 0; j < embeds.length; j++) {
                    embeds[j].style.visibility = (state == "hide") ? 'hidden' : 'visible';
                }
            } catch(e) { }
        }
    }
};
LyteBox.prototype.toggleSelects = function(state) {
    var selects = this.doc.getElementsByTagName("select");
    for (var i = 0; i < selects.length; i++ ) {
        selects[i].style.visibility = (state == "hide") ? 'hidden' : 'visible';
    }
    if (this.isFrame) {
        for (var i = 0; i < parent.frames.length; i++) {
            try {
                selects = parent.frames[i].window.document.getElementsByTagName("select");
                for (var j = 0; j < selects.length; j++) {
                    selects[j].style.visibility = (state == "hide") ? 'hidden' : 'visible';
                }
            } catch(e) { }
        }
    }
};
LyteBox.prototype.pause = function(numberMillis) {
    var now = new Date();
    var exitTime = now.getTime() + numberMillis;
    while (true) {
        now = new Date();
        if (now.getTime() > exitTime) { return; }
    }
};

if(typeof(myLytebox)=="undefined"){
  if (window.addEventListener) {
      window.addEventListener("load",initLytebox,false);
  } else if (window.attachEvent) {
      window.attachEvent("onload",initLytebox);
  } else {
      window.onload = function() {initLytebox();}
  }
}
function initLytebox() { myLytebox = new LyteBox();}
//Pour etendre la config, creer un objet HyphenatorConfig avec les paramètres supplémentaires ou de remplacement
// par défault, les membres qui ont la classe 'hyphenate' seront traités.
// documentation : http://code.google.com/p/hyphenator/
var HyphenatorDefaultConfig =  { 
    classname: 'hyphenate',
    remoteloading : true,
    onerrorhandler : function (e) {
        //do nothing
    }      
}  

$j(document).ready(function(){
    if(typeof(HyphenatorConfig) != 'undefined'){
        $j.extend(HyphenatorDefaultConfig, HyphenatorConfig);
    }   
    
    var RunHyphenator = function() {
        Hyphenator.config(HyphenatorDefaultConfig);
        Hyphenator.run();   
    }
    
    //Lance le traitement pour la page courante
    RunHyphenator();
    //Force le lancement apres chaque appel ajax
    $j(document).bind('onLoadHtmlCompleted', RunHyphenator );

});
<!-- Fonctions supplémentaires propres au site -->

var langueCourante;


var t;
function startAnimEvent () {
	if (t != null) clearInterval(t);
	t=setInterval("changeAnimEvent()",5000);
	
}

function changeAnimEvent() {
	var myPosition = $j("#contentAnimEvent").css('top');
	
	//alert(myPosition);
	
	if (myPosition == '0px') {
		$j("#contentAnimEvent").animate({top:-164},2000);
	} else if (myPosition == '-164px') {
		$j("#contentAnimEvent").animate({top:-328},2000);
	} else {
		$j("#contentAnimEvent").animate({top:0},2000);
	}
}

$j(document).bind('onAfterSpeedmailingSubscribe', function(evt, response) { 
    

    var axel = Math.random() + "";
    var a = axel * 10000000000000;
    
    if ($j('.Tracker_subscribe_speedmailing').length>=1){
        $j('.Tracker_subscribe_speedmailing').remove();
    }
    $j('body').prepend('<div class="Tracker_subscribe_speedmailing"></div>');
    
    $j('.Tracker_subscribe_speedmailing').html(''
    +'<iframe src="http://fls.doubleclick.net/activityi;src=3083843;type=parcd980;cat=parcd729;u1=' + a + '" width="1" height="1" frameborder="0" style="display:none"></iframe>');
    
});



$j(document).ready(function() {
	langueCourante = window.langue;
	if(!is_admin) {
		$j.fancybox({'type':'image','href':'../images/pop-event-'+langueCourante+'.jpg', 'overlayColor':'#1A3925', 'overlayOpacity':0.96, 'padding':1});
		console.log('yo');
	}
});

