var InfosBrowser = {"isApiciusGuy":false,"isRobot":false,"isGoogleBot":false,"isMsnBot":false,"isSlurp":false,"isAmaya":false,"isChrome":true,"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":true,"isPlatformWindowsCE":false,"browser":"Chrome","platform":"Windows","version":"17.0.963.56"};
/*
 * 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);

/**
 * 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);
    }
});
//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 activeURL;
var oldActiveURL;

var indexDiv = 1;
var tabTemp = [];



//----------------------------------
//  Init
//----------------------------------
$j(document).bind('onLoadHtmlCompleted', function(evt, ajaxObject, data) {

   	onClick(ajaxObject.page);
	if (ajaxObject.page == 'l-alpaga.php' || ajaxObject.page == 'collection-de-l-alpaga.php' || ajaxObject.page == 'situation-et-acces.php' || ajaxObject.page == 'tarifs-et-informations.php')
	{
		initOnglets();
	}
	
	$('#coda-slider-1').codaSlider();
	
	if (ajaxObject.page == "index.php")
		initIndex();
	else if (ajaxObject.page == "galerie-photos.php")
		initGalerie();
	else
		initPages();
} );

$j(document).bind('onAfterChargePageCall', function(e, p) { vegasClean(); });

//----------------------------------
//  Apparition de la nav
//----------------------------------

$j(document).ready( function() {
	onClick();
	initMusic();
	initFooter();
	if (getFileName() == 'l-alpaga.php' || getFileName() == 'collection-de-l-alpaga.php' || getFileName() == 'situation-et-acces.php' || getFileName() == 'tarifs-et-informations.php')
	{
		initOnglets();
	}

	if (getFileName() == "index.php" || getFileName() == "")
		initIndex();
	else if (getFileName() == "galerie-photos.php")
		initGalerie();
	else
		initPages();

	if(is_admin)
	{
		$j(".floatRight").css({float:"none"});
	}

	$('#coda-slider-1').codaSlider();
		
} );


//----------------------------------
//  onClick
//----------------------------------

function onClick(page) {
	//s'il le nom du fichier n'est pas défini on lance la fonction qui va bien
	if (page == undefined) {
		page = getFileName();
		if (page == '') page = "index.php";
	}

	/* SIMULE CLICK */
	oldActiveURL = activeURL;
	activeURL = page;

	$j('#navigationLeft li a').each(function(){

		if (oldActiveURL == $j(this).attr('href'))
			$j(this).removeClass("boutonActif");
		if (activeURL == $j(this).attr('href'))
			$j(this).addClass("boutonActif");

	});

	page = page.substring(0, page.length - 4);


}


//----------------------------------
//  getPageFileName
//----------------------------------

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

var GetPageInfo =
{
	fileName: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;
	}
}



//----------------------------------
//  Init toggle pied de page
//----------------------------------
function initFooter() {

	$j('#footerHidden').css('display','none');

	$j('#contactsPlanDeSite').toggle(ouvrir, fermer);

	function ouvrir () {
		$j('#footerHidden').slideDown(300);
	}

	function fermer () {
		$j('#footerHidden').slideUp(300);
	}
}



//----------------------------------
//  Init onglets
//----------------------------------

function initOnglets() {
	// if et else permet de vider le contenu du tableau s'il ne l'était pas (vu qu'on utilise la mm fonction pour tous les pdv avec des onglets)
	if (tabTemp == null) {
		tabTemp = new Array();
	}

	else {
		tabTemp = [];
		indexDiv = 1;
	}

	var nbTitle = $j('.bloc h1').length;
	$j('.bloc h1').each(function(i){

	if (i==0) $j(this).addClass('selected');
	tabTemp.push($j(this));
	$j(this).remove();
	if ((i+1) == nbTitle) {
		$j('<div class="navigationOnglets"></div>').prependTo('.bloc');

		if (langue == 'fr') {$j('<div class="clear floatRight"><div class="btnRetour">Retour</div><div class="btnSuite">Suite</div></div>').appendTo('.blocBlanc');}
		else if (langue == 'uk') {$j('<div class="clear floatRight"><div class="btnRetour">Back</div><div class="btnSuite">Next</div></div>').appendTo('.blocBlanc');}
		else if (langue == 'ru') {$j('<div class="clear floatRight"><div class="btnRetour">Назад</div><div class="btnSuite">Далее</div></div>').appendTo('.blocBlanc');}

		$j('.btnRetour').css({display:'none'});

		for ( j=tabTemp.length-1 ; j>=0 ; j--) {
			if (j==tabTemp.length-1) $j('<div class="clear"></div>').prependTo('.navigationOnglets');
			$j(tabTemp[j]).prependTo('.navigationOnglets');



			$j(tabTemp[j]).click(function(e) {
				e.preventDefault();

				indexDiv =  ($j(this).index('.navigationOnglets h1') + 1);


				var idNumOnglet = '#div' + ($j(this).index('.navigationOnglets h1') + 1);
				$j('.navigationOnglets h1.selected').removeClass('selected');
				$j(this).addClass('selected');

				// permet de cacher le bouton Retour si on est dans la div1, le btn Suivant si dernière div ou d'afficher les deux btns.
				if(indexDiv == 1)
				{
					$j('.btnRetour').each(function()
					{
						$j(this).css({display:'none'});
					});

					$j('.btnSuite').each(function()
					{
						$j(this).css({display:'block'});
					});
				}//fin if
				else if(indexDiv == tabTemp.length)
				{
					$j('.btnSuite').each(function()
					{
						$j(this).css({display:'none'});
					});
					$j('.btnRetour').each(function()
					{
						$j(this).css({display:'block'});
					});
				}//fin if
				else
				{
					$j('.btnSuite').each(function()
					{
						$j(this).css({display:'block'});
					});
					$j('.btnRetour').each(function()
					{
						$j(this).css({display:'block'});
					});
				}//fin if


				$j('.blocBlanc').fadeOut(0);
				$j(idNumOnglet).fadeIn(0);
				if($('#coda-slider-2').hasClass('preload')) $('#coda-slider-2').codaSlider();					
			});
		}
	}
});


	$j('.bloc div.blocBlanc').each(function(i){
		if (i!=0) $j(this).fadeOut(0);
	});
}



