Your IP : 216.73.216.71


Current Path : /home/lescs/www/local/cache-js/
Upload File :
Current File : /home/lescs/www/local/cache-js/jsdyn-javascripts_js-700b5426.js

/* #PRODUIRE{fond=javascripts.js}
   md5:2604eff1b183524e23cbd4fa93773075 */

// Menu accessible dynamique et CSS alternatives, V 2.0 (avec jquery)
//
// Copyright (c) 2004 Jacques PYRAT
// https://www.pyrat.net/
//
// Licensed under the LGPL license
// http://www.gnu.org/copyleft/lesser.html
//
// **********************************************************************
// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// **********************************************************************
//
// Presets

// Encapsulation pour permettre l'utilisation de jQl, cf http://permalink.gmane.org/gmane.comp.web.spip.zone/38793
// Même si ça marche, le résultat du test jQL était un doublement du temps de chargement
// jQuery(function(){

var jp_blankpic='plugins/auto/soyezcreateurs/v6.6.2/images/1.png';
var jp_onclass='menu_plus';
var jp_offclass='menu_minus';
var jp_picalt='Cliquer pour ';
var jp_strDeplier='d\351plier : ';
var jp_strReplier='replier : ';

function jp_expinit(){
	// Checking for DOM compatibility
	var jp_parentID = [ 'menu', 'sidr-main', 'sidr-navigation'];
	if(jp_parentID){
		var jp_alluls = [];
		jp_parentID.forEach(function(item, index, array) {
			if(document.getElementById(item)){
				jp_alluls = Array.prototype.concat.apply(jp_alluls, document.getElementById(item).getElementsByTagName('UL'));
			}
		});
		for(i=0;i<jp_alluls.length;i++){
			jp_subul=jp_alluls[i];
			if(jp_subul.parentNode.tagName=='LI'){
				jp_supli=jp_subul.parentNode
				jp_islink=jp_supli.getElementsByTagName('a')[0];
				if(jp_islink){
					jp_addimg = document.createElement('img');
					jp_addimg.src=jp_blankpic;
					jp_addimg.className='node';
					jp_addimg.alt='';
					jp_addimg.onclick=function() {jp_ex(this,null);return false;};
					jp_supli.getElementsByTagName('A')[0].onkeypress=inputKeyHandler;
					jp_supli.getElementsByTagName('A')[0].onfocus=function() {jp_ex(this,0);};
					jp_supli.insertBefore(jp_addimg,jp_supli.firstChild);
				}
				// Do not collapse when there is a strong element in the list.
				jp_highlight=jp_subul.parentNode.getElementsByTagName('strong').length==0?true:false;
				jp_disp=jp_highlight?'none':'block';
				var jp_picaltonoff=jp_highlight?jp_picalt+jp_strDeplier:jp_picalt+jp_strReplier;
				jp_pic_class=jp_highlight?jp_onclass:jp_offclass;
				// End  highlight change
				jp_childs=jp_subul.getElementsByTagName('li').length
				jp_momimg=jp_subul.parentNode.getElementsByTagName('img')[0]
				if(jp_momimg){
					jp_momimg.setAttribute('title',jp_picaltonoff+jp_subul.parentNode.getElementsByTagName('a')[0].text);
					jp_momimg.setAttribute('alt',jp_picaltonoff+jp_subul.parentNode.getElementsByTagName('a')[0].text);
					jp_momimg.className=jp_pic_class;
					jp_subul.style.display=jp_disp;
				}
			}
		}
	}
}

