var zIndexMenu = 10;
var menuPrincipal = "";

var contenuAccueil = "Contenu de l'accueil";
var titreAccueil = "Titre de l'accueil";



/*******************************************************************************/
/**************************** CHARGEMENT DE DEPART *****************************/
/*******************************************************************************/
$(document).ready(function () {
	

	$('.lien_retour').bind('click',function(){
		openMenu("accueil");
	});
	
	
					$('#menu_accueil ul li a').hover(function() {
					$('#menu_accueil ul li a').stop().animate({width: "122.5px", opacity : 0.5}, {duration: 450, easing: "easeOutQuad", complete: "callback"});
					$(this).stop().animate({width: "280px", opacity : 1}, {duration: 450, easing: "easeOutQuad", complete: "callback"});
				}, function () {
						$('#menu_accueil ul li a').stop().animate({width: "154px", opacity : 1}, {duration: 450, easing: "easeOutQuad", complete: "callback"});
				});
				

										$('#lien_profession').bind('click',function(){
															chargeContenu("profession","Ma profession : l'ostéopathie");
								//alert("chargecontenu profession");
																				});
											$('#lien_pourqui').bind('click',function(){
															chargeContenu("pourqui","L'ostéopathie, pour qui ?");
								//alert("chargecontenu pourqui");
																						//alert(" open sub menu pourqui");
								openMenu("pourqui");
													});
											$('#lien_pourquoi').bind('click',function(){
															chargeContenu("pourquoi","L'ostéopathie, pourquoi ?");
								//alert("chargecontenu pourquoi");
																						//alert(" open sub menu pourquoi");
								openMenu("pourquoi");
													});
											$('#lien_comment').bind('click',function(){
															chargeContenu("comment","Comment se déroule une consultation ?");
								//alert("chargecontenu comment");
																				});
											$('#lien_quoideneuf').bind('click',function(){
															chargeContenu("quoideneuf","Quoi de neuf - Actualités sur l'ostéopathie");
								//alert("chargecontenu quoideneuf");
																						//alert(" open sub menu quoideneuf");
								openMenu("quoideneuf");
													});
									$('#menu_pourqui ul li a').hover(function() {
					$('#menu_pourqui ul li a').stop().animate({width: "98px", opacity : 0.5}, {duration: 450, easing: "easeOutQuad", complete: "callback"});
					$(this).stop().animate({width: "280px", opacity : 1}, {duration: 450, easing: "easeOutQuad", complete: "callback"});
				}, function () {
						$('#menu_pourqui ul li a').stop().animate({width: "128.33333333333px", opacity : 1}, {duration: 450, easing: "easeOutQuad", complete: "callback"});
				});
				

										$('#lien_pourqui_nourrissons').bind('click',function(){
															chargeContenu("pourqui_nourrissons","L'ostéopathie chez les nourrissons");
								//alert("chargecontenu pourqui_nourrissons");
																				});
											$('#lien_pourqui_enfants').bind('click',function(){
															chargeContenu("pourqui_enfants","L'ostéopathie chez les enfants");
								//alert("chargecontenu pourqui_enfants");
																				});
											$('#lien_pourqui_enceintes').bind('click',function(){
															chargeContenu("pourqui_enceintes","L'ostéopathie chez les femmes enceintes");
								//alert("chargecontenu pourqui_enceintes");
																				});
											$('#lien_pourqui_adultes').bind('click',function(){
															chargeContenu("pourqui_adultes","L'ostéopathie chez les adultes");
								//alert("chargecontenu pourqui_adultes");
																				});
											$('#lien_pourqui_handicap').bind('click',function(){
															chargeContenu("pourqui_handicap","L'ostéopathie chez les personnes handicapées");
								//alert("chargecontenu pourqui_handicap");
																				});
									$('#menu_pourquoi ul li a').hover(function() {
					$('#menu_pourquoi ul li a').stop().animate({width: "122.5px", opacity : 0.5}, {duration: 450, easing: "easeOutQuad", complete: "callback"});
					$(this).stop().animate({width: "280px", opacity : 1}, {duration: 450, easing: "easeOutQuad", complete: "callback"});
				}, function () {
						$('#menu_pourquoi ul li a').stop().animate({width: "154px", opacity : 1}, {duration: 450, easing: "easeOutQuad", complete: "callback"});
				});
				

										$('#lien_pourquoi_nourrissons').bind('click',function(){
															chargeContenu("pourquoi_nourrissons","Les nourrissons : pourquoi consulter ?");
								//alert("chargecontenu pourquoi_nourrissons");
																				});
											$('#lien_pourquoi_enfants').bind('click',function(){
															chargeContenu("pourquoi_enfants","Les enfants : pourquoi consulter ?");
								//alert("chargecontenu pourquoi_enfants");
																				});
											$('#lien_pourquoi_enceintes').bind('click',function(){
															chargeContenu("pourquoi_enceintes","Femmes enceintes : pourquoi consulter ?");
								//alert("chargecontenu pourquoi_enceintes");
																				});
											$('#lien_pourquoi_handicap').bind('click',function(){
															chargeContenu("pourquoi_handicap","Personnes handicapées : pourquoi consulter ?");
								//alert("chargecontenu pourquoi_handicap");
																				});
									$('#menu_quoideneuf ul li a').hover(function() {
					$('#menu_quoideneuf ul li a').stop().animate({width: "245px", opacity : 0.5}, {duration: 450, easing: "easeOutQuad", complete: "callback"});
					$(this).stop().animate({width: "280px", opacity : 1}, {duration: 450, easing: "easeOutQuad", complete: "callback"});
				}, function () {
						$('#menu_quoideneuf ul li a').stop().animate({width: "256.66666666667px", opacity : 1}, {duration: 450, easing: "easeOutQuad", complete: "callback"});
				});
				

										$('#lien_quoideneuf_legislation').bind('click',function(){
															chargeContenu("quoideneuf_legislation","Législation");
								//alert("chargecontenu quoideneuf_legislation");
																				});
											$('#lien_quoideneuf_liens').bind('click',function(){
															chargeContenu("quoideneuf_liens","Liens sur l'ostéopathie");
								//alert("chargecontenu quoideneuf_liens");
																				});
								

	
	openMenu('accueil')
	$("#menu_accueil").show();
	$('#menus').css('background','white');

});
/*******************************************************************************/
/*******************************************************************************/







