
/* CARROUSEL */
jQuery(function(){
	$('.anythingSlider').anythingSlider({
		easing: "easeInOutExpo",        // Anything other than "linear" or "swing" requires the easing plugin
		autoPlay: true,                 // This turns off the entire FUNCTIONALY, not just if it starts running or not.
		delay: 3000,                    // How long between slide transitions in AutoPlay mode
		startStopped: false,            // If autoPlay is on, this can force it to start stopped
		animationTime: 600,             // How long the slide transition takes
		hashTags: true,                 // Should links change the hashtag in the URL?
		buildNavigation: false,          // If true, builds and list of anchor links to link to each slide
		pauseOnHover: true,
		startText: "",             // Start text
        stopText: ""         // Stop text

	});
	
	//fonction pour gerer l'id et le click des liens du catalogue
	//voir ds le code jquery.anythingslider.js la mention JULIEN
	/*$(".conteneur-famille > ul > li > a").each(function(j){
		$(this).attr({"id":"onglet-"+j});
		$(this).click(function(){
			$(".conteneur-famille > ul > li > a").each(function(){
				$(this).removeClass("actif");
				$('.detail').hide(); return false;
			});
			$('.anythingSlider').anythingSlider(j+1);
		});
	});*/
	

	/*$(".conteneur-famille > ul > li > a").each(function(j){
		$(this).attr({"id":"onglet-"+j});
		$(this).click(function(){
				$(".anythingSlider").each(function(){
				$(".conteneur-famille > ul > li > a").removeClass("actif");
				$('.anythingSlider').removeClass("actif");
				$('#slider-onglet-'+j).addClass("actif");
				$('#onglet-'+j).addClass("actif");
				return false;
			});
			return false;
		});
	});*/
	
	//Pour le catalogue avec rechargement de la page quand on clique sur une gamme : j'ai ptet fais des b$etises j'ai pas trop compris à quoi servait tout
	$(this).attr({"id":"onglet-0"});
	$('#slider-onglet-0').addClass("actif");
	$('#onglet-0').addClass("actif");
});

/* CONTACT > AFFICHER SITE */
$(function() {
  $("#etes").change(function () {
	if ($("#etes").val() != "un particulier"){
		$("#box-site").slideDown();
		return false;
	} else {
		$("#box-site").slideUp();
		return false;
		}
  });
 });   


/* CLIC SUR IMAGE OUVRE UNE BOX TEXTE */
$(function() {
	/*$('.lien-image').click(
	function () {
		$('.detail').fadeIn();
		return false;
	});
	
	*/
	$('.home .wrapper').hover(
	function () {
		$('.detail').fadeIn(); 
		},  
		function () { 
			$('.detail').fadeOut();
	});
	
	
	$('.lien-fermer').click(
	function () {
		$('.detail').fadeOut();
		return false;
	});
	
	$('.arrow').click(
	function () {
		$('.detail').hide();
		return false;
	});
});


/* TABS FINITIONS */
$(function() {
	// setup ul.tabs to work as tabs for each div directly under div.panes
	$("ul.tabs").tabs("div.panes > div");
		
	$("#slide-jump-1").click(function(){
		$('.anythingSlider').anythingSlider(1);
	});
	$("#slide-jump-2").click(function(){
		$('.anythingSlider').anythingSlider(1);
	});
	
});


/* TOOLTIP SUR CROISILLONS */
$(document).ready(function() 
{
	$('.conteneur-croisillon a[href][title]').qtip({
      content: {
         text: false // Use each elements title attribute
		},
      	position: { 
			target: "mouse",
			corner: 'bottomMiddle'
		},
	 	style: {
			name: "dark", // Give it the preset dark style
			width: {
				min: 120
			},
			border: {
			   width: 0, 
			   radius: 4 
		},
		tip: 'bottomMiddle' // Apply a tip at the default tooltip corner
		},
		show: { 
			effect: { 
				type: 'fade' ,
				length: '130'
			} 
		},
		hide: { 
			effect: { 
				type: 'fade' ,
				length: '130'
			} 
		}
   });
  
});

/* MENU DEROULANT FINITONS */
$(document).ready(function() { 
	$('ul.sf-menu').superfish({ 
		delay:       100,                             // one second delay on mouseout 
		animation:   {opacity:'show',height:'show'},  // fade-in and slide-down animation 
		speed:       'fast',                          // faster animation speed 
		autoArrows:  false,                           // disable generation of arrow mark-up 
		dropShadows: false                            // disable drop shadows 
	}); 
});


