skip=0;
intro_twinair=0;
var sliderH;
function showSliderHP() {
	$('#intro_flash').html('');
	$('#intro_flash').hide();
	
	if (sliderH != null) {
		sliderH.doSlide();
	} else {
		sliderH = $("#myController").jFlow({
			slides: "#slides",
			controller: ".jFlowControl", // must be class, use . sign
			slideWrapper : "#jFlowSlide", // must be id, use # sign
			selectedWrapper: "jFlowSelected",  // just pure text, no sign
			auto: true,		//auto change slide, default true
			width: "1024px",
			height: "537px",
			duration: 400,
			prev: ".jFlowPrev", // must be class, use . sign
			next: ".jFlowNext" // must be class, use . sign
		});
	}
	
	$('#home_photos').show();
	$('#home_photos').animate({opacity:0},0);
	$('#home_photos').animate({opacity:1},750);
	
	/*$('#btns_home').prepend('<a class="replay" href="javascript:;"></a><a class="making" href="http://vivezlavieen500.fiat.fr/" target="_blank"></a>');*/

	$('.replay').click(function() {
	
		sliderH.stop_jFlow();
	
		startIntro();
		return false;
	});

}
function showHomePage() {
	$('#intro_flash').html('');
	$('#intro_flash').hide();
	
	
	$('#home_photos').show();
	$('#home_photos').animate({opacity:0},0);
	$('#home_photos').animate({opacity:1},750);
	
	sliderH.doSlide(0);

	$('.replay').click(function() {
		sliderH.stop_jFlow();
		startIntro();
		return false;
	});

}

function startIntro() {
	intro_twinair = 1;

	$('#home_photos').hide();
	
	$('#intro_flash').html('<div id="intro"></div>');
	$('#intro_flash').show();
	
 	//intro flash
 	var flashvars = {
 		file: "FIAT_1280.flv",
		widthP: "958",
		heightP: "540"
 	};
 	var params = {
		menu: "false",
		allowfullscreen:"flase",
		wmode: "opaque",
	};
	var attributes = {
		id: "intro",
		name: "intro"
	};
 	
 	swfobject.embedSWF("swf/intro.swf", "intro", "955", "537", "9.0.0.0", "swf/expressInstall.swf", flashvars, params, attributes);
	
}

 $(document).ready(function() {
	$('.header-bottom').piroBox_ext({
		piro_speed : 700,
		bg_alpha : 0.8,
		piro_scroll : false // pirobox always positioned at the center of the page
	});
	
	$('.menu_specification_configurateur').piroBox_ext({
		piro_speed : 700,
		bg_alpha : 0.8,
		piro_scroll : false // pirobox always positioned at the center of the page
	});
		
	$(window).scroll();
 
	var scrollTop = $(window).scrollTop();

	$(window).scroll(function() {
		var scrollTop = $(window).scrollTop();
        if(scrollTop > 16 && scrollTop < 26) { // Si on dépassé les 300 pixels
			$('.piro_overlay').css('top',  '38px' );
		} else if(scrollTop > 26){
			$('.piro_overlay').css('top',  '0px' );
		} else {
			$('.piro_overlay').css('top',  '56px' );
		}
	});
	
	$('#link_mentions').hover(
		function() {
			$('#mentions_legales, #overlay_ml').fadeIn('fast');
		},
		function() {
			$('#mentions_legales, #overlay_ml').fadeOut('fast');
		}
	);
 
 	if (skip==1) intro_twinair = 1;
 	showSliderHP();
 	
});
 
 
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-8296546-26']);
_gaq.push(['_trackPageview']);

(function() {
	var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
 
 
 
 

