
$(document).ready(function() {
	jQuery.extend({
		get_host: function() { 
			var sHostToReturn = "http://";
	  		var sHost = window.location.host;
	  		
	  		if(sHost == "127.0.0.1") { sHostToReturn =  sHostToReturn + sHost + "/www.fmrc.fr/"; }
	  		else { sHostToReturn =  sHostToReturn + sHost + "/"; }
	  		
	  		return sHostToReturn; 
		},
		get_surface_ecran: function() {
			var oDivFooter = $('.bas_page'); //Mise en variable de l'element footer
			var iHeightDivFooter = oDivFooter.height(); //recuperation de la hauteur de l'element
			var aOffsetDivFooter = oDivFooter.offset(); //Recupetion du top et du left
			var iTopDivFooter = aOffsetDivFooter.top; //Recuperation du top
			var iScreenWidth = screen.width; //Longueur de l'ecran
			
			var iWidthLoading = iScreenWidth;
			var iHeightLoading = iTopDivFooter + iHeightDivFooter;
			
			return  {width: iScreenWidth + "px", height: iHeightLoading + "px"};
		}		
	});
	
	
	//target blank non obstrusif
	$(".externalLink").attr("target","_blank");
	
	
	//ACCORDEON / Guestbook
	$("#accordion").accordion();
	
	//CAROUSEL GALERIE
	$(".liste_thumbs").popeye({
		/*caption:    false,*/
		/*navigation: 'permanent',*/
		direction:  'left'
	});
	
	
	// LIGHTBOX
	$(function() {
        $('.liste_overlay a').lightBox({
        	imageLoading:			'../.../../../img/lightbox/lightbox-ico-loading.gif',		// (string) Path and the name of the loading icon
			imageBtnPrev:			'../.../../../img/lightbox/lightbox-btn-prev.gif',			// (string) Path and the name of the prev button image
			imageBtnNext:			'../.../../../img/lightbox/lightbox-btn-next.gif',			// (string) Path and the name of the next button image
			imageBtnClose:			'../.../../../img/lightbox/lightbox-btn-close.gif',			// (string) Path and the name of the close btn
			imageBlank:				'.../.../../../img/lightbox/lightbox-blank.gif'				// (string) Path and the name of a blank image (one pixel)
        } );
    });
	
	//OVERLAY GALERIE
	// select the thumbnails and make them trigger our overlay 
	/*$(".liste_overlay a").overlay({ 
	    // each trigger uses the same overlay with the id "gallery" 
	    target: '#zoomgallery', 
	    // optional exposing effect 
	    expose: '#010101' 
	// let the gallery plugin do its magic! 
	}).gallery({ 
	    // the plugin accepts its own set of configuration options 
	    speed: 400 
	});*/
	

	//PNGFIX
	$(document).pngFix();
	
	
	
	
});
