//galleries
$(document).ready(

	function(){
		$('#slider').innerfade({
			animationtype: 'fade',
			speed: 1750,
			timeout: 7000,
			type: 'random',
			containerheight: '110px'
		});
			
		$(".scrollable").scrollable();	
		$(".items img").click(function() { 
    var url = $(this).attr("alt"); 
    // get handle to element that wraps the image and make it semitransparent 
    var wrap = $("#image_wrap").fadeTo("fast", 0.8); 
    var img = new Image(); 
    // call this function after it's loaded 
    img.onload = function() { 
        // make wrapper fully visible 
        wrap.fadeTo(200, 1); 
        // changer l'image 
        wrap.find("img").attr("src", url); 
 
    }; 
 
    img.src = url; 
 
	}).filter(":first").click();// simule un clique au chargement de la page
	
	$(".popin[rel]").overlay({expose: { 
       color: '#000', 
       loadSpeed: 200, 
        opacity: 0.5 
    }});
    

//	$(".zoom img[rel]").overlay({effect: 'apple'});	
//	$('a[rel*=external]').click( function() {
//		window.open(this.href);
//		return false;
//	});

	}
);

//invocation du calendrier - doc: http://keith-wood.name/datepick.html
$(function() {
$.datepick.setDefaults({ buttonImageOnly: true, showStatus: true, showOn: 'both', buttonImage: 'media/img/calendar.png', minDate:0, maxDate: '+1Y', showMonthAfterYear: true});
$(".popupDatepicker").datepick();
});


//???
function getForm() {
date=getVar('dateIN');
date2=getVar('dateOUT');
pers=getVar('pers');
resa=getVar('resa');
lang=getVar('lang');
if(date != 0) document.getElementById("Date").value = date;
if(date != 0) document.getElementById("Date2").value = date2;
if(date != 0) document.getElementById("adulte").value = pers;

if(lang == 'fr') txt = "Votre demande a bien ŽtŽ enregistrŽe.";
if(lang == 'uk') txt = "Votre demande a bien ŽtŽ enregistrŽe.";
if(lang == 'nl') txt = "Votre demande a bien ŽtŽ enregistrŽe.";

if(resa == 'ok') document.getElementById("resaValid").innerHTML = txt;
}


function Favoris() {
 title = document.title; 
 url = window.location.href;
 
    if (window.sidebar) { // Mozilla Firefox Bookmark
        window.sidebar.addPanel(title, url,"");
    } else if( window.external ) { // IE Favorite
        window.external.AddFavorite( url, title); }
    else if(window.opera && window.print) { // Opera Hotlist
        return true; }
 }