/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \
|
|		Copyright (c) 2010
|		Design + HTML/CSS/DOM JavaScript : Smart Agence
|		http://www.smartagence.com/
|
\ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */

function $id(sID) {
	return document.getElementById(sID);
};

if (typeof(tplPath)=="undefined") {
	tplPath="./";
	var tplPathRelative="../../";
}

/* ______________________[ 01 | Interactivité du menu principal (menu horizontal) ]________________________ */

/* A special thanks goes to Eric Shepherd for his ALA article about “Hybrid CSS Dropdowns”: http://www.alistapart.com/articles/hybrid/
and to Patrick Griffiths and Dan Webb for their htmldog.com article “Sons of Suckerfish”: http://www.htmldog.com/articles/suckerfish/ */


function SmartHover() {
	var args=SmartHover.arguments;
	for (n=0;n<args.length;n++) {
		if (document.getElementById&&document.getElementsByTagName&&document.getElementById(args[n])) {
			navRoot=document.getElementById(args[n]).getElementsByTagName("LI");
			for (k=0;k<navRoot.length;k++) {
				nodeS=navRoot[k];
				var nodeS2=navRoot[k].getElementsByTagName("UL");
				if (document.all) {
					nodeS.onmouseover=function() {this.className+=" over";}
					nodeS.onmouseout=function() {this.className=this.className.replace(" over", "");}
				}
				if (nodeS2[0]) {
					//var pos2=document.all?(150-nodeS2[0].parentNode.firstChild.offsetWidth)/2:16;
					var pos2=(154-nodeS2[0].parentNode.firstChild.offsetWidth)/2;
					nodeS2[0].style.marginLeft="-"+pos2+"px";
				}
			}
		}
	}
}




/* ______________________[ 02 | Gestion de la taille du texte d’un article ]________________________ */

function SmartSize() {
	var args=SmartSize.arguments;
	if (document.getElementById&&document.getElementById("Tplus")&&document.getElementById("Tmoins")) {
		var cibleplus=document.getElementById("Tplus");
		var ciblemoins=document.getElementById("Tmoins");
		cibleplus.onclick=function() {
			for (n=0;n<args.length;n++) {
				if (document.getElementById(args[n])) {
					var cibletxt=document.getElementById(args[n]);
					var sizestr=cibletxt.style.fontSize.substring(0,cibletxt.style.fontSize.length-2);
					var sizeinter=cibletxt.style.lineHeight.substring(0,cibletxt.style.lineHeight.length-2);
					sizestr=sizestr!=""?parseInt(sizestr):12;
					cibletxt.style.fontSize=sizestr+1+"px";
				}
			}
		}
		ciblemoins.onclick=function() {
			for (n=0;n<args.length;n++) {
				if (document.getElementById(args[n])) {
					var cibletxt=document.getElementById(args[n]);
					var sizestr=cibletxt.style.fontSize.substring(0,cibletxt.style.fontSize.length-2);
					var sizeinter=cibletxt.style.lineHeight.substring(0,cibletxt.style.lineHeight.length-2);
					sizestr=sizestr!=""?parseInt(sizestr):12;
					cibletxt.style.fontSize=sizestr-1+"px";
				}
			}
		}
	}
}


/* ______________________[ 03 | Lancement d’une impression pour les navigateurs compatibles ]________________________ */

function DirectPrint() {
	if (window.print) self.print();
}


/* ______________________[ 04 | Miscellaneous ]________________________ */

function OpenPopup(url,nom,option) {
	window.open(url,nom,option);
}


/* ______________________[ 06 | Ajout de la page courante aux favoris ]________________________ */

