/* GESTION TOUCHES CLAVIER */

	/*popup mentions légales*/
	function popupcentree(page,largeur,hauteur,options)
	{
		var top=(screen.height-hauteur)/2;
		var left=(screen.width-largeur)/2;
		window.open(page,"","top="+top+",left="+left+",width="+largeur+",height="+hauteur+","+options);
	} 

	/* touches clavier*/
			jQuery(document).bind('keydown', function(e){
				/* diapo suivant*/
				if(e.which==40){
					/* si diapo*/
					if('function' == typeof(stopAutoplay)){
						diaposuivant();
					}
				/* diapo precedent*/
				}else if(e.which==38){
					/* si diapo*/
					if('function' == typeof(stopAutoplay)){
						diapoprecedent();
					}
				}
				/* page suivante */
				else if(e.which==39){
					document.location=document.getElementById('pagesuivant').href;
				}
				/* page precedente */
				else if(e.which==37){
					document.location=document.getElementById('pageprecedent').href;
				}
			});

			
/* CHANGEMENTS DE COULEURS SURVOL BOUTONS + SCROLL*/

		function chargement(){

			/* voir si boutons diapo à cacher (page références)*/
			if (typeof references != "undefined" && references==true) {
				visible="";
				boutonsdiapo();
				window.onresize=boutonsdiapo;
			}
			
			/* scroll de 340px (pour formulaire de contact) */
			if (typeof scroller != "undefined" && scroller==true) {
				this.scroll(1,340);
			}

			/* si shadowbox=true => shadowbox ; défilement continu*/
			if(typeof shadowbox != "undefined" && shadowbox==true){
				Shadowbox.init({continuous:true});
			}
			
			/* si click sur bouton suivant précédent shadowbox*/
			if(typeof shadowbox != "undefined" && shadowbox==true){
				document.getElementById('sb-nav-next').onclick=diaposuivant;
				document.getElementById('sb-nav-previous').onclick=diapoprecedent;
			}

		}
		
		

/* APPARITION DU DIAPO AU CHARGEMENT DE LA PAGE, MISE EN CACHE*/

		jQuery(document).ready(function(){
		
			/* apparition diapo progressive*/
			if(document.getElementById("content")){
				$('#content').fadeTo(0,0.5);
				$('#content').fadeTo(1500,1);		
			}
			
			/* mettre en cache les images des autres pages*/
			(function($) {
				var cache = [];
				// Arguments are image paths relative to the current page.
				$.preLoadImages = function() {
					var args_len = arguments.length;
					for (var i = args_len; i--;) {
						var cacheImage = document.createElement('img');
						cacheImage.src = arguments[i];
						cache.push(cacheImage);
					}
				}
			})(jQuery)

			jQuery.preLoadImages(
				/* backgrounds*/
				"images/background_emarketing_marketing_webmarketing.jpg", 
				"images/background_infogerance_hebergement_supervision.jpg",
				"images/background_actualites_agence_marketing_referencement_sites.jpg",
				"images/background_medias_sociaux_agence_reseaux.jpg",
				"images/background_solutions_mobiles_agence_developpement_application_mobile_smartphone.jpg",
				"images/background_solutions_web_agence_joomla_magento_prestashop.jpg",
				"images/background_references_site_internet_e_commerce_institutionnel.jpg",
				/* images et backgrounds page références*/
/*				"images/references/bardahl.jpg", 
				"images/references/bardahl.png", 
*//*			"images/references/feelingcooking.jpg", 
				"images/references/feelingcooking.png", 
				"images/references/houdan.jpg", 
				"images/references/houdan.png", 
				"images/references/icestream.jpg", 
				"images/references/icestream.png", 
				"images/references/jowiz.jpg", 
				"images/references/jowiz.png", 
				"images/references/luxaflex.jpg", 
				"images/references/luxaflex.png",
 				"images/references/mesphotosurtoile.jpg", 
				"images/references/mesphotosurtoile.png", 
 				"images/references/sampa.jpg", 
				"images/references/sampa.png", 
 				"images/references/stradale.jpg", 
				"images/references/stradale.png",
*/				/* carte page contact*/
				"images/carte.png",
				/* page agence*/
				"images/agence/background_agence_communication_digitale_1.jpg"/*,
				"images/agence/background_agence_communication_digitale_2.jpg",
				"images/agence/background_agence_communication_digitale_3.jpg",
				"images/agence/background_agence_communication_digitale_4.jpg",
				"images/agence/background_agence_communication_digitale_5.jpg",
				"images/agence/background_agence_communication_digitale_6.jpg",
				"images/agence/background_agence_communication_digitale_7.jpg",
				"images/agence/mini_agence_communication_digitale_1.jpg",
				"images/agence/mini_agence_communication_digitale_2.jpg",
				"images/agence/mini_agence_communication_digitale_3.jpg",
				"images/agence/mini_agence_communication_digitale_4.jpg",
				"images/agence/mini_agence_communication_digitale_5.jpg",
				"images/agence/mini_agence_communication_digitale_6.jpg",
				"images/agence/mini_agence_communication_digitale_7.jpg"
*/		);

		});

		/* à charger a l'ouverture de la page*/
		window.onload=chargement;


/* POUR LES MODIFICATIONS DE COULEURS SURVOL BOUTONS*/
		
		/* diapo suivant */
		function diaposuivant(){
			nextSlide = ActSlide-1;
			stopAutoplay();
			jumpTo(nextSlide);
			if(typeof shadowbox != "undefined" && shadowbox==true){
				Shadowbox.next();
			}
		}
		
		/* diapo précédent */
		function diapoprecedent(){
			prevSlide = ActSlide+1;
			stopAutoplay();
			jumpTo(prevSlide);
			if(typeof shadowbox != "undefined" && shadowbox==true){
				Shadowbox.previous();
			}
		}

		/* cacher ou pas boutons*/
		function boutonsdiapo(){
			if(document.body.clientHeight<750 && visible==true){
				document.getElementById('diapoprecedent').style.visibility="hidden";
				document.getElementById('diaposuivant').style.visibility="hidden";
				visible=false;
			}
			if(document.body.clientHeight>=750 && visible==false){
			/*window.innerHeight>=750 || */
				document.getElementById('diapoprecedent').style.visibility="visible";
				document.getElementById('diaposuivant').style.visibility="visible";
				visible=true;
			}
		}
