/****image preloader***/
jQuery.preloadImages = function()
{
 for(var i = 0; i<arguments.length; i++){
 	jQuery("#img_footer_"+i).attr("src", arguments[i]);
 }
}
	
			
var loading_image = "http://www.autosportacademy.com/images/skin_default/loading.gif";
var loading_texte = "Chargement en cours..."; 
var loading_image_html = '<p style="width:50px;margin:auto;padding:auto;position:absolute;top:45%;left:40%;"><img style="vertical-align:middle;" src="' + loading_image +'" alt="'+ loading_texte +'" /></p>';

$(function() {

	//tabs photos
	//$("ul.css-tabs").tabs("div.css-panes > div", {effect: 'ajax'}); 
	$("ul.css-tabs").tabs("div.css-panes > div", {
				
		event : 'mouseover',
		effect: 'fade'
	});


	//images footer
	/*jQuery.preloadImages(
						 "http://www.autosportacademy.com/asa_v2/images/logos/logo_ffsa.png",
						 "http://www.autosportacademy.com/asa_v2/images/logos/logo_total.png",
						 "http://www.autosportacademy.com/asa_v2/images/logos/logo_renault.png",
						 "http://www.autosportacademy.com/asa_v2/images/logos/logo_pays_loire.png",
						 "http://www.autosportacademy.com/asa_v2/images/logos/logo_conseil_general_sarthe.png",
						 "http://www.autosportacademy.com/asa_v2/images/logos/logo_lemans.png",
						 "http://www.autosportacademy.com/asa_v2/images/logos/logo_lms.png",
						 "http://www.autosportacademy.com/asa_v2/images/logos/logo_michelin.png",
						 "http://www.autosportacademy.com/asa_v2/images/logos/logo_ministere_education.png",
						 "http://www.autosportacademy.com/asa_v2/images/logos/logo_ministere_sports.png"
						 );*/


	// initialize scrollable together with the circular plugin
	$("#home_news_nav").scrollable({
		//nombre d'items
		size:2							   
		});

	// initialize scrollable together with the circular plugin
	$("#home_news_instit_nav").scrollable({
		//nombre d'items
		size:2							   
		});

	// initialize scrollable together with the circular plugin
	$("#home_pilotes_nav").scrollable({
		//nombre d'items
		size:2
		});

	//animation footer
	/*$("#footer_logos").scrollable().circular().autoscroll({
		autoplay:true,
		loop:true,
		speed:800
		});*/

	
	//overlay footer contact
	 // if the function argument is given to overlay, 
    // it is assumed to be the onBeforeLoad event listener 
    $(".popup").overlay({  
        expose: '#207FBE', 
        effect: 'apple',
		absolute:false,
        onBeforeLoad: function() { 
            // grab wrapper element inside content 
            var wrap = this.getContent().find(".contentWrap"); 
            // load the page specified in the trigger 
            wrap.load(this.getTrigger().attr("href")); 
			}  
    });
	//visite virtuelle
    $(".popup_visite_virtuelle").overlay({  
        expose: '#207FBE', 
        effect: 'apple',
		absolute:false,
        onBeforeLoad: function() { 
            // grab wrapper element inside content 
            var wrap = this.getContent().find(".contentWrapVisiteVirtuelle"); 
            // load the page specified in the trigger 
            wrap.load(this.getTrigger().attr("href")); 
			}  
    });

	
});