/* Mettre la page courante en favoris — MSIE and Firefox */
function AddBookmark(btn) {
	if (document.getElementById&&document.getElementById(btn)) {
		var el=document.getElementById(btn);
		var operaStr="« Ctrl + T » pour ajouter aux favoris.";
		if (document.all&&navigator.userAgent.indexOf("Opera")==-1) {
			el.onclick=function() {
				window.external.AddFavorite(document.location,document.title);
			}
		} else if (navigator.userAgent.indexOf("Firefox")!=-1) {
			el.onclick=function () {
				window.sidebar.addPanel(document.title,document.location,"");
			}
		} else if (navigator.userAgent.indexOf("Opera")!=-1) {
			el.title=operaStr;
			window.status=operaStr;
		}
	}
}

/* Get elements by class name(s) */
function getElementsByClassName(oElm, strTagName, oClassNames){		//src element, target element tag, class name(s)
	var arrElements = (strTagName == "*" && oElm.all)? oElm.all : oElm.getElementsByTagName(strTagName);
	var arrReturnElements = new Array();
	var arrRegExpClassNames = new Array();
	if(typeof oClassNames == "object"){
		for(var i=0; i<oClassNames.length; i++){
			arrRegExpClassNames.push(new RegExp("(^|\\s)" + oClassNames[i].replace(/\-/g, "\\-") + "(\\s|$)"));
		}
	} else {
		arrRegExpClassNames.push(new RegExp("(^|\\s)" + oClassNames.replace(/\-/g, "\\-") + "(\\s|$)"));
	}
	var oElement;
	var bMatchesAll;
	for(var j=0; j<arrElements.length; j++){
		oElement = arrElements[j];
		bMatchesAll = true;
		for(var k=0; k<arrRegExpClassNames.length; k++){
			if(!arrRegExpClassNames[k].test(oElement.className)){
				bMatchesAll = false;
				break;
			}
		}
		if(bMatchesAll){
			arrReturnElements.push(oElement);
		}
	}
	return (arrReturnElements)
};


/* ______________________[ 07 | <select/> au clavier ]________________________ */

/* Thanks goes to Cameron Adams from http://www.themaninblue.com/ */

function initSelect(whichSelect) {
	if (document.getElementById&&document.getElementById(whichSelect)) {
		var theSelect=document.getElementById(whichSelect);
		theSelect.changed=false;
		theSelect.onfocus=selectFocussed;
		theSelect.onchange=selectChanged;
		theSelect.onkeydown=selectKeyed;
		theSelect.onclick=selectClicked;
		return true;
	}
}

function selectChanged(theElement) {
	var theSelect;
	if (theElement&&theElement.value) {
		theSelect=theElement;
	} else {
		theSelect=this;
	}
	if (!theSelect.changed) {
		return false;
	}
	if (theSelect.value&&theSelect.value!="0") window.location=theSelect.value;
	return true;
}

function selectClicked() {
	this.changed=true;
}

function selectFocussed() {
	this.initValue=this.value;
	return true;
}

function selectKeyed(e){
	var theEvent;
	var keyCodeTab="9";
	var keyCodeEnter="13";
	var keyCodeEsc="27";
	if (e) {
		theEvent=e;
	} else {
		theEvent=event;
	}
	if ((theEvent.keyCode==keyCodeEnter||theEvent.keyCode==keyCodeTab)&&this.value!=this.initValue) {
		this.changed=true;
		selectChanged(this);
	} else if (theEvent.keyCode==keyCodeEsc) {
		this.value=this.initValue;
	} else {
		this.changed=false;
	}
	return true;
}


/* Roll over */
function findimg() {
	var imgs,i;
	imgs=document.getElementsByTagName('img');
	for(i=0;i<imgs.length;i++) {
		if (/roll/.test(imgs[i].className)) {
			imgs[i].onmouseover=function(){roll(this);};
			imgs[i].onmouseout=function(){roll(this);};
		}
	}
};

function roll(o) {
	var src,ftype,newsrc;
	src=o.src;
	ftype=src.substring(src.lastIndexOf('.'), src.length);
	if(/_over/.test(src)) {
		newsrc=src.replace('_over','');
	} else {
		newsrc=src.replace(ftype, '_over'+ftype);
	}
	o.src=newsrc;
};

