var zIndexMenu = 10;
var menuPrincipal = "";

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



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

	$('.pngHack').ifixpng();
	//$('#top_content').css('zIndex','1');
	//$('#body_content').css('zIndex','2');

	
	$('.lien_retour').bind('click',function(){
		openMenu("accueil");
	});
	
	
					$('#menu_accueil ul li a').hover(function() {
					//alert($(this).css('background-image',$(this).css('background-image').replace('.jpg','_on.jpg'));
					//$(this).css('background-image',$(this).css('background-image').replace('.jpg','_on.jpg'));
					$('#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,borderColor:'#ff0000'}, {duration: 450, easing: "easeOutQuad", complete: "callback"});
				}, function () {
						$('#menu_accueil ul li a').stop().animate({width: "154px", opacity : 1}, {duration: 450, easing: "easeOutQuad", complete: "callback"});
						//$(this).css('background-image',$(this).css('background-image').replace('_on.jpg','.jpg'));
				});
				

										$('#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_pourquoi ul li a').hover(function() {
					//alert($(this).css('background-image',$(this).css('background-image').replace('.jpg','_on.jpg'));
					//$(this).css('background-image',$(this).css('background-image').replace('.jpg','_on.jpg'));
					$('#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,borderColor:'#ff0000'}, {duration: 450, easing: "easeOutQuad", complete: "callback"});
				}, function () {
						$('#menu_pourquoi ul li a').stop().animate({width: "154px", opacity : 1}, {duration: 450, easing: "easeOutQuad", complete: "callback"});
						//$(this).css('background-image',$(this).css('background-image').replace('_on.jpg','.jpg'));
				});
				

										$('#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_adultes').bind('click',function(){
															chargeContenu("pourquoi_adultes","Ados et adultes : pourquoi consulter ?");
								//alert("chargecontenu pourquoi_adultes");
																				});
									$('#menu_pourqui ul li a').hover(function() {
					//alert($(this).css('background-image',$(this).css('background-image').replace('.jpg','_on.jpg'));
					//$(this).css('background-image',$(this).css('background-image').replace('.jpg','_on.jpg'));
					$('#menu_pourqui ul li a').stop().animate({width: "122.5px", opacity : 0.5}, {duration: 450, easing: "easeOutQuad", complete: "callback"});
					$(this).stop().animate({width: "280px", opacity : 1,borderColor:'#ff0000'}, {duration: 450, easing: "easeOutQuad", complete: "callback"});
				}, function () {
						$('#menu_pourqui ul li a').stop().animate({width: "154px", opacity : 1}, {duration: 450, easing: "easeOutQuad", complete: "callback"});
						//$(this).css('background-image',$(this).css('background-image').replace('_on.jpg','.jpg'));
				});
				

										$('#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");
																				});
									$('#menu_quoideneuf ul li a').hover(function() {
					//alert($(this).css('background-image',$(this).css('background-image').replace('.jpg','_on.jpg'));
					//$(this).css('background-image',$(this).css('background-image').replace('.jpg','_on.jpg'));
					$('#menu_quoideneuf ul li a').stop().animate({width: "163.33333333333px", opacity : 0.5}, {duration: 450, easing: "easeOutQuad", complete: "callback"});
					$(this).stop().animate({width: "280px", opacity : 1,borderColor:'#ff0000'}, {duration: 450, easing: "easeOutQuad", complete: "callback"});
				}, function () {
						$('#menu_quoideneuf ul li a').stop().animate({width: "192.5px", opacity : 1}, {duration: 450, easing: "easeOutQuad", complete: "callback"});
						//$(this).css('background-image',$(this).css('background-image').replace('_on.jpg','.jpg'));
				});
				

										$('#lien_quoideneuf_legislation').bind('click',function(){
															chargeContenu("quoideneuf_legislation","Législation");
								//alert("chargecontenu quoideneuf_legislation");
																				});
											$('#lien_quoideneuf_conferences').bind('click',function(){
															chargeContenu("quoideneuf_conferences","Conférences");
								//alert("chargecontenu quoideneuf_conferences");
																				});
											$('#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(44.0178175, 4.4041443),14);
		map.setCenter(new GLatLng(44.0175301, 4.4045064),14);
	    //map.openInfoWindow(map.getCenter(),document.createTextNode("Chemin de la flesque"));
	    var point = new GLatLng(44.0175301, 4.4045064);
		map.addOverlay(new GMarker(point));
		map.setMapType(G_HYBRID_MAP);
	}
}



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

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




