//Url du dossier de base
var base = "http://www.webinventif.fr/wp-content/themes/tma2/";
/************************************************************************************************************
 *
 *  Background-Position Animations - http://www.corrupt-system.de/jquery/backgroundPosition/
 * 
*************************************************************************************************************/
eval(function(p,a,c,k,e,d){e=function(c){return(c<a?"":e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('(f($){$.G($.5.x,{e:f(5){H(5.v==0&&A 5.7==\'B\'){b 6=$.q(5.m,\'e\');6=h(6);5.6=[6[0],6[2]];b 7=h(5.7);5.7=[7[0],7[2]];5.i=[7[1],7[3]]}b 9=[];9[0]=((5.7[0]-5.6[0])*5.n)+5.6[0]+5.i[0];9[1]=((5.7[1]-5.6[1])*5.n)+5.6[1]+5.i[1];5.m.F.e=9[0]+\' \'+9[1];f h(8){8=8.c(/r|t/g,\'u\');8=8.c(/w|y/g,\'z%\');8=8.c(/(\\d+)(\\s|\\)|$)/g,"$D$2");b a=8.p(/(\\d+)(k|\\%|l|j)\\s(\\d+)(k|\\%|l|j)/);C[o(a[1]),a[2],o(a[3]),a[4]]}}})})(E);',44,44,'|||||fx|start|end|strg|nowPosX|res|var|replace||backgroundPosition|function||toArray|unit|pt|px|em|elem|pos|parseFloat|match|curCSS|left||top|0px|state|right|step|bottom|100|typeof|string|return|1px|jQuery|style|extend|if'.split('|'),0,{}));
/************************************************************************************************************
 *
 *  hoverIntent r5 // 2007.03.27 // jQuery 1.1.2 - http://cherne.net/brian/resources/jquery.hoverIntent.html
 * 
*************************************************************************************************************/
(function($){$.fn.hoverIntent=function(f,g){var cfg={sensitivity:7,interval:100,timeout:0};cfg=$.extend(cfg,g?{over:f,out:g}:f);var cX,cY,pX,pY;var track=function(ev){cX=ev.pageX;cY=ev.pageY;};var compare=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);if((Math.abs(pX-cX)+Math.abs(pY-cY))<cfg.sensitivity){$(ob).unbind("mousemove",track);ob.hoverIntent_s=1;return cfg.over.apply(ob,[ev]);}else{pX=cX;pY=cY;ob.hoverIntent_t=setTimeout(function(){compare(ev,ob);},cfg.interval);}};var delay=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);ob.hoverIntent_s=0;return cfg.out.apply(ob,[ev]);};var handleHover=function(e){var p=(e.type=="mouseover"?e.fromElement:e.toElement)||e.relatedTarget;while(p&&p!=this){try{p=p.parentNode;}catch(e){p=this;}}if(p==this){return false;}var ev=jQuery.extend({},e);var ob=this;if(ob.hoverIntent_t){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);}if(e.type=="mouseover"){pX=ev.pageX;pY=ev.pageY;$(ob).bind("mousemove",track);if(ob.hoverIntent_s!=1){ob.hoverIntent_t=setTimeout(function(){compare(ev,ob);},cfg.interval);}}else{$(ob).unbind("mousemove",track);if(ob.hoverIntent_s==1){ob.hoverIntent_t=setTimeout(function(){delay(ev,ob);},cfg.timeout);}}};return this.mouseover(handleHover).mouseout(handleHover);};})(jQuery);
/************************************************************************************************************
 *
 *  wsticky
 * 
*************************************************************************************************************/
(function($){$.fn.wsticky=function(h){h=jQuery.extend({limited:'bottom',duration:750,effect:'swing',decal:0,idparent:false},h);function gogogo(a,i){var b;if(!h.idparent){b=a.parent()}else{b=$(h.idparent)}var c=b.offset();var d=a.offset();var e=[d.left-c.left,d.top-c.top];var f=0;var g=h.effect;if(jQuery.easing.easeInQuad==undefined&&(g!='swing'||g!='normal')){g='swing'}b.css("position","relative");a.before(a.clone().css("visibility","hidden"));a.css({position:"absolute",top:e[1]+"px",left:e[0]+"px",zIndex:Number(600+i),margin:0});var j=0;$(window).scroll(function(){j=document.documentElement.scrollTop||document.body.scrollTop});$(window).resize(function(){j=document.documentElement.scrollTop||document.body.scrollTop});function ano(){if(j<d.top-h.decal&&h.limited!='none'&&h.limited!='top'){f=Number(e[1])}else if(Number(j-d.top+h.decal+e[1])>Number(b.height()-a.height())&&h.limited!='none'&&h.limited!='bottom'){f=Number(b.height()-a.height())}else{f=Number(j-d.top+e[1]+h.decal)}a.animate({top:f+"px"},h.duration-200,g)}setInterval(ano,h.duration)}return this.each(function(i){gogogo($(this),i)})}})(jQuery);
/************************************************************************************************************
 *
 *  	Perso
 * 
*************************************************************************************************************/
$(document).ready(function(){
	function globale(){
	//animation des fleches de fond
	$('.first_level li a').css({backgroundPosition: '0px 0px'});
	$('.first_level li a').each(function(){
		$(this).hover(function(){$(this).animate({backgroundPosition: '(0px 30px)'})}, function(){$(this).animate({backgroundPosition: '(0px 0px)'});});
	});
	};
	globale();
	//ajax
	function ajax_page(ele,msg,url){
		$(ele).slideUp("fast", function(){
			$(ele).html(msg).show("fast", function(){
				$(ele).load(url+" "+ele, {limit: 25}, function(){
					var tampon = $(ele).html();
					$(ele).html(msg).hide("fast",function(){
						$(ele).html(tampon);
						$(ele).slideDown("fast");
					});
				});
			});
		});
	}
	function ajax_page2(ele,msg,url){
		$(ele).html(msg).load(url+" "+ele);
	}
	$("a.ajax").click(function(){
		ajax_page('.unique1','<p style="text-align: center">Loading ...</p>',this.href);
		return false;
	});
});