/*******************************************************************************/
/**************************** CHARGEMENT SOUS MENU *****************************/
/*******************************************************************************/
function openMenu(sjt)
{
	$('#fondMenus').hide();
	$('#menus').css('background','transparent');
	$(".menuSlide:visible").fadeOut(1000,function() {
		$("#menu_"+sjt).fadeIn(1000,function() {
			$('#fondMenus').show();
			$('#menus').css('background','white');
		});
	});
}

/*******************************************************************************/
/*******************************************************************************/


function includeJS(srcScript)
{
	var sc = document.createElement('script');
	sc.type = 'text/javascript';
	sc.src = srcScript;
	document.getElementsByTagName("head")[0].appendChild(sc);
}



function loadMap(divId) {
	if (GBrowserIsCompatible()) {
		var map = new GMap2(document.getElementById(divId));
		map.addControl(new GSmallMapControl());
		map.addControl(new GMapTypeControl());
		map.setCenter(new GLatLng(45.1805733,5.7251407),13);
	    //map.openInfoWindow(map.getCenter(),document.createTextNode("Chemin de la flesque"));
	    var point = new GLatLng(45.1805733, 5.7251407);
		map.addOverlay(new GMarker(point));
	}
}



/*******************************************************************************/
/***************************** CHARGEMENT CONTENU ******************************/
/*******************************************************************************/
function chargeContenu(sujet,titre)
{
	$('#contenu').stop().animate({height: "1px"}, {duration: 750, easing: "easeOutQuad", complete: function() {
		
		$.get("chargement.php",{idItem: sujet,tmpUnique:(new Date).valueOf()},function(data){
			
			$('#titre').html(titre);
			$('#txt_contenu').html(data);
			$('#contenu').stop().animate({height: $('#txt_contenu').height()+150}, {duration: 750, easing: "easeOutQuad"});
		});
	}});

}
/*******************************************************************************/
/*******************************************************************************/




