$(document).ready(function(){

   /* cufon */
	Cufon.replace('.ker', { fontFamily: 'ker' });

	/* Comportement Rollover avec class="rollover" */
	$("img.rollover").each(function(){
		attachRollOverEvent(this);
	});

	/* Remplacement image actif avec class="actif" */
	$("img.actif").each( function(){
		attachActif(this);
	});

	/* Fancybox Propriétés */
  $("a.fancy").fancybox({ 'overlayShow': true, 'overlayOpacity': 0.70, 'hideOnContentClick': true });
  $("a#fenetre").fancybox({ 'overlayShow': true, 'zoomSpeedOut':0, 'zoomSpeedIn':0, 'overlayOpacity': 0.70, 'hideOnContentClick': true });

  /* PNG Fix */
  $(document).pngFix();


	/* comportement roll plans */
	$('#plans a').each(function(i){
		var myPlan = i;
		$(this).hover(function(){
		    $("#plans a img:eq("+myPlan+")").addClass("cacher");
			$("#plans a span:eq("+myPlan+")").removeClass("cacher");
		 },function(){
		    $("#plans a img:eq("+myPlan+")").removeClass("cacher");
			$("#plans a span:eq("+myPlan+")").addClass("cacher");
		 });
	});

	$('#plansProduit a').each(function(i){
		var myPlan2 = i;
		$(this).hover(function(){
		    $("#plansProduit a img:eq("+myPlan2+")").addClass("cacher");
			$("#plansProduit a span:eq("+myPlan2+")").removeClass("cacher");
		 },function(){
		    $("#plansProduit a img:eq("+myPlan2+")").removeClass("cacher");
			$("#plansProduit a span:eq("+myPlan2+")").addClass("cacher");
		 });
	});


	$("#gal div.scrollable2").scrollable({
		size: 4,
		clickable:false
	});
	$("#gal2 div.scrollable2").scrollable({
		size: 6,
		clickable:false
	});
	// initialize scrollable
	$("div.scrollable").scrollable();

	$("#focusImage").cycle({
		fx:    'fade',
		speed:  2500,
		timeout:  6500
	});



}); /* fin doc ready */


/* ======== Fonctions ========================================================================== */

/* Comportement Rollover avec class="rollover" */
attachRollOverEvent = function(imageId){
	$(imageId).mouseover( function(){ $(this).attr("src", $(this).attr("src").replace('.','_roll.')) } );
	$(imageId).mouseout( function(){ $(this).attr("src", $(this).attr("src").replace('_roll','')) } );
}

/* Change image pour les "actif" */
attachActif = function(imageId){
	$(imageId).attr("src", $(imageId).attr("src").replace('.','_roll.'));
}

/* Impression des documents */
function imprimer(){
	if(window.print) window.print();
	else alert("Désolé mais votre navigateur ne supporte pas cette fonctionnalité. Pour la plupart des navigateurs, vous pouvez imprimer cette page  en allant dans le menu 'Fichier' > 'Imprimer'");
}

/* Ajouter aux favoris */

function favoris() {
if ( navigator.appName != 'Microsoft Internet Explorer' )
{ window.sidebar.addPanel("le nom du site","http://www.tonsite.com",""); }
else { window.external.AddFavorite("http://www.tonsite.com","le nom du site"); } }
