/* FUNCTION HOME */
function home()
{   
	$('#header_right').delay(1600).slideDown(1000);
 	$("#body_top_inner a").each(function(index) {   
		$(this).delay(500 * index).fadeIn("slow");      
	}); 
}   


/* FUNCTION ENTREPRENEUR */
function entrepreneur()
{
   $("#background").delay(300).fadeIn(1000); 
}   

/* FUNCTION ENTREPRISE */
function entreprise()
{
   $("#background").delay(300).fadeIn(1000); 
}

/* FUNCTION AUTONOME - PROFESSIONNEL */
function autonome()
{
   $("#background").delay(300).fadeIn(1000); 
}  

/* FUNCTION FONDATION - ASSOCIATION */
function fondation()
{
   $("#background").delay(300).fadeIn(1000); 
}

/* FUNCTION LOAD GOOGLE MAP */
function load_google_map(target,lat,lng)
{         
	var latlng = new google.maps.LatLng(lat,lng);
	var myOptions = {  
		scrollwheel: false,
		zoom: 12,
		center: latlng,   
		disableDefaultUI: true,      
	    zoomControl: true,
		mapTypeId: google.maps.MapTypeId.ROADMAP
	};    
	var map = new google.maps.Map(document.getElementById(target),
	myOptions);     
	var marker = new google.maps.Marker({
		position: latlng
	});
	marker.setMap(map);
}


$(document).ready(function() {       
	
	/* ROLLOVER IMAGE */
	$( '.over' ).live("mouseover", function () { 
		$(this).attr("src", $(this).attr("src").split(".").join("_hover."));
	});

	$( '.over' ).live("mouseout", function () {  
		$(this).attr("src", $(this).attr("src").split("_hover.").join("."));
	});   
		
	// bullite
	$(".cercle_element").mouseover(function() {
		var type = $(this).next().attr("class");    
		var position = $(this).position();     
		if(type=='bulle_droite')
		{
		   $(this).next().css("left",position.left+130);     
		   $(this).next().css("top",position.top-35); 
		} 
		if(type=='bulle_gauche')
		{
		   $(this).next().css("left",position.left-260);     
		   $(this).next().css("top",position.top-35);
		} 
		$(this).next().show(); 
	});  
	$(".cercle_element").mouseout(function() {
		$(this).next().hide();
	});
	
	
	// autonome
	$("#cible_financiere").click(function() {
		$("#cadre_autonome").show();
	});     
	$("#cadre_autonome").click(function() {
		$("#cadre_autonome").hide(); 
	}); 
	
	// chronique
	$("#chronique_archive").click(function(e) {            
		if($("#chronique_archive_container").is(":hidden"))
		{    	
		$(this).addClass("selected");
		$("#chronique_archive_container").slideDown("slow");
		} 
		else
		{
		$(this).removeClass("selected");
		$("#chronique_archive_container").slideUp("slow");	
		}   
		e.stopPropagation();
	});  
	$("#chronique_archive_container").click(function(e) { 
		$("#chronique_archive").removeClass("selected");
		e.stopPropagation();    
	});  
	$("body").click(function() {    
		$("#chronique_archive").removeClass("selected");
		$("#chronique_archive_container").hide();       
		e.stopPropagation();
	});
	
	
});