// Collapse and Expand node.
function jp_ex(jp_n,jp_event){
	jp_u=jp_n.parentNode.getElementsByTagName("ul")[0];
	if (!jp_u) jp_u=jp_n.parentNode.parentNode.getElementsByTagName("ul")[0];;
	if(jp_u){
		if (((jp_u.style.display=='none'||jp_u.style.display=='')&&(jp_event==0||jp_event==43||jp_event==null))||((jp_u.style.display=='block')&&(jp_event==45||jp_event==null))) {
			jp_u.style.display=jp_u.style.display=='none'||jp_u.style.display==''?'block':'none';
			jp_img=jp_u.parentNode.getElementsByTagName('img')[0];
			jp_img.className=jp_img.className.indexOf(jp_offclass)!=-1?jp_onclass:jp_offclass;
			var jp_strAlt=jp_img.getAttribute('title');
			if (jp_strAlt==null) { jp_strAlt=''; }
			if (jp_img.className.indexOf(jp_offclass)!=-1) {
				var jp_re = new RegExp (jp_strDeplier, 'gi');
				var jp_strAltNew = jp_strAlt.replace(jp_re,jp_strReplier);
			}else{
				var jp_re = new RegExp (jp_strReplier, 'gi');
				var jp_strAltNew = jp_strAlt.replace(jp_re,jp_strDeplier);
			}
			jp_img.setAttribute('title',jp_strAltNew);
			jp_img.setAttribute('alt',jp_strAltNew);
			adjustLayout();
			return true;
		} else {
			return false;
		}
	}
}
function inputKeyHandler(ev) {
	ev = ev || event;
	if (jp_ex(ev.target || ev.srcElement,ev.keyCode || ev.which)) {
		ev.cancelBubble= true;
		if (ev.stopPropagation) ev.stopPropagation();
	}
}

function form_disable_auto(formid) {
	if (jQuery(formid).length > 0) {
		jQuery(formid).attr('spellcheck','false');
		jQuery(formid).attr('autocapitalize','off');
	}
}

/* FUNCTIONS ON ALL PAGES */
function myInitPages() {
	/* HOME SPECIAL FEATURE */
	if (jQuery('#homeSpecialFeature').length > 0) {
		if (jQuery('.hSFItem').length>1) { initMyHomeSpecialFeature = myHomeSpecialFeature("#homeSpecialFeature",'hSFItem','hSFDecoImg','hSFDecoSpan'); }
	}
	if (jQuery('.sf-menu').length > 0) {
		$(document).ready(function(){
		  $(".sf-menu").superfish({
			hoverClass: 'hover',
			delay: 800
		  }).supposition();

		});
	}
	if (jQuery('#arretSurImg .mainCarousels').length > 0) { homeCarousel('.mainCarousels'); }
	if (jQuery('#arretSurImg2 .mainCarousels2').length > 0) { homeCarousel2('.mainCarousels2'); }
	jp_expinit();
	// Surligner l'evenement en cours
	var id_anchor = location.hash.substr(1); //Get the word after the hash from the url
	if (id_anchor) jQuery('#'+id_anchor).addClass('highlight_anchor'); // ajoute la classe highlight_anchor à l'element autour de l'ancre

	// retourtop
	jQuery(window).scroll(function () {
		if (jQuery(this).scrollTop() > 300) {
			jQuery('.retourtop').fadeIn();
		} else {
			jQuery('.retourtop').fadeOut();
		}
	});

 
	jQuery(function() { jQuery( document ).tooltip({
		  track: true,
		  items: '[title]:not(.crayon-icones *, .formulaire_crayon *, a span, a img, .postListItem *)',
		  show: {
			delay: 1000}
		});
	});


	form_disable_auto('#formulaire_recherche');
	form_disable_auto('#session_nom');
	form_disable_auto('#session_email');
	form_disable_auto('#url_site');
}
;
/* BLACK TRANSPARENT BACKGROUNDS */
function mySpecialBackgrounds(elt,correcAmount,correcAmount2) {
	jQuery(elt).each(function() {
		var targetHeight = jQuery(this).parent().height();
		var targetWidth = jQuery(this).parent().width();
		jQuery(this).css({'height':targetHeight+correcAmount,'width':targetWidth+correcAmount2,'opacity':.5});
	});
}
;
/* HOME SPECIAL FEATURE */
function myHomeSpecialFeature(container,item,decoImg,decoSpan) {
	jQuery('#'+item+'1').addClass('active'+item);
	mySpecialBackgrounds('.'+item+' .'+decoSpan,14,10);
	jQuery('#'+item+'1 .'+decoSpan).css("opacity", 1);
	jQuery('.'+item+' .'+decoImg).hide();
	jQuery('#'+item+'1 .'+decoImg).show();

	var x = 1;
	var maxX = jQuery('.'+item).length;
	function myAnimate(x,maxX) {
		if (x > maxX) { x = 1; }
		jQuery('.'+item).removeClass('active'+item);
		jQuery('#'+item+x).addClass('active'+item);
		jQuery('.'+item+' .'+decoSpan).animate({"opacity": .5}, { queue:false, duration:800 });
		jQuery('#'+item+x+' .'+decoSpan).animate({"opacity": 1},800);
		jQuery('.'+item+' .'+decoImg).fadeOut(800);
		jQuery('#'+item+x+' .'+decoImg).fadeIn(800);
		timer = setTimeout(function() {
			if (x < maxX) { x = x+1; myAnimate(x,maxX); }
			else if (x = maxX) { x = 1; myAnimate(x,maxX); }
		} , 4000);
	}
	myAnimate(x,maxX);

	jQuery('.'+item).each(function() {
		jQuery(this).hoverIntent(
			function() {
				clearTimeout(timer);
				currentItem = jQuery('.'+item).index(this)+1;
				jQuery('.'+item).removeClass('active'+item);
				jQuery(this).addClass('active'+item);
				jQuery('.'+item+' .'+decoSpan+':not("#'+item+currentItem+' .'+decoSpan+'")').css("opacity", .5);
				jQuery(this).children().children('.'+decoSpan).animate({"opacity": 1},400);
				jQuery('.'+item+' .'+decoImg+':not("#'+item+currentItem+' .'+decoImg+'")').fadeOut(400);
				jQuery(this).children('.'+decoImg).fadeIn(400);
			},
			function() {
				clearTimeout(timer);
				currentItem = jQuery('.'+item).index(this)+2;
				jQuery(this).removeClass('active'+item);
				jQuery(this).children().children('.'+decoSpan).animate({"opacity": .5},400);
				timer = setTimeout(function() { myAnimate(currentItem,maxX); } , 1000 );
			}
		);
	});
}
;

