(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);

$(document).ready(function(){
	$(".noImgPreload img").each(function() {
    	$(this).attr("src", $(this).attr("original"));
	});
	$(".noImgPreload").each(function() {
    	$(this).attr("src", $(this).attr("original"));
	});

	// MENU DEROULANT START
	function megaHoverOver(){
		$(this).find(".sub").stop().fadeTo('fast', 1).show();
		(function($) {//Calculate width of all ul's
			jQuery.fn.calcSubWidth = function() {
				rowWidth = 0;
				$(this).find("ul").each(function() {//Calculate row					
					rowWidth += $(this).width(); 
				});	
			};
		})(jQuery); 
		if ( $(this).find(".row").length > 0 ) { //If row exists...
			var biggestRow = 0;	
			$(this).find(".row").each(function() {	//Calculate each row				  
				$(this).calcSubWidth();
				if(rowWidth > biggestRow) {//Find biggest row
					biggestRow = rowWidth;
				}
			});
			$(this).find(".sub").css({'width' :biggestRow});//Set width
			$(this).find(".row:last").css({'margin':'0'});
		} else { //If row does not exist...
			$(this).calcSubWidth();
			$(this).find(".sub").css({'width' : rowWidth});//Set Width
		}
	}
	function megaHoverOut(){
	 $(this).find(".sub").stop().fadeTo('fast', 0, function() {
		  $(this).hide();
	  });
	}
	var config = {
		 sensitivity: 2,		// number = sensitivity threshold (must be 1 or higher)    
		 interval: 0, 			// number = milliseconds for onMouseOver polling interval    
		 over: megaHoverOver,   // function = onMouseOver callback (REQUIRED)    
		 timeout: 1, 			// number = milliseconds delay before onMouseOut    
		 out: megaHoverOut 		// function = onMouseOut callback (REQUIRED)    
	};
	$("ul#topnavigation li .sub").css({'opacity':'0'});
	$("ul#topnavigation li").hoverIntent(config);
	// Add class to the current element
	$("ul#topnavigation li").click(function(){
		$("ul#topnavigation").find("li.current").removeClass().removeAttr("class");
		$(this).addClass("current");
	});
	// Change arrow on hover
	/*$("li.liSub").hover(function(){
		$(this).find("span img").attr("src", "http://www.snoupix.com/demo/css3-mega-dropdown-menu/arrow_hover.png");
	},function(){
		$(this).find("span img").attr("src", "http://www.snoupix.com/demo/css3-mega-dropdown-menu/arrow.png");
	});*/
	// Delete the border for the last li of the submenu
	$("ul#topnavigation .sub ul li:last-child a").css("border", "none");
	// MENU DEROULANT END

	/*// CONNEXION BOX
	$("#BoxMembreConnexionHidden").hide();
	$('#BoxMembreConnexionLoader').hide();
	$('#BoxMembreConnexionResponse').hide();
	$(".BoxMembreConnexion").click(function () {
		if ($("#BoxMembreConnexionHidden").is(":hidden")) {
		$("#BoxMembreConnexionHidden").slideDown("slow");
		$("#UserName").focus();
		$('#BoxMembreConnexionError').hide();
		} else {
		$("#BoxMembreConnexionHidden").slideUp("slow");
		}
	});
		$("#BoxMembreConnexionSubmit").click(function () {
			$.get("/include-connexion-verif-REQUEST.php",{UserName: $("#UserName").val(), PassWord: $("#PassWord").val(), redirectURL: $("#redirectURL").val()},  
			function(data) {
			  $('#BoxMembreConnexionForm').hide();
			  $('#BoxMembreConnexionLoader').show();
			  $('#BoxMembreConnexionError').hide();
				if(data == "1"){
					setTimeout(function() {
					  $('#BoxMembreConnexionError').show();
					  $('#BoxMembreConnexionForm').show();
					  $('#UserName').val('');
					  $("#UserName").focus();
					  $('#PassWord').val('');
					  $('#BoxMembreConnexionLoader').hide();
					}, 2000);
				}else{
					setTimeout(function() {
						$('#BoxMembreConnexionLoader').hide();
						$('#BoxMembreConnexionResponse').show();
						$('#BoxMembreConnexionResponse').html(data);
						setTimeout(function() {
							window.location = $("#redirectURL").val();
						}, 2000);
					}, 2000);
					
				}
			});
		});	
	$("#deconnexionBox").click(function () {
		$.get("/include-connexion-close-REQUEST.php",{},  
		function(data) {
			setTimeout(function() {
				window.location = $("#redirectURL").val();
			}, 2000);
		});
	});		*/
	//SCROLL TO TOP PAGE
	$('a[href=#top]').click(function(){
        $('html, body').animate({scrollTop:0}, 'slow');
        return false;
    });	
    // SCROLL TO BOTTOM PAGE
	$('#someID').click(function(){
        $('html, body').animate({scrollTop:$(document).height()}, 'slow');
        return false;
    });	// MODAL WINDOW
	$('a[name=modal]').click(function(e) {
		e.preventDefault();
		var id = $(this).attr('href');
		var maskHeight = $(document).height();
		var maskWidth = $(window).width();
		$('#modalboxmask').css({'width':maskWidth,'height':maskHeight});
		$('#modalboxmask').fadeIn(1000);	
		$('#modalboxmask').fadeTo("slow",0.6);	
		var winH = $(window).height();
		var winW = $(window).width();
		$(id).css('top',  winH/2-$(id).height()/2);
		$(id).css('left', winW/2-$(id).width()/2);
		$(id).fadeIn(2000); 
		
        $('html, body').animate({scrollTop:0}, 'slow');
        return false;
	});
	$('.window .close').click(function (e) {
		e.preventDefault();
		$('#modalboxmask').hide();
		$('.window').hide();
	});		
	$('#modalboxmask').click(function () {
		$(this).hide();
		$('.window').hide();
	});			
	$(".imgHover").hover( 
		function () {
			$(this).fadeTo("fast", .5);
		},
		function () {
			$(this).fadeTo("fast", 1);
		}				   
	);
});
// INTERDIRE AUTO REMPLISSAGE NAVIGATEUR
if (document.getElementsByTagName) {
	var inputElements = document.getElementsByTagName("input");
	for (i=0; inputElements[i]; i++) {
	  if (inputElements[i].className && (inputElements[i].className.indexOf("SuppAutoRempl") != -1)) {
		inputElements[i].setAttribute("autocomplete","off");
	  }
	}
}
function PopupCentrer(page,largeur,hauteur,options) {
	var top=(screen.height-hauteur)/2;
	var left=(screen.width-largeur)/2;
	window.open(page,"","top="+top+",left="+left+",width="+largeur+",height="+hauteur+","+options);
}
//email protector
var maildivider="[at]" 
for (i=0; i<=(document.links.length-1); i++){
	if (document.links[i].href.indexOf(maildivider)!=-1)
	document.links[i].href=document.links[i].href.split(maildivider)[0]+"@"+document.links[i].href.split(maildivider)[1]
}
function CheckForm(){
	if (document.conected.UserName.value == "") {
		document.getElementById('Errorbox').innerHTML = '<font style="color:#cc0000"><img src="\/images\/no2.gif" alt="" \/> Veuillez indiquer votre nom d\'utilisateur.<\/font>';
		document.getElementById('UserName').style.border = '1px solid #D41919';
		document.conected.UserName.focus();
		return false;
	}else if (document.conected.PassWord.value == "") {
		document.getElementById('Errorbox').innerHTML = '<font style="color:#cc0000"><img src="\/images\/no2.gif" alt="" \/> Veuillez indiquer votre mot de passe.<\/font>';
		document.getElementById('PassWord').style.border = '1px solid #D41919';
		document.conected.PassWord.focus();
		return false;
	}else{
		document.getElementById('UserName').style.border = '1px solid #CFD8E0';
		document.getElementById('PassWord').style.border = '1px solid #CFD8E0';
		document.getElementById('Errorbox').innerHTML = '';
		return true;
	}
}
// SWFObject v2.2 <http://code.google.com/p/swfobject/>
var swfobject=function(){function u(){if(!s){try{var a=d.getElementsByTagName("body")[0].appendChild(d.createElement("span"));a.parentNode.removeChild(a)}catch(b){return}s=true;for(var a=x.length,c=0;c<a;c++)x[c]()}}function L(a){s?a():x[x.length]=a}function M(a){if(typeof m.addEventListener!=i)m.addEventListener("load",a,false);else if(typeof d.addEventListener!=i)d.addEventListener("load",a,false);else if(typeof m.attachEvent!=i)U(m,"onload",a);else if(typeof m.onload=="function"){var b=m.onload;
m.onload=function(){b();a()}}else m.onload=a}function V(){var a=d.getElementsByTagName("body")[0],b=d.createElement(r);b.setAttribute("type",y);var c=a.appendChild(b);if(c){var f=0;(function(){if(typeof c.GetVariable!=i){var g=c.GetVariable("$version");if(g)g=g.split(" ")[1].split(","),e.pv=[parseInt(g[0],10),parseInt(g[1],10),parseInt(g[2],10)]}else if(f<10){f++;setTimeout(arguments.callee,10);return}a.removeChild(b);c=null;D()})()}else D()}function D(){var a=o.length;if(a>0)for(var b=0;b<a;b++){var c=
o[b].id,f=o[b].callbackFn,g={success:false,id:c};if(e.pv[0]>0){var d=n(c);if(d)if(z(o[b].swfVersion)&&!(e.wk&&e.wk<312)){if(t(c,true),f)g.success=true,g.ref=E(c),f(g)}else if(o[b].expressInstall&&F()){g={};g.data=o[b].expressInstall;g.width=d.getAttribute("width")||"0";g.height=d.getAttribute("height")||"0";if(d.getAttribute("class"))g.styleclass=d.getAttribute("class");if(d.getAttribute("align"))g.align=d.getAttribute("align");for(var h={},d=d.getElementsByTagName("param"),j=d.length,k=0;k<j;k++)d[k].getAttribute("name").toLowerCase()!=
"movie"&&(h[d[k].getAttribute("name")]=d[k].getAttribute("value"));G(g,h,c,f)}else W(d),f&&f(g)}else if(t(c,true),f){if((c=E(c))&&typeof c.SetVariable!=i)g.success=true,g.ref=c;f(g)}}}function E(a){var b=null;if((a=n(a))&&a.nodeName=="OBJECT")typeof a.SetVariable!=i?b=a:(a=a.getElementsByTagName(r)[0])&&(b=a);return b}function F(){return!A&&z("6.0.65")&&(e.win||e.mac)&&!(e.wk&&e.wk<312)}function G(a,b,c,f){A=true;H=f||null;N={success:false,id:c};var g=n(c);if(g){g.nodeName=="OBJECT"?(w=I(g),B=null):
(w=g,B=c);a.id=O;if(typeof a.width==i||!/%$/.test(a.width)&&parseInt(a.width,10)<310)a.width="310";if(typeof a.height==i||!/%$/.test(a.height)&&parseInt(a.height,10)<137)a.height="137";d.title=d.title.slice(0,47)+" - Flash Player Installation";f=e.ie&&e.win?"ActiveX":"PlugIn";f="MMredirectURL="+m.location.toString().replace(/&/g,"%26")+"&MMplayerType="+f+"&MMdoctitle="+d.title;typeof b.flashvars!=i?b.flashvars+="&"+f:b.flashvars=f;if(e.ie&&e.win&&g.readyState!=4)f=d.createElement("div"),c+="SWFObjectNew",
f.setAttribute("id",c),g.parentNode.insertBefore(f,g),g.style.display="none",function(){g.readyState==4?g.parentNode.removeChild(g):setTimeout(arguments.callee,10)}();J(a,b,c)}}function W(a){if(e.ie&&e.win&&a.readyState!=4){var b=d.createElement("div");a.parentNode.insertBefore(b,a);b.parentNode.replaceChild(I(a),b);a.style.display="none";(function(){a.readyState==4?a.parentNode.removeChild(a):setTimeout(arguments.callee,10)})()}else a.parentNode.replaceChild(I(a),a)}function I(a){var b=d.createElement("div");
if(e.win&&e.ie)b.innerHTML=a.innerHTML;else if(a=a.getElementsByTagName(r)[0])if(a=a.childNodes)for(var c=a.length,f=0;f<c;f++)!(a[f].nodeType==1&&a[f].nodeName=="PARAM")&&a[f].nodeType!=8&&b.appendChild(a[f].cloneNode(true));return b}function J(a,b,c){var f,g=n(c);if(e.wk&&e.wk<312)return f;if(g){if(typeof a.id==i)a.id=c;if(e.ie&&e.win){var q="",h;for(h in a)if(a[h]!=Object.prototype[h])h.toLowerCase()=="data"?b.movie=a[h]:h.toLowerCase()=="styleclass"?q+=' class="'+a[h]+'"':h.toLowerCase()!="classid"&&
(q+=" "+h+'="'+a[h]+'"');h="";for(var j in b)b[j]!=Object.prototype[j]&&(h+='<param name="'+j+'" value="'+b[j]+'" />');g.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+q+">"+h+"</object>";C[C.length]=a.id;f=n(a.id)}else{j=d.createElement(r);j.setAttribute("type",y);for(var k in a)a[k]!=Object.prototype[k]&&(k.toLowerCase()=="styleclass"?j.setAttribute("class",a[k]):k.toLowerCase()!="classid"&&j.setAttribute(k,a[k]));for(q in b)b[q]!=Object.prototype[q]&&q.toLowerCase()!=
"movie"&&(a=j,h=q,k=b[q],c=d.createElement("param"),c.setAttribute("name",h),c.setAttribute("value",k),a.appendChild(c));g.parentNode.replaceChild(j,g);f=j}}return f}function P(a){var b=n(a);if(b&&b.nodeName=="OBJECT")e.ie&&e.win?(b.style.display="none",function(){if(b.readyState==4){var c=n(a);if(c){for(var f in c)typeof c[f]=="function"&&(c[f]=null);c.parentNode.removeChild(c)}}else setTimeout(arguments.callee,10)}()):b.parentNode.removeChild(b)}function n(a){var b=null;try{b=d.getElementById(a)}catch(c){}return b}
function U(a,b,c){a.attachEvent(b,c);v[v.length]=[a,b,c]}function z(a){var b=e.pv,a=a.split(".");a[0]=parseInt(a[0],10);a[1]=parseInt(a[1],10)||0;a[2]=parseInt(a[2],10)||0;return b[0]>a[0]||b[0]==a[0]&&b[1]>a[1]||b[0]==a[0]&&b[1]==a[1]&&b[2]>=a[2]?true:false}function Q(a,b,c,f){if(!e.ie||!e.mac){var g=d.getElementsByTagName("head")[0];if(g){c=c&&typeof c=="string"?c:"screen";f&&(K=l=null);if(!l||K!=c)f=d.createElement("style"),f.setAttribute("type","text/css"),f.setAttribute("media",c),l=g.appendChild(f),
e.ie&&e.win&&typeof d.styleSheets!=i&&d.styleSheets.length>0&&(l=d.styleSheets[d.styleSheets.length-1]),K=c;e.ie&&e.win?l&&typeof l.addRule==r&&l.addRule(a,b):l&&typeof d.createTextNode!=i&&l.appendChild(d.createTextNode(a+" {"+b+"}"))}}}function t(a,b){if(R){var c=b?"visible":"hidden";s&&n(a)?n(a).style.visibility=c:Q("#"+a,"visibility:"+c)}}function S(a){return/[\\\"<>\.;]/.exec(a)!=null&&typeof encodeURIComponent!=i?encodeURIComponent(a):a}var i="undefined",r="object",y="application/x-shockwave-flash",
O="SWFObjectExprInst",m=window,d=document,p=navigator,T=false,x=[function(){T?V():D()}],o=[],C=[],v=[],w,B,H,N,s=false,A=false,l,K,R=true,e=function(){var a=typeof d.getElementById!=i&&typeof d.getElementsByTagName!=i&&typeof d.createElement!=i,b=p.userAgent.toLowerCase(),c=p.platform.toLowerCase(),f=c?/win/.test(c):/win/.test(b),c=c?/mac/.test(c):/mac/.test(b),b=/webkit/.test(b)?parseFloat(b.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,g=!+"\u000b1",e=[0,0,0],h=null;if(typeof p.plugins!=i&&
typeof p.plugins["Shockwave Flash"]==r){if((h=p.plugins["Shockwave Flash"].description)&&!(typeof p.mimeTypes!=i&&p.mimeTypes[y]&&!p.mimeTypes[y].enabledPlugin))T=true,g=false,h=h.replace(/^.*\s+(\S+\s+\S+$)/,"$1"),e[0]=parseInt(h.replace(/^(.*)\..*$/,"$1"),10),e[1]=parseInt(h.replace(/^.*\.(.*)\s.*$/,"$1"),10),e[2]=/[a-zA-Z]/.test(h)?parseInt(h.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}else if(typeof m.ActiveXObject!=i)try{var j=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");if(j&&(h=j.GetVariable("$version")))g=
true,h=h.split(" ")[1].split(","),e=[parseInt(h[0],10),parseInt(h[1],10),parseInt(h[2],10)]}catch(k){}return{w3:a,pv:e,wk:b,ie:g,win:f,mac:c}}();(function(){e.w3&&((typeof d.readyState!=i&&d.readyState=="complete"||typeof d.readyState==i&&(d.getElementsByTagName("body")[0]||d.body))&&u(),s||(typeof d.addEventListener!=i&&d.addEventListener("DOMContentLoaded",u,false),e.ie&&e.win&&(d.attachEvent("onreadystatechange",function(){d.readyState=="complete"&&(d.detachEvent("onreadystatechange",arguments.callee),
u())}),m==top&&function(){if(!s){try{d.documentElement.doScroll("left")}catch(a){setTimeout(arguments.callee,0);return}u()}}()),e.wk&&function(){s||(/loaded|complete/.test(d.readyState)?u():setTimeout(arguments.callee,0))}(),M(u)))})();(function(){e.ie&&e.win&&window.attachEvent("onunload",function(){for(var a=v.length,b=0;b<a;b++)v[b][0].detachEvent(v[b][1],v[b][2]);a=C.length;for(b=0;b<a;b++)P(C[b]);for(var c in e)e[c]=null;e=null;for(var f in swfobject)swfobject[f]=null;swfobject=null})})();return{registerObject:function(a,
b,c,f){if(e.w3&&a&&b){var d={};d.id=a;d.swfVersion=b;d.expressInstall=c;d.callbackFn=f;o[o.length]=d;t(a,false)}else f&&f({success:false,id:a})},getObjectById:function(a){if(e.w3)return E(a)},embedSWF:function(a,b,c,d,g,q,h,j,k,m){var n={success:false,id:b};e.w3&&!(e.wk&&e.wk<312)&&a&&b&&c&&d&&g?(t(b,false),L(function(){c+="";d+="";var e={};if(k&&typeof k===r)for(var l in k)e[l]=k[l];e.data=a;e.width=c;e.height=d;l={};if(j&&typeof j===r)for(var o in j)l[o]=j[o];if(h&&typeof h===r)for(var p in h)typeof l.flashvars!=
i?l.flashvars+="&"+p+"="+h[p]:l.flashvars=p+"="+h[p];if(z(g))o=J(e,l,b),e.id==b&&t(b,true),n.success=true,n.ref=o;else if(q&&F()){e.data=q;G(e,l,b,m);return}else t(b,true);m&&m(n)})):m&&m(n)},switchOffAutoHideShow:function(){R=false},ua:e,getFlashPlayerVersion:function(){return{major:e.pv[0],minor:e.pv[1],release:e.pv[2]}},hasFlashPlayerVersion:z,createSWF:function(a,b,c){if(e.w3)return J(a,b,c)},showExpressInstall:function(a,b,c,d){e.w3&&F()&&G(a,b,c,d)},removeSWF:function(a){e.w3&&P(a)},createCSS:function(a,
b,c,d){e.w3&&Q(a,b,c,d)},addDomLoadEvent:L,addLoadEvent:M,getQueryParamValue:function(a){var b=d.location.search||d.location.hash;if(b){/\?/.test(b)&&(b=b.split("?")[1]);if(a==null)return S(b);for(var b=b.split("&"),c=0;c<b.length;c++)if(b[c].substring(0,b[c].indexOf("="))==a)return S(b[c].substring(b[c].indexOf("=")+1))}return""},expressInstallCallback:function(){if(A){var a=n(O);if(a&&w){a.parentNode.replaceChild(w,a);if(B&&(t(B,true),e.ie&&e.win))w.style.display="block";H&&H(N)}A=false}}}}();

// Animated Collapsible DIV- Author: Dynamic Drive (http://www.dynamicdrive.com)
var uniquepageid=window.location.href.replace("http://"+window.location.hostname,"").replace(/^\//,"");
function animatedcollapse(a,c,b,d){this.divId=a;this.divObj=document.getElementById(a);this.divObj.style.overflow="hidden";this.timelength=c;this.initstate=typeof d!="undefined"&&d=="block"?"block":"contract";this.isExpanded=animatedcollapse.getCookie(uniquepageid+"-"+a);this.contentheight=parseInt(this.divObj.style.height);var e=this;if(isNaN(this.contentheight)){if(animatedcollapse.dotask(window,function(){e._getheight(b)},"load"),!b&&this.initstate=="contract"||b&&this.isExpanded!="yes")this.divObj.style.visibility=
"hidden"}else if(!b&&this.initstate=="contract"||b&&this.isExpanded!="yes")this.divObj.style.height=0;b&&animatedcollapse.dotask(window,function(){animatedcollapse.setCookie(uniquepageid+"-"+e.divId,e.isExpanded)},"unload")}animatedcollapse.prototype._getheight=function(a){this.contentheight=this.divObj.offsetHeight;!a&&this.initstate=="contract"||a&&this.isExpanded!="yes"?(this.divObj.style.height=0,this.divObj.style.visibility="visible"):this.divObj.style.height=this.contentheight+"px"};
animatedcollapse.prototype._slideengine=function(a){var c=(new Date).getTime()-this.startTime,b=this;c<this.timelength?(this.divObj.style.height=(a=="down"?animatedcollapse.curveincrement(c/this.timelength):1-animatedcollapse.curveincrement(c/this.timelength))*this.contentheight+"px",this.runtimer=setTimeout(function(){b._slideengine(a)},10)):(this.divObj.style.height=a=="down"?this.contentheight+"px":0,this.isExpanded=a=="down"?"yes":"no",this.runtimer=null)};
animatedcollapse.prototype.slidedown=function(){if(typeof this.runtimer=="undefined"||this.runtimer==null)if(isNaN(this.contentheight))alert("Please wait until document has fully loaded then click again");else if(parseInt(this.divObj.style.height)==0)this.startTime=(new Date).getTime(),this._slideengine("down")};
animatedcollapse.prototype.slideup=function(){if(typeof this.runtimer=="undefined"||this.runtimer==null)if(isNaN(this.contentheight))alert("Please wait until document has fully loaded then click again");else if(parseInt(this.divObj.style.height)==this.contentheight)this.startTime=(new Date).getTime(),this._slideengine("up")};
animatedcollapse.prototype.slideit=function(){isNaN(this.contentheight)?alert("Please wait until document has fully loaded then click again"):parseInt(this.divObj.style.height)==0?this.slidedown():parseInt(this.divObj.style.height)==this.contentheight&&this.slideup()};animatedcollapse.curveincrement=function(a){return(1-Math.cos(a*Math.PI))/2};
animatedcollapse.dotask=function(a,c,b){b=window.addEventListener?b:"on"+b;a.addEventListener?a.addEventListener(b,c,false):a.attachEvent&&a.attachEvent(b,c)};animatedcollapse.getCookie=function(a){a=RegExp(a+"=[^;]+","i");return document.cookie.match(a)?document.cookie.match(a)[0].split("=")[1]:""};animatedcollapse.setCookie=function(a,c,b){if(typeof b!="undefined"){var d=new Date;d.setDate(d.getDate()+b);document.cookie=a+"="+c+"; expires="+d.toGMTString()}else document.cookie=a+"="+c};

// JQUERY LAZY LOAD
(function($){$.fn.lazyload=function(options){var settings={threshold:0,failurelimit:0,event:"scroll",effect:"show",container:window};if(options){$.extend(settings,options);}
var elements=this;if("scroll"==settings.event){$(settings.container).bind("scroll",function(event){var counter=0;elements.each(function(){if($.abovethetop(this,settings)||$.leftofbegin(this,settings)){}else if(!$.belowthefold(this,settings)&&!$.rightoffold(this,settings)){$(this).trigger("appear");}else{if(counter++>settings.failurelimit){return false;}}});var temp=$.grep(elements,function(element){return!element.loaded;});elements=$(temp);});}
this.each(function(){var self=this;if(undefined==$(self).attr("original")){$(self).attr("original",$(self).attr("src"));}
if("scroll"!=settings.event||undefined==$(self).attr("src")||settings.placeholder==$(self).attr("src")||($.abovethetop(self,settings)||$.leftofbegin(self,settings)||$.belowthefold(self,settings)||$.rightoffold(self,settings))){if(settings.placeholder){$(self).attr("src",settings.placeholder);}else{$(self).removeAttr("src");}
self.loaded=false;}else{self.loaded=true;}
$(self).one("appear",function(){if(!this.loaded){$("<img />").bind("load",function(){$(self).hide().attr("src",$(self).attr("original"))
[settings.effect](settings.effectspeed);self.loaded=true;}).attr("src",$(self).attr("original"));};});if("scroll"!=settings.event){$(self).bind(settings.event,function(event){if(!self.loaded){$(self).trigger("appear");}});}});$(settings.container).trigger(settings.event);return this;};$.belowthefold=function(element,settings){if(settings.container===undefined||settings.container===window){var fold=$(window).height()+$(window).scrollTop();}else{var fold=$(settings.container).offset().top+$(settings.container).height();}
return fold<=$(element).offset().top-settings.threshold;};$.rightoffold=function(element,settings){if(settings.container===undefined||settings.container===window){var fold=$(window).width()+$(window).scrollLeft();}else{var fold=$(settings.container).offset().left+$(settings.container).width();}
return fold<=$(element).offset().left-settings.threshold;};$.abovethetop=function(element,settings){if(settings.container===undefined||settings.container===window){var fold=$(window).scrollTop();}else{var fold=$(settings.container).offset().top;}
return fold>=$(element).offset().top+settings.threshold+$(element).height();};$.leftofbegin=function(element,settings){if(settings.container===undefined||settings.container===window){var fold=$(window).scrollLeft();}else{var fold=$(settings.container).offset().left;}
return fold>=$(element).offset().left+settings.threshold+$(element).width();};$.extend($.expr[':'],{"below-the-fold":"$.belowthefold(a, {threshold : 0, container: window})","above-the-fold":"!$.belowthefold(a, {threshold : 0, container: window})","right-of-fold":"$.rightoffold(a, {threshold : 0, container: window})","left-of-fold":"!$.rightoffold(a, {threshold : 0, container: window})"});})(jQuery);