function AddToolButton(sContainerID, oParams){
	var DOM = document.createElement && document.getElementById && document.getElementById(sContainerID);
	if(DOM){
		var cible=document.getElementById(sContainerID).getElementsByTagName('UL');

		// no container list? let's create it
		if(cible.length == 0) {
			var oUL = document.createElement('UL');
			document.getElementById(sContainerID).appendChild(oUL);
		}
		cible = document.getElementById(sContainerID).getElementsByTagName('UL');

		if(cible){
			var oLi = document.createElement("LI");
			var oLink = document.createElement("A");
			var oImg = document.createElement("IMG");

			with(oLink){
				id = oParams.linkId;
				title = oParams.imgAlt;
				href = oParams.linkHREF? oParams.linkHREF : "javascript:;";
				onclick = oParams.onclick? oParams.onclick : "";
			};
			with(oImg){
				src = oParams.imgSrc;
				alt = oParams.imgAlt;
				className = oParams.imgClass;
			};
			oLink.appendChild(oImg);
			oLi.appendChild(oLink);

			// insertion&hellip; avant un element existant
			if(oParams.insertBefore && document.getElementById(oParams.insertBefore)) {
				var oNext = document.getElementById(oParams.insertBefore).parentNode;
				cible[0].insertBefore(oLi,oNext);
			}
			else{
				// ou en fin de liste
				cible[0].appendChild(oLi);
			}
		}	// end if cible
	}	// end if DOM
};	// end AddToolButton()



/* ______________________[ 08 | Lancement des scripts ]________________________ */

window.onload=function() {
	if($id("plansite")) {
		var SiteMap = new SiteMapManager("plansite").setToggleSwitch(true,"plansite").apply();
	}

	if($id("ToolBox")){
		var lang = document.getElementsByTagName('html')[0].getAttribute('lang');
		var fr = {Tplus:'Grand texte',Tmoins:'Petit texte',imprimer:'Imprimer cette page',favoris:'Ajouter cette page aux favoris'};
		var en = {Tplus:'Increase the text size',Tmoins:'Decrease the text size',imprimer:'Print current page',favoris:'Bookmark current page'};
		if( lang == "en") {
			objLg = en;
		}else {
			objLg = fr;
		}
		AddToolButton("ToolBox",{linkId:"Tplus",linkHREF:"javascript:;",imgSrc:"img/toolbox/plus.gif",imgClass:"roll",imgAlt:objLg.Tplus,insertAfter:"rss"});
		AddToolButton("ToolBox",{linkId:"Tmoins",linkHREF:"javascript:;",imgSrc:"img/toolbox/moins.gif",imgClass:"roll",imgAlt:objLg.Tmoins,insertAfter:"Tplus"});
		AddToolButton("ToolBox",{linkId:"favori",linkHREF:"javascript:AddBookmark('favori');",imgSrc:"img/toolbox/favori.gif",imgClass:"roll",imgAlt:objLg.favoris,insertAfter:"Tmoins"});
		AddToolButton("ToolBox",{linkId:"print",linkHREF:"javascript:DirectPrint();",imgSrc:"img/toolbox/print.gif",imgClass:"roll",imgAlt:objLg.imprimer,insertAfter:"ami"});
		findimg();
		SmartSize("ColContenu");
	}
	/* IE 5-6 background flicker fix */
	try {document.execCommand('BackgroundImageCache', false, true);}
	catch(e) { }
}


/* Dropdown menu hack */
function foo(px,py,pw,ph,baseElement,fid)
{
		var win = document.getElementById(this.fid);
}


