
compteurDA = 0;


function diaporama_accueil(){
	if(!total_photo_acc)
	total_photo_acc = 0;
	//alert(compteur+"a"+photo.length);
 if(compteurDA<total_photo_acc) {
  compteurDA++;}
  else {compteurDA=1;}
  
  change_bandeau(compteurDA);
  
 theTimer=setTimeout("diaporama_accueil()",14000);
}


if(typeof( total_photo_acc ) != "undefined")
	diaporama_accueil();


var defautsousmenu = $("#sousnav").html();

$(".autoursousnav").mouseover( function() {

//alert('sorti !');

$('#sousnav').html(defautsousmenu);
$(".sm").each(function () {
		
	id = $(this).attr("id");	
	
	
			//alert (id.substr(4,2));
	
	if(id.substr(4,2) < 7)
		{
		$(this).css("border","none");
		$(this).css("font-size","15px");
		$("li", this).css("padding-bottom","3px");
		}


});

									});

$(".input").mouseover( function() {
								 //alert('sorti !');
$('#sousnav').html(defautsousmenu);
$(".sm").each(function () {
		
	id = $(this).attr("id");	
	
	
			//alert (id.substr(4,2));
	
	if(id.substr(4,2) < 7)
		{
		$(this).css("border","none");
		$(this).css("font-size","15px");
		$("li", this).css("padding-bottom","3px");
		}


});

									});

$("#colDroite").mouseover( function() {
								 //alert('sorti !');
$('#sousnav').html(defautsousmenu);
$(".sm").each(function () {
		
	id = $(this).attr("id");	
	
	
			//alert (id.substr(4,2));
	
	if(id.substr(4,2) < 7)
		{
		$(this).css("border","none");
		$(this).css("font-size","15px");
		$("li", this).css("padding-bottom","3px");
		}


});

									});

$("#outils").mouseover( function() {
								 //alert('sorti !');
$('#sousnav').html(defautsousmenu);
$(".sm").each(function () {
		
	id = $(this).attr("id");	
	
	
			//alert (id.substr(4,2));
	
	if(id.substr(4,2) < 7)
		{
		$(this).css("border","none");
		$(this).css("font-size","15px");
		$("li", this).css("padding-bottom","3px");
		}


});

									});






$(".sm").each(function () {
		
	id = $(this).attr("id");	
	
	
			//alert (id.substr(4,2));
	
	if(id.substr(4,2) < 7)
		{
		$(this).css("border","none");
		$(this).css("font-size","15px");
		$("li", this).css("padding-bottom","3px");
		}


});

var offsetpanier = $("#panierandco").offset();
if(offsetpanier)
	var toppanier = Math.round(offsetpanier.top);

var offsetliste = $("#listevariete").offset();
if(offsetliste)
	var topliste = Math.round(offsetliste.top);

var offsetpied = $("#piedpage").offset();
var toppied = Math.round(offsetpied.top);


$(document).scroll(function() {
		var posScroll = parseInt($(document).scrollTop());	
		WindowHeight = window.innerHeight;
		PanierHeight = $("#panier").height();
		PanierandcoHeight = $("#panierandco").height();
		bottompanier = toppanier+PanierandcoHeight;
		bottomliste = topliste + $("#listevariete").height();

		//alert(topliste+'->'+bottomliste+'/'+toppanier+'->'+bottompanier);

		listenbre = $("#listevariete").length;
		if(bottomliste > bottompanier && posScroll>toppanier && WindowHeight>PanierHeight && listenbre > 0)
			{
			$("#panierandco").css("position","fixed");
			$("#panierandco").css("top","10px");
			$("#panierandco").css("margin-bottom","50px");
			if((PanierandcoHeight+posScroll)>toppied)
				{
					//alert((PanierandcoHeight+posScroll+20)-toppied);
				//$("#piedpage").css("margin-top",((PanierandcoHeight+posScroll+20)-toppied)+"px");
				}
				
			}
		else
			{
			$("#panierandco").css("position","relative");
			$("#panierandco").css("top","0px");
			}
		if(bmaj)
			{
			
			var offsetSubmit = $("#Submit").offset();
			var topSubmit = Math.round(offsetSubmit.top);
			//alert(topSubmit +"/"+WindowHeight+"/"+posScroll+" / "+(WindowHeight-posScroll));
			diff = topSubmit - WindowHeight - posScroll;
			if(diff<0)
				$("#bmaj").css("top",(WindowHeight+5+diff)+"px");
			else
				$("#bmaj").css("top",(WindowHeight-30)+"px");
			
			}
	   });


