/* ---------------------------------------------------
   Load Function  ------------------------------------ */

    function loadFct(){
        
        var popup = $("#popup");
        var testimonial = $("#testimonial");
        
        $().externalLinks();
        
        //Testimonails animation
        testimonial.cycle({timeout: 14000, height: '35px'}); 
      
        //Animation
        $(".b_watch").bind("click", function(){
            testimonial.cycle("pause");
            popup.animate({"top":"22px"}, 500, function(){addFlash();});
            return false;
        });  
         
        $("#popup-content .b_close").bind("click", function(){   
            $("#player").empty();
            popup.animate({"top":"-400px"}, 500, function(){ testimonial.cycle("resume"); });            
            return false;
        });
      
        return;
    };
    
 /*  ------------------------------------------------------------------
	 ADD Flash - SWFObject -------------------------------------------- */
    
     function addFlash(){ 
        jQuery('<div>')
            .attr('id', 'f_player')
			.appendTo("#player");
        
        var flashvars = {fileName: "/commun/flash/Barry_LaValley.flv"};
		var params = {};
		var attributes = {};
		
		swfobject.embedSWF("/commun/flash/player.swf", "f_player", "343", "264", "7.0.0", null, flashvars, params, attributes);
    };
    
    
 /*  ------------------------------------------------------------------
	External Link ---------------------------------------------------- */   
    
    (function() {
		jQuery.fn.externalLinks = function() {
			var container = this;
			
			return this.each( function() {
				jQuery("a.external", this)
				.bind("click", function(){ this.target='_blank'; /*return !window.open(this.href);*/ });
			});				
		};
    })(jQuery);	
    
 
 /*  ------------------------------------------------------------------
	Hover - Fix IE6 -------------------------------------------------- */	
	
	try {
	  document.execCommand('BackgroundImageCache', false, true);
	} catch(e) {}  