/**
	LOADER
*/
QueryLoader.selectorPreload = "#menu";
QueryLoader.init();
/**
	VARIABLES
*/
var animation_en_cours=0;
var prochaine_animation;
var prochaine_animation;
var animation_actuelle;
var hover_home=1;
var pageactuel	= "page0";

var afficheprojet	= 0; // pour savoir si l'on est sur la page projet
var locationPage = {
	put: function(hash, win) {
		(win || window).location.hash = encodeURIComponent(hash);
	},
	get: function(win) {
		var hash = ((win || window).location.hash).replace(/^#/, '');
		return $.browser.fx ? hash : decodeURIComponent(hash);
	}
};
 /**
   * Fonction de mise a jour de la position de la souris
   */
  function updateThemeRepertory(theRepertory){
	  repertory			= theRepertory;
  }
// fonction qui verifie toutes les 10 secondes si le contenu est bien affichée, sinon l'affiche
function verif_anim_en_cours(){
	var height = getTotalHeight();	
	if(height > 800){
		top_agence="50%";
		margin_agence="-340px";
	}else{
		top_agence="0px";
		margin_agence="0px";	
	}	
	
	if(locationPage.get() == "/agence/"){
		$('.container_page').not("#agence_content").hide();
		$("#agence_content").fadeIn(800);
		$(".button_projet").hide();
		$('#agence_content').css({top:top_agence,'margin-top':margin_agence});
	}
	if(locationPage.get() == "/equipe/"){
		$('.container_page').not("#equipe_content").hide();
		$("#equipe_content").fadeIn(800);
		$(".button_projet").hide();
		$('#equipe_content').css({top:top_agence,'margin-top':margin_agence});	
		$("#equipe_content").find('li').fadeIn(400);
	}
	if(locationPage.get() == "/instant/"){
		$('.container_page').not("#instant_content").hide();
		$("#instant_content").fadeIn(800);
		$(".button_projet").hide();
		$("#instant_content").css({top:top_agence,'margin-top':margin_agence});
	}
	if(locationPage.get() == "/contact/"){
		$('.container_page').not("#contact_content").hide();
		$("#contact_content").fadeIn(800);
		$(".button_projet").hide();
		$("#contact_content").css({top:top_agence,'margin-top':margin_agence});
	}
	if(locationPage.get() == "/" || locationPage.get() == ""){
		// var height_total=getTotalHeight();
		// var top_menu=height_total/2;
		// top_menu=top_menu-76;	
		// $('#menu').css({'top':top_menu+'px'});
	}
	if(locationPage.get() == "/instant_actualite/"){
		$('.container_page').not("#instant_one_content").hide();
		$("#instant_one_content #agence_ul").show();
		$('#instant_one_content').css({top:top_agence,'margin-top':margin_agence});	
	}
}
function showPage() {  
thisPage = location.href.substring((location.href.lastIndexOf("/"))+1) 
}  
// Définition d'un objet global (c.à.d. l'objet window)
window.$my = {
	// Initialisation des variables globales
	navigateur : getInternetExplorerVersion()
};

/**
 * Rollover pour les vignettes projets et membres (black&white --> couleur)
 */
function roll_on() {
  this.src = this.src.replace(/_off/,'_on');
}
function roll_off() {
	this.src = this.src.replace(/_on/,'_off');
}
function img_rollover() {
  for (i = 0; i < document.images.length; i++) {
	if (document.images[i].src.indexOf('_off.') > 0) {
	  document.images[i].onmouseover = roll_on;
	  document.images[i].onmouseout = roll_off;
	}
  }
}
var url_page;
$(function(){
/**
 * Fonction qui permet de tester une adresse email
 */
function test_email(my_email) {
	var reg = new RegExp('^[a-z0-9]+([_|\.|-]{1}[a-z0-9]+)*@[a-z0-9]+([_|\.|-]{1}[a-z0-9]+)*[\.]{1}[a-z]{2,6}$', 'i');
	if(reg.test(my_email)){
		return(true);
	}else{
		return(false);
	}
}
$('#menu_ombre').css('width', $(window).width() + 'px');
$('#input_newsletter').click(function(){
	$('#input_newsletter').val('');
});

$('#madmimi_btn').click(function(){
	var input_email	= $('#input_newsletter').val();
	
	if(input_email.indexOf("Entrez votre e-mail.") !=-1 || input_email == ''){
		$('#input_newsletter').val('   Entrez une adresse svp...');
	}
	else if(!test_email(input_email)){
		$('#input_newsletter').val('  Adresse non valide...');
	}
	else{
		$.post("http://madmimi.com/signups/subscribe/37523", { 'signup[email]':  input_email},
			function(data){
			}			
		);
		$('#input_newsletter').val('   Merci pour votre inscription');
	}	
});
function initMadmimi(){
	var input_email	= $('#input_newsletter').val();	
	if(input_email.indexOf("Entrer votre email ici") !=-1 || input_email.indexOf("Adresse non valide") !=-1 || input_email.indexOf("Merci pour votre inscription") !=-1){
		$('#input_newsletter').val('Entrer votre email ici');
	}
}
});

/**
	ARRIVEE SUR LE SITE
*/
$(function(){
	var support = DetectMobile();
	if(support==false){
		$('#content_main').jScrollPane();
	}
	$('#selectDemo1').mSelect();				
	setInterval("verif_anim_en_cours()",12000);
	var height_total=getTotalHeight();
	var top_menu=height_total/2;
	top_menu=top_menu-126;
	$('#menu').css('top',top_menu+'px');
	// mise en place des CSS non valide W3C
	if ($my.navigateur==7 || $my.navigateur==8) {
		$('#equipe_ul li').css({'background':'none'});
	}
	$('#footer .vignette .vignette_ombre img').css({'-ms-filter':' "progid:DXImageTransform.Microsoft.gradient(startColorstr=#00FFFFFF,endColorstr=#00FFFFFF)"','filter':'progid:DXImageTransform.Microsoft.gradient(startColorstr=#00FFFFFF,endColorstr=#00FFFFFF)','zoom':'1'});
	$('.mask_black').css({'opacity':'0.5','filter':' alpha(opacity=50)'});
	$('.hover_title').css({'|margin-left':'-135px'});
	$('#content_newsletter span, #content_newsletter input, #content_newsletter button').css({'opacity':'0','filter':' alpha(opacity=0)'});
	$('#slider, #slider-agence').css({'border':'1px 1px 12px #CCC',' -moz-box-shadow':'1px 1px 12px #CCC',' -webkit-box-shadow':' 1px 1px 12px #CCC',' box-shadow':' 1px 1px 12px #CCC','filter':'progid:DXImageTransform.Microsoft.Shadow(color="#CCCCCC", Direction=135, Strength=12)','zoom':'1'});
	$('#menu_right').css('|top','10px');	
});

$(window).load(function(){
	$('#select_projet').show();
	// on recupere le nom de la page si l'URL est passée directement
	var url=window.location.href;
	var tableau=url.split("/");
	var length=tableau.length;
	var length_1=length-3;
	var url_param_1=tableau[length_1];
	if(url_param_1=="www.future-creation.com"){
		length=length-2;
		url_page=tableau[length];
	}
	if(url_param_1=="equipe"){ // si l'avant dernier c'est equipe 
		length=length-2;
		url_page='equipe_membre';
	}	
	if(url_param_1=="projets"){ // si l'avant dernier c'est projet 
		length=length-2;
		url_page='projet';
	}	
	if(url_param_1!="www.future-creation.com" && url_param_1!="equipe" && url_param_1!="projets" && url_param_1!=""){ // si l'avant dernier c'est equipe 
		length=length-2;
		url_page='instant_one';
	}
	// placement du footer
	var height = getTotalHeight();	
	var height_footer=document.documentElement.clientHeight;	
	$('#test_height').html(hover_home);
	if(height < 720){	
		height_footer2=610; 	
	}else{
		height_footer2=height_footer-50; 
	}
	$('#footer').css("top",height_footer2+"px");
	
	//click sur le logo
	$("#logo_left").bind("click", function(e){
		var url = "";
		url_page="home";
		url = url.replace(/^.*#/, '');
		$.history.load(url); 				
	});
	// click sur les projets
	$(".active_hover").bind("click", function(e){
		var id_projet=$(this).attr('id');
		id_projet=id_projet.replace("projet_","");	
		var url = "#/projet/";
		url = url.replace(/^.*#/, '');
		$('#projet_actuel').val(id_projet);
		$.history.load(url); 
		$('#projet_actuel').val(id_projet);
		$('.select_vignette').css({'opacity':'0'});
		$(this).find('.select_vignette').stop().show().animate({'opacity':'1'},400);		
		var projet_en_cours = $('#projet_en_cours').val();		
		if(projet_en_cours==1){
			var id_actuel=$('#projet_actuel').val();
			if(id_actuel==""){id_actuel=$('#projet_actuel_direct').val();}
			affiche_projet_2(id_actuel);
		}		
		$('#projet_en_cours').val('1');
		return false;
	});
	
	$(".select_click").bind("click", function(e){	
		$('#projet_en_cours').val('1');
		var id_projet=$(this).find('input').attr('value');
		id_projet=id_projet.replace("projet_","");	
		var url = "#/projet/";
		url = url.replace(/^.*#/, '');
		$('#projet_actuel').val(id_projet);
		$.history.load(url); 
		$('#projet_actuel').val(id_projet);
		$('.select_vignette').css({'opacity':'0'});
		var id_projet_select = "li#projet_"+id_projet;
		$(id_projet_select).find('.select_vignette').stop().show().animate({'opacity':'1'},400);
		var projet_en_cours = $('#projet_en_cours').val();		
		if(projet_en_cours==1){
			var id_actuel=$('#projet_actuel').val();
			if(id_actuel==""){id_actuel=$('#projet_actuel_direct').val();}
			affiche_projet_2(id_actuel);
		}	
		$('#projet_en_cours').val('1');
	});

	$(".active_hover").hover(
	  function () {			
		$(this).find('.hover_black').stop().show().animate({'opacity':'1'},400);
		$('#frise_vignette').css('height','137px');
		$(this).find('.hover_title').show().stop().animate({'opacity':'1'},400);
	  },
	  function () {
		$(this).find('.hover_black').stop().animate({'opacity':'0'},400);
		$(this).find('.hover_title').stop().animate({'opacity':'0'},400).hide();
	  }
	);	
	// click sur "l'agence"
	$(".navigation_right, #logo_left").bind("click", function(e){
		$('.select_vignette').css({'opacity':'0'});
		$('#selectDemo1').mSelect('selected',0);
	});	
	$("#nav_agence").bind("click", function(e){
		var url = "#/agence/";
		url = url.replace(/^.*#/, '');
		$.history.load(url); 
		$('#projet_en_cours').val('0');		
		return false;
	});	
	// click sur "l'equipe"
	$("#nav_equipe").bind("click", function(e){
		var url = "#/equipe/";
		url = url.replace(/^.*#/, '');
		$.history.load(url); 
		$('#projet_en_cours').val('0');		
		return false;
	});	
	// click sur "instant"
	$("#nav_instant").bind("click", function(e){
		var url = "#/instant/";
		url = url.replace(/^.*#/, '');
		$.history.load(url); 
		$('#projet_en_cours').val('0');		
		return false;
	});	
	// click sur "contact"
	$("#nav_contact").bind("click", function(e){
		var url = "#/contact/";
		url = url.replace(/^.*#/, '');
		$.history.load(url); 
		$('#projet_en_cours').val('0');		
		return false;
	});		
	// jquery.history
	activateHistory();	
	
	$("#globale").hide();	
	Cufon.replace('h2', {fontFamily: 'ChaletComprime-MilanSixty' });
	Cufon.replace('.hover_title', {fontFamily: 'ChaletComprime-MilanSixty' });
	Cufon.replace('.newsletter_font', {fontFamily: 'ChaletComprime-MilanSixty' });
	// les premières fonctions sont lancées en bas du fichier "nobei.loader.js"
	// reduction_barre_bleu(); et affiche_mael();
	
	//affiche_menu_right(); --> appelée à la fin de : affiche_vignette()
	//affiche_accroche(); --> appelée à la fin de : affiche_menu_right()
});

/**
 * History
 */
function activateHistory(){
	$.history.init(function(hash){	
        if(hash == "" && url_page!='agence' && url_page!='equipe' && url_page!='projet' && url_page!='contact' && url_page!='equipe_membre' && url_page!='instant' && url_page!='instant_one') {
			$('#image_fond_home').fadeIn(400);
			$('#watt').delay(500).fadeIn(800);
			
			navigation_active('');
			$('#projet_en_cours').val('0');		
			$('.button_projet').fadeOut(400);
			if(pageactuel=="page2"){  // page Projet
				menu_middle(0);
				ferme_projet();	
				$('#accroche').delay(1000).fadeIn(800);	
			}
			if(pageactuel=="page3"){ // page Agence
				menu_middle(200);
				ferme_agence(0);	
				$('#accroche').delay(800).fadeIn(1200);				
			}
			if(pageactuel=="page4"){ // page Equipe
				 menu_middle(200);
				ferme_equipe();		
				$('#accroche').delay(1500).fadeIn(800);
			}
			if(pageactuel=="page5"){ // page Equipe membre
				 menu_middle(200);
				ferme_equipe_membre();	
				$('#accroche').delay(1000).fadeIn(800);				
			}
			if(pageactuel=="page6"){ // page contact
				 menu_middle(200);
				 ferme_contact(0);	
				$('#accroche').delay(1000).fadeIn(800);				
			}
			if(pageactuel=="page7"){ // page actualite
				 menu_middle(200);
				 ferme_instant(0);	
				$('#accroche').delay(1000).fadeIn(800);				
			}
			if(pageactuel=="page8"){ // Instant Actualite seule
				menu_middle(200);
				ferme_instant_one(0);	
				$('#accroche').delay(1000).fadeIn(800);				
			}
			if(pageactuel=="page1" || pageactuel=="page0"){
				// animation d'arrivee sur la page 1
				startfooter();
				affiche_vignette();				
				var $main_mael = $('#main_mael');
				var $accroche = $('#accroche');
				$main_mael.fadeIn(800);
				$accroche.fadeIn(800);				
			}
			$('#footer').delay(400).animate({top:height_footer2+'px'}, 1400,'easeOutCirc',function(){$('#corporate_network').fadeIn(800);});
			pageactuel		= "page1";			
        }else if(hash=="/projet/" || (url_page=="projet" && hash=="")){
			$('#image_fond_home').fadeOut(400);
			$('#watt').fadeOut(400);
			$('#corporate_network').fadeOut(400);
			navigation_active('');
			$('#logo_enter').hide();
			var delay_projet=0;
			if(pageactuel=='page0'){
				affiche_vignette();
				startfooter();
			}
			if(pageactuel=='page3'){
				ferme_agence(0);	
			}
			var delay_agence=0;
			if(pageactuel=="page4"){ // page Equipe
				ferme_equipe();
				delay_agence=1200;				
			}
			if(pageactuel=="page5"){ // page Equipe Membre
				ferme_equipe_membre();
				delay_agence=300;				
			}
			if(pageactuel=='page6'){ // page Contact
				ferme_contact(0);
				delay_projet=1000;
			}
			if(pageactuel=="page7"){ // page Instant
				ferme_instant();
				delay_agence=1200;				
			}
			if(pageactuel=="page8"){ // page Instant one
				ferme_instant_one(0);
				delay_agence=300;				
			}
			$('#accroche').fadeOut(800);
			var objet_actuel=$('#objet_actuel').val();
			var id_actuel=$('#projet_actuel').val();
			if(id_actuel==""){id_actuel=$('#projet_actuel_direct').val();}
			hover_home=1;
			affiche_projet(objet_actuel,id_actuel,delay_projet);				
			pageactuel	= "page2";			
			afficheprojet=1;			
        }else if(hash=="/agence/" || (url_page=="agence" && hash=="")){
			$('#image_fond_home').fadeOut(400);
			$('#watt').fadeOut(400);
			$('#corporate_network').fadeOut(400);
			navigation_active('agence');
			$('#logo_enter').hide();
			if(pageactuel=='page0'){
				affiche_vignette();
				startfooter();
			}
			if(pageactuel=='page2'){
				ferme_projet();
			}
			var delay_agence=0;
			if(pageactuel=="page4"){ // page Equipe
				ferme_equipe();
				delay_agence=1200;				
			}
			if(pageactuel=="page5"){ // page Equipe Membre
				ferme_equipe_membre();
				delay_agence=300;				
			}
			if(pageactuel=='page6'){ // page Contact
				ferme_contact(0);
				delay_agence=1200;	
			}
			if(pageactuel=="page7"){ // page Instant
				ferme_instant();
				delay_agence=1200;				
			}
			if(pageactuel=="page8"){ // page Instant one
				ferme_instant_one(0);
				delay_agence=900;				
			}
			$('#accroche').fadeOut(800);
			affiche_agence(delay_agence);	
			pageactuel	= "page3";			
		}else if(hash=="/equipe/" || (url_page=="equipe" && hash=="")){
			$('#image_fond_home').fadeOut(400);
			$('#watt').fadeOut(400);
			$('#corporate_network').fadeOut(400);
			navigation_active('equipe');
			$('#logo_enter').hide();
			if(pageactuel=='page0'){
				affiche_vignette();
				startfooter();
			}
			if(pageactuel=='page2'){
				ferme_projet();
			}
			var delay_equipe=0;
			if(pageactuel=='page3'){ // agence
				delay_equipe=1000;
				ferme_agence(0);
			}
			if(pageactuel=='page5'){
				delay_equipe=1000;
				ferme_equipe_membre(0);
			}
			if(pageactuel=='page6'){ // contact
				delay_equipe=1000;
				ferme_contact(0);
			}
			if(pageactuel=='page7'){
				delay_equipe=1000;
				ferme_instant(0);
			}
			if(pageactuel=='page8'){
				delay_equipe=1000;
				ferme_instant_one(0);
			}
			$('#accroche').fadeOut(800);
			affiche_equipe(delay_equipe);						
			pageactuel	= "page4";			
		}else if(hash=="/equipe_membre/"  || (url_page=="equipe_membre" && hash=="")){
			$('#image_fond_home').fadeOut(400);
			$('#watt').fadeOut(400);
			$('#corporate_network').fadeOut(400);
			navigation_active('equipe');
			$('#logo_enter').hide();
			var delay_equipe_membre=0;
			if(pageactuel=='page0'){
				affiche_vignette();
				startfooter();
			}
			if(pageactuel=='page2'){
				ferme_projet();
			}
			if(pageactuel=='page3'){
				ferme_agence(0);
				delay_equipe_membre=1000;
			}
			
			if(pageactuel=='page4'){
				ferme_equipe();
				delay_equipe_membre=1100;
			}
			if(pageactuel=='page6'){
				ferme_contact(0);
				delay_equipe_membre=1000;
			}
			if(pageactuel=='page7'){
				ferme_instant(0);
				delay_equipe_membre=1000;
			}
			if(pageactuel=='page8'){
				ferme_instant_one(0);
			}
			$('#accroche').fadeOut(800);
			affiche_equipe_membre(delay_equipe_membre);						
			pageactuel	= "page5";			
		}else if(hash=="/contact/"|| (url_page=="contact" && hash=="")){
			$('#image_fond_home').fadeOut(400);
			$('#watt').fadeOut(400);
			$('#corporate_network').fadeOut(400);
			navigation_active('contact');
			$('#logo_enter').hide();
			if(pageactuel=='page0'){
				affiche_vignette();
				startfooter();
			}
			if(pageactuel=='page2'){
				ferme_projet();
			}
			var delay_contact=0;
			if(pageactuel=='page3'){
				ferme_agence(0);
				delay_contact=1000;
			}			
			if(pageactuel=="page4"){ // page Equipe
				ferme_equipe();		
			}
			if(pageactuel=="page5"){ // page Equipe Membre
				ferme_equipe_membre();				
			}
			if(pageactuel=='page7'){
				ferme_instant(0);
				delay_contact=650;
			}
			if(pageactuel=="page8"){ // page instant one
				ferme_instant_one(0);	
				delay_contact=900;				
			}
			$('#accroche').fadeOut(800);
			affiche_contact(delay_contact);						
			pageactuel	= "page6";
		}else if(hash=="/instant/" || (url_page=="instant" && hash=="")){
			$('#image_fond_home').fadeOut(400);
			$('#watt').fadeOut(400);
			$('#corporate_network').fadeOut(400);
			navigation_active('instant');
			var delay_instant=300;
			$('#logo_enter').hide();
			if(pageactuel=='page0'){
				affiche_vignette();
				startfooter();
			}
			if(pageactuel=='page2'){
				ferme_projet();
			}
			if(pageactuel=='page3'){
				ferme_agence(0);
				delay_instant=900;
			}
			
			if(pageactuel=="page4"){ // page Equipe
				ferme_equipe();			
			}
			if(pageactuel=="page5"){ // page Equipe Membre
				ferme_equipe_membre();				
			}
			if(pageactuel=='page6'){
				ferme_contact(0);				
				delay_instant=1000;
			}
			if(pageactuel=="page8"){ // page instant one
				ferme_instant_one(0);
				delay_instant=1000;				
			}
			$('#accroche').fadeOut(800);
			affiche_instant(delay_instant);						
			pageactuel	= "page7";
		}else if(hash=="/instant_actualite/" || (url_page=="instant_one" && hash=="")){
			$('#image_fond_home').fadeOut(400);
			$('#watt').fadeOut(400);
			$('#corporate_network').fadeOut(400);
			var delai_instant_one=0;
			navigation_active('instant');
			$('#logo_enter').hide();
			if(pageactuel=='page0'){
				affiche_vignette();
				startfooter();
			}
			if(pageactuel=='page2'){
				ferme_projet();
			}
			if(pageactuel=='page3'){
				ferme_agence(0);
				delai_instant_one=900;
			}
			if(pageactuel=="page4"){ // page Equipe
				ferme_equipe();			
			}
			if(pageactuel=="page5"){ // page Equipe Membre
				ferme_equipe_membre();			
			}
			if(pageactuel=='page6'){ // page contact
				ferme_contact(0);
				delai_instant_one=900;
			}
			if(pageactuel=="page7"){ // page instant
				delai_instant_one=1000;
				ferme_instant(0);				
			}
			$('#accroche').fadeOut(800);
			affiche_instant_one(delai_instant_one);						
			pageactuel	= "page8";
		}
		return false; //on desactive le lien reel
    },
    { unescape: ",/" });
}

/** 
	REND ACTIF UN MENU
*/
function navigation_active(menu_actif){
	$('#li_agence a').removeClass('nav_agence_active');
	$('#li_equipe a').removeClass('nav_equipe_active');
	$('#li_instant a').removeClass('nav_instant_active');
	$('#li_contact a').removeClass('nav_contact_active');
	if(menu_actif != ""){
		var li_actif="#li_"+menu_actif+" a";
		var class_active="nav_"+menu_actif+"_active";
		$(li_actif).addClass(class_active);
	}
}

/**
	RESIZE
*/
$(window).resize(function() {
	var support = DetectMobile();
	if(support==false){
		$('#content_main').jScrollPaneRemove();
		$('#content_main').jScrollPane();
	}
	$('#menu_ombre').css('width', $(window).width() + 'px');

	var height_total=getTotalHeight();
	if(pageactuel=="page0" || pageactuel=="page1"){
		var top_menu=height_total/2;
		top_menu=top_menu-126;
		$('#menu').css('top',top_menu+'px'); // deplacement de la barre de menu
	}	
		
	if(pageactuel=="page2"){  // placement du projet
		var height_fenetre=document.documentElement.clientHeight;
		var top = height_fenetre - 250 -375;
		top=top/2;
		top=top + 120;
		if(top<150){top=150;}
		$('#projet_content').css('top',top+'px');
		var height_container=getTotalHeight();	
		height_container=height_container-140;	
		if(height_container<630){height_container=630;}
		$('#projet_container').css("height",height_container+"px");		
	}
	
	// placement ...		
	var height_footer=document.documentElement.clientHeight;	
	$('#test_height').html(height_total);
	if(height_total < 720){	
		height_footer2=675; 	
		if(pageactuel=="page0" || pageactuel=="page1"){height_footer2=610; 	}
		// $('#content_main').css('overflow-y','auto');
	}else{
		height_footer2=height_footer-50; 
	}
	$('#footer').css("top",height_footer2+"px"); // ... du footer		
	if(pageactuel=="page3"){
		if(height_total > 800){
			height_menu=height_footer2-280;	
			top_agence="50%";
			margin_agence="-340px";
		}else{
			height_menu=height_footer2-280;	
			top_agence="-10px";
			margin_agence="0px";	
		}		
		
		$('#agence_content').css({top:top_agence,'margin-top':margin_agence});	
		$('#menu').css({top:height_menu+'px'}); // ... de la barre menu dans la page agence		
	}
	
	if(pageactuel=="page4"){
		if(height_total > 800){
			height_menu=height_footer2-280;	
			top_agence="50%";
			margin_agence="-340px";
		}else{
			height_menu=height_footer2-280;	
			top_agence="-10px";
			margin_agence="0px";	
		}		
		$('#equipe_content').css({top:top_agence,'margin-top':margin_agence});	
		$('#menu').css({top:height_menu+'px'}); // ... de la barre menu dans la page agence		
	}
	if(pageactuel=="page5"){
		if(height_total > 800){
			height_menu=height_footer2-280;	
			top_agence="50%";
			margin_agence="-340px";
		}else{
			height_menu=height_footer2-280;	
			top_agence="-10px";
			margin_agence="0px";	
		}		
		$('#equipe_membre_content').css({top:top_agence,'margin-top':margin_agence});	
		$('#menu').css({top:height_menu+'px'}); // ... de la barre menu dans la page agence		
	}
	if(pageactuel=="page6"){
		if(height_total > 800){
			height_menu=height_footer2-280;	
			top_agence="50%";
			margin_agence="-340px";
		}else{
			height_menu=height_footer2-280;	
			top_agence="-10px";
			margin_agence="0px";	
		}		
		$('#contact_content').css({top:top_agence,'margin-top':margin_agence});	
		$('#menu').css({top:height_menu+'px'}); // ... de la barre menu dans la page agence		
	}
	if(pageactuel=="page7"){
		if(height_total > 800){
			height_menu=height_footer2-280;	
			top_agence="50%";
			margin_agence="-340px";
		}else{
			height_menu=height_footer2-280;	
			top_agence="-10px";
			margin_agence="0px";	
		}		
		$('#instant_content').css({top:top_agence,'margin-top':margin_agence});	
		$('#menu').css({top:height_menu+'px'}); // ... de la barre menu dans la page agence		
	}
	if(pageactuel=="page8"){
		if(height_total > 800){
			height_menu=height_footer2-280;	
			top_agence="50%";
			margin_agence="-340px";
		}else{
			height_menu=height_footer2-280;	
			top_agence="-10px";
			margin_agence="0px";	
		}		
		$('#instant_one_content').css({top:top_agence,'margin-top':margin_agence});	
		$('#menu').css({top:height_menu+'px'}); // ... de la barre menu dans la page agence		
	}
});

/**
	HAUTEUR DE LA FENETRE
*/
function getTotalHeight() {
	// firefox is ok
	// var height = document.documentElement.scrollHeight;
	var height = document.body.scrollHeight;
	// now IE 7 + Opera with "min window"
	if(document.documentElement.clientHeight > height ) {
	height = document.documentElement.clientHeight;
	}
	// last for safari
	if(document.body.scrollHeight > height) {
	height = document.body.scrollHeight;
	}	
	return height;
}

/**
	FONCTION POUR FICHIER AJAX
*/
function file(url){
	try { xhr_object = new ActiveXObject("Microsoft.XMLHTTP");}
	catch(e){ xhr_object = new XMLHttpRequest();}
	xhr_object.open("GET",url,false);xhr_object.send(null);if(xhr_object.readyState==4)
	return(xhr_object.responseText);else
	return(false);
}

/**
	HOVER SUR LE MENU (agrandissement des vignettes)
*/
function hover_home_thumb(){
	$(".active_hover").hover(
	function () {if(hover_home==1){$("#vignettes").css("height","270px");$(this).stop().animate({width:'264px',height:'230px'},800);$(this).find("img").stop().animate({width:'264px',height:'170px'},700);}},
	function () {$(this).stop().animate({width:'132px',height:'88px'},800);$("#vignettes").css("height","140x");$(this).find("img").stop().animate({width:'132px',height:'88px'},800);});	
}

function prochaine_anim(anim){
	if(anim=="equipe"){affiche_equipe(100);}
	if(anim=="equipe_membre"){affiche_equipe_membre(100);}
	if(anim=="agence"){affiche_agence(100);}
	if(anim=="projet"){	
		var objet_actuel=$('#objet_actuel').val();
		var id_actuel=$('#projet_actuel').val();
		if(id_actuel==""){id_actuel=$('#projet_actuel_direct').val();}
		affiche_projet(objet_actuel,id_actuel,100);
	}
	if(anim=="instant"){affiche_instant(100);}
	if(anim=="instant_one"){affiche_instant_one(100);}
	if(anim=="contact"){affiche_contact(100);}
}



/**
	AFFICHAGE D'UN PROJET
*/
	function affiche_projet_2(id_actuel){
		var id_projet_actuel=id_actuel;
		var tri_projet=$('#tri_actuel').val();
		var tri_actuel=$('#tri_actuel_name').val();
		var load_project = file("http://www.future-creation.com/wp-content/themes/futurecreation_emilie/projet_load.php?id="+id_projet_actuel+"&action=none&tri="+tri_projet+"&tri_actuel="+tri_actuel);
		$('#loading_projet').fadeIn(400);		 
		$('.active_content_left').removeClass('.active_content_left');	
		$('.active_projet #slider a').fadeOut(100);			
		$('.active_projet').stop().animate({'top':'140px'},400,function(){	
			$('.cache_projet').css('overflow','hidden');
			$('.active_projet').animate({'top':'550px'},600,function(){
				$('.active_projet .carousel_projet_video').html('');
				$('#projet_content').append(load_project);				
				$('.next_projet').fadeIn(100,function(){
					$('#loading_projet').fadeOut(400);
					$('.next_projet').animate({'top':'140px'},400,function(){
						$('.next_projet').animate({'top':'200px'},400);
						$('.cache_projet').css('overflow','visible');								
						$('.next_projet #slider a').show();		
						$(".next_projet .carousel_acteur").hide();
						$(".next_projet .carousel_acteur").show();
						$(".next_projet .carousel_acteur").jCarouselLite({
							btnNext: ".next_acteur",
							visible : 4,
							start:0
						});								
						$(this).removeClass('next_projet');
						$(this).addClass('active_projet');										
					});					
				});					 
				$(this).removeClass('active_projet');
				$(this).parent().hide();			
				$(this).remove();	   			
			});		
		});		
	}


function affiche_projet(objet_actuel, id_projet,delay_projet){
	page="projet";	
	prochaine_animation="projet";
	if(animation_en_cours==0){
		animation_actuelle="projet";
		animation_en_cours=1;
		affiche_page(delay_projet,page);
		var height_fenetre=document.documentElement.clientHeight;
		var top = height_fenetre - 250 -375;
		top=top/2;
		top=top + 120;
		if(top<150){top=150;}
		// $('#projet_content').css({'top':'-450px'});
		var delay_projet2=delay_projet+1600;
		
		$('#projet_content').delay(delay_projet2).animate({'top':top+'px'}, 1800,'easeOutCirc',function(){
			$('.projet_wrapper').fadeIn( 1000,'easeOutCirc');
			$('.button_projet').fadeIn(400);		
			$(".carousel_acteur").jCarouselLite({
				btnNext: ".next_acteur",
				visible : 4,
				start:0
			});
			
			
			$(".carousel_projet_video").show();
	
					
			$(".carousel_acteur li").bind("click", function(e){
				var url = "#/equipe_membre/";
				url = url.replace(/^.*#/, '');
				$.history.load(url); 
				var id_membre=$(this).attr('id');
				id_membre=id_membre.replace("equipe_","");	
				$('#membre_actuel').val(id_membre);
				return false;
			});
			img_rollover();		
		});	
		animation_en_cours = 0;
	}	
}

/**
	FERMETURE D'UN PROJET
*/
function ferme_projet(){
	$('.button_projet').fadeOut(600);
	$('#projet_content').stop().delay(100).fadeOut(400,function(){
	 $('.active_projet .carousel_projet_video').html('');
	 $('#projet_content').hide();
		animation_en_cours=0;
	 if(animation_actuelle!=prochaine_animation){
		prochaine_anim(prochaine_animation);
	 }	 
	});	
} 

/**
	AFFICHAGE D'UNE PAGE
*/
function affiche_page(delay_agence,page){
	$(".button_projet").hide();
	var page_content='#'+page+'_content';
	var delay_tmp=0;
	if(page=="agence"){var page_php=page+'.php?id=80';}else{
		if(page=="equipe_membre"){
			var id_membre=$('#membre_actuel').val();
			// si l'url est rentrée directement :
			if(id_membre==""){id_membre=$('#membre_actuel_direct').val();}
			var page_php=page+'.php?id_membre='+id_membre;
		}else{ 
			if(page=="instant_one"){
				var id_instant="";
				id_instant=$('#actu_actuel').val();
				if(id_instant==""){id_instant=$('#actu_actuel_direct').val();}
				var page_php=page+'.php?id='+id_instant;
			}else{
				if(page=="projet"){
					var id_projet=$('#projet_actuel').val();
					// var tri_projet=$('#tri_actuel').val();
					if(id_projet==""){id_projet=$('#projet_actuel_direct').val();}
					delay_tmp=400;
					var page_php=page+'.php?id='+id_projet;
				}else{
					var page_php=page+'.php';
				}
			}
		}
	}
	
	hover_home=1;
	var height_footer=document.documentElement.clientHeight;
	if(height < 700){	
		height_footer=800; 		
	}else{
		height_footer=height_footer-50; 
	}
	if(height_footer2==610){var top_footer=height_footer2+100;}
	$('#footer').delay(delay_tmp).animate({top:top_footer+'px'}, 1400,'easeOutCirc');
	var height = getTotalHeight();	
	if(height > 800){ 	height_menu=height_footer-280;	 }else{height_menu=420;}
	$('#menu').css({height:'315px'});
	if(page=="projet"){height_menu="-43";}
	$('#menu').delay(delay_tmp).animate({top:height_menu+'px'}, 1400,'easeOutCirc');
	var load_agence = file("http://www.future-creation.com/wp-content/themes/futurecreation_emilie/"+page_php);
	var projet_en_cours = $('#projet_en_cours').val();
	if(projet_en_cours==1){
	}else{
		$(page_content).css({'top':'-450px'});
	}
	
	$('.barre_horizontale').hide();
	$(page_content).html(load_agence);
	$(page_content).show();
	if(height > 800){
		top_agence="50%";
		margin_agence="-340px";
	}else{
		top_agence="0px";
		margin_agence="0px";	
	}				
}

/**
	AFFICHAGE DE LA PAGE AGENCE
*/
function affiche_agence(delay_agence){
	prochaine_animation="agence";
	if(animation_en_cours==0){
		animation_actuelle="agence";
		animation_en_cours=1;
		page="agence";	
		affiche_page(delay_agence,page);
		$("#agence_ul").show();
		$('#agence_content').stop().delay(delay_agence).animate({top:top_agence,'margin-top':margin_agence},2000,'easeOutCirc',function(){
			if ($my.navigateur==7 || $my.navigateur==8) {$('.barre_horizontale').show();}else{
			$('.barre_horizontale').fadeIn(800);
		 }			
			animation_en_cours=0;		
		});	
	}
}

/**
	FERMETURE DE LA PAGE AGENCE
*/
function ferme_agence(delay_ferme_agence){
	animation_en_cours=1;
	$('#agence_content').stop().delay(delay_ferme_agence).animate({'top':'-450px'},1400,function(){
	 $('#agence_content').hide();
	 animation_en_cours=0;
	 if(animation_actuelle!=prochaine_animation){
		prochaine_anim(prochaine_animation);
	 }
	});
} 


/**
	AFFICHAGE DE LA PAGE EQUIPE
*/
function affiche_equipe(delay_equipe){
	if ($my.navigateur==7 || $my.navigateur==8) {
		$('#equipe_ul li').css({'background':'none'});
	}
	prochaine_animation="equipe";
	if(animation_en_cours==0){
		animation_actuelle="equipe";
		animation_en_cours=1;
		var page="equipe";
		affiche_page(delay_equipe,page);	
		// affichage des vignettes une par une
		$('#equipe_content').css({top:top_agence,'margin-top':margin_agence});	
		$("#equipe_content").find('li').each(function(index) {
			var nb_total_li=$("#equipe_content").find('li').size();
			nb_total_li=nb_total_li-1;
			if(index==0){
				$(this).stop().delay(delay_equipe).fadeIn(400);
			}else{
				$(this).stop().delay(delay_equipe+(250*index)).fadeIn(400,function(){
					if(index==nb_total_li){
						if(animation_actuelle=="equipe"){
							animation_en_cours=0;
						}
					}
				});				
			}
			
		});
		Cufon.replace('h1, h2', {fontFamily: 'ChaletComprime-MilanSixty' });	
		// hover sur les vignettes
		$(".equipe_cadre_hover").hover(
			function () {
				$(this).find('.equipe_hover').stop().animate({'top':'0px'},800,'easeOutExpo');
			},
			function () {
				$(this).find('.equipe_hover').stop().animate({'top':'134px'},400);
		});	
		// click sur "un membre de l'équipe"
		$("#equipe_ul li").bind("click", function(e){
			var id_membre=$(this).attr('id');
			id_membre=id_membre.replace("equipe_","");	
			
			var url = "#/equipe_membre/";
			url = url.replace(/^.*#/, '');
			$('#membre_actuel').val(id_membre);
			$.history.load(url); 
			return false;
		});		
	}
	// else{
		// setTimeout('affiche_equipe(100)',500);
		 // setInterval('verif_animation()',100);
		 // if(animation_en_cours==0){affiche_equipe();}
	// }
}
// function verif_animation(){
	// return animation_en_cours;
// }
/**
	FERMETURE DE LA PAGE EQUIPE
*/
function ferme_equipe(){
	animation_en_cours=1;
	var nb_li = $("#equipe_content li").size();
	function rembobine_equipe(nb_li){
		$("#equipe_content li").eq(nb_li).fadeOut(100,function(){
			$(this).removeClass('equipe_last');
			$("#equipe_content li:last-child").addClass('equipe_last');
			nb_li=nb_li-1;
			if(nb_li != -1){
				rembobine_equipe(nb_li);
			}else{
				$('#equipe_content').hide();	
				animation_en_cours=0;
				 if(animation_actuelle!=prochaine_animation){
					prochaine_anim(prochaine_animation);
				 }
			}
		});		
	}	
	rembobine_equipe(nb_li-1);	
}

/**
	AFFICHAGE DE LA PAGE MEMBRE EQUIPE
*/
function affiche_equipe_membre(delay_agence){
	var page="equipe_membre";
	prochaine_animation="equipe_membre";
	if(animation_en_cours==0){
		animation_actuelle="equipe_membre";
		animation_en_cours=1;
	
	affiche_page(delay_agence,page);
	
	$('#equipe_membre_content').css({'top':top_agence,'margin-top':margin_agence,'display':'none'});
	$("#equipe_membre_content #agence_ul").show();
	$('#equipe_membre_content').stop().delay(delay_agence).fadeIn(800,function(){
		if ($my.navigateur==7 || $my.navigateur==8) {$('.barre_horizontale').show();}else{
			$('.barre_horizontale').fadeIn(800);
		 }			
		// carousel des projets d'un membre
		$(".carousel_membre").jCarouselLite({
			btnNext: ".next_membre",
			visible : 3,
			start:0
		});
		
		$(".carousel_membre li").bind("click", function(e){
			// var url = "#/projet/";
			// url = url.replace(/^.*#/, '');
			// $.history.load(url); 
			// var id_projet=$(this).attr('id');
			// id_projet=id_projet.replace("projet_","");	
			// $('#projet_actuel').val(id_projet);
			// return false;
			var id_projet=$(this).attr('id');
			id_projet=id_projet.replace("projet_","");	
			var url = "#/projet/";
			url = url.replace(/^.*#/, '');
			$('#projet_actuel').val(id_projet);
			$.history.load(url); 
			$('#projet_actuel').val(id_projet);
			$('.select_vignette').css({'opacity':'0'});
			$(this).find('.select_vignette').stop().show().animate({'opacity':'1'},400);		
			var projet_en_cours = $('#projet_en_cours').val();		
			if(projet_en_cours==1){
				var id_actuel=$('#projet_actuel').val();
				if(id_actuel==""){id_actuel=$('#projet_actuel_direct').val();}
				affiche_projet_2(id_actuel);
			}		
			$('#projet_en_cours').val('1');
			return false;
		});
		
		img_rollover();
	});
	}
}

/**
	FERMETURE DE LA PAGE MEMBRE EQUIPE
*/
function ferme_equipe_membre(delay_equipe){
	$('#equipe_membre_content').fadeOut(1500,function(){	
	 $('#equipe_membre_content').hide();
	 animation_en_cours=0;
	 if(animation_actuelle!=prochaine_animation){
		prochaine_anim(prochaine_animation);
	 }
	});
} 

/**
	AFFICHAGE DE LA PAGE INSTANT
*/
function affiche_instant(delay_agence){
	prochaine_animation="instant";
	if(animation_en_cours==0){
		animation_actuelle="instant";
		animation_en_cours=1;
		var page="instant";
		affiche_page(delay_agence,page);
		$(".carousel_actu").show();
		// carousel des actualités	
		$(".carousel_actu").jCarouselLite({
			btnNext: ".next_actu",
			btnPrev: ".prev_actu",
			visible : 4,
			start:0
		});		
		$("#instant_content").stop().delay(delay_agence).animate({top:top_agence,'margin-top':margin_agence},2000,'easeOutCirc',function(){
			if ($my.navigateur==7 || $my.navigateur==8) {$('.barre_horizontale').show();}else{
			$('.barre_horizontale').fadeIn(800);
		 }			
			animation_en_cours=0;
		});	
		
		// hover sur les actualités
		$("#instant_ul li").hover(
			function () {
				$(this).find('h1').stop().animate({'color':'#39a0c0'});
				$(this).find('.hover_actu').stop().animate({'width':'216px','height':'160px'},800,'easeOutCirc');
			},
			function () {
				$(this).find('h1').stop().animate({'color':'#6a6867'});
				$(this).find('.hover_actu').stop().animate({'width':'0px','height':'0px'},600,'easeOutCirc');
			}
		);		
		// click sur "un membre de l'équipe"
		$("#instant_ul li").bind("click", function(e){		
			var id_actu=$(this).attr('id');		
			id_actu=id_actu.replace("actu_","");			
			var url = "#/instant_actualite/";
			url = url.replace(/^.*#/, '');
			$('#actu_actuel').val(id_actu);		
			$.history.load(url); 
			return false;
		});
	}
}

/**
	FERMETURE DE LA PAGE INSTANT
*/
function ferme_instant(delay_ferme_agence){
	animation_en_cours=1;
	$('#instant_content').stop().delay(delay_ferme_agence).animate({'top':'-450px'},1400,function(){	
	 $('#instant_content').hide();	
	 animation_en_cours=0;
	 if(animation_actuelle!=prochaine_animation){
		prochaine_anim(prochaine_animation);
	 }
	});
} 

/**
	AFFICHAGE DE LA PAGE INSTANT ONE
*/
function affiche_instant_one(delay_instant_one){
	var page="instant_one";
	prochaine_animation="instant_one";
	if(animation_en_cours==0){
		animation_actuelle="instant_one";
		animation_en_cours=1;
	
	affiche_page(delay_instant_one,page);	
	$("#instant_one_content #agence_ul").show();
	$('#instant_one_content').stop().delay(delay_instant_one).animate({top:top_agence,'margin-top':margin_agence},2000,'easeOutCirc',function(){
		if ($my.navigateur==7 || $my.navigateur==8) {$('.barre_horizontale').show();}else{
			$('.barre_horizontale').fadeIn(800);
		 }				
	});	
	}	
}

/**
	FERMETURE DE LA PAGE INSTANT ONE
*/
function ferme_instant_one(delay_ferme_instant_one){
	$('#instant_one_content').stop().delay(delay_ferme_instant_one).animate({'top':'-450px'},1400,function(){	
	 $('#instant_one_content').hide();	
	  animation_en_cours=0;
	 if(animation_actuelle!=prochaine_animation){
		prochaine_anim(prochaine_animation);
	 }
	});
} 

/**
	AFFICHAGE DE LA PAGE CONTACT
*/
function affiche_contact(delay_contact){
	prochaine_animation="contact";
	if(animation_en_cours==0){
		animation_actuelle="contact";
		animation_en_cours=1;
		var page="contact";
		affiche_page(delay_contact,page);
		$("#contact_content").stop().delay(delay_contact).animate({top:top_agence,'margin-top':margin_agence},2000,'easeOutCirc',function(){
			if ($my.navigateur==7 || $my.navigateur==8) {$('.barre_horizontale').show();}else{
			$('.barre_horizontale').fadeIn(800);
		 }			
			animation_en_cours=0;		
		});	
	}
}

/**
	FERMETURE DE LA PAGE CONTACT
*/
function ferme_contact(delay_ferme_contact){
	$('#contact_content').stop().delay(delay_ferme_contact).animate({'top':'-450px'},1400,function(){	
	 $('#contact_content').hide();	 
	 animation_en_cours=0;
	 if(animation_actuelle!=prochaine_animation){
		prochaine_anim(prochaine_animation);
	 }
	});
} 

/**
	REPLACE LE MENU A SA PLACE INITIALE
*/
function menu_middle(delay_menu){	
	var height_total=getTotalHeight();
	var top_menu=height_total/2;
	top_menu=top_menu-76;	
	$('#menu').delay(delay_menu).stop().animate({'top':top_menu+'px'},1400);
}
/**
	ANIMATION DE LA BARRE BLEU A L'ARRIVEE SUR LE SITE
	(permet l'affichage des vignettes projets)
*/
function reduction_barre_bleu(){
	var $logo_enter = $('#logo_enter');
	if ($my.navigateur==7 || $my.navigateur==8) {$logo_enter.hide();}else{$logo_enter.fadeOut(800);}	
	$('#menu_main').delay(1000).animate({height:'110px'}, 500);
}

/**
	AFFICHAGE DE L'ARRIERE-PLAN
*/
function affiche_mael(){	
	var $main_mael = $('#main_mael');
	if ($my.navigateur==7 || $my.navigateur==8) {$main_mael.show();}else{$main_mael.fadeIn(800);}
	$("#logo_left_annecy_paris").delay(400).animate({left:'256px'}, 1000, 'easeOutBack');
	$("#logo_left").delay(600).animate({left:'19px'}, 800, 'easeOutBack',function(){
		affiche_menu_right();
	});	
}

/**
	AFFICHAGE DES VIGNETTES PROJET
*/
function affiche_vignette(){
	$('#menu_zonevignettes').show();
}

/**
	AFFICHAGE DE LA NAVIGATION
*/
function affiche_menu_right(){	 
    $('#menu_right li').each(function(index) {
		$(this).delay(600*index).animate({left:'21px'}, 800, 'easeOutBack',function(){
			affiche_accroche();
			if(index==3){
				if ($my.navigateur==7 || $my.navigateur==8){
					$('#ombre_right_tri').show();
					$('#content_tri').animate({'right':'138px'},1400,function(){$('#menu_right').css({'background':'none','z-index':'9999999999'});});
					$('#ombre_left_tri').show(400);
					$('#select_projet').delay(1500).animate({'right':'254px'},1400);		
				}else{
					$('#ombre_right_tri').fadeIn(800,function(){
						$('#content_tri').animate({'right':'138px'},1400,function(){$('#menu_right').css({'background':'none','z-index':'9999999999'});});
						$('#ombre_left_tri').fadeIn(400);
						$('#select_projet').delay(1500).animate({'right':'254px'},1400);
					});		
				}				
			}
		});
  });
}

/**
	AFFICHAGE DE L'ACCROCHE ( L'agence Globale... )
*/
function affiche_accroche(){
	$("#agence").animate({left:'50px'}, 1000, 'easeOutBack');
	$("#globale").delay(200).show().animate({top:'90px'}, 1000, 'easeOutBack',function(){
		$("#communication").animate({top:'55px'}, 1000, 'easeOutBack');
		$("#visuelle").delay(200).animate({top:'55px'}, 1000, 'easeOutBack');
		$("#et").delay(400).animate({top:'57px'}, 1000, 'easeOutBack');
		$("#interactive").delay(600).animate({top:'55px'}, 1000, 'easeOutBack',function(){
			// $('#image_fond_home').fadeIn(800);
		});
	});
}

/**
	ANIMATION DU FOOTER
*/ 
function startfooter(){  footer_showvignette("#footervignette1", 2000);
  footer_showvignette("#footervignette2", 2500);
  footer_showvignette("#footervignette3", 3000);
  footer_showvignette("#footervignette4", 3500);
  footer_showvignette("#footervignette5", 4000);
  footer_showtext(4500);
  footer_show_ico_nav_clavier(4500);  
  $("#footervignette5").hover(
	function () {
		$('#content_newsletter span').stop().delay(100).fadeTo(500,1);
		$('#content_newsletter input').stop().delay(400).fadeTo(500,1);
		$('#content_newsletter button').stop().delay(700).fadeTo(500,1);
		$('#newsletter_trait').stop().animate({'width':'286px'},1100);
		if ($my.navigateur==7 || $my.navigateur==8){$('#content_newsletter span,#content_newsletter button,#content_newsletter input').css('visibility','visible');}
	},
	function(){}
  );	
	
	$("#footervignette5").parent().hover(
	function () {},
	function(){
		$('#newsletter_trait').stop().animate({'width':'0px'},1300);
		$('#content_newsletter span').stop().delay(700).fadeTo(500,0);
		$('#content_newsletter input').stop().delay(400).fadeTo(500,0);
		$('#content_newsletter button').stop().delay(100).fadeTo(500,0);
		if ($my.navigateur==7 || $my.navigateur==8){$('#content_newsletter span,#content_newsletter button,#content_newsletter input').css('visibility','hidden');}
	});	
}
function footer_showvignette(theid, thedelay){  
 $(theid+" .vignette_ombre").delay(thedelay+1000).fadeIn(600); 
 $(theid+" .vignette_item img").delay(thedelay).animate({bottom:'-7px'}, 700, 'easeOutBack');
 $(theid+" .vignette_reflet img").delay(thedelay).animate({top:'-7px'}, 700, 'easeOutBack'); 
 //on active le mouseover et le mouseout
 $(theid+" ").mouseenter(function(){
	$(theid+" .vignette_item img").stop().animate({bottom:'-3px'}, 400, 'easeOutBack');
	$(theid+" .vignette_reflet img").stop().animate({top:'-3px'}, 400, 'easeOutBack');
 }).mouseleave(function(){
	$(theid+" .vignette_item img").stop().animate({bottom:'-7px'}, 400, 'easeOutBack');
	$(theid+" .vignette_reflet img").stop().animate({top:'-7px'}, 400, 'easeOutBack');
 });
 // $(theid+" ").click(function(){
	// $(theid+" .vignette_item img").stop().animate({bottom:'-40px'}, 700, 'easeOutBack');
	// $(theid+" .vignette_reflet img").stop().animate({top:'-40px'}, 700, 'easeOutBack');	
	// return false;	 
 // });
	$('#drag_img').show();
}
function footer_showtext(thedelay){
 $("#footertext").delay(thedelay).animate({top:'15px'}, 700, 'easeOutBack');
}
function footer_show_ico_nav_clavier(thedelay){
	$("#icone_nav_clavier").delay(thedelay).animate({bottom:'18px'}, 700, 'easeOutBack',function(){
		// $('#content_main').css('overflow-y','auto');
	});
}