/* FANCYBOX = LIGHTBOX */
$(document).ready(function() {
    $("a.mon-plan").fancybox({
		'overlayOpacity': 0.5,
		'overlayColor' 	: '#333'
	});
});

/* FANCYBOX = LIGHTBOX */
$(document).ready(function() {
    $("a.photo").fancybox({
		'overlayOpacity': 0.5,
		'overlayColor' 	: '#333'
	});
});



$(document).ready(function() {	
	$("#lien-login-form").fancybox({
		'overlayOpacity': 0.5,
		'overlayColor' 	: '#333',
		'autoDimensions'	: false,
		'padding'		: 0,
		'width'			: 340,
		'height'		: 205,
		'scrolling'		: 'no',
		'titleShow'		: false,
		'onClosed'		: function() {
			$("#txt-erreur").hide();
		}
	});
	/*
	$("#login-form").bind("submit", function() {
	
		if ($("#login-name").val() == "Login" || $("#login-pass").val() == "Password") {
			$(".txt-erreur").show();
			$.fancybox.resize();
			return false;
		}
	});*/
	$("#login-form").submit(function(){
		if ($("#login-name").val() == "Login" || $("#login-pass").val() == "Password") {
			$(".txt-erreur").show();
			$.fancybox.resize();
			return false;
		} 
		$.ajax({
			   type: "POST",
			   data: "login-name="+$("#login-name").val()+"&login-pass="+$("#login-pass").val(),
			   success: function(msg){
					if(msg=="error")
						$(".txt-erreur").html("<br>Erreur de login ou de mot de passe").show();
					else
						document.location = "tarif-sous-home.php";
			   }
		});
		return false;
	});
});
﻿/***********************************************************/
/*                    tinyTips Plugin                      */
/*                      Version: 1.0                       */
/*                      Mike Merritt                       */
/*                 Updated: Feb 4th, 2010                  */
/***********************************************************/

(function($){  
	$.fn.tinyTips = function (supCont) {
		
		/* User settings
		**********************************/
		
		// Enter the markup for your tooltips here. The wrapping div must have a class of tinyTip and 
		// it must have a div with the class "content" somewhere inside of it.
		var tipFrame = '<div class="tinyTip"><div class="content"></div><div class="bottom">&nbsp;</div></div>';
		
		// Speed of the animations in milliseconds - 1000 = 1 second.
		var animSpeed = 300;
		
		/***************************************************************************************************/
		/* End of user settings - Do not edit below this line unless you are trying to edit functionality. */
		/***************************************************************************************************/
		
		// Global tinyTip variable;
		var tinyTip;
		var tText;
		
		// When we hover over the element that we want the tooltip applied to
		$(this).hover(function() {
		
			// Inject the markup for the tooltip into the page and
			// set the tooltip global to the current markup and then hide it.
			$('body').append(tipFrame);
			tinyTip = $('div.tinyTip');
			tinyTip.hide();
			
			// Grab the content for the tooltip from the title attribute (or the supplied content) and
			// inject it into the markup for the current tooltip. NOTE: title attribute is used unless
			// other content is supplied instead.
			if (supCont === 'title') {
				var tipCont = $(this).attr('title');
			} else if (supCont !== 'title') {
				var tipCont = supCont;
			}
			$('.tinyTip .content').html(tipCont);
			tText = $(this).attr('title');
			$(this).attr('title', '');
			
			// Offsets so that the tooltip is centered over the element it is being applied to but
			// raise it up above the element so it isn't covering it.
			var yOffset = tinyTip.height() + 17;
			var xOffset = (((tinyTip.width() - 10) / 2)) - ($(this).width() / 2);
			// Grab the coordinates for the element with the tooltip and make a new copy
			// so that we can keep the original un-touched.
			var pos = $(this).offset();
			var nPos = pos;
			// Add the offsets to the tooltip position
			nPos.top = pos.top - yOffset;
			nPos.left = pos.left - xOffset;
			
			// Make sure that the tooltip has absolute positioning and a high z-index, 
			// then place it at the correct spot and fade it in.
			tinyTip.css('position', 'absolute').css('z-index', '1000');
			tinyTip.css(nPos).fadeIn(animSpeed);
			
		}, function() {
			
			$(this).attr('title', tText);
		
			// Fade the tooltip out once the mouse moves away and then remove it from the DOM.
			$('div.tinyTip').fadeOut(animSpeed, function() {
				$(this).remove();
			});
			
		});
		
	}

})(jQuery);

$(document).ready(function() {
	$('a.tTip').tinyTips('title');
});