/* HOME CYCLE */
function homeCarousel(elt) {
	/* carousels internes */
	var elemNbr = jQuery(elt+' > li').length;
	var myCounter = 1;
	function onAfter(curr,next,opts) {
		if (opts.currSlide+1 == opts.slideCount) {
			if (myCounter < elemNbr) {
				myCounter = myCounter+1;
			} else if (myCounter == elemNbr) {
				myCounter = 1;
			}

			function reloadCarousels() {
				jQuery('.smallCarousel').stop(true,true).fadeOut(750);
				jQuery('#sc'+myCounter+'b').stop(true,true).fadeIn(750).children('ul').cycle({
				    //fx: 'scrollHorz', // pour transition latérale
				    fx: 'fade',
				    speed: 1500,
				    timeout: 4000,
					pause: true,
					startingSlide: 0,
					after: onAfter
				});
			jQuery('.mainCarousel').removeClass('active');
			if (myCounter == 1) {
				jQuery('.mainCarousel:first').addClass('active');
			} else {
					jQuery('.mainCarousel').eq(myCounter-1).addClass('active');
			}
		}
			jQuery('.smallCarousel').children('ul').cycle('stop');
			var t2=setTimeout(reloadCarousels,3000);
		} else {
			clearTimeout(t2);
		}
		//alert(myCounter);
	}
	function onAfter2(curr,next,opts) {
		//
	}
	jQuery('.smallCarousel ul').cycle({
	    //fx: 'scrollHorz', // pour transition latérale
	    fx: 'fade',
	    speed: 1500,
	    timeout: 4000,
		pause: true,
		startingSlide: 0,
		after: onAfter
	});
	jQuery('.smallCarousel').hide().children('ul').cycle('pause');
	jQuery('#sc1b').show().children('ul').cycle('resume');
	/* faux carousel principal */
	var whatToShow = '';
	jQuery('.mainCarousel:first').addClass('active');
	jQuery(document).delegate('.mainCarousel','mouseenter focus', function() {
		jQuery('.mainCarousel').removeClass('hover active');
		jQuery(this).addClass('hover active');
		whatToShow = jQuery(this).children().children('a').attr('id');
		jQuery('.smallCarousel').stop(true,true).fadeOut().children('ul').cycle('stop');
		// jQuery(whatToShow).stop(true,true).fadeIn().children('ul').cycle({fx: 'scrollHorz',speed: 1500,timeout: 4000,pause: true,after: onAfter2}).cycle('resume'); // avec transition latérale
		jQuery('#'+whatToShow+'b').stop(true,true).fadeIn().children('ul').cycle({fx: 'fade',speed: 1500,timeout: 4000,pause: true,startingSlide: 0,after: onAfter2});
	}).delegate('.mainCarousel','mouseleave blur', function() {
		whatToShow = jQuery(this).children().children('a').attr('id');
		jQuery(this).removeClass('hover');
		// jQuery('.smallCarousel').stop(true,true).fadeOut().children('ul').cycle({fx: 'scrollHorz',speed: 1500,timeout: 4000,pause: true,after: onAfter}).cycle('pause'); // avec transition latérale
		jQuery('.smallCarousel').stop(true,true).fadeOut().children('ul').cycle('stop');
		jQuery('#'+whatToShow+'b').stop(true,true).fadeIn().children('ul').cycle({fx: 'fade',speed: 1500,timeout: 4000,pause: true,startingSlide: 0,after: onAfter});
		myCounter = jQuery(this).index()+1;
	});
}

