
(function($) {
var _rootUrl = '/', _serverUrl = _rootUrl + 'ezjscore/', _seperator = '@SEPERATOR$';
if ( window.XMLHttpRequest && window.ActiveXObject )
$.ajaxSettings.xhr = function() { try { return new window.ActiveXObject('Microsoft.XMLHTTP'); } catch(e) {} };
function _ez( callArgs, post, callBack )
{
callArgs = callArgs.join !== undefined ? callArgs.join( _seperator ) : callArgs;
var url = _serverUrl + 'call/';
if ( post )
{
var _token = '', _tokenNode = document.getElementById('ezxform_token_js');
if ( _tokenNode ) _token = _tokenNode.getAttribute('title');
if ( post.join !== undefined )// support serializeArray() format
{
post.push( { 'name': 'ezjscServer_function_arguments', 'value': callArgs } );
post.push( { 'name': 'ezxform_token', 'value': _token } );
}
else if ( typeof(post) === 'string' )// string
{
post += ( post ? '&' : '' ) + 'ezjscServer_function_arguments=' + callArgs + '&ezxform_token=' + _token;
}
else // object
{
post['ezjscServer_function_arguments'] = callArgs;
post['ezxform_token'] = _token;
}
return $.post( url, post, callBack, 'json' );
}
return $.get( url + encodeURIComponent( callArgs ), {}, callBack, 'json' );
};
_ez.url = _serverUrl;
_ez.root_url = _rootUrl;
_ez.seperator = _seperator;
$.ez = _ez;
function _ezLoad( callArgs, post, selector, callBack )
{
callArgs = callArgs.join !== undefined ? callArgs.join( _seperator ) : callArgs;
var url = _serverUrl + 'call/';
if ( post )
{
post['ezjscServer_function_arguments'] = callArgs;
post['ezxform_token'] = jQuery('#ezxformtoken').attr('title');
}
else
url += encodeURIComponent( callArgs );
return this.load( url + ( selector ? ' ' + selector : '' ), post, callBack );
};
$.fn.ez = _ezLoad;
})(jQuery);
(function( jQuery, undefined ){
var oldManip = jQuery.fn.domManip, tmplItmAtt = "_tmplitem", htmlExpr = /^[^<]*(<[\w\W]+>)[^>]*$|\{\{\! /,
newTmplItems = {}, wrappedItems = {}, appendToTmplItems, topTmplItem = { key: 0, data: {} }, itemKey = 0, cloneIndex = 0, stack = [];
function newTmplItem( options, parentItem, fn, data ) {
var newItem = {
data: data || (data === 0 || data === false) ? data : (parentItem ? parentItem.data : {}),
_wrap: parentItem ? parentItem._wrap : null,
tmpl: null,
parent: parentItem || null,
nodes: [],
calls: tiCalls,
nest: tiNest,
wrap: tiWrap,
html: tiHtml,
update: tiUpdate
};
if ( options ) {
jQuery.extend( newItem, options, { nodes: [], parent: parentItem });
}
if ( fn ) {
newItem.tmpl = fn;
newItem._ctnt = newItem._ctnt || newItem.tmpl( jQuery, newItem );
newItem.key = ++itemKey;
(stack.length ? wrappedItems : newTmplItems)[itemKey] = newItem;
}
return newItem;
}
jQuery.each({
appendTo: "append",
prependTo: "prepend",
insertBefore: "before",
insertAfter: "after",
replaceAll: "replaceWith"
}, function( name, original ) {
jQuery.fn[ name ] = function( selector ) {
var ret = [], insert = jQuery( selector ), elems, i, l, tmplItems,
parent = this.length === 1 && this[0].parentNode;
appendToTmplItems = newTmplItems || {};
if ( parent && parent.nodeType === 11 && parent.childNodes.length === 1 && insert.length === 1 ) {
insert[ original ]( this[0] );
ret = this;
} else {
for ( i = 0, l = insert.length; i < l; i++ ) {
cloneIndex = i;
elems = (i > 0 ? this.clone(true) : this).get();
jQuery( insert[i] )[ original ]( elems );
ret = ret.concat( elems );
}
cloneIndex = 0;
ret = this.pushStack( ret, name, insert.selector );
}
tmplItems = appendToTmplItems;
appendToTmplItems = null;
jQuery.tmpl.complete( tmplItems );
return ret;
};
});
jQuery.fn.extend({
tmpl: function( data, options, parentItem ) {
return jQuery.tmpl( this[0], data, options, parentItem );
},
tmplItem: function() {
return jQuery.tmplItem( this[0] );
},
template: function( name ) {
return jQuery.template( name, this[0] );
},
domManip: function( args, table, callback, options ) {
if ( args[0] && jQuery.isArray( args[0] )) {
var dmArgs = jQuery.makeArray( arguments ), elems = args[0], elemsLength = elems.length, i = 0, tmplItem;
while ( i < elemsLength && !(tmplItem = jQuery.data( elems[i++], "tmplItem" ))) {}
if ( tmplItem && cloneIndex ) {
dmArgs[2] = function( fragClone ) {
jQuery.tmpl.afterManip( this, fragClone, callback );
};
}
oldManip.apply( this, dmArgs );
} else {
oldManip.apply( this, arguments );
}
cloneIndex = 0;
if ( !appendToTmplItems ) {
jQuery.tmpl.complete( newTmplItems );
}
return this;
}
});
jQuery.extend({
tmpl: function( tmpl, data, options, parentItem ) {
var ret, topLevel = !parentItem;
if ( topLevel ) {
parentItem = topTmplItem;
tmpl = jQuery.template[tmpl] || jQuery.template( null, tmpl );
wrappedItems = {}; // Any wrapped items will be rebuilt, since this is top level
} else if ( !tmpl ) {
tmpl = parentItem.tmpl;
newTmplItems[parentItem.key] = parentItem;
parentItem.nodes = [];
if ( parentItem.wrapped ) {
updateWrapped( parentItem, parentItem.wrapped );
}
return jQuery( build( parentItem, null, parentItem.tmpl( jQuery, parentItem ) ));
}
if ( !tmpl ) {
return []; // Could throw...
}
if ( typeof data === "function" ) {
data = data.call( parentItem || {} );
}
if ( options && options.wrapped ) {
updateWrapped( options, options.wrapped );
}
ret = jQuery.isArray( data ) ?
jQuery.map( data, function( dataItem ) {
return dataItem ? newTmplItem( options, parentItem, tmpl, dataItem ) : null;
}) :
[ newTmplItem( options, parentItem, tmpl, data ) ];
return topLevel ? jQuery( build( parentItem, null, ret ) ) : ret;
},
tmplItem: function( elem ) {
var tmplItem;
if ( elem instanceof jQuery ) {
elem = elem[0];
}
while ( elem && elem.nodeType === 1 && !(tmplItem = jQuery.data( elem, "tmplItem" )) && (elem = elem.parentNode) ) {}
return tmplItem || topTmplItem;
},
template: function( name, tmpl ) {
if (tmpl) {
if ( typeof tmpl === "string" ) {
tmpl = buildTmplFn( tmpl );
} else if ( tmpl instanceof jQuery ) {
tmpl = tmpl[0] || {};
}
if ( tmpl.nodeType ) {
tmpl = jQuery.data( tmpl, "tmpl" ) || jQuery.data( tmpl, "tmpl", buildTmplFn( tmpl.innerHTML ));
}
return typeof name === "string" ? (jQuery.template[name] = tmpl) : tmpl;
}
return name ? (typeof name !== "string" ? jQuery.template( null, name ):
(jQuery.template[name] ||
jQuery.template( null, htmlExpr.test( name ) ? name : jQuery( name )))) : null;
},
encode: function( text ) {
return ("" + text).split("<").join("&lt;").split(">").join("&gt;").split('"').join("&#34;").split("'").join("&#39;");
}
});
jQuery.extend( jQuery.tmpl, {
tag: {
"tmpl": {
_default: { $2: "null" },
open: "if($notnull_1){__=__.concat($item.nest($1,$2));}"
},
"wrap": {
_default: { $2: "null" },
open: "$item.calls(__,$1,$2);__=[];",
close: "call=$item.calls();__=call._.concat($item.wrap(call,__));"
},
"each": {
_default: { $2: "$index, $value" },
open: "if($notnull_1){$.each($1a,function($2){with(this){",
close: "}});}"
},
"if": {
open: "if(($notnull_1) && $1a){",
close: "}"
},
"else": {
_default: { $1: "true" },
open: "}else if(($notnull_1) && $1a){"
},
"html": {
open: "if($notnull_1){__.push($1a);}"
},
"=": {
_default: { $1: "$data" },
open: "if($notnull_1){__.push($.encode($1a));}"
},
"!": {
open: ""
}
},
complete: function( items ) {
newTmplItems = {};
},
afterManip: function afterManip( elem, fragClone, callback ) {
var content = fragClone.nodeType === 11 ?
jQuery.makeArray(fragClone.childNodes) :
fragClone.nodeType === 1 ? [fragClone] : [];
callback.call( elem, fragClone );
storeTmplItems( content );
cloneIndex++;
}
});
function build( tmplItem, nested, content ) {
var frag, ret = content ? jQuery.map( content, function( item ) {
return (typeof item === "string") ?
(tmplItem.key ? item.replace( /(<\w+)(?=[\s>])(?![^>]*_tmplitem)([^>]*)/g, "$1 " + tmplItmAtt + "=\"" + tmplItem.key + "\" $2" ) : item) :
build( item, tmplItem, item._ctnt );
}) :
tmplItem;
if ( nested ) {
return ret;
}
ret = ret.join("");
ret.replace( /^\s*([^<\s][^<]*)?(<[\w\W]+>)([^>]*[^>\s])?\s*$/, function( all, before, middle, after) {
frag = jQuery( middle ).get();
storeTmplItems( frag );
if ( before ) {
frag = unencode( before ).concat(frag);
}
if ( after ) {
frag = frag.concat(unencode( after ));
}
});
return frag ? frag : unencode( ret );
}
function unencode( text ) {
var el = document.createElement( "div" );
el.innerHTML = text;
return jQuery.makeArray(el.childNodes);
}
function buildTmplFn( markup ) {
return new Function("jQuery","$item",
"var $=jQuery,call,__=[],$data=$item.data;" +
"with($data){__.push('" +
jQuery.trim(markup)
.replace( /([\\'])/g, "\\$1" )
.replace( /[\r\t\n]/g, " " )
.replace( /\$\{([^\}]*)\}/g, "{{= $1}}" )
.replace( /\{\{(\/?)(\w+|.)(?:\(((?:[^\}]|\}(?!\}))*?)?\))?(?:\s+(.*?)?)?(\(((?:[^\}]|\}(?!\}))*?)\))?\s*\}\}/g,
function( all, slash, type, fnargs, target, parens, args ) {
var tag = jQuery.tmpl.tag[ type ], def, expr, exprAutoFnDetect;
if ( !tag ) {
throw "Unknown template tag: " + type;
}
def = tag._default || [];
if ( parens && !/\w$/.test(target)) {
target += parens;
parens = "";
}
if ( target ) {
target = unescape( target );
args = args ? ("," + unescape( args ) + ")") : (parens ? ")" : "");
expr = parens ? (target.indexOf(".") > -1 ? target + unescape( parens ) : ("(" + target + ").call($item" + args)) : target;
exprAutoFnDetect = parens ? expr : "(typeof(" + target + ")==='function'?(" + target + ").call($item):(" + target + "))";
} else {
exprAutoFnDetect = expr = def.$1 || "null";
}
fnargs = unescape( fnargs );
return "');" +
tag[ slash ? "close" : "open" ]
.split( "$notnull_1" ).join( target ? "typeof(" + target + ")!=='undefined' && (" + target + ")!=null" : "true" )
.split( "$1a" ).join( exprAutoFnDetect )
.split( "$1" ).join( expr )
.split( "$2" ).join( fnargs || def.$2 || "" ) +
"__.push('";
}) +
"');}return __;"
);
}
function updateWrapped( options, wrapped ) {
options._wrap = build( options, true,
jQuery.isArray( wrapped ) ? wrapped : [htmlExpr.test( wrapped ) ? wrapped : jQuery( wrapped ).html()]
).join("");
}
function unescape( args ) {
return args ? args.replace( /\\'/g, "'").replace(/\\\\/g, "\\" ) : null;
}
function outerHtml( elem ) {
var div = document.createElement("div");
div.appendChild( elem.cloneNode(true) );
return div.innerHTML;
}
function storeTmplItems( content ) {
var keySuffix = "_" + cloneIndex, elem, elems, newClonedItems = {}, i, l, m;
for ( i = 0, l = content.length; i < l; i++ ) {
if ( (elem = content[i]).nodeType !== 1 ) {
continue;
}
elems = elem.getElementsByTagName("*");
for ( m = elems.length - 1; m >= 0; m-- ) {
processItemKey( elems[m] );
}
processItemKey( elem );
}
function processItemKey( el ) {
var pntKey, pntNode = el, pntItem, tmplItem, key;
if ( (key = el.getAttribute( tmplItmAtt ))) {
while ( pntNode.parentNode && (pntNode = pntNode.parentNode).nodeType === 1 && !(pntKey = pntNode.getAttribute( tmplItmAtt ))) { }
if ( pntKey !== key ) {
pntNode = pntNode.parentNode ? (pntNode.nodeType === 11 ? 0 : (pntNode.getAttribute( tmplItmAtt ) || 0)) : 0;
if ( !(tmplItem = newTmplItems[key]) ) {
tmplItem = wrappedItems[key];
tmplItem = newTmplItem( tmplItem, newTmplItems[pntNode]||wrappedItems[pntNode] );
tmplItem.key = ++itemKey;
newTmplItems[itemKey] = tmplItem;
}
if ( cloneIndex ) {
cloneTmplItem( key );
}
}
el.removeAttribute( tmplItmAtt );
} else if ( cloneIndex && (tmplItem = jQuery.data( el, "tmplItem" )) ) {
cloneTmplItem( tmplItem.key );
newTmplItems[tmplItem.key] = tmplItem;
pntNode = jQuery.data( el.parentNode, "tmplItem" );
pntNode = pntNode ? pntNode.key : 0;
}
if ( tmplItem ) {
pntItem = tmplItem;
while ( pntItem && pntItem.key != pntNode ) {
pntItem.nodes.push( el );
pntItem = pntItem.parent;
}
delete tmplItem._ctnt;
delete tmplItem._wrap;
jQuery.data( el, "tmplItem", tmplItem );
}
function cloneTmplItem( key ) {
key = key + keySuffix;
tmplItem = newClonedItems[key] =
(newClonedItems[key] || newTmplItem( tmplItem, newTmplItems[tmplItem.parent.key + keySuffix] || tmplItem.parent ));
}
}
}
function tiCalls( content, tmpl, data, options ) {
if ( !content ) {
return stack.pop();
}
stack.push({ _: content, tmpl: tmpl, item:this, data: data, options: options });
}
function tiNest( tmpl, data, options ) {
return jQuery.tmpl( jQuery.template( tmpl ), data, options, this );
}
function tiWrap( call, wrapped ) {
var options = call.options || {};
options.wrapped = wrapped;
return jQuery.tmpl( jQuery.template( call.tmpl ), call.data, options, call.item );
}
function tiHtml( filter, textOnly ) {
var wrapped = this._wrap;
return jQuery.map(
jQuery( jQuery.isArray( wrapped ) ? wrapped.join("") : wrapped ).filter( filter || "*" ),
function(e) {
return textOnly ?
e.innerText || e.textContent :
e.outerHTML || outerHtml(e);
});
}
function tiUpdate() {
var coll = this.nodes;
jQuery.tmpl( null, null, null, this).insertBefore( coll[0] );
jQuery( coll ).remove();
}
})( jQuery );
(function($, undefined){
innerShiv=function(){function h(c,e,b){return/^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i.test(b)?c:e+"></"+b+">"}var c,e=document,j,g="abbr article aside audio canvas datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video".split(" ");return function(d,i){if(!c&&(c=e.createElement("div"),c.innerHTML="<nav></nav>",j=c.childNodes.length!==1)){for(var b=e.createDocumentFragment(),f=g.length;f--;)b.createElement(g[f]);b.appendChild(c)}d=d.replace(/^\s\s*/,"").replace(/\s\s*$/,"").replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,"").replace(/(<([\w:]+)[^>]*?)\/>/g,h);c.innerHTML=(b=d.match(/^<(tbody|tr|td|col|colgroup|thead|tfoot)/i))?"<table>"+d+"</table>":d;b=b?c.getElementsByTagName(b[1])[0].parentNode:c;if(i===!1)return b.childNodes;for(var f=e.createDocumentFragment(),k=b.childNodes.length;k--;)f.appendChild(b.firstChild);return f}}();
$.helioLightbox = {
defaults: {
templateID: 'heliolightbox-default',						//ID de la template jQuery d'affichage
loaderTemplateID: 'heliolightbox-default-loader',			//ID de la template jQuery de l'indicateur de chargement
rootURL: '/',												//URL de base des requêtes (doit inclure le siteaccess si nécessaire)
url: '/ezjscore/call/heliolightbox::load::__type__::__target__',	//URL de chargement des données
type: 'default',											//identifiant du type de lightbox
target: '',													//Cible de la lightbox
load: function( config ){
var url = config.rootURL + config.url.replace( '__type__', config.type )
.replace('__target__', config.target);
return $.getJSON( url );
},
maxWidth: 960,									//largeur maximale
maxHeight: 700,									//hauteur maximale
width: undefined,								//largeur fixée à la lightbox (undefined = fonction du contenu)
height: undefined,								//hauteur fixée à la lightbox (undefined = fonction du contenu)
onLoad: [],										//Fonctions de callback appelées au chargement de données
onLoadingError: [],								//Fonctions de callback appelées en cas d'erreur de chargement
onLoaded: [],									//Fonctions de callback appelées lorsque les données sont chargées
onOpen: [ setOverflow ],						//Fonctions de callback appelées à l'ouverture
onOpened: [],									//Fonctions de callback appelées une fois l'ouverture terminée
onClose: [],									//Fonctions de callback appelées à la fermeture
onClosed: [],									//Fonctions de callback appelées après la fermeture
onResize: [],									//Fonctions de callback appelées au redimensionnement de la lightbox
animation: {
from: {										//propriétés CSS au début de l'ouverture
width: '10px',
height: '10px',
marginTop: '-5px',
marginLeft: '-5px'
},
to: {},										//propriétés CSS à la fin de l'ouverture
speed: 'fast',								//vitesse de l'animation (vitesse jQuery)
easing: 'swing'								//Fonction d'easing (jQuery)
}
},
types: {},
setRootURL: function( rootURL ){
this.defaults.rootURL = rootURL;
$.each( this.types, function( key, value ){
this.types[key].rootURL = rootURL;
});
}
};
var dataOverrides = [ 'target', 'width', 'height', 'maxWidth', 'maxHeight' ],
$container = $('<div id="heliolightbox-container"></div>'),
$overlay = $('<div id="heliolightbox-overlay"></div>').appendTo( $container ),
$currentLightbox,
currentLightBoxData,
$loader,
deferred;
$(document).delegate( 'a[rel="heliolightbox"]', 'click', function(e){
e.preventDefault();
launchLightbox( getConfigFromElem( e.currentTarget ) );
} );
function getConfigFromElem( elem ){
var cfg = $.extend( {}, $.helioLightbox.defaults ),
$elem = $(elem),
data = $elem.data(),
dataPropName,
configName;
if( data.heliolightboxType && $.heliolightbox.types[data.heliolightboxType] ){
$.extend( cfg, $.heliolightbox.types[data.heliolightboxType] );
}
var len = dataOverrides.length;
for( var i = 0; i < len; i++ ){
configName = dataOverrides[i];
dataPropName = 'heliolightbox-' + configName.toLowerCase();
if( data[dataPropName] ){
cfg[configName] = data[dataPropName];
}
}
if( !cfg.target )
{
cfg.target = $elem.attr('href');
}
return cfg;
}
function launchLightbox( config ){
if( $currentLightbox )
{
closeLightbox( null, function(){
launchLightbox( config );
});
}
$.each( config.onLoad, function( index, func ){
func.apply( null, [config] );
} );
$loader = $( '#' + config.loaderTemplateID )
.tmpl( config )
.appendTo( $container );
$container.appendTo( $('body') );
$overlay.hide().fadeIn( config.animation.speed );
$loader.css({
marginTop: -Math.round( $loader.outerHeight() / 2 ) + 'px',
marginLeft: -Math.round( $loader.outerWidth() / 2 ) + 'px'
});
deferred = config.load( config )
.done( config.onLoaded, function( data ){
openLightbox( config, data );
})
.fail( config.onLoadingError, function( jqXHR, textStatus, errorThrown ){
openLightbox( config, { error_text: errorThrown } );
} );
}
function openLightbox( config, data ){
$loader.detach();
$container.addClass( 'opening' );
var $lightbox = $('#' + config.templateID)
.tmpl( data );
$currentLightbox = $.browser.msie && parseFloat( $.browser.version ) < 9 ? $( innerShiv( $('<div />').append( $lightbox ).html(), false ) ) : $lightbox;
$currentLightbox.appendTo( $container );
var width = config.width || Math.min( config.maxWidth, $currentLightbox.width() );
var height = config.height || Math.min( config.maxHeight, $currentLightbox.height() );
var beginProps = $.extend({}, config.animation.from );
var endProps = $.extend( config.animation.to, {
width: width + 'px',
height: height + 'px',
marginTop: - Math.round( height / 2 ) + 'px',
marginLeft: - Math.round( width / 2 ) + 'px'
});
currentLightBoxData = $.extend({}, {
config: config,
width: width,
height: height,
cssBefore: beginProps,
cssAfter: endProps
});
$.each( config.onOpen, function( index, func ){
func.apply( null, [$currentLightbox, currentLightBoxData] );
} );
$currentLightbox.css( beginProps )
.animate(
endProps,
config.animation.speed,
config.animation.easing,
onLightboxOpened
);
}
function onLightboxOpened(){
var config = currentLightBoxData.config;
$container  .removeClass( 'opening' )
.delegate( '#heliolightbox-overlay', 'click', closeLightbox)
.delegate( '.heliolightbox-close', 'click', closeLightbox );
$(document).bind('keydown', keyPress);
$.each( config.onOpened, function( index, func ){
func.apply( null, [$currentLightbox, currentLightBoxData] );
} );
}
function closeLightbox( e, callback ){
if( e ) e.preventDefault();
var config = currentLightBoxData.config || $.helioLightbox.defaults;
if( $loader )
{
$loader.detach();
$loader = undefined;
}
$.each( config.onClose, function( index, func ){
func.apply( null, [$currentLightbox, currentLightBoxData] );
} );
$(document).unbind('keydown', keyPress);
$container  .undelegate( '#heliolightbox-overlay', 'click' )
.undelegate( '.heliolightbox-close', 'click' );
$container.fadeOut(
config.animation.speed,
config.animation.easing,
function(){
if( $currentLightbox ){
$currentLightbox.detach();
$currentLightbox = null;
currentLightBoxData = null;
}
$container.detach().show();
$.each( config.onClosed, function( index, func ){
func.apply( null );
} );
});
if( $.isFunction( callback ) ){
callback.apply( null );
}
}
function keyPress(e){
if( e.keyCode === 27 ){
closeLightbox();
}
}
function setOverflow( $lightbox, data ){
var titleBar = $lightbox.find('.heliolightbox-title-bar'),
contentBlock = $lightbox.find('.heliolightbox-content');
var h =   data.height
- titleBar.outerHeight()
- ( contentBlock.outerHeight() - contentBlock.height() );
contentBlock.css( 'height', h + 'px');
}
})(jQuery);
(function($, undefined){
$.fn.helioEqualHeight = function(){
var h = 0;
this.each(function(){
if($(this).height() >= h) h = $(this).height();
})
this.each(function(){
$(this).height(h);
})
}
})(window.jQuery);
var HeliopsisUtils = (function($, undefined){
var pub = {
};
pub.initLinks = function(subset){
if(subset == undefined) subset = $(document);
subset.find("a[rel='external']").click(openInNewWindow);
}
$(function initPage(){
pub.initLinks();
});
function openInNewWindow(e){
window.open(e.currentTarget.href, '_blank');
e.preventDefault();
}
return pub;
})(window.jQuery);
window.log = function(){
log.history = log.history || [];   // store logs to an array for reference
log.history.push(arguments);
if(this.console){
console.log( Array.prototype.slice.call(arguments) );
}
};
(function(doc){
var write = doc.write;
doc.write = function(q){
log('document.write(): ',arguments);
if (/docwriteregexwhitelist/.test(q)) write.apply(doc,arguments);
};
})(document);
jQuery(function(){
});
(function($, undefined){
$(function(){
$("Nav .menu > li a").hover(function() { //When trigger is clicked...
$(this).parent().find("ul").slideDown('fast').show(); //Drop down the subnav on click
if($(this).parent().find("ul").find("li").size()==0)
$(this).parent().find("ul").remove();
$(this).parent().hover(function() {
}, function(){
$(this).parent().find("ul").slideUp('slow'); //When the mouse hovers out of the subnav, move it back up
});
}).hover(function() {
$(this).addClass("subhover"); //On hover over, add class "subhover"
}, function(){  //On Hover Out
$(this).removeClass("subhover"); //On hover out, remove class "subhover"
});
});
})(jQuery);
(function($)
{
$.fn.sudoSlider = function(optionsOrg)
{
var falsev = !1,
truev = !falsev,
defaults = {
controlsShow:      truev,
controlsFadeSpeed: 400,
controlsFade:      truev,
insertAfter:       truev,
firstShow:         falsev,
lastShow:          falsev,
vertical:          falsev,
speed:             800,
ease:              'swing',
auto:              falsev,
pause:             2000,
continuous:        falsev,
prevNext:          truev,
numeric:           falsev,
numericAttr:       'class="controls"',
numericText:       [],
clickableAni:      falsev,
history:           falsev,
speedhistory:      400,
autoheight:        truev,
customLink:        falsev,
fade:              falsev,
crossFade:         truev,
fadespeed:         1000,
updateBefore:      falsev,
ajax:              falsev,
preloadAjax:       100,
startSlide:        falsev,
ajaxLoadFunction:  falsev,
beforeAniFunc:     falsev,
afterAniFunc:      falsev,
uncurrentFunc:     falsev,
currentFunc:       falsev,
prevHtml:          '<a href="#" class="prevBtn"><span> Précédent</span></a>',
nextHtml:          '<a href="#" class="nextBtn"><span> Suivant </span></a>',
loadingText:       'Loading Content...',
firstHtml:         '<a href="#" class="firstBtn"> first </a>',
controlsAttr:      'id="controls"',
lastHtml:          '<a href="#" class="lastBtn"> last </a>',
autowidth:         truev,
slideCount:        1,
resumePause:       falsev,
moveCount:         1
},
baseSlider = this;
optionsOrg = $.extend(defaults, optionsOrg);
return this.each(function()
{
var init,
ul,
li,
liConti,
s,
t,
ot,
ts,
clickable,
buttonclicked,
fading,
ajaxloading,
numericControls,
numericContainer,
destroyed,
controls,
html,
firstbutton,
lastbutton,
nextbutton,
prevbutton,
timeout,
destroyT,
oldSpeed,
dontCountinue,
dontCountinueFade,
autoOn,
a,
b,
i,
continuousClones,
orgSlideCount,
beforeAniFuncFired = falsev,
asyncTimedLoad,
obj = $(this),
options = optionsOrg,
option = [];
initSudoSlider(obj, falsev);
function initSudoSlider(obj, destroyT)
{
b = 0;
for (a in options) {
option[b] = options[a];
b++;
}
destroyed = falsev; // In case this isn't the first init.
init = truev; // I know it's an ugly workaround, but it works.
ul = obj.children("ul");
li = ul.children("li");
s = li.length;
if (option[25]/*ajax*/)
{
if (ul.length == 0) obj.append(ul = $('<ul></ul>'));// No it's not, lets create it.
if (option[25]/*ajax*/.length > s)
{
for (a = 1; a <= option[25]/*ajax*/.length - s; a++) ul.append('<li><p>' +  option[35]/*loadingText*/ + '</p></li>');
li = ul.children("li");
s = li.length;
}
}
t = 0;
ot = t;
ts = s-1;
clickable = truev;
buttonclicked = falsev;
fading = falsev;
ajaxloading = falsev;
numericControls = new Array();
destroyed = falsev;
if (obj.css("position") == "static") obj.css("position","relative"); // Fixed a lot of IE6 + IE7 bugs.
option[40]/*slideCount*/ = parseInt10(option[40]/*slideCount*/)
option[42]--/*moveCount*/;
orgSlideCount = option[40]/*slideCount*/;
if (!option[21]/*fade*/) option[40]/*slideCount*/ += option[42]/*moveCount*/;
if (option[40]/*slideCount*/ > s) option[40]/*slideCount*/ = s;
option[27]/*startSlide*/ = parseInt10(option[27]/*startSlide*/) || 1;
continuousClones = option[11]/*continuous*/ && (!option[21]/*fade*/ || option[40]/*slideCount*/ > 1);
for(a=0;a<s;a++)
{
option[15]/*numericText*/[a] = option[15]/*numericText*/[a] || (a+1);
option[25]/*ajax*/[a] = option[25]/*ajax*/[a] || falsev;
}
if(continuousClones)
{
for (i = option[40]/*slideCount*/;i >= 1 ;i--)
{
ul
.prepend(li.eq(-option[40]/*slideCount*/+i-1).clone())
.append(li.eq(option[40]/*slideCount*/-i).clone());
}
liConti = ul.children("li");
if (option[25]/*ajax*/)
{
for(a = s - option[40]/*slideCount*/;a<s;a++)
{
if (option[25]/*ajax*/[a] && a != option[27]/*startSlide*/ - 1) ajaxLoad(a, falsev, 0, falsev); // I still do not wan't to load the current slide at this point.
}
}
}
option[2]/*controlsFade*/ = option[2]/*controlsFade*/ && !option[11]/*continuous*/;
ul[option[6]/*vertical*/ ? 'height' : 'width'](10000000); // That gives room for about 14000 slides of 700px each.
liConti = ul.children("li");
controls = falsev;
if(option[0]/*controlsShow*/)
{
controls = $('<span ' + option[37]/*controlsAttr*/ + '></span>');
$(obj)[option[3]/*insertAfter*/ ? 'after' : 'before'](controls);
if(option[13]/*numeric*/) {
numericContainer = controls.prepend('<ol '+ option[14]/*numericAttr*/ +'></ol>').children();
b = option[13]/*numeric*/ == 'pages' ? orgSlideCount : 1;
if(s>1){
for(a=0;a<s-((option[11]/*continuous*/ || option[13]/*numeric*/ == 'pages') ? 1 : orgSlideCount)+1;a += b)
{
numericControls[a] = $("<li rel='" + (a+1) + "'><a href='#'><span>"+ option[15]/*numericText*/[a] +"</span></a></li>")
.appendTo(numericContainer)
.click(function(){
goToSlide($(this).attr('rel') - 1, truev);
return falsev;
});
};
}
}
if(option[4]/*firstShow*/) firstbutton = makecontrol(option[36]/*firstHtml*/, "first");
if(option[5]/*lastShow*/) lastbutton = makecontrol(option[38]/*lastHtml*/, "last");
if(option[12]/*prevNext*/){
nextbutton = makecontrol(option[34]/*nextHtml*/, "next");
prevbutton = makecontrol(option[33]/*prevHtml*/, "prev");
}
};
if (option[26]/*preloadAjax*/ === truev) for (i=0;i<=ts;i++) if (option[25]/*ajax*/[i] && option[27]/*startSlide*/-1 != i) ajaxLoad(i, falsev, 0, falsev);
b = [1/*controlsFadeSpeed*/,7/*speed*/,10/*pause*/,18/*speedhistory*/,23/*fadespeed*/];
for (a in b) {
option[parseInt10(b[a])] = textSpeedToNumber(option[parseInt10(b[a])]);
}
if (option[20]/*customLink*/)
{
$(option[20]/*customLink*/).live('click', function() { // When i started making this script, the .live() was brand new.
if (a = $(this).attr('rel')) {
if (a == 'stop')
{
option[9]/*auto*/ = falsev;
stopAuto();
}
else if (a == 'start')
{
timeout = startAuto(option[10]/*pause*/);
option[9]/*auto*/ = truev;
}
else if (a == 'block') clickable = falsev; // Simple, beautifull.
else if (a == 'unblock') clickable = truev; // -||-
else if (clickable) goToSlide((a == parseInt10(a)) ? a - 1 : a, truev);
}
return falsev;
});
}
runOnImagesLoaded (liConti.slice(0,option[40]/*slideCount*/), truev, function ()
{
if (option[9]/*auto*/) timeout = startAuto(option[10]/*pause*/);
if (destroyT) animate(destroyT,falsev,falsev,falsev);
else if (option[17]/*history*/) {
if ($.hashchange)
{
$(window).hashchange(URLChange);
}
else if ($.address)
{
$.address.change(function(e) {
URLChange();
});
}
else
{
$(window).bind('hashchange', URLChange);
}
URLChange();
}
else animate(option[27]/*startSlide*/ - 1,falsev,falsev,falsev);
})
}
function URLChange()
{
i = filterUrlHash(location.hash.substr(1));
if (init) animate(i,falsev,falsev,falsev);
else if (i != t) goToSlide(i, falsev);
}
function startAsyncDelayedLoad ()
{
if (option[25]/*ajax*/ && parseInt10(option[26]/*preloadAjax*/))
{
for (a in option[25]/*ajax*/)
{
if (option[25][a])
{
clearTimeout(asyncTimedLoad);
asyncTimedLoad = setTimeout(function(){
ajaxLoad(a, falsev, 0, falsev);
},parseInt10(option[26]/*preloadAjax*/));
break;
}
}
}
}
function startAuto(pause)
{
autoOn = truev; // The variable telling that an automatic slideshow is running.
return setTimeout(function(){
goToSlide("next", falsev);
},pause);
}
function stopAuto()
{
clearTimeout(timeout);
autoOn = falsev; // The variable telling that auto is no longer in charge.
}
function textSpeedToNumber(speed)
{
return (parseInt10(speed) || speed == 0) ?
parseInt10(speed) :
speed == 'fast' ?
200 :
(speed == 'normal' || speed == 'medium') ?
400 :
speed == 'slow' ?
600 :
400;
};
function makecontrol(html, action)
{
return $(html).prependTo(controls).click(function(){
goToSlide(action, truev);
return falsev;
});
}
function goToSlide(i, clicked)
{
beforeAniFuncFired = falsev;
if (!destroyed)
{
if (option[9]/*auto*/)
{
var delay = option[7]/*speed*/;
if (fading && option[22]/*crossFade*/) delay = parseInt10((delay)*(3/5));
else if (fading) delay = 0;
if(clicked){
stopAuto();
if (option[41]/*resumePause*/) timeout = startAuto(delay + option[41]/*resumePause*/);
}
else timeout = startAuto(option[10]/*pause*/ + delay);
}
if (option[21]/*fade*/)
{
fadeto(i, clicked);
}
else
{
if (option[11]/*continuous*/)
{
i = filterDir(i);
var diff = Math.abs(t-i);
if (i < option[40]/*slideCount*/-orgSlideCount+1 && Math.abs(t - i - s)/* t - (i + s) */ < diff) // if (does any clone exist && is the route the shortest by going to that clone? )
{
i = i + s;
diff = Math.abs(t - i - s); // Setting the new "standard", for how long the animation can be.
}
if (i > ts - option[40]/*slideCount*/ && Math.abs(t- i + s)/* t - (i - s) */  < diff)
{
i = i - s;
}
}
else
{
i = filterDir(i);
}
animate(i,clicked,truev,falsev);
}
}
};
function fadeControl (fadeOpacity,fadetime,nextcontrol) // It may not sound like it, but the variable fadeOpacity is only for truev/falsev.
{
if (nextcontrol)
{
var eA = nextbutton,
eB = lastbutton,
directionA = 'next',
directionB = 'last',
firstlastshow = option[5]/*lastShow*/;
}
else
{
var eA = prevbutton,
eB = firstbutton,
directionA = 'prev',
directionB = 'first',
firstlastshow = option[4]/*firstShow*/;
}
if (option[0]/*controlsShow*/)
{
if (option[12]/*prevNext*/) eA[fadeOpacity ? 'fadeIn' : 'fadeOut'](fadetime);
if (firstlastshow) eB[fadeOpacity ? 'fadeIn' : 'fadeOut'](fadetime);
}
if(option[20]/*customLink*/)
{
$(option[20]/*customLink*/)
.filter(function(index) {
return ($(this).attr("rel") == directionA || $(this).attr("rel") == directionB);
})
[fadeOpacity ? "fadeIn" : "fadeOut"](fadetime);
}
};
function fadeControls (a,fadetime)
{
fadeControl (a,fadetime,falsev); // abusing that the number 0 == falsev.
fadeControl(a < s - orgSlideCount, fadetime, truev);
};
function setCurrent(i)
{
i = getRealPos(i) + 1;
if (option[13]/*numeric*/) for (a in numericControls) setCurrentElement(numericControls[a], i);
if(option[20]/*customLink*/) setCurrentElement($(option[20]/*customLink*/), i);
};
function setCurrentElement(element,i)
{
if (element.filter)
{
element
.filter(".current")
.removeClass("current")
.each(function() {
if (isFunc(option[31]/*uncurrentFunc*/)){ option[31]/*uncurrentFunc*/.call(this, $(this).attr("rel")); }
});
element
.filter(function() {
b = $(this).attr("rel");
if (option[13]/*numeric*/ == 'pages')
{
for (a = 0; a < orgSlideCount; a++)
{
if (b == i - a) return truev;
}
}
else return b == i;
return falsev;
})
.addClass("current")
.each(function(index) {
if (isFunc(option[32]/*currentFunc*/)){ option[32]/*currentFunc*/.call(this, i); }
});
}
};
function filterUrlHash(a)
{
for (i in option[15]/*numericText*/) if (option[15]/*numericText*/[i] == a) return i;
return a ? t : 0;
};
function runOnImagesLoaded (target, all, callback)
{
var elems = target.add(target.find('img')).filter('img');
var len = elems.length;
if (!len)
{
callback();
}
elems.load(function() {
if (this.naturalHeight && !this.clientHeight)
{
$(this).height(this.naturalHeight).width(this.naturalWidth);
}
if (all)
{
len--;
if (len == 0) callback();
}
else
{
callback();
}
}).each(function(){
if ((this.complete || this.complete === undefined) && all)
{
var src = this.src;
this.src = "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==";
this.src = src;
}
});
}
function autoadjust(i, speed)
{
if (option[19]/*autoheight*/) autoheightwidth(i, speed, truev);//autoheight(i, speed);
if (option[39]/*autowidth*/) autoheightwidth(i, speed, falsev);//autowidth(i, speed);
}
function autoheightwidth(i, speed, axis) // Axis: truev == height, falsev == width.
{
obj.ready(function() {// Not using .load(), because that only triggers when something is loaded.
adjustHeightWidth (i, speed, axis);
runOnImagesLoaded (li.eq(i), falsev, function(){
adjustHeightWidth (i, speed, axis);
});
});
};
function adjustHeightWidth (i, speed, axis)
{
var i = getRealPos(i); // I assume that the continuous clones, and the original element is the same height. So i allways adjust acording to the original element.
var target = li.eq(i);
b = target[axis ? "height" : "width"]();
obj.animate(
axis ? {height : b} : {width : b},
{
queue:falsev,
duration:speed,
easing:option[8]/*ease*/
}
);
}
function adjustPosition()
{
ul.css(option[6]/*vertical*/ ? "margin-top" : "margin-left",getSlidePos(t));
};
function getSlidePos(slide)
{
var slide = liConti.eq(slide + (continuousClones ? option[40]/*slideCount*/ : 0));
return slide.length ? - slide.position()[option[6]/*vertical*/ ? 'top' : 'left'] : 0;
};
function adjust()
{
t = getRealPos(t); // Going to the real slide, away from the clone.
if(!option[24]/*updateBefore*/) setCurrent(t);
adjustPosition();
clickable = truev;
if(option[17]/*history*/ && buttonclicked) window.location.hash = option[15]/*numericText*/[t];
if (!fading && beforeAniFuncFired)
{
AniCall (t, truev); // I'm not running it at init, if i'm loading the slide.
}
};
function AniCall (i, after) // after ? truev == afterAniFunc : falsev == beforeAniFunc;
{
(after ? afterAniCall : beforeAniCall)(li.eq(i), getRealPos(i) + 1);
if (continuousClones)
{
if (i < option[40]/*slideCount*/) (after ? afterAniCall : beforeAniCall)(liConti.eq((i<0) ? i + option[40]/*slideCount*/ : i - option[40]/*slideCount*/),i+1);
if (i > ts - option[40]/*slideCount*/ || i == -option[40]/*slideCount*/) (after ? afterAniCall : beforeAniCall)(liConti.eq((i == -option[40]/*slideCount*/) ? -1 : option[40]/*slideCount*/ + i - ts - 1),i+1);
}
}
function afterAniCall(el, a)
{
if (isFunc(option[30]/*afterAniFunc*/)) option[30]/*afterAniFunc*/.call(el, a);
}
function beforeAniCall(el, a)
{
if (isFunc(option[29]/*beforeAniFunc*/)) option[29]/*beforeAniFunc*/.call(el, a);
}
function filterDir(dir)
{
return  dir == 'next' ?
getRealPos(t + 1 + option[42]/*moveCount*/) :
dir == 'prev' ?
getRealPos(t - 1 - option[42]/*moveCount*/) :
dir == 'first' ?
0 :
dir == 'last' ?
ts :
parseInt10(dir);
};
function ajaxLoad(i, adjust, speed, ajaxCallBack)
{
if (asyncTimedLoad) clearTimeout(asyncTimedLoad);// I dont want it to run to often.
var target = option[25]/*ajax*/[i],
targetslide = li.eq(i),
ajaxInit = speed === truev,
speed = (speed === truev) ? 0 : speed,
ajaxspeed = (fading) ? (!option[22]/*crossFade*/ ? parseInt10(option[23]/*fadespeed*/ * (2/5)) : option[23]/*fadespeed*/) : speed,
tt = i + 1,
textloaded = falsev;
$.ajax({
url: target,
success: function(data, textStatus, jqXHR){
var type = jqXHR.getResponseHeader('Content-Type').substr(0,5);
if (type != 'image')
{
textloaded = truev;
targetslide.html(data);
ajaxAdjust(i, speed, ajaxCallBack, adjust, ajaxInit, falsev);
}
},
complete: function(jqXHR){
if (!textloaded)
{
image = new Image();
targetslide.html('').append(image);
image.src = target;
ajaxAdjust(i, speed, ajaxCallBack, adjust, ajaxInit, truev);
}
}
});
option[25]/*ajax*/[i] = falsev;
options.ajax[i] = falsev;
};
function ajaxAdjust(i, speed, ajaxCallBack, adjust, ajaxInit, img){
var target = li.eq(i);
if (continuousClones)
{
if (i < option[40]/*slideCount*/) liConti.eq((i<0) ? i + option[40]/*slideCount*/ : i - option[40]/*slideCount*/).replaceWith($(target).clone());
if (i > ts - option[40]/*slideCount*/) liConti.eq(option[40]/*slideCount*/ + i - ts - 1).replaceWith($(target).clone());
liConti = ul.children("li");
if (ajaxInit === truev) adjustPosition();// Only doing this little trick at init.
}
if (adjust) autoadjust(i, speed);
runOnImagesLoaded (target, truev, function(){
if (ajaxInit === truev) adjustPosition();// Doing this little trick after the images are done.
if (isFunc(ajaxCallBack)) ajaxCallBack();
startAsyncDelayedLoad();
});
if (isFunc(option[28]/*ajaxLoadFunction*/)){option[28]/*ajaxLoadFunction*/.call(target, parseInt10(i)+1, img);}
if (ajaxCallBack == 2)
{
AniCall(i, falsev);
if (!beforeAniFuncFired)
{
AniCall(i, truev);
beforeAniFuncFired = truev;
}
}
};
function fadeto(i, clicked, ajaxcallback)
{
if (filterDir(i) != t && !destroyed && clickable) // We doesn't want something to happen all the time. The URL can change a lot, and cause som "flickering".
{
ajaxloading = falsev;
if (option[24]/*updateBefore*/) setCurrent(filterDir(i));
var speed = (!clicked && !option[9]/*auto*/ && option[17]/*history*/) ? option[23]/*fadespeed*/ * (option[18]/*speedhistory*/ / option[7]/*speed*/) : option[23]/*fadespeed*/,
ll = filterDir(i);
if(option[2]/*controlsFade*/) fadeControls (ll,option[1]/*controlsFadeSpeed*/);
if (ajaxcallback)
{
speed = oldSpeed;
if (dontCountinueFade) dontCountinueFade--; // It is nice that 0 == falsev;
}
else if (option[25]/*ajax*/)
{
dontCountinueFade = 0;
oldSpeed = speed;
for (a = ll; a < ll + orgSlideCount; a++)
{
if (option[25]/*ajax*/[a])
{
ajaxLoad(getRealPos(a), falsev, speed, function(){
fadeto(i, clicked, truev);
});
dontCountinueFade++;
}
}
}
else
{
dontCountinueFade = falsev;
}
if (!dontCountinueFade) // if (dontCountinueFade == 0)
{
clickable = !clicked;
autoadjust(ll,option[23]/*fadespeed*/); // The height animation takes the full lenght of the fade animation (fadein + fadeout if it's not crossfading).
AniCall(ll, falsev);
if (option[22]/*crossFade*/)
{
var firstRun = truev,
push = 0;
for (a = ll; a < ll + orgSlideCount; a++)
{
li.eq(getRealPos(a)).clone().prependTo(obj).css({'z-index' : '100000', 'position' : 'absolute', 'list-style' : 'none', 'top' : option[6]/*vertical*/ ? push : 0, 'left' : option[6]/*vertical*/ ? 0 : push}).
hide().fadeIn(option[23]/*fadespeed*/, function() {
fixClearType(this);
clickable = truev;
fading = truev;
if (firstRun)
{
animate(ll,falsev,falsev,falsev); // Moving to the correct place.
if(option[17]/*history*/ && clicked) window.location.hash = option[15]/*numericText*/[t]; // It's just one line of code, no need to make a function of it.
AniCall(ll, truev);
firstRun = falsev;
}
$(this).remove();
fading = falsev;
});
push += li.eq(a)[option[6]/*vertical*/ ? 'outerHeight' : 'outerWidth'](truev);
}
}
else
{
var fadeinspeed = parseInt10((speed)*(3/5));
var fadeoutspeed = speed - fadeinspeed;
li.stop().fadeTo(fadeoutspeed, 0.001, function(){
clickable = truev;
fading = truev;
animate(ll,falsev,falsev,falsev); // Moving to the correct place.
clickable = !clicked;
li.fadeTo(fadeinspeed, 1, function(){
fixClearType(this);
if(option[17]/*history*/ && clicked) window.location.hash = option[15]/*numericText*/[t]; // It's just one line of code, no need to make a function of it.
clickable = truev;
fading = falsev;
AniCall(ll, truev);
});
});
}
}
}
};
function animate(dir,clicked,time,ajaxcallback) // (Direction, did the user click something, is this to be done in >1ms?, is this inside a ajaxCallBack?)
{
if ((clickable && !destroyed && (dir != t || init)) && s >  getRealPos(dir) || ajaxcallback)
{
if (!ajaxcallback) ajaxloading = falsev;
clickable = (!clicked && !option[9]/*auto*/) ? truev : option[16]/*clickableAni*/;
buttonclicked = clicked;
ot = t;
t = dir;
if (option[24]/*updateBefore*/) setCurrent(t);
var diff = Math.sqrt(Math.abs(ot-t)),
speed = (!time) ? 0 : ((!clicked && !option[9]/*auto*/) ? parseInt10(diff*option[18]/*speedhistory*/) : parseInt10(diff*option[7]/*speed*/)),
i = getRealPos(t);
if (ajaxcallback)
{
speed = oldSpeed;
if (dontCountinue) dontCountinue--; // It is nice that 0 == falsev;
}
else if (option[25]/*ajax*/)
{
if (option[25]/*ajax*/[i])
{
ajaxLoad(i, truev, init || speed, 2); // 2 for AniCall
ajaxloading = truev;
}
if (!fading)
{
var aa = (ot>t) ? t : ot,
ab = (ot>t) ? ot : t;
dontCountinue = 0;
oldSpeed = speed;
for (a = aa; a <= ab; a++)
{
if (a<=ts && a>=0 && option[25]/*ajax*/[a])
{
ajaxLoad(a, falsev, speed, function(){
animate(dir,clicked,time, truev);
});
dontCountinue++;
}
}
}
for (a = i+1; a <= i + orgSlideCount; a++)
{
if (option[25]/*ajax*/[a]) ajaxLoad(a, falsev, 0, falsev);
}
}
if (!dontCountinue)
{
if (!fading && !ajaxloading)
{
AniCall(i, falsev);
beforeAniFuncFired = truev;
}
if (!fading) autoadjust(t, speed);
b = getSlidePos(t);
ul.animate(
option[6]/*vertical*/ ? { marginTop: b } : { marginLeft: b},
{
queue:falsev,
duration:speed,
easing:option[8]/*ease*/,
complete:adjust
}
);
if(option[2]/*controlsFade*/)
{
var fadetime = option[1]/*controlsFadeSpeed*/;
if (!clicked && !option[9]/*auto*/) fadetime = (option[18]/*speedhistory*/ / option[7]/*speed*/) * option[1]/*controlsFadeSpeed*/;
if (!time) fadetime = 0;
if (fading) fadetime = parseInt10((option[23]/*fadespeed*/)*(3/5));
fadeControls (t,fadetime);
}
if (init) if (!option[25]/*ajax*/[i]) startAsyncDelayedLoad();
init = falsev; //nasty workaround, but it works.
};
}
};
function getRealPos(a) //instead of the position of the "continuous-clone"
{
return parseInt10(
a < 0 ?
a + s :
a > ts ?
a - s :
a);
}
function isFunc(func) //Closure compiler inlines this. But i still keep it.
{
return $.isFunction(func);
}
function parseInt10 (num)
{
return parseInt(num,10);
}
function fixClearType (element)
{
if (screen.fontSmoothingEnabled) element.style.removeAttribute("filter"); // Fix cleartype
}
baseSlider.getOption = function(a){
return options[a];
}
baseSlider.setOption = function(a, val){
if (val)
{
baseSlider.destroy(); // Make it easy to work.
options[a] = val; // Sets the semi-global option.
baseSlider.init(); // This makes sure that the semi-local options is inserted into the slide again.
}
return baseSlider;
}
baseSlider.insertSlide = function(html, pos, numtext){
if (html)
{
baseSlider.destroy();
if (pos > s) pos = s; // If you try to add a slide after the last slide fix.
var html = '<li>' + html + '</li>';
if (!pos || pos == 0) ul.prepend(html);
else li.eq(pos -1).after(html);
if (pos <= destroyT || (!pos || pos == 0)) destroyT++;
if (option[15]/*numericText*/.length < pos){ option[15]/*numericText*/.length = pos;}
option[15]/*numericText*/.splice(pos,0,numtext || parseInt10(pos)+1);
baseSlider.init();
}
return baseSlider;
}
baseSlider.removeSlide = function(pos){
pos--; // 1 == the first.
baseSlider.destroy();
li.eq(pos).remove();
option[15]/*numericText*/.splice(pos,1);
if (pos < destroyT) destroyT--;
baseSlider.init();
return baseSlider;
}
baseSlider.goToSlide = function(a){
goToSlide((a == parseInt10(a)) ? a - 1 : a, truev);
return baseSlider;
}
baseSlider.block = function(){
clickable = falsev; // Simple, beautifull.
return baseSlider;
}
baseSlider.unblock = function(){
clickable = truev; // Simple, beautifull.
return baseSlider;
}
baseSlider.startAuto = function(){
option[9]/*auto*/ = truev;
timeout = startAuto(option[10]/*pause*/);
return baseSlider;
}
baseSlider.stopAuto = function(){
option[9]/*auto*/ = falsev;
stopAuto();
return baseSlider;
}
baseSlider.destroy = function(){
destroyT = t;
if (controls) controls.remove(); // that's it.
destroyed = truev; // No animation, no fading, no clicking from now.
$(option[20]/*customLink*/).die("click");
if (continuousClones) for (a=1;a<=option[40]/*slideCount*/;a++) liConti.eq(a-1).add(liConti.eq(-a)).remove();
ul.css(option[6]/*vertical*/ ? "margin-top" : "margin-left",getSlidePos(t));
return baseSlider;
}
baseSlider.init = function(){
if (destroyed) {
initSudoSlider(obj, destroyT);
}
return baseSlider;
}
baseSlider.adjust = function(speed){
if (!speed) speed = 0;
autoadjust(i, speed)
return baseSlider;
}
baseSlider.getValue = function(a){
return a == 'currentSlide' ?
t + 1 :
a == 'totalSlides' ?
s :
a == 'clickable' ?
clickable :
a == 'destroyed' ?
destroyed :
a == 'autoAnimation' ?
autoOn :
undefined;
}
});
};
})(jQuery);
$(document).ready(function(){
var retour = true;
var tempsTransition = 1000;
var affichePlayPause = true;
var lectureAutomatique = true;
var tempsAttente = 6000;
var icones = new Array();
icones['play'] = 'img/play_slider.png';
icones['pause'] = 'img/pause_slider.png';
var currentPosition = 0;
var slideWidth =230;
if(window.location.pathname=="/")
var slideWidth =330;
else
var slideWidth =230;
var slides = $('.slide');
var numberOfSlides = slides.length;
var interval;
var lectureEnCours = false;
$('#slidesContainer').css('overflow', 'hidden');
slides
.wrapAll('<div id="slideInner"></div>')
.css({
'display' : 'block',
'float' : 'left',
'width' : slideWidth
});
$('#slideInner').css('width', slideWidth * numberOfSlides);
$('#slideshow')
.prepend('<span class="control" id="leftControl">Précédent</span>')
.append('<span class="control" id="rightControl">Suivant</span>');
manageControls(currentPosition);
$('.control')
.bind('click', function(){
currentPosition = ($(this).attr('id')=='rightControl') ? currentPosition+1 : currentPosition-1;
if(currentPosition == numberOfSlides && retour == false ){
currentPosition--;
pause();
}
manageControls(currentPosition);
$('#slideInner').animate({
'marginLeft' : slideWidth*(-currentPosition)
},tempsTransition);
});
function manageControls(position){
if(position==0){ $('#leftControl').hide() } else{ $('#leftControl').show() }
if(position==numberOfSlides-1 && retour == false){
$('#rightControl').hide();
} else {
$('#rightControl').show();
}
if(position == numberOfSlides && retour == true){
currentPosition = 0;
$('#leftControl').hide();
}
}
function suivant(){
$('#rightControl').click();
}
function start() {
lectureEnCours = true;
interval = setInterval(suivant, tempsAttente );
}
function pause() {
lectureEnCours = false;
clearInterval(interval);
}
if(lectureAutomatique == true){
start();
}
$(".slider").sudoSlider({
numeric:true,
autoheight: false,
prevHtml:'<a href="#" class="prevBtn"><span> Précédent</span></a>',
nextHtml:'<a href="#" class="nextBtn"><span> Suivant </span></a>'
});
function setHeight($lightbox){
$(".heliolightbox-default .slider").sudoSlider({
numeric:true,
autoheight: false,
prevHtml:'<a href="#" class="prevBtn"><span> Précédent</span></a>',
nextHtml:'<a href="#" class="nextBtn"><span> Suivant </span></a>'
});
}
$.helioLightbox.defaults.width=735;
$.helioLightbox.defaults.onOpened.push(setHeight);
});
(function($, undefined){
$(function(){
function caleBlocDroite(){
var full = $(".full").outerHeight();
var bloc_droit = $(".bloc_droit").outerHeight();
var bloc_ref = full - bloc_droit;
if(full > bloc_droit){
$(".bloc-reference").css({
paddingTop: bloc_ref + 'px'
});
}
}
setTimeout(caleBlocDroite, 500);
desactive();
active(".banniere img:first",$(".banniere a:first"))
$(".banniere a").hover(function(){
var sel =$(this).attr('id');
desactive();
active(".banniere ."+sel,$(this));
});
function active(id,elt){
$(id).show();
elt.addClass('desactive');
elt.addClass('active');
}
function desactive(){
$(".banniere img").hide();
$(".banniere a").removeClass('active');
$(".banniere a").addClass('desactive');
}
});
})(jQuery);