$("#corps .tarifs").each(function () {
								   	
		
		$(this).hover(
			
			function() { 
			$(this).css("display","");	
		},
		
		function() { 
			$(this).slideUp('fast');
		});
		
	});


$("#corps tbody").each(function () {
		$(this).css("margin-right","0px");
		$(this).css("margin-left","0px");
		});

$("#corps table").each(function () {
	align = $(this).attr("align");
	width = $(this).attr("width");
	border = $(this).attr("border");
	
	if(border>0)
		{
		$(this).attr("border",0);
		$(this).addClass("tableborder");		
		}
		
	if(width>710)
		$(this).attr("width",710);
});

$("#corps a").each(function () {
							 
	lien = $(this).attr("href");
	if(lien.substr((lien.length-4),4) == ".jpg" && $(this).attr("class") != "highslide")
		{
		//alert(lien);
		$(this).attr("class","highslide");
		$(this).attr("onclick","return hs.expand(this);");
		$(this).find("img").css("border","none");
		}
	
	
							 });


$("#corps img").each(function () {
	align = $(this).attr("align");
	width = $(this).attr("width");
	height = $(this).attr("height");
		
	if($(this).attr("src").indexOf("images/varietes/")==0)
		{
		//alert($(this).attr("src"));
		$(this).css("padding-top","0px");
		$(this).css("padding-bottom","0px");
		$(this).css("padding-left","0px");
		$(this).css("padding-right","0px");
		//$(this).css("border","solid 2px #E8E4DB");
		}
	else if($(this).attr("src").indexOf("fleche.gif")>0)
		{
		//alert($(this).attr("src"));
		$(this).css("padding-top","4px");
		$(this).css("padding-bottom","4px");
		$(this).css("padding-left","0px");
		//$(this).css("border","solid 2px #E8E4DB");
		}
	else if(align=="right")
		{
		 $(this).css("margin-right","0");
		 $(this).css("padding-right","0");
		 }
	else if(align=="left")
		{
		 $(this).css("margin-left","0");
		 $(this).css("padding-left","0");
		 }
	else if(align=="")
		{
		$(this).css("margin-right","0");
		$(this).css("margin-left","0");
		$(this).css("padding-right","0");
		$(this).css("padding-left","0");
		}
});


$("#colDroite img").each(function () {
	align = $(this).attr("align");
	width = $(this).attr("width");
	height = $(this).attr("height");
	if(align=="right")
		{
		 $(this).css("margin-right","0");
		 $(this).css("padding-right","0");
		 }
	if(align=="left")
		{
		 $(this).css("margin-left","0");
		 $(this).css("padding-left","0");
		 }
	if(align=="")
		{
		$(this).css("margin-right","0");
		$(this).css("margin-left","0");
		$(this).css("padding-right","0");
		$(this).css("padding-left","0");
		}
	if(width<100 && height<100)
		$(this).css("border","none");
});


open_ext_link();

if(afficher_gmap)
	load();
	
if(bmaj)
	{
		
	
	
	//alert(posScroll);
	var posScroll = parseInt($(document).scrollTop());	
	WindowHeight = window.innerHeight;
	var offsetSubmit = $("#Submit").offset();
	var topSubmit = Math.round(offsetSubmit.top);
	//alert(topSubmit +"/"+WindowHeight+"/"+posScroll+" / "+(WindowHeight-posScroll));
	diff = topSubmit - WindowHeight - posScroll;
	if(diff>0)
		{

	$("#bmaj").css("position","fixed");
	$("#bmaj input").css("margin","10px;");
	$("#bmaj").css("top",(WindowHeight-30)+"px");
		}
		
	}

