// JavaScript Document





function animbtninscriptions(){
	$("#btninscriptions").animate({opacity: 0.60}).delay(100).animate({opacity: 1},animbtninscriptions);
}

$(window).load(
    function () {
		
		//animNumero(); 
		animbtninscriptions();
		$("#menubackanim").delay(800).fadeIn("slow");
		$("#badge").delay(1800).fadeOut("fast").delay(1800).fadeIn("fast").delay(10000).fadeOut("fast").delay(10000).fadeIn("fast");
		//$('#tickertop').cycle({
	    //fx:     'none'
		//});
		
		}
);



// when the DOM is ready...
$(function () {
			

			$(".scrollable").scrollable({easing: 'custom', speed: 700, circular: true}).autoscroll({ autoplay: true });
			$(".scrollable div.item[title]").tooltip({ effect: 'slide'});
			// custom easing called "custom"
			$.easing.custom = function (x, t, b, c, d) {
			var s = 1.70158;
			if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
			return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
			}


			
			$('#topheadslide').slides({
				container: 'topheadslide_container',
				effect: 'slide',
				preload: false,
				play: 5000,
				pause: 5000,
				generatePagination: false,
				bigTarget: true,
				hoverPause: true				
			});
			
		
			//$('.zerofraisbanque').delay(5000).show(500);
			//$('.zerofraiscourtier').delay(10000).show(500);
			
	
			
			
	$('#testimonial_home').cycle({
	fx:      'fade', 
    speedIn:  2500, 
    speedOut: 500,
	timeout: 15000    	  
	});
    $('#boxparrainagelist').cycle({
	fx:      'fade', 
    speedIn:  2500, 
    speedOut: 500, 
    delay:   1000	  
	});
   $('#tauxMin').cycle({
	fx:     'scrollDown', 
    easing: 'bounceout'
	  
	});
   
	//$('#postithautdefil').cycle({
	//fx:     'scrollUp', 
    //timeout: 8000, 
    //easing: 'bouncein',
	//pause:   1
	//});	

   $('#sysFlashInfoCrditImmo').cycle({
	});	

  // drop shadow
  //$(".navSecondary li").dropShadow({left: 2, top: 2, opacity: 0.5, blur: 2});
  //$(".navSecondary li.current").dropShadow({left: 2, top: 3, opacity: 0.5, blur: 2});
 

  
  // spritely  
  // $('body').pan({fps: 12, speed: 1, dir: 'left'}); 
  
  // load the ticker
	
	// iframe catalogue
	$(".gallery a[rel^='prettyPhoto']").prettyPhoto({theme:'facebook'});
// menu top 
	$('#menutop a')
		.css( {backgroundPosition: "0 0"} )
		.mouseover(function(){
			$(this).stop().animate({backgroundPosition:"(0 -180px)"}, {duration:300})
		})
		.mouseout(function(){
			$(this).stop().animate({backgroundPosition:"(0 0)"}, {duration:300})
		})
// menu secondaire		
//get the default top value
		var top_val = $('.navSecondary li a').css('top');
 
		//animate the selected menu item
		$('.navSecondary li.current').children('a').stop().animate({top:0}, {easing: 'easeOutQuad', duration:200});		
		$('.navSecondary li').hover(
			function () {
				
				//animate the menu item with 0 top value
				$(this).children('a').stop().animate({top:0}, {easing: 'easeOutQuad', duration:200});		
			},
			function () {
 
				//set the position to default
				$(this).children('a').stop().animate({top:top_val}, {easing: 'easeOutQuad', duration:200});		
 
				//always keep the previously selected item in fixed position			
				$('.navSecondary li.current').children('a').stop().animate({top:0}, {easing: 'easeOutQuad', duration:200});		
			}
				
		);
		

// menu principal
ddsmoothmenu.init({
	mainmenuid: "smoothmenu1", //menu DIV id
	orientation: 'h', //Horizontal or vertical menu: Set to "h" or "v"
	classname: 'ddsmoothmenu', //class added to menu's outer DIV
	//customtheme: ["#1c5a80", "#18374a"],
	contentsource: "markup" //"markup" or ["container_id", "path_to_menu_file"]
})	
})



