$(document).ready(function() {
	//
	//DropDownMenu Jquery
	$('.down-list').width(200);
	$('.menu-first').hover(
	  function () {
		$('.menu-first', this).addClass('slide-down'); 
		$('.down-list', this).slideDown(1);
	  }, 
	  function () {
		obj = this;
		$('.down-list', this).slideUp(1, function(){ $('.menu-first', obj).removeClass('slide-down'); });
	  }
	);
	//
	//infiniteCarousel
	$(function(){
		$('#carousel').infiniteCarousel({
			displayTime: 6000,
			textholderHeight : .25
		});
	});
	//
	//Sliding Panel
	$("div.panel_button").click(function(){
		$("div#panel").animate({
			height: "170px"
		})
		.animate({
			height: "160px"
		}, "fast");
		$("div.panel_button").toggle();
	
	});	
	
	$("div#hide_button").click(function(){
		$("div#panel").animate({
			height: "0px"
		}, "fast");
		
	
	});
	//
	//FancyBox
	$(".portfolio-image").fancybox();
	$(".avant-apres-fancybox").fancybox();
	$(".espaceClient").fancybox({
		'width'				: 900,
		'height'			: 550,
		'type'				: 'iframe'
	});
	//
	//Fader Photos
	$('.screen-projet').innerfade({ 
		speed: 'slow', 
		timeout: 4000, 
		type: 'sequence', 
		containerheight: '270px'
	});
	//
	//jQtransform
	$(function(){
		$('form').jqTransform({imgPath:'/images/jqtransform/'});
	});
	//
	//Hide div w/id extra
	$(".siteVitrine, .siteEcommerce, .creationGraphique, .referencementSite, #blocPage2, .showBtnSubmit").css("display","none");
	//
	// Add onclick handler to checkbox w/id **Site Vitrine**
	$("#choix_projet_vitrine").click(function(){
		
		// If checked
		if ($("#choix_projet_vitrine").hasClass("jqTransformChecked"))
		{
			//show the hidden div
			$(".siteVitrine").fadeIn();
			$(".showBtnSubmit").fadeIn();
		}
		else
		{
			//otherwise, hide it 
			$(".siteVitrine").fadeOut();
		}
	});
	//
	// Add onclick handler to checkbox w/id **Site E-commerce**
	$("#choix_projet_ecommerce").click(function(){
		
		// If checked
		if ($("#choix_projet_ecommerce").hasClass("jqTransformChecked"))
		{
			//show the hidden div
			$(".siteEcommerce").fadeIn();
			$(".showBtnSubmit").fadeIn();
		}
		else
		{
			//otherwise, hide it 
			$(".siteEcommerce").fadeOut();
		}
	});
	//
	// Add onclick handler to checkbox w/id **Création Graphique**
	$("#choix_projet_graphique").click(function(){
		
		// If checked
		if ($("#choix_projet_graphique").hasClass("jqTransformChecked"))
		{
			//show the hidden div
			$(".creationGraphique").fadeIn();
			$(".showBtnSubmit").fadeIn();
		}
		else
		{
			//otherwise, hide it 
			$(".creationGraphique").fadeOut();
		}
	});
	//
	// Add onclick handler to checkbox w/id **Référencement**
	$("#choix_projet_referencement").click(function(){
		
		// If checked
		if ($("#choix_projet_referencement").hasClass("jqTransformChecked"))
		{
			//show the hidden div
			$(".referencementSite").fadeIn();
			$(".showBtnSubmit").fadeIn();
		}
		else
		{
			//otherwise, hide it 
			$(".referencementSite").fadeOut();
		}
	});
	//
	// Toggle Tableau Tarif
	$(".toggleModule01").click(function () {
		$(".closeModule01").toggle();
	});
	$(".toggleModule02").click(function () {
		$(".closeModule02").toggle();
	});
	$(".toggleModule03").click(function () {
		$(".closeModule03").toggle();
	});
	$(".toggleModule04").click(function () {
		$(".closeModule04").toggle();
	});
	$(".toggleModule05").click(function () {
		$(".closeModule05").toggle();
	});
	$(".toggleModule06").click(function () {
		$(".closeModule06").toggle();
	});
	$(".toggleModule07").click(function () {
		$(".closeModule07").toggle();
	});
	$(".toggleModule08").click(function () {
		$(".closeModule08").toggle();
	});
	$(".toggleModule09").click(function () {
		$(".closeModule09").toggle();
	});
	$(".toggleModule10").click(function () {
		$(".closeModule10").toggle();
	});
	$(".toggleModule11").click(function () {
		$(".closeModule11").toggle();
	});
	//
	// Pour Les boutons Retour !
	$("button.btnRetour").click(function() {
		history.back();
		return false;
	});
	//
	// TabSlideOut Rappel immediat
	$(function(){
	$('.slide-out-div').tabSlideOut({
		tabHandle: '.handle',								//class of the element that will be your tab
		pathToTabImage: '/images/rappel-immediat.png',		//path to the image for the tab (optionaly can be set using css)
		imageHeight: '167px',								//height of tab image
		imageWidth: '30px',									//width of tab image    
		tabLocation: 'right',								//side of screen where tab lives, top, right, bottom, or left
		speed: 300,											//speed of animation
		action: 'click',									//options: 'click' or 'hover', action to trigger animation
		margintop: '-1px',									//margin-top: position off button for border
		topPos: '20px',										//position from the top
		fixedPosition: true								//options: true makes it stick(fixed position) on scroll
		});
	});
});
