// Code déclenché au chargement de la page
	var meaVehicleCurrent		=	3;
	var meaVehicleMin			=	1;
	var meaVehicleMax			=	8;
	var galerieMin				=	1;
	var galerieMax				=	5;
	var alreadyAnimate			=	false;
	var modelSideView			=	150;

// Définition de l'url actuelle
	splitted_url		=	window.location.href.split( "/" );
	server_url			=	splitted_url[0]+"/"+splitted_url[1]+"/"+splitted_url[2];
	page_with_ext		=	splitted_url[ ( splitted_url.length - 1 ) ];
	current_ext			=	page_with_ext.substr( page_with_ext.indexOf(".") ).toLowerCase(); 
	current_page		=	page_with_ext.substr( 0, page_with_ext.indexOf(".") );

	$(document).ready( function(){

		// Affichage publicitaire concernant la Swift Sport
			// if ( current_page == "home" ) {
				// showAds( "/media/image/overlay/swift_sport_white.jpg" );
			// }
		//---
		// Affichage brut
			// $("body").fadeIn();
		
		// Affichage de la poup
			$(".flashPopup").click( function (){
				showGalerieModel( "/media/image/error/flashMissing.jpg" );
				$("#popInOverlay").css({
					"z-index":				"10000"
				});
				$("#popInContent").css({
					"z-index":				"10001"
				});
				$("#galerieDetail").css({
					"z-index":				"10010"
				});
				return false;
			});
		//---

		// Lissage des polices
			if ( $.browser.msie ) {
				if ( 6 < parseInt( $.browser.version.substr( 0, 1 ) ) ) {
					Cufon.now();
					Cufon.replace( ".lisse" );
				}
			} else {
				Cufon.now();
				Cufon.replace( ".lisse" );
			}
		//---
		// Placement du sous-menu
			$("li[id^='pages_']").map( function (){
				$(this).css({
					"left":			$("#category_"+($(this).attr("id").substr(6))).position().left+"px"
				});
			});
		//---
		// Mentions légales des modèles
			var animMentionsLegales=true;
			$("#tarifComplet").hover( function (){
				if ( animMentionsLegales ) {
					animMentionsLegales=false;
					$("#mentionsLegalesModel").slideDown("slow", function(){animMentionsLegales=true;});
				}
			}, function (){
			});
			// Masquer
				$("#mentionsLegalesModel").hover( function (){
				}, function (){
					if ( animMentionsLegales ) {
						animMentionsLegales=false;
						$("#mentionsLegalesModel").slideUp("slow", function(){animMentionsLegales=true;});
					}
				});
				$("#miseEnAvant").hover( function (){
				}, function (){
					if ( animMentionsLegales ) {
						animMentionsLegales=false;
						$("#mentionsLegalesModel").slideUp("slow", function(){animMentionsLegales=true;});
					}
				});
			//---
		//---
		// Gestion du sous-menu
			$(".menuItem a").hover( function (){
				$(".subMenu").hide();
				$("#pages_"+($(this).attr("id").substr(9))).show();
				$(this).css({
					"background":		"#ffffff",
					"color":			"#003145"
				});
			}, function (){
				if ( -1 == $(this).parent().attr("class").search("menuACTIVE") ) {
					$(this).css({
						"background":		"none",
						"color":			"#ffffff"
					});
				}
			});
			$(".modelPreview").hide();
			$(".modelPreview:first").show();
			$(".modelMenu a").hover( function (){
				if ( -1 == $(this).attr("class").search(/configLink/) ) {
					$(".modelPreview").hide();
					$("#"+$(this).attr("id").substr(4)).parent().show();
					$(this).css({
						"background":		"#003145",
						"color":			"#ffffff"
					});
				}
			}, function (){
				if ( -1 == $(this).attr("class").search(/configLink/) ) {
					if ( "impair" == $(this).attr("class") ) {
						$(this).css({
							"background":		"#eff2f2",
							"color":			"#003145"
						});
					} else {
						$(this).css({
							"background":		"#ffffff",
							"color":			"#003145"
						});
					}
				}
			});
			$(".modelPreview").hover( function (){
				$("#Show"+$(this).children("a").attr("id")).css({
					"background":		"#003145",
					"color":			"#ffffff"
				});
			}, function (){
				if ( "impair" == $("#Show"+$(this).children("a").attr("id")).attr("class") ) {
					$("#Show"+$(this).children("a").attr("id")).css({
						"background":		"#eff2f2",
						"color":			"#003145"
					});
				} else {
					$("#Show"+$(this).children("a").attr("id")).css({
						"background":		"#ffffff",
						"color":			"#003145"
					});
				}
			});
			$(".subMenu").hover( function (){
				$(this).show();
				$("#category_"+($(this).attr("id").substr(6))).css({
					"background":		"#ffffff",
					"color":			"#003145"
				});
			}, function (){
				if ( -1 == $("#category_"+($(this).attr("id").substr(6))).parent().attr("class").search("menuACTIVE") ) {
					$("#category_"+($(this).attr("id").substr(6))).css({
						"background":		"none",
						"color":			"#ffffff"
					});
				}
				$(".subMenu").hide();
			});
		//---
		// Capture des touches du clavier pour bouger les mises en avant
			/*
			$(window).keydown( function (e){
				$(window).scrollLeft(0);
				switch( e.keyCode ) {
					// Gauche
					case 37:
						$(".fleche_gauche").click();
						break;
					// Droite
					case 39:
						$(".fleche_droite").click();
						break;
					default:
						return true;
						break;
				}
				return false;
			});
			*/
		//---
		// Redimensionnement du bandeau
			$(window).resize();
			$("#modele"+meaVehicleCurrent).fadeIn(500);
		//---
		// Validation du formulaire de recherche concessionnaire
			$("#concessionnairesSearch").submit( function (){
				var ccs_param				=	"";
				if ( "" != $("#ccs_nom").val() && $("#ccs_nom").val() != "lieu-dit, adresse ..." ) {
					ccs_param					+=	"_"+ $("#ccs_nom").val();
				}
				if ( "" != $("#ccs_departement").val() ) {
					ccs_param					+=	"_du"+ $("#ccs_departement").val();
				}
				if ( "" != $("#ccs_ville").val() ) {
					ccs_param					+=	"_a"+ $("#ccs_ville").val();
				}
				window.location.href		=	"/concessionnaires" +ccs_param+ ".html";
				return false;
			});
		//---
		// Clic sur les mentions légales
			$(".mentionsLegalesPlus").click( function (){
				if ( "none" == $(".mentionsLegalesDetails").css("display") ) {
					$(this).children(".expand").children("img").attr( "src", $(this).children(".expand").children("img").attr( "src" ).replace( "&ld=1", "&lu=1" ) );
					$(".mentionsLegalesDetails").slideDown();
				} else {
					$(this).children(".expand").children("img").attr( "src", $(this).children(".expand").children("img").attr( "src" ).replace( "&lu=1", "&ld=1" ) );
					$(".mentionsLegalesDetails").slideUp();
				}
				return false;
			});
		//---
		// Contact
			$(".case").map( function (){
				$(this).css({
					"height":			parseInt($(this).parent().parent().height()-10)+"px"
				});
			});
		//---
		// Déplacement du caroussel
			if ( "home" == current_page ) {

				// Définition des variables
					modelWidth			=	$("a.modele").width();
					screenWidth			=	$(window).width();
					moveSize			=	( screenWidth / 2 ) - ( modelWidth / 2 ) + ( modelWidth - modelSideView )
					alreadyMoveEnd		=	true;

				// Placement initial
					$("a.modele").css({
						"margin-right":		parseInt( ( screenWidth - modelWidth - ( 2 * modelSideView ) ) / 2 ) + "px"
					});
					$("div#modele_holder").css({
						"margin-left":		"-" + parseInt( modelWidth - modelSideView ) + "px"
					});
					$("div#modele_holder").css({
						"margin-left":		( parseInt( parseInt( $("div#modele_holder").css("margin-left") ) - ( ( meaVehicleCurrent - 2 ) * moveSize ) ) ) + "px"
					});
					$("#photoModele"+meaVehicleCurrent).css({
						"z-index":			"9200",
						"position":			"relative"
					});

				// Actions des flèches
					$(".fleche_gauche").click( function(){
						if ( alreadyMoveEnd ) {
							alreadyMoveEnd		=	false;
							if ( meaVehicleCurrent > meaVehicleMin ) {
								$(".punchLine").fadeOut(100);
								meaVehicleCurrent--;
								$("#modele"+meaVehicleCurrent).fadeIn(400);
								$("a.modele").css({
									"z-index":			"4000",
									"position":			"static"
								});
								$("div#modele_holder").animate({
									"margin-left":		parseInt( parseInt( $("div#modele_holder").css("margin-left") ) + moveSize ) + "px"
									}, 500, function (){
										alreadyMoveEnd		=	true;
										$("#photoModele"+meaVehicleCurrent).css({
											"z-index":			"9200",
											"position":			"relative"
										});
									}
								);
							} else {
								$(".punchLine").fadeOut(600);
								meaVehicleCurrent	=	meaVehicleMax;
								$("#modele"+meaVehicleCurrent).fadeIn(400);
								$("a.modele").css({
									"z-index":			"4000",
									"position":			"static"
								});
								$("div#modele_holder").animate({
									"margin-left":		( parseInt( parseInt( $("div#modele_holder").css("margin-left") ) - ( ( meaVehicleMax - 1 ) * moveSize ) ) ) + "px"
									}, 1000, function (){
										alreadyMoveEnd		=	true;
										$("#photoModele"+meaVehicleCurrent).css({
											"z-index":			"9200",
											"position":			"relative"
										});
									}
								);
							}
						}
					});
					$(".fleche_droite").click( function(){
						if ( alreadyMoveEnd ) {
							alreadyMoveEnd		=	false;
							if ( meaVehicleCurrent < meaVehicleMax ) {
								$(".punchLine").fadeOut(100);
								meaVehicleCurrent++;
								$("#modele"+meaVehicleCurrent).fadeIn(400);
								$("a.modele").css({
									"z-index":			"4000",
									"position":			"static"
								});
								$("div#modele_holder").animate({
									"margin-left":		parseInt( parseInt( $("div#modele_holder").css("margin-left") ) - moveSize ) + "px"
									}, 500, function (){
										alreadyMoveEnd		=	true;
										$("#photoModele"+meaVehicleCurrent).css({
											"z-index":			"9200",
											"position":			"relative"
										});
									}
								);
							} else {
								$(".punchLine").fadeOut(600);
								meaVehicleCurrent	=	meaVehicleMin;
								$("#modele"+meaVehicleCurrent).fadeIn(400);
								$("a.modele").css({
									"z-index":			"4000",
									"position":			"static"
								});
								$("div#modele_holder").animate({
									"margin-left":		( parseInt( parseInt( $("div#modele_holder").css("margin-left") ) + ( ( meaVehicleMax - 1 ) * moveSize ) ) ) + "px"
									}, 1000, function (){
										alreadyMoveEnd		=	true;
										$("#photoModele"+meaVehicleCurrent).css({
											"z-index":			"9200",
											"position":			"relative"
										});
									}
								);
							}
						}
					});

			}
		//---
		$("a[rel=external]").click( function (){
			window.open( $(this).attr('href') );
			return false;
		});
		$("a[rel=popup]").click( function (){
			window.open( $(this).attr('href'), $(this).attr('title'), 'toolbar=0,menubar=0,location=0,scrollbars=1,width=1050,height=820' );
			return false;
		});
		// Hack IE6
			if ( $.browser.msie ) {
				if ( "6.0" == $.browser.version.substr( 0, 3 ) ) {
					$("*").map( function (){
						var imagePng			=	$(this).css("background-image");
						if ( "none" == imagePng ) {
							imagePng				=	$(this).attr("src");
						} else {
							imagePng				=	imagePng.replace( /url\(\"(.*)\"\)/, "$1" );
						}
						if ( undefined != imagePng ) {
							if ( ".png" == imagePng.substr( imagePng.length - 4 ) ) {
								imagePng					=	imagePng.replace( "http://suzuki.actu.com", "" );
								if ( undefined != $(this).attr( "src" ) ) {
									$(this).attr( "src", "/blank.gif" );
								}
								if ( "no-repeat" == $(this).css("background-repeat") ) {
									$(this).css({
										"background":				"none",
										"filter":					"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+ imagePng +"')"
									});
								} else {
									$(this).css({
										"background":				"none",
										"filter":					"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+ imagePng +"', sizingMethod='scale')"
									});
								}
							}
						}
					});
				}
				if ( "7" <= $.browser.version.substr( 0, 1 ) ) {
					setTimeout( "$('#ie_updater').slideUp('slow');", 5000 );
				}
			}
		//---
		// Suppression des liens inutilisés
			$(".thumb").css({
				"cursor":			"default"
			});
		//---
		// Clic sur la galerie photo
			$("#thumbs .thumbs").css({
				"cursor":			"pointer"
			});
			$(".thumbs").click( function (){
				showGalerieModel( $(this).children("img").attr("src").replace("/thumbs/", "/galerie/") );
				return false;
			});
		//---
		// Fermeture de la popIn
			$(".popInClose").click( function (){
				hidePopIn();
				return false;
			});
			$("#popInOverlay").click( function (){
				hidePopIn();
				return false;
			});
		//---
		// Fermeture de la popIn
			$(".arrowPopInGauche").click( function (){
				movePhotoModel( -1 );
				return false;
			});
			$(".arrowPopInDroite").click( function (){
				movePhotoModel( +1 );
				return false;
			});
		//---
		// Over de la home modèle
			$(".over").slideUp(0);
			$(".couv").hover( function (){
				$(this).children().children(".over").slideDown();
			}, function (){
				$(this).children().children(".over").slideUp();
			});
		//---
		if ( "success" == current_page ) {
			alert( "Merci d'avoir rempli ce formulaire, nous avons bien enregistré votre demande, nous allons la traiter dans les plus brefs délais." );
		}
		// Suppression du texte initial
			$("#details").css("color","#808080");
			$("#details").click( function (){
				// if ( "Inscrivez votre demande ici... Ne peut concerner que les demandes d’essais..." == $(this).val() ) {
				if ( "Inscrivez votre demande ici..." == $(this).val() ) {
				$(this).css("color","#000000");
					$(this).val("");
				}
			});
			$("#details").blur( function (){
				if ( !$(this).val().length ) {
					$(this).val("Inscrivez votre demande ici...");
					$(this).css("color","#808080");
				}
			});
		//---
		// Suppression du texte initial du moteur de recherche
			$("#recherche").css("color","#808080");
			$("#recherche").click( function (){
				if ( "Entrez votre recherche" == $(this).val() ) {
				$(this).css("color","#000000");
					$(this).val("");
				}
			});
			$("#recherche").blur( function (){
				if ( !$(this).val().length ) {
					$(this).val("Entrez votre recherche");
					$(this).css("color","#808080");
				}
			});
				$("#recherche2").css("color","#808080");
				$("#recherche2").click( function (){
					if ( "Entrez votre recherche" == $(this).val() ) {
					$(this).css("color","#000000");
						$(this).val("");
					}
				});
				$("#recherche2").blur( function (){
					if ( !$(this).val().length ) {
						$(this).val("Entrez votre recherche");
						$(this).css("color","#808080");
					}
				});
		//---
		// Validation du moteur de recherche
			$("#moteur_recherche").submit( function (){
				if ( ""!=$("#recherche").val() && "Entrez votre recherche"!=$("#recherche").val() ) {
					window.location.href	=	"/recherche_"+ $("#recherche").val() + ".html";
				}
				return false;
			});
				$("#moteur_recherche2").submit( function (){
				if ( ""!=$("#recherche2").val() && "Entrez votre recherche"!=$("#recherche2").val() ) {
					window.location.href	=	"/recherche_"+ $("#recherche2").val() + ".html";
				}
					return false;
				});
		//---
		// Chargement en AJAX de la liste des concessionnaires
			if ( "contact" == current_page ) {
				$("#departement").keyup( function(){
					$.ajax({
						type: "POST",
						url: "/select_ccs.ajax",
						data: "departement="+$("#departement").val(),
						success: function( returnCode ){
							$("#concession").html( returnCode );
						}
					});
				});
				if ( $("#concession").attr( "id" ) != undefined ) {
					$.ajax({
						type: "POST",
						url: "/select_ccs.ajax",
						data: "departement="+$("#departement").val(),
						success: function( returnCode ){
							$("#concession").html( returnCode );
						}
					});
				}
			}
		//---
		// Chargement en AJAX de la page des concessionnaires
			if ( "concessionnaires" == current_page ) {
				/*
				$.ajax({
					type: "POST",
					url: "/liste_ccs.ajax",
					success: function( returnCode ){
						$("#result").html( returnCode );
					}
				});
				*/
			}
		//---
		// Chargement de la carte GMaps
			if ( -1 != current_page.search( /concessionnaires/ ) ) {
				initializeGMaps();
			}
		//---

		// Raplacement de l'historique
			if ( "historique" == current_page ) {
				$('h2 > a[id^=showPeriod]').live( 'click', function (){
					$('div[id^=period]').hide();
					$('div#'+$(this).attr('id').replace('showP', 'p')).show();
					return false;
				});
				/*
				var nxtPage			=	2;
				var isLoading		=	false;
				var lastLeftBar		=	false;
				$(window).scroll( function () {
					if ( ( $(document).height() - $(window).scrollTop() - 50 ) < $(window).height() && !isLoading ) {
						isLoading		=	true;
						var thisNext	=	$(this);
						$.ajax({
							type:			"POST",
							url:			"/his_show.ajax",
							data:			{
								"page":			nxtPage
							},
							success:		function( returnCode ){
								var his_page	=	$( "<div />" );
								his_page.css({
									// "display":			"none",
									"position":			"relative",
									"z-index":			"0"
								})
								his_page.html( returnCode );
								his_page.appendTo( ".contenu" );
								Cufon.now();
								Cufon.replace( ".lisse" );
								his_page.slideDown( 0, function (){
									nxtPage++;
									isLoading		=	false;
								});
							}
						});
					}
				});
				*/
			}
		//---

	});

if ( -1 != current_page.search( /concessionnaires/ ) ) {

var map;
var geocoder;
var image;
var shape;
var browserSupportFlag	=	 new Boolean();
function initializeGMaps() {
	geocoder				=	new google.maps.Geocoder();
	var latlng				=	new google.maps.LatLng( 48.8566667, 2.3509871 );
	var myOptions			=	{
		"zoom":					9,
		"center":				latlng,
		"mapTypeId":			google.maps.MapTypeId.ROADMAP
	};
	image					=	new google.maps.MarkerImage(
		"http://suzuki.actu.com/media/image/concession/gmaps.png",
		new google.maps.Size(20, 32),
		new google.maps.Point(0,0),
		new google.maps.Point(0, 32)
	);
	shape					=	{
		coord: [1, 1, 1, 20, 18, 20, 18 , 1],
		type: 'poly'
	};
	map						=	new google.maps.Map( document.getElementById("GoogleMap"), myOptions );

	if ( ""!=$("#ccs_ville").val() || ""!=$("#ccs_departement").val() || ( ""!=$("#ccs_nom").val() && "lieu-dit, adresse ..."!=$("#ccs_nom").val() ) ) {

		lieuDit					=	$("#ccs_nom").val();
		if ( "lieu-dit, adresse ..."==lieuDit ) {
			lieuDit					=	"";
		}
		// alert( lieuDit+", "+$("#ccs_ville").val()+", "+$("#ccs_departement").val()+", France" );
		zoomOnAdress( lieuDit+", "+$("#ccs_ville").val()+", "+$("#ccs_departement").val()+", France" );

	} else {

		// Try W3C Geolocation (Preferred)

		var positionLat			=	0;
		var positionLng			=	0;

		if(navigator.geolocation) {
			browserSupportFlag = true;
			navigator.geolocation.getCurrentPosition(function(position) {

				if ( -1 == current_page.search( /concessionnaires_/ ) ) {
					positionLat				=	position.coords.latitude;
					positionLng				=	position.coords.longitude;
					$.ajax({
						type:			"POST",
						url:			"/geo_get.ajax",
						data:			{
							"lat":			positionLat,
							"lng":			positionLng
						},
						success:		function( returnCode ){
							$("#result").html( returnCode );
							setTimeout( function (){ placeConcess(); }, 1000 );
						}
					});
				}

				initialLocation = new google.maps.LatLng(position.coords.latitude,position.coords.longitude);
				map.setCenter(initialLocation);
			}, function() {
				handleNoGeolocation(browserSupportFlag);
			});
		// Try Google Gears Geolocation
		} else if (google.gears) {
			browserSupportFlag = true;
			var geo = google.gears.factory.create('beta.geolocation');
			geo.getCurrentPosition(function(position) {

				if ( -1 == current_page.search( /concessionnaires_/ ) ) {
					positionLat				=	position.coords.latitude;
					positionLng				=	position.coords.longitude;
					$.ajax({
						type:			"POST",
						url:			"/geo_get.ajax",
						data:			{
							"lat":			positionLat,
							"lng":			positionLng
						},
						success:		function( returnCode ){
							$("#result").html( returnCode );
							setTimeout( function (){ placeConcess(); }, 1000 );
						}
					});
				}

				initialLocation = new google.maps.LatLng(position.latitude,position.longitude);
				map.setCenter(initialLocation);
			}, function() {
				handleNoGeoLocation(browserSupportFlag);
			});
		// Browser doesn't support Geolocation
		} else {
			browserSupportFlag = false;
			handleNoGeolocation(browserSupportFlag);
		}

		function handleNoGeolocation(errorFlag) {
			if (errorFlag == true) {
				initialLocation = latlng;
			} else {
				initialLocation = latlng;
			}
			map.setCenter(initialLocation);
		}

	}

	placeConcess();
}
function zoomOnAdress( address ) {
	map.zoom				=	9;
	geocoder.geocode( { "address": address }, function( results, status ) {
		if ( status == google.maps.GeocoderStatus.OK ) {
			map.setCenter(results[0].geometry.location);
		}
	});
};

function setCenterMap(latitude,longitude) {
	map.setCenter( new google.maps.LatLng( latitude, longitude ) );
	document.location.href = "#miseEnAvant";
}

function addMarkerOnPoint( longitude, latitude, title, content ) {
	var marker				=	new google.maps.Marker({
		"map":					map,
		"position":				new google.maps.LatLng( latitude, longitude ),
		"icon":					image,
		"shape":				shape,
		"title":				title
	});
	var infowindow			=	new google.maps.InfoWindow({
		"content":				content
	});
	google.maps.event.addListener( marker, "click", function (){
		infowindow.open( map, marker );
		map.setCenter( new google.maps.LatLng( latitude, longitude ) );
	});
};

}

if ( "home" == current_page || "success" == current_page ) {

	// Redimensionnement du caroussel en fonction de l'écran
		$(window).resize( function (){
			// Définition des variables
				modelWidth			=	$("a.modele").width();
				screenWidth			=	$(window).width();
				moveSize			=	( screenWidth / 2 ) - ( modelWidth / 2 ) + ( modelWidth - modelSideView )
				alreadyMoveEnd		=	true;

			// Placement initial
				$("a.modele").css({
					"margin-right":		parseInt( ( screenWidth - modelWidth - ( 2 * modelSideView ) ) / 2 ) + "px"
				});
				$("div#modele_holder").css({
					"margin-left":		"-" + parseInt( modelWidth - modelSideView ) + "px"
				});
				$("div#modele_holder").css({
					"margin-left":		( parseInt( parseInt( $("div#modele_holder").css("margin-left") ) - ( ( meaVehicleCurrent - 2 ) * moveSize ) ) ) + "px"
				});
		});
	//---

}
	// Affichage du PopIn en Home
		var scrollPos			=	0;
		function showAds ( imgUrl ) {
			if ( $.browser.msie ) {
				$("img#overlaySuzuki").attr( "src", "/media/image/interface/mask.png" ).css({
					"z-index":				"9995"
				});
				// $("img#overlaySuzuki").attr( "src", "/blank.gif" ).css({
					// "background":		"none",
					// "filter":			"progid:DXImageTransform.Microsoft.AlphaImageLoader( src='/media/image/interface/mask.png', sizingMethod='scale')"
				// });
			}
			$(".arrowPopIn").remove();
			scrollPos			=	$(window).scrollTop();
			$.scrollTo( 0, 750, { onAfter: function (){
				$("#galerieDetail").attr( "src", imgUrl );
				$("#fleche_gauche").css({
					"z-index":			"0"
				});
				$("#fleche_droite").css({
					"z-index":			"0"
				});
				$("#popInOverlay").css({
					"background":		"#ffffff",
					"opacity":			"0.85",
					"height":			$(document).height() +"px"
				});
				var sOverflowSaved			=	$("body").css( "overflow" );
				$("body").css( "overflow", "hidden" );
				$("#popInOverlay").click( function (){
					$("body").css( "overflow", sOverflowSaved );
					$("#fleche_gauche").css({
						"z-index":			"9998"
					});
					$("#fleche_droite").css({
						"z-index":			"9998"
					});
				});
				$("#popInCloseMe").click( function (){
					$("body").css( "overflow", sOverflowSaved );
					$("#fleche_gauche").css({
						"z-index":			"9998"
					});
					$("#fleche_droite").css({
						"z-index":			"9998"
					});
				});
				$("#popInOverlay").fadeIn( 750, function (){
					$("#popInContent").fadeIn( 500, function (){
						var dCoeff			=	20;
						var dWidthDebut		=	parseInt( $("img#overlaySuzuki").width() + $("img#overlaySuzuki").css("padding-left") + $("img#overlaySuzuki").css("padding-right") + $("img#overlaySuzuki").css("border-width") );
						var dHeightDebut	=	parseInt( $("img#overlaySuzuki").height() + $("img#overlaySuzuki").css("padding-top") + $("img#overlaySuzuki").css("padding-bottom") + $("img#overlaySuzuki").css("border-width") );
						$("img#overlaySuzuki").animate({
							"width":			( dWidthDebut * dCoeff )+"px",
							"height":			( dHeightDebut * dCoeff )+"px",
							"margin-left":		"-"+parseInt( dWidthDebut * dCoeff / 2 )+"px",
							"margin-top":		"-"+parseInt( dHeightDebut * dCoeff / 2 )+"px"
						}, 10000, "easeInQuint", function(){
							$("img#overlaySuzuki").remove();
							$("body").css( "overflow", sOverflowSaved );
						});
					})
				});
			}});
		}
	// Affichage du PopIn
		var scrollPos			=	0;
		function showGalerieModel ( imgUrl ) {
			$("img#overlaySuzuki").remove();
			scrollPos			=	$(window).scrollTop();
			$.scrollTo( 0, 750, { onAfter: function (){
				$("#galerieDetail").attr( "src", imgUrl );
				$("#popInOverlay").css({
					"height":			$(document).height() +"px"
				});
				$("#popInOverlay").fadeIn(750, function (){ $("#popInContent").fadeIn(500) });
			}});
		}
	//---
	// Masquage du PopIn
		function hidePopIn () {
			$(".popIn").fadeOut("slow", function (){
				$.scrollTo( scrollPos, 750 );
			});
		}
	//---
	// Changement de la photo de la galerie
		function movePhotoModel ( sens ) {
			if ( sens == undefined ) {
				sens					=	1;
			}
			var currentPhotoModel	=	$("#galerieDetail").attr("src");
			var nextPhotoModel		=	( parseInt( currentPhotoModel.substr( currentPhotoModel.search( /([0-9][0-9])\.jpg/ ), 2 ) ) + sens ).toString();
			if ( nextPhotoModel > galerieMax ) {
				nextPhotoModel			=	"1";
			} else if ( nextPhotoModel < galerieMin ) {
				nextPhotoModel			=	"5";
			}
			if ( 2 > nextPhotoModel.length ) {
				nextPhotoModel			=	( "0" + nextPhotoModel );
			}
			currentPhotoModel		=	currentPhotoModel.replace( /([0-9][0-9])\.jpg/, nextPhotoModel.toString()+".jpg" );
			$("#galerieDetail").attr( "src", currentPhotoModel );
		}
	//---
//---

// Fonction de rotation des promos
	function fRotatePromo (){
		if ( $("div#footer_holder div#promotion-encart div:first").html() != $("div#footer_holder div#promotion-encart div:last").html() ){
			clearTimeout( rotatePromoTimeout );
			// On définit la prochaine
				if ( $("div#footer_holder div#promotion-encart div:last").html() == $("div#footer_holder div#promotion-encart div.enCours").html() ){
					$("div#footer_holder div#promotion-encart div:first").addClass("next");
				} else {
					$("div#footer_holder div#promotion-encart div.enCours").next().addClass("next").removeClass("hidden");;
				}
			//---

			$("div#footer_holder div#promotion-encart div.next").animate({ "margin-left": "0" });
			$("div#footer_holder div#promotion-encart div.enCours").animate({ "margin-left": "255px" }, function (){ $(this).css({ "margin-left":"-255px" }); }).removeClass("enCours");

			$("div#footer_holder div#promotion-encart div.next").addClass("enCours").removeClass("next");
			// $("div#footer_holder div#promotion-encart").firstChild("div").removeclass("hidden");

			rotatePromoTimeout		=	setTimeout( function (){ fRotatePromo(); }, 2800 );
		}
	}
	// Rotation cyclique des promotions
		var countPromo				=	1;
		var rotatePromoTimeout		=	setTimeout( function (){ fRotatePromo(); }, 2800 );
	//---
//---
// Rotation actus
	function fRotateActu (){
		if ( $("div#footer_holder div#actualite-encart div:first").html() != $("div#footer_holder div#actualite-encart div:last").html() ){
			clearTimeout( rotateActuTimeout );
			// On définit la prochaine
				if ( $("div#footer_holder div#actualite-encart div:last").html() == $("div#footer_holder div#actualite-encart div.enCours").html() ){
					$("div#footer_holder div#actualite-encart div:first").addClass("next");
				} else {
					$("div#footer_holder div#actualite-encart div.enCours").next().addClass("next").removeClass("hidden");;
				}
			//---

			$("div#footer_holder div#actualite-encart div.next").animate({ "margin-left": "0" });
			$("div#footer_holder div#actualite-encart div.enCours").animate({ "margin-left": "-255px" }, function (){ $(this).css({ "margin-left":"255px" }); }).removeClass("enCours");

			$("div#footer_holder div#actualite-encart div.next").addClass("enCours").removeClass("next");
			// $("div#footer_holder div#actualite-encart").firstChild("div").removeclass("hidden");

			rotateActuTimeout		=	setTimeout( function (){ fRotateActu(); }, 2800 );
		}
	}
	// Rotation cyclique des promotions
		var countActu				=	1;
		var rotateActuTimeout		=	setTimeout( function (){ fRotateActu(); }, 2800 );
	//---
//---
// Fonction de rotation des actus
	// function fRotateActu (){
		// clearTimeout( rotateActuTimeout );
		// $.ajax({
			// "type":				"POST",
			// "url":				"/select_acp.ajax",
			// "data":				{
				// "countActu":		++countActu
			// },
			// "success":			function ( returnCode ){
				// promoInfos			=	returnCode.split( ";" );
				// promoUrl			=	promoInfos[0];
				// promoMiniature		=	promoInfos[1];
				// promoNom			=	promoInfos[2];
				// countActu			=	promoInfos[3];
				// $("#actualite-encart a").fadeOut( 1000, function (){
					// $("#actualite-encart a").attr( "href", promoUrl );
					// $("#actualite-encart a").attr( "alt", promoNom );
					// $("#actualite-encart a").attr( "Title", promoNom );
					// $("#actualite-encart a img").attr( "src", promoMiniature );
					// $("#actualite-encart a.lien").html( promoNom );
					// $("#actualite-encart a").fadeIn( 500 );
					// rotateActuTimeout		=	setTimeout( function (){ fRotateActu(); }, 2800 );
				// });
			// }
		// });
	// }
	// Rotation cyclique des promotions
		// var countActu				=	1;
		// var rotateActuTimeout		=	setTimeout( function (){ fRotateActu(); }, 2800 );
	//---
//---