function dropdown_menu_hack(el)
{
	if(el.runtimeStyle.behavior.toLowerCase()=="none"){return;}
	el.runtimeStyle.behavior="none";

	var ie5 = (document.namespaces==null);
	el.ondblclick = function(e)
	{
		window.event.returnValue=false;
		return false;
	}

	if(window.createPopup==null) {
		var fid = "dropdown_menu_hack_" + Date.parse(new Date());

		window.createPopup = function()
		{
			if(window.createPopup.frameWindow==null)
			{
					el.insertAdjacentHTML("AfterEnd","<iframe   id='"+fid+"' name='"+fid+"' src='about:blank'  frameborder='1' scrolling='no'></></iframe>");
					var f = document.frames[fid];
					f.document.open();
					f.document.write("<html><body></body></html>");
					f.document.close();
					f.fid = fid;


					var fwin = document.getElementById(fid);
					fwin.style.cssText="position:absolute;top:0;left:0;display:none;z-index:99999;";


					f.show = function(px,py,pw,ph,baseElement)
					{
						py = py + baseElement.getBoundingClientRect().top + Math.max( document.body.scrollTop, document.documentElement.scrollTop) ;
						px = px + baseElement.getBoundingClientRect().left + Math.max( document.body.scrollLeft, document.documentElement.scrollLeft) ;
						fwin.style.width = pw + "px";
						fwin.style.height = ph + "px";
						fwin.style.posLeft =px ;
						fwin.style.posTop = py ;
						fwin.style.display="block";
					}


					f_hide = function(e)
					{
						if(window.event && window.event.srcElement	&& window.event.srcElement.tagName && window.event.srcElement.tagName.toLowerCase()=="select"){return true;}
						fwin.style.display="none";
					}
					f.hide = f_hide;
					document.attachEvent("onclick",f_hide);
					document.attachEvent("onkeydown",f_hide);

			}
			return f;
		}
	}

	function showMenu()
	{

		function selectMenu(obj)
			{
				var o = document.createElement("option");
				o.value = obj.value;
				o.innerHTML = obj.innerHTML;
				while(el.options.length>0){el.options[0].removeNode(true);}
				el.appendChild(o);
				el.title =  o.innerHTML;
				el.contentIndex = obj.selectedIndex  ;
				el.menu.hide();
			}


		el.menu.show(0 , el.offsetHeight , 10,  10, el);
		var mb = el.menu.document.body;

		mb.style.cssText ="border:solid 1px black;margin:0;padding:0;overflow-y:auto;overflow-x:auto;background:white;text-aligbn:center;font-family:Verdana;font-size:12px;";
		var t = el.contentHTML;
		t = t.replace(/<select/gi,'<ul');
		t = t.replace(/<option/gi,'<li');
		t = t.replace(/<\/option/gi,'</li');
		t = t.replace(/<\/select/gi,'</ul');
		mb.innerHTML = t;


		el.select = mb.all.tags("ul")[0];
		el.select.style.cssText="list-style:none;margin:0;padding:0;";
		mb.options = el.select.getElementsByTagName("li");

		for(var i=0;i<mb.options.length;i++)
		{
			mb.options[i].selectedIndex = i;
			mb.options[i].style.cssText = "list-style:none;margin:0;padding:1px 2px;width/**/:100%;cursor:hand;cursor:pointer;white-space:nowrap;"
			mb.options[i].title =mb.options[i].innerHTML;
			mb.options[i].innerHTML ="<nobr>" + mb.options[i].innerHTML + "</nobr>";
			mb.options[i].onmouseover = function()
				{
					if( mb.options.selected ){mb.options.selected.style.background="white";mb.options.selected.style.color="black";}
					mb.options.selected = this;
					this.style.background="#333366";this.style.color="white";
				}

			mb.options[i].onmouseout = function(){this.style.background="white";this.style.color="black";}
			mb.options[i].onmousedown = function(){selectMenu(this);	}
			mb.options[i].onkeydown = function(){selectMenu(this);	}


			if(i == el.contentIndex)
			{
				mb.options[i].style.background="#333366";
				mb.options[i].style.color="white";
				mb.options.selected = mb.options[i];
			}
		}


		var mw = Math.max(   ( el.select.offsetWidth + 22 ), el.offsetWidth + 22  );
			 mw = Math.max(  mw, ( mb.scrollWidth+22) );
		var mh =  mb.options.length * 15  + 8 ;

		var mx = (ie5)?-3:0;
		var my = el.offsetHeight -2;
		var docH =   document.documentElement.offsetHeight ;
		var bottomH = docH  - el.getBoundingClientRect().bottom ;

		mh = Math.min(mh, Math.max(( docH - el.getBoundingClientRect().top - 50),100)		);

		if(( bottomH < mh) )
		{

			mh = Math.max( (bottomH - 12),10);
			if( mh <100 )
			{
				my = -100 ;

			}
			mh = Math.max(mh,100);
		}


		self.focus();

		el.menu.show( mx , my ,  mw, mh , el);
		sync=null;
		if(mb.options.selected)
		{
			mb.scrollTop = mb.options.selected.offsetTop;
		}




		window.onresize = function(){el.menu.hide()};
	}

	function switchMenu() {
		if(event.keyCode)
		{
			if(event.keyCode==40){ el.contentIndex++ ;}
			else if(event.keyCode==38){ el.contentIndex--; }
		}
		else if(event.wheelDelta )
		{
			if (event.wheelDelta >= 120)
			el.contentIndex++ ;
			else if (event.wheelDelta <= -120)
			el.contentIndex-- ;
		}else{return true;}

		if( el.contentIndex > (el.contentOptions.length-1) ){ el.contentIndex =0;}
		else if (el.contentIndex<0){el.contentIndex = el.contentOptions.length-1 ;}

		var o = document.createElement("option");
			 o.value = el.contentOptions[el.contentIndex].value;
			 o.innerHTML = el.contentOptions[el.contentIndex].text;
			 while(el.options.length>0){el.options[0].removeNode(true);}
			 el.appendChild(o);
			 el.title =  o.innerHTML;
	}

	if(dropdown_menu_hack.menu ==null)
	{
		dropdown_menu_hack.menu =  window.createPopup();
		document.attachEvent("onkeydown",dropdown_menu_hack.menu.hide);
	}
	el.menu = dropdown_menu_hack.menu ;
	el.contentOptions = new Array();
	el.contentIndex = el.selectedIndex;
	el.contentHTML = el.outerHTML;

	for(var i=0;i<el.options.length;i++)
	{
		el.contentOptions [el.contentOptions.length] =
		{
			"value": el.options[i].value,
			"text": el.options[i].innerHTML
		}

		if(!el.options[i].selected){el.options[i].removeNode(true);i--;};
	}


	el.onkeydown = switchMenu;
	el.onclick = showMenu;
	el.onmousewheel= switchMenu;

}