/* HOME CYCLE */
function homeCarousel2(elt) {
	/* carousels internes */
	var elemNbr = jQuery(elt+' > li').length;
	var myCounter = 1;
	function onAfter(curr,next,opts) {
		if (opts.currSlide+1 == opts.slideCount) {
			if (myCounter < elemNbr) {
				myCounter = myCounter+1;
			} else if (myCounter == elemNbr) {
				myCounter = 1;
			}

			function reloadCarousels() {
				jQuery('.smallCarousel2').stop(true,true).fadeOut(750);
				jQuery('#sc'+myCounter+'b2').stop(true,true).fadeIn(750).children('ul').cycle({
				    //fx: 'scrollHorz', // pour transition latérale
				    fx: 'fade',
				    speed: 1500,
				    timeout: 4000,
					pause: true,
					startingSlide: 0,
					after: onAfter
				});
			jQuery('.mainCarousel2').removeClass('active');
			if (myCounter == 1) {
				jQuery('.mainCarousel2:first').addClass('active');
			} else {
					jQuery('.mainCarousel2').eq(myCounter-1).addClass('active');
			}
		}
			jQuery('.smallCarousel2').children('ul').cycle('stop');
			var t2=setTimeout(reloadCarousels,3000);
		} else {
			clearTimeout(t2);
		}
		//alert(myCounter);
	}
	function onAfter2(curr,next,opts) {
		//
	}
	jQuery('.smallCarousel2 ul').cycle({
	    //fx: 'scrollHorz', // pour transition latérale
	    fx: 'fade',
	    speed: 1500,
	    timeout: 4000,
		pause: true,
		startingSlide: 0,
		after: onAfter
	});
	jQuery('.smallCarousel2').hide().children('ul').cycle('pause');
	jQuery('#sc1b2').show().children('ul').cycle('resume');
	/* faux carousel principal */
	var whatToShow = '';
	jQuery('.mainCarousel2:first').addClass('active');
	jQuery(document).delegate('.mainCarousel2','mouseenter focus', function() {
		jQuery('.mainCarousel2').removeClass('hover active');
		jQuery(this).addClass('hover active');
		whatToShow = jQuery(this).children().children('a').attr('id');
		jQuery('.smallCarousel2').stop(true,true).fadeOut().children('ul').cycle('stop');
		// jQuery(whatToShow).stop(true,true).fadeIn().children('ul').cycle({fx: 'scrollHorz',speed: 1500,timeout: 4000,pause: true,after: onAfter2}).cycle('resume'); // avec transition latérale
		jQuery('#'+whatToShow+'b2').stop(true,true).fadeIn().children('ul').cycle({fx: 'fade',speed: 1500,timeout: 4000,pause: true,startingSlide: 0,after: onAfter2});
	}).delegate('.mainCarousel2','mouseleave blur', function() {
		whatToShow = jQuery(this).children().children('a').attr('id');
		jQuery(this).removeClass('hover');
		// jQuery('.smallCarousel').stop(true,true).fadeOut().children('ul').cycle({fx: 'scrollHorz',speed: 1500,timeout: 4000,pause: true,after: onAfter}).cycle('pause'); // avec transition latérale
		jQuery('.smallCarousel2').stop(true,true).fadeOut().children('ul').cycle('stop');
		jQuery('#'+whatToShow+'b2').stop(true,true).fadeIn().children('ul').cycle({fx: 'fade',speed: 1500,timeout: 4000,pause: true,startingSlide: 0,after: onAfter});
		myCounter = jQuery(this).index()+1;
	});
}

jQuery(window).ready(function() {
	// Ceci devrait régler le problème de l'ajustement des colonne pas toujours fait
	jQuery(document).ready(function() {
		myInitPages();
	});
	
});



// Fin Encapsulation pour permettre l'utilisation de jQl, cf http://permalink.gmane.org/gmane.comp.web.spip.zone/38793
//});