	
/* ------------------------------- */
	
/* Begin main.js.php?module=home&module_base= */
	
/* ------------------------------- */	
	
	
$(document).ready(function()
		{
		
		/* ------ */
		/* Onload Events */
		/* ------ */
		
		// Show the tooltip for the link to home (except into the home page itself)
		if ( $("img#fixed_to_home").length > 0 )
			{
			$('a#to_home').attr({ 'title':'' });
			var this_tooltip_url = '/plugs/tooltips.plug.php?tooltip=home';
			
			$('img#fixed_to_home').attr({ 'rel':this_tooltip_url });
			$('img#fixed_to_home').cluetip({ width:360, positionBy:'mouse', leftOffset:-30, showTitle:false, cluetipClass:'home', clickThrough:true});
			}	
	// 2009-04-20 Marc Nadeau ; 2009-04-23 Marc Nadeau 

	/* begin include = home.js.inc.php */

	// Supprimer le bas de la page (contenu statique)
	$("div#static_content").hide();
	$('span#credits').hide();

	// Ces rangees sont cachees dans la version sans jquery
	$('td#fixed_main_menu').css({ 'visibility':'visible'});
	$('td#fixed_secondary_menu').css({ 'visibility':'visible'});		
	$("div#ajax_content").css({ 'visibility':'visible' });

	// Cacher des parties
	$("div.changing").hide();
	$("img.detonateur").hide();
	
	// Changer le titre de l image principale
	$('img#main_picture').attr( { 'title':"Cliquez sur l'image pour découvrir ce que nous sommes."} );

	// Explosion initiale
	$("div#main_picture_cont").show();
	$("img#main_picture").show("slide", { direction: "up" }, 1500);

	// Un clique sur le l image principale ramene le texte de presentation
	$("img#main_picture").click(function ()
		{
		$(this).hide("explode", {}, 1500);
		$("div.changing").hide();
		$("div#presentation_cont").show().fadeTo('slow', 0.1).fadeTo('slow', 0.60).fadeTo('slow', 1.00);
		$("img.detonateur").show("explode", {}, 2000);
		$(this).show();
		});

	// Un clique sur le detonateur retourne l image principale
	$("img#detonateur").click(function ()
		{
		$("div.changing").hide('fast');
		$("div#main_picture_cont").show('fast');
		$("img#main_picture").fadeTo('slow','0.50').show("explode", {}, 2000).fadeTo('slow','1.00');
		$(this).hide("explode", {}, 'slow');
		});

	// Un clique sur le texte de presentation retourne l image principale
	$("div#presentation_cont").click(function ()
		{
		$("div.changing").hide('fast');
		$("img.detonateur").hide("explode", {}, 2000);
		$("div#main_picture_cont").show('fast');
		$("img#main_picture").fadeTo('slow','0.50').show("explode", {}, 2000).fadeTo('slow','1.00');
		$(this).hide();
		});

	// On surligne les menus au passage
	$('td.menu_item').hover(function ()
		{
		$(this).css({ 'border-bottom':'yellow solid 1px', 'border-top':'yellow solid 1px' });
			},
		function ()
			{
		$(this).css({'border-bottom':'#1f2692 solid 1px', 'border-top':'#1f2692 solid 1px' });
			});

	// Vers le theatre
	$("img#pic_to_theatre").click(function ()
		{
		$("img#main_picture:visible").hide("explode", {}, 1000);
		$('div.changing:visible').hide('fast');
		$("div#le_theatre_cont").show("slide", { direction: "up" }, 1500);
		$("img.detonateur:hidden").show("explode", {}, 1500).css('margin', 'auto');
		});

	$("img#text_to_theatre").click(function ()
		{
		$("img#main_picture:visible").hide("explode", {}, 1000);
		$('div.changing:visible').hide('fast');
		$("div#le_theatre_cont").show("slide", { direction: "up" }, 1500);
		$("img.detonateur:hidden").show("explode", {}, 1500).css('margin', 'auto');
		});

	// Vers le centre de documention
	$("img#pic_to_centre_doc").click(function ()
		{
		$("img#main_picture:visible").hide("explode", {}, 1000);
		$('div.changing:visible').hide('fast');
		$("div#centre_documentation_cont").show("slide", { direction: "up" }, 1500);
		$("img.detonateur:hidden").show(10).css('margin', 'auto');
		});

	$("img#text_to_centre_doc").click(function ()
		{
		$("img#main_picture:visible").hide("explode", {}, 1000);
		$('div.changing:visible').hide('fast');
		$("div#centre_documentation_cont").show("slide", { direction: "up" }, 1500);
		$("img.detonateur:hidden").show(10).css('margin', 'auto');
		});

	// Vers le coin des enfants
	$("img#pic_to_coin_des_enfants").click(function ()
		{
		$("img#main_picture:visible").hide("explode", {}, 1000);
		$('div.changing:visible').hide('fast');
		$("div#coin_des_enfants_cont").show("slide", { direction: "up" }, 1500);
		$("img.detonateur:hidden").show(10).css('margin', 'auto');
		});

	$("img#text_to_coin_des_enfants").click(function ()
		{
		$("img#main_picture:visible").hide("explode", {}, 1000);
		$('div.changing:visible').hide('fast');
		$("div#coin_des_enfants_cont").show("slide", { direction: "up" }, 1500);
		$("img.detonateur:hidden").show(10).css('margin', 'auto');
		});

	// Vers les petits_plus
	$("img#pic_to_petits_plus").click(function ()
		{
		$("img#main_picture:visible").hide("explode", {}, 1000);
		$('div.changing:visible').hide('fast');
		$("div#petits_plus_cont").show("slide", { direction: "up" }, 1500);
		$("img.detonateur:hidden").show(10).css('margin', 'auto');
		});

	$("img#text_to_petits_plus").click(function ()
		{
		$("img#main_picture:visible").hide("explode", {}, 1000);
		$('div.changing:visible').hide('fast');
		$("div#petits_plus_cont").show("slide", { direction: "up" }, 1500);
		$("img.detonateur:hidden").show(10).css('margin', 'auto');
		});

	// Tooltips on photos menus
	$('img.photo_button').each(function()
		{
		var this_tooltip = $(this).parent().attr('rev');
//		var this_tooltip_url = 'http://www.marionnettes.ca/plugs/main_menu_tooltips.plug.php?tooltip=' + this_tooltip;
		var this_tooltip_url = 'http://www.marionnettes.ca/plugs/standard_tooltips.plug.php?class=menu&tooltip_s=menu&tooltip=' + this_tooltip;		
		$(this).parent().removeAttr('title');
		$(this).removeAttr('alt');
		$(this).attr({ 'rel':this_tooltip_url });
		$(this).cluetip({ width:240, positionBy:'mouse', leftOffset:30, showTitle:false, cluetipClass:'main_menu', clickThrough:true});
		});
	
	// Tooltips on text (img) menus
	$('img.menu_index').each(function()
		{
		var this_tooltip = $(this).parent().attr('rev');
//		var this_tooltip_url = 'http://www.marionnettes.ca/plugs/main_menu_tooltips.plug.php?tooltip=' + this_tooltip;
		
		
		var this_tooltip_url = 'http://www.marionnettes.ca/plugs/standard_tooltips.plug.php?class=menu&tooltip_s=menu&tooltip=' + this_tooltip;
		
		
		$(this).parent().removeAttr('title');
		$(this).removeAttr('alt');
		$(this).attr({ 'rel':this_tooltip_url });
		$(this).cluetip({ width:240, positionBy:'mouse', leftOffset:30, showTitle:false, cluetipClass:'main_menu', clickThrough:true});
		});


	/* end include = home.js.inc.php */
		


 }); // END jquery document.ready