/* ______________________[ 02 | Champs focus sur input recherche ]________________________ */

(function($) {
    $.fn.toggleFocus = function() {
        return this.each( function() {
            var input =  $(this);
			if( input.length > 0 ) {
				var id_input = input.attr("id");
				var form = input.parents("form");
				var label = form.find("label").attr("for",id_input);
				var old_val = label.text() || "";
				label.css("display","none");
				input.val(old_val);

				var news_val = "";
				input.focus(function() {
					news_val = input.val() ;
					if ( old_val == news_val ) {
						input.val("");
					}
				});
				input.blur(function() {
					if (input.val() != "" ){
						news_val = input.val();
					} else {
						news_val = old_val ;
					}
				   input.val(news_val);
				});
			}
        });
    };
})(jQuery);




/* Equalize */
(function($) {
	/**
	 * equalizes the heights of all elements in a jQuery collection
	 * thanks to John Resig for optimizing this!
	 * usage: $("#col1, #col2, #col3").equalizeCols();
	 */
	$.fn.equalizeCols = function(){
		var height = 0;
		function normalize(el) {
			return (parseInt(el.css("paddingTop"), 10) || 0)
				+ (parseInt(el.css("paddingBottom"), 10) || 0)
				+ (parseInt(el.css("borderTopWidth"), 10) || 0)
				+ (parseInt(el.css("borderBottomWidth"), 10) || 0);
  		};
		return this
			.css("height", "auto")
			.each(function() {
				height = Math.max(height, $(this).outerHeight());
			})
			.css("height", function() {
				return height - normalize($(this));
			});
	};
})(jQuery);
























