$(document).ready(function(){
    
$(".various").fancybox();
    
	$(".bloc_partic .inside").hide();
	$(".bloc_partic h3").click(function(){
		$(this).next().slideToggle("fast");
		return false;
	});
});

$(document).ready(function(){
	$(".blink .inside").hide();
	$(".blink .inside").attr("stat","0");
	$(".blink h4").css({color: "#000"});
	
	$(".blink h4").click(function(){
		if($(this).attr("stat") == "1"){
			$(this).attr("stat","0");
			$(this).next().slideUp("normal");
			$(this).next().animate({opacity: "0"}, 500);
			$(".blink h4").css({color: "#000", fontWeight:"normal", backgroundImage:"url(style1/fleche_d.gif)"});
		}else{
			$(".blink h4").attr("stat","0");
			$(".blink h4").css({color: "#000", fontWeight:"normal", backgroundImage:"url(style1/fleche_d.gif)"});
			$(".blink .inside").animate({opacity: "0"}, 1);
			$(".blink .inside").slideUp("normal");
			
			
			$(this).attr("stat","1");
			$(this).css({color:"#F90", fontWeight: "bold", backgroundImage:"url(style1/fleche_b.gif)"});
			$(this).next().slideDown("normal");
			$(this).next().animate({opacity: "1"}, 500);
			return false;
		}
	});
});
/*
// remove the registerOverlay call to disable the controlbar
hs.registerOverlay({
	thumbnailId: null,
	overlayId: 'controlbar',
	position: 'top right',
	hideOnMouseOut: true
});

hs.outlineType = 'rounded-white';
// Tell Highslide to use the thumbnail's title for captions
hs.captionEval = 'this.thumb.title';

function popupcentre(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);
}
*/	
	
function PopupImage(img) { 
	titre="Agrandissement"; 
	w=open("",'image','width=400,height=400,toolbar=no,scrollbars=no,resizable=no'); 
	w.document.write("<HTML><HEAD><TITLE>"+titre+"</TITLE></HEAD>"); 
	w.document.write("<SCRIPT language=javascript>function checksize() { if (document.images[0].complete) { window.resizeTo(document.images[0].width+10,document.images[0].height+30); window.focus();} else { setTimeout('checksize()',250) } }</"+"SCRIPT>"); 
	w.document.write("<BODY onload='checksize()' onblur='window.close()' onclick='window.close()' leftMargin=0 topMargin=0 marginwidth=0 marginheight=0>");
	w.document.write("<TABLE width='100%' border='0' cellspacing='0' cellpadding='0' height='100%'><TR>");
	w.document.write("<TD valign='middle' align='center'><IMG src='"+img+"' border=0 alt=''>"); 
	w.document.write("</TD></TR></TABLE>");
	w.document.write("</BODY></HTML>"); 
	w.document.close(); 
}

$(function(){
    //FOnction permettant de mettre du texte DANS le formulaire et le faire effacer quand on saisie
    $(".autoEmpty").each(function(){
        var defaultText = $(this).val();
        $(this).focus(function(){
            if($(this).val()==defaultText){
                $(this).val("");
            }
        });
        $(this).blur(function(){
            if($(this).val()==""){
                $(this).val(defaultText);
            }
        });
    }); 
 
 
    $(".bulle a").mouseover(function(){
        if($(this).attr("title")=="") return false;
        
        $("body").append('<span class="infobulle"></span>');
        var bulle = $(".infobulle:last");
        bulle.append($(this).attr("title"));
        $(this).attr("title","");
        var posTop = $(this).offset().top-$(this).height();
        var posLeft = $(this).offset().left+$(this).width()/2-bulle.width()/2;
        bulle.css({
            left:posLeft,
            top:posTop-20,
            opacity:0
        });
        bulle.animate({
            top:posTop-10,
            opacity:0.99
        });
    });
    
    $(".bulle a").mouseout(function(){
        var bulle = $(".infobulle:last");
        $(this).attr("title",bulle.text());
        bulle.animate(
            {
                top:bulle.offset().top+10,
                opacity:0
            },
            500,
            "linear",
            function(){
                bulle.remove();  
            }
        );
    });
});