//----------------------------------
//  Init Boutons Retour et Suite
//----------------------------------

$j(".btnSuite").live('click' , function(e) {
	e.preventDefault();
	$j(tabTemp[indexDiv]).trigger('click');
});

$j(".btnRetour").live('click' , function(e) {
	e.preventDefault();
	$j(tabTemp[indexDiv - 2 ]).trigger('click');
});


//----------------------------------
//  Init Musique HTML 5
//----------------------------------

var initMusic = function() {
	var stateMusic = false;
	var musicTag = document.getElementsByTagName("audio")[0];

	$j('#btnMusic').click(function(e) {
		e.preventDefault();
		if (stateMusic) stopMusic();
		else playMusic();
	});

	var playMusic = function () {
		stateMusic = true;
		musicTag.play();
		$j('#btnMusic').removeClass('musicOff');
		$j('#btnMusic').addClass('musicOn');
	}

	var stopMusic = function () {
		stateMusic = false;
		musicTag.pause();
		$j('#btnMusic').removeClass('musicOn');
		$j('#btnMusic').addClass('musicOff');
	}
}


var boxID = 0;

// GALERIE PHOTOS
var initGalerie = function ()
{
	$j("#langues").hide();
	$j(".btnAccueil").find("a").show();
	$j(".btnGaleriePhotos, .btnOffres").find("a").hide();
	$j.vegas('slideshow', {
		backgrounds:
			[
				{ src	:	'../images/index/hd-01.jpg', fade	:	1000 },
				{ src	:	'../images/index/hd-02.jpg', fade	:	1000 },
				{ src	:	'../images/index/hd-03.jpg', fade	:	1000 },
				{ src	:	'../images/index/hd-04.jpg', fade	:	1000 },
				{ src	:	'../images/index/hd-05.jpg', fade	:	1000 },
				{ src	:	'../images/index/hd-06.jpg', fade	:	1000 },
				{ src	:	'../images/index/hd-07.jpg', fade	:	1000 },
				{ src	:	'../images/index/hd-08.jpg', fade	:	1000 },
				{ src	:	'../images/index/hd-09.jpg', fade	:	1000 },
				{ src	:	'../images/index/hd-10.jpg', fade	:	1000 }
			],
			step	:	boxID
	});

	// Affichage du n° de la photo / 10
	$j(document).bind('vegaswalk', function(e, bg, step) { $j(".vegasWalk").html((step + 1) + "/10"); });
	$j(".vegasPrevious").bind("click", function(e) { $j.vegas('previous'); });
	$j(".vegasNext").bind("click", function(e) { $j.vegas('next'); });
}

var initIndex = function ()
{
	$j("body").removeClass("bodyOther").addClass("bodyIndex");
	$j("#langues").addClass("languesIndex");
	$j("#langues").show();

	$j(".btnAccueil").find("a").hide();
	$j(".btnGaleriePhotos, .btnOffres").find("a").show();

	$j(".legende").hide();

	$j('#container').masonry({ itemSelector: '.box'	});

	$j(".boxPhoto").bind('mouseover', function(e) { $j(this).children(".legende").show(); });
	$j(".boxPhoto").bind('mouseout', function(e) { $j(this).children(".legende").hide(); });
	// Désactivé
	// $j(".boxPhoto").bind("click", function(e) { boxID = Number(this.id.substr(3,4)) - 1; return chargePage("galerie-photos.php", 0, false); });

	$j(".boxTexte").bind('mouseover', function(e) { $j(this).addClass('boxTexteHover'); });
	$j(".boxTexte").bind('mouseout', function(e) { $j(this).removeClass('boxTexteHover'); });
	$j(".boxTexte").bind("click", function(e)
	{
		var url = new String($j(this).find("a").attr("href"));
		return chargePage(url, 0, false);
		return false;
	});
}

var initPages = function ()
{
	$j("body").removeClass("bodyIndex").addClass("bodyOther");
	$j("#langues").show();
	$j("#langues").removeClass("languesIndex");
}

var vegasClean = function ()
{
	$j.vegas('stop');
	$j(".vegas-background").hide();
}

