// initialise Superfish 
    $(document).ready(function(){ 
        				 
		$("ul.menu").superfish({ 
			delay:       200,                            // one second delay on mouseout 
			animation:   {opacity:'show',height:'show'},  // fade-in and slide-down animation 
			speed:       'fast',                          // faster animation speed 
			autoArrows:  true,                           // disable generation of arrow mark-up 
			dropShadows: false                           // disable drop shadows 
		});
		
		$("ul.menu > li > a.sf-with-ul").parent("li").addClass("sf-ul");
		
		
		<!---- lavalamp ---->
		$("ul.menu ul > li").addClass("noLava");			
		var startLink = 0;		
		/*$("ul.menu > li.current-cat-parent, ul.menu > li.current-cat, ul.menu > li.current_page_parent, ul.menu > li.current_page_item").each(function(){
			startLink = jQuery(this).prevAll().length;
		});*/
		$("ul.menu").lavaLamp({ startItem: startLink });
		if ( startLink !=0 ) $("ul.menu > li.backLava").animate({left:"+=2"},0);
		$("ul.menu > li > ul").prev("a").attr("href","#");					 
						 
				 
						 
    }); 




// What is $(document).ready ? See: http://flowplayer.org/tools/documentation/basics.html#document_ready
$(function() {
	
	$(".slidetabs").tabs(".images > div", {
	// enable "cross-fading" effect
		effect: 'fade',
		fadeOutSpeed: 'slow',
	// start from the beginning after the last tab
		rotate: true
	// use the slideshow plugin. It accepts its own configuration
	}).slideshow({autoplay: true, interval: 8000});
	//$(".slidetabs").data("slideshow").play();
});




// initialise Recherche universelle 

$().ready(function() {
	// if text input field value is not empty show the "X" button
	$("#field").keyup(function() {
		$("#x").fadeIn();
		if ($.trim($("#field").val()) == "") {
			$("#x").fadeOut();
		}
	});
	// on click of "X", delete input field value and hide "X"
	$("#x").click(function() {
		$("#field").val("");
		$(this).hide();
	});
});



// initialise Trigger
 $(
		function()
		{
		   
	//Hide (Collapse) the toggle containers on load
	$(".toggle_container").hide(); 

	//Switch the "Open" and "Close" state per click then slide up/down (depending on open/close state)
	$("h2.trigger").click(function(){
		$(this).toggleClass("active").next().slideToggle("slow");
		return false; //Prevent the browser jump to the link anchor
	});
 	   

   }

   
   );



$(
  function(){
            $(".formContainer input[type=text]").focus(function(){
                $(this).parent().siblings(".error").css("display", "none");
				$(this).parent().siblings(".info").css("display", "block");

            }).blur(function(){
                $(this).parent().siblings(".info").css("display", "none");
            });
        });
        
        function validateForm()
        {
            $(".formContainer input[type=text]").each(function(){
                var text = $(this).attr("value");
                if (text == "")
                {
                    $(this).parent().siblings(".error").css("display", "block");
                }
            });
        }
        
        function clearForm()
        {
            $(".formContainer input[type=text]").each(function(){
                $(this).parent().siblings(".error").css("display", "none");
            });
       }









$( 
  function(){
		
	  $("form input:radio[name=isInvestisseur]").click(function(e){
	  
	  if($(this).val() == "1")
	  {
	  	$("#PositiveAnswer").show();
		$("#PositiveAnswer input:radio[name=reponseFormulaire]").first().attr('checked', true);
		$("#NegativeAnswer").hide();
	  }
	  else
	  {
	  	$("#PositiveAnswer").hide();
		$("#NegativeAnswer").show();
		$("#NegativeAnswer input:radio[name=reponseFormulaire]").first().attr('checked', true);
	  }

	  });
	  
	  /**
		* ToolTips for fields
		*/
		$(":input.infoBulle").tooltip({
		
			// place tooltip on the right edge
			position: "center right",
			
			// a little tweaking of the position
			offset: [-2, 10],
			
			// use the built-in fadeIn/fadeOut effect
			effect: "fade",
			
			// custom opacity setting
			opacity: 0.7
		
		});
});









