function json_decode(str_json){var json=this.window.JSON;if(typeof json==="object"&&typeof json.parse==="function")try{return json.parse(str_json)}catch(err){if(!(err instanceof SyntaxError))throw new Error("Unexpected error type in json_decode()");this.php_js=this.php_js||{};this.php_js.last_error_json=4;return null}var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;var j;var text=str_json;cx.lastIndex=0;if(cx.test(text))text=text.replace(cx,
function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)});if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){j=eval("("+text+")");return j}this.php_js=this.php_js||{};this.php_js.last_error_json=4;return null}
if(!document.getCookie){function getCookie(name){var search=name+"=",defcook="";if(document.cookie.length>0){offset=document.cookie.indexOf(search);if(offset!=-1){offset+=search.length;end=document.cookie.indexOf(";",offset);if(end==-1)end=document.cookie.length;defcook=unescape(document.cookie.substring(offset,end));if(defcook!="")return defcook}}}}
if(!document.setCookie)setCookie=function(document,name,value,expire){document.cookie=name+"="+escape(value)+"; path=/;"+(expire==null?"":"; expires="+expire.toGMTString())};function getUrlVars(){var vars=[],hash;var hashes=window.location.href.slice(window.location.href.indexOf("?")+1).split("&");for(var i=0;i<hashes.length;i++){hash=hashes[i].split("=");vars.push(hash[0]);vars[hash[0]]=hash[1]}return vars}var tab_get=getUrlVars();
if(typeof tab_get["srcid"]!="undefined"){plus_un_jour=new Date;plus_un_jour.setTime(plus_un_jour.getTime()+864E5);setCookie(document,"provenance_jour",tab_get["srcid"],plus_un_jour);setCookie(document,"provenance_time",Math.floor(plus_un_jour.getTime()/1E3),plus_un_jour)}var regExpCss={negAndPos:/-?[0-9]+/,floatValPx:/^[1-9][.,]?[0-9]*px/,val:/[0-9.,]+/};
function static_carousel(){$(".static-carousel").each(function(i){var $THIS=$(this);var knownCssProperties={rightBorder:"border-right-width",rightMargin:"margin-right"};var params=json_decode($THIS.attr("rel"));if(typeof params=="undefined"){alert("Paramètres du carousel absents !");return}params.slideDuration=typeof params.slideDuration!="undefined"?params.slideDuration:500;var $innerUL=$THIS.find("ul").eq(0),$wrapper=$innerUL.parent();var itemLi=$innerUL.children(":last").eq(0);var item_profile=
{width:itemLi.innerWidth(),excedant:0};for(el in params)if(typeof knownCssProperties[el]!="undefined"){var hasCssProperty=regExpCss.floatValPx.test(itemLi.css(knownCssProperties[el]));var cssProperty=hasCssProperty?+itemLi.css(knownCssProperties[el]).match(regExpCss.val).join(""):0;item_profile["excedant"]+=cssProperty}var item_unit=item_profile.width+item_profile.excedant;$innerUL.css("width",item_unit*$innerUL.children().size()+"px");var wrapperMaxWidth=$THIS.width()-2*$THIS.children("div.carousel-control").width();
var step=item_unit*params.nb_items;if(step>wrapperMaxWidth);if(item_profile["excedant"]>0){var wrapperWidth=step-item_profile["excedant"],wrapperSideMargin=(wrapperMaxWidth-wrapperWidth)/2;$wrapper.css("width",wrapperWidth+"px");$wrapper.css("margin-left",wrapperSideMargin+"px").css("margin-right",wrapperSideMargin+"px")}else{$wrapper.css("width",step+"px");var wrapperSideMargin=(wrapperMaxWidth-step)/2;$wrapper.css("margin-left",wrapperSideMargin+"px").css("margin-right",wrapperSideMargin+"px")}if(/MSIE 6/.test(navigator.appVersion)){wrapperSideMargin-=
9;$wrapper.css("margin-left",(wrapperSideMargin>0?wrapperSideMargin:0)+"px").css("margin-right",(wrapperSideMargin>0?wrapperSideMargin:0)+"px")}if(+$innerUL.css("left").match(regExpCss.negAndPos)==0)$THIS.find("div.carousel-control > a[class=prev]").css({cursor:"default",backgroundPosition:"top right"});$THIS.find("div.carousel-control > a").bind("click",function(event){var $me=$(this),listOffset="",is_next=$me.hasClass("next"),$opposite=$me.parent().siblings(".carousel-control").find("a").eq(0);
if(is_next){$opposite.css({cursor:"pointer",backgroundPosition:"top left"});if($innerUL.width()+ +$innerUL.css("left").match(regExpCss.negAndPos)-step<=step)listOffset="-"+($innerUL.width()-step)+"px";else listOffset="-="+step+"px"}else{$opposite.css({cursor:"pointer",backgroundPosition:"bottom left"});if(Math.abs(+$innerUL.css("left").match(regExpCss.negAndPos))<=step)listOffset="0px";else if(0+ +$innerUL.css("left").match(regExpCss.negAndPos)<=0)listOffset="+="+step+"px"}$innerUL.animate({left:listOffset},
{duration:params.slideDuration,complete:function(){var ulWidth=$innerUL.width(),ulOffset=+$innerUL.css("left").match(regExpCss.negAndPos);if(is_next&&ulWidth+ulOffset<=step)$me.css({cursor:"default",backgroundPosition:"bottom right"});else if(!is_next&&ulOffset==0)$me.css({cursor:"default",backgroundPosition:"top right"})}});return false})})}$(document).ready(function(){static_carousel()});