jQuery(document).ready(function($jQ) {
	SmartHover("NavigationPrincipale");

	if($jQ("input#mot_cle").length > 0)	{
		$jQ("input#mot_cle").toggleFocus();
	}

	/*_____________________Menu survol______________________*/
	if( $jQ("#NavigationPrincipale").length > 0 ) {
        $jQ("#NavigationPrincipale li ul li a:has(strong)").each(function(){
            var a = $jQ(this);
            var li = a.parents("li:first");
            var ul = a.parents("ul:first");
            var subM = li.find(".subM");
			li.bind("mouseenter",function(){
				if($jQ.browser.msie){
					$jQ("#NavigationPrincipale li ul li.over").removeClass("over");
					li.addClass("over");
				}
				if( subM.find("li").length > 0) {
					subM.stop('true', 'true').fadeIn(500);
				}
			});
			li.bind("mouseleave",function(){
				if($jQ.browser.msie){
					$jQ("#NavigationPrincipale li ul li.over").removeClass("over");
				}
				subM.hide(50);
			});
        });
    }

	/*______ 10 ans anniversaire ___________*/

//	 if (document.cookie.indexOf('visited=true') == -1) {
//				var oneDays = 1000*60*60*24*1;
//        var expires = new Date((new Date()).valueOf() + oneDays);
//
//				if($jQ(".innerCadre").length > 0) {
//
//					document.cookie = "visited=true;expires=" + expires.toUTCString();
//					 $jQ.fn.colorbox({href:"lightbox.html", width:"1000px", height:"800px"});
//
//
//				}
//  }


	/*_____________________Fil d'infos______________________*/
	if( $jQ(".infos .bloc").length > 0 ) {
		$jQ(".infos .bloc .titre img").click(function() {
			var img = $jQ(this);
			var alt = img.attr("alt");
			var bloc = img.parents(".bloc");
			var innBloc = bloc.find(".innBloc");
			if( alt == "ouvrir") {
				if(bloc.not(".on")) {
					bloc.addClass("on");
				}
				innBloc.css("display","none").slideDown("slow");
			}
		});
		$jQ(".infos .bloc .fermer img").click(function() {
			var img = $jQ(this);
			var alt = img.attr("alt");
			var bloc = img.parents(".bloc");
			var innBloc = bloc.find(".innBloc");
			if( alt == "fermer") {
				if(innBloc.css("display") != "block") {
					innBloc.css("display","block");
				}
				innBloc.slideUp("slow",function(){if( bloc.hasClass("on") ) {
					bloc.removeClass("on");
				}});
			}
		});
	}

	if( $jQ(".block").length > 0 ) {
		$jQ(".block").each(function(n){
			if( n%2 == 0 ) {
				$jQ(this).addClass("impair");
			}
		});

	}

	/*______________onglet_______________*/
	if( $jQ(".onglet").length > 0){

		$jQ("#onglet_menu li:first").addClass("on");

		$jQ("div.onglet_box").slice(1).hide();
		$jQ("#onglet_menu li").each(function(i) {
			var li = $jQ(this);
			var a = li.find('a');
			li.hover(
				function(){
					$jQ(this).addClass("over");
				},
				function(){
					$jQ(this).removeClass("over");
			});
			li.click(function(event){
				event.stopPropagation();
				event.preventDefault();
				if( li.hasClass("on") ) {
					return;
				}else {
					$jQ("#onglet_menu li.on").removeClass("on");
					li.addClass("on");
					$jQ("div.onglet_box").css("display","none");
					$jQ("div.onglet_box").eq(i).fadeIn("slow");
				}
				a.blur();
				return false;
			});
		});
	}
	/*______________carte de la France_________________*/

	if( $jQ("#formReseau input#aeroports").length > 0){
		$jQ("#formReseau input#aeroports").attr("checked","true");
		$jQ("#formReseau input:checkbox").click(function(){
			var cks = $jQ("#formReseau input:checked");
			if (cks.length==0) {
				$jQ("#carte ul li").addClass("cache");
			} else if ( cks.length == 1 ){
				$jQ("#carte ul li").addClass("cache");
				var attr = cks.eq(0).attr("id");
				$jQ("#carte ul li[rel*="+attr+"]").removeClass("cache");
			} else if ( cks.length == 2 ){
				$jQ("#carte ul li").addClass("cache");
				var attr1 = cks.eq(0).attr("id");
				var attr2 = cks.eq(1).attr("id");
				$jQ("#carte ul li[rel*="+attr1+ " "+attr2 +"]").removeClass("cache");
			} else {
				$jQ("#carte ul li").addClass("cache");
				$jQ("#carte ul li[rel*=hotels parcsExpos]").removeClass("cache");
			}
		});
	}
	if( $jQ("select#optionParNom").length > 0){
		$jQ("select#optionParNom").change(function(){
			var url = "";
			$jQ("select#optionParNom option:selected").each(function () {
				url = $jQ(this).val();
				if( url != "#") {
					window.open(url,'','');
				} else {
					return false;
				}
			  });
		});
	}
	if( $jQ("div#carte ul").length > 0){
		$jQ("div#carte ul li .ftr").hide();
		$jQ("div#carte ul li img.pngwifi").click(function(event){
			event.preventDefault();
			event.stopPropagation();

			var li = $jQ(this).parents("li:first");
			var ftr = li.find(".ftr");
			$jQ("div#carte ul li .ftr").hide();
			ftr.show("slow",function(){
				$jQ(this).hover(
					function(){
						$jQ(this).css("display","block");
					},
					function(){
						ftr.hide();
				});
			});
			//return false;
		});
	}

	if( $jQ("#menu-ancre .inner2 p a").length > 0){
		$jQ("#menu-ancre .inner2 p a:first").addClass("first");
	}

	/* Cornerz */
	if($jQ('.block .contenu .inner').length>0) {
		$jQ('.block .contenu .inner').cornerz({radius:6});
	}
	if($jQ('.recher .contenu .inner').length>0) {
		$jQ('.recher .contenu .inner').cornerz({radius:6});
	}
	if($jQ('#chapo .inner').length>0) {
		$jQ('#chapo .inner').cornerz({radius:6});
	}
	if($jQ('#menu-ancre .inner').length>0) {
		$jQ('#menu-ancre .inner').cornerz({radius:6});
	}

	/* ScrollTo */
	$jQ('#haut a').localScroll();

	/* last */
	$jQ('#line2 .court').each(function(i){
		var n=i++;
		if(n%2==0) {
			$jQ(this).addClass('first');
		}
	});

	/* EQ cols */
	if( $jQ('.court .contenu .inner .inner2').length > 0) {
		$jQ(".court .contenu .inner .inner2").equalizeCols();
	}



});

/* Create ImageFlow instances when the DOM structure has been loaded */
domReady(function()
{
	var instanceOne = new ImageFlow();
	instanceOne.init({
		ImageFlowID:'imgFlow',
		//reflectionPNG:true,
		reflectionPNG:false,
		reflectionP:0.15,
		reflectPath:'http://www.hubtelecom.com/lib/js/',
		imagePath:'../../',
		startID:3,
		slider:false,
		reflections:true,
		reflectionGET:'&bgc=FFFFFF&height=15%&fade_start=30%&fade_end=0%',
		//reflections:false,
		imageFocusM:1,
		aspectRatio:1.818,
		imagesHeight: 0.81,
		imagesM:0.5,
		slideshow:true,
		slideshowAutoplay:true,
		slideshowSpeed:6000,
		circular:true
	});
});

