/*JS*/
$(document).ready(function() {

	if($('#moreInfo').length) {
		hoverInfoHome();
	}

	/*AFO 2012*/
	if($('#home').length) {
		flyMeToTheMoon();
		pushHome();
	}
	/*FIN AFO 2012*/
	
	
	if($('#moteurResa_home').length) {
		switcherResaHome();
		/*
    $("#moteurResa_home input.datepicker").datepicker({
			showOn: 'both',
			buttonImage: 'images/common/btn_datepicker.png'	,
			changeMonth: true,
			changeYear: true,
			minDate: 0,
			buttonText: '' //'Choisissez votre date de depart'
		});
    */

		$("#sliderBudget").slider({
			range:true,
			min: 0,
			max: 6,
			values:[ $('#valueBudgetMin').val(), $('#valueBudgetMax').val()],
			step: 1,
			stop: function(event, ui) {
        $('#valueBudgetMin').val(ui.values[0]);
        $('#valueBudgetMax').val(ui.values[1]);
			}
		});
		$("#sliderBudget .ui-slider-handle").eq(0).addClass('firstHandle');

		$("#sliderBudgetWE").slider({
			range:true,
			min: 0,
			max: 6,
			values:[ 0, 6],
			step: 1,
			stop: function(event, ui) {
        $('#valueBudgetWEMin').val(ui.values[0]);
        $('#valueBudgetWEMax').val(ui.values[1]);
			}
		});
		$("#sliderBudgetWE .ui-slider-handle").eq(0).addClass('firstHandle');

		//$('#moteurResa_home select').sSelect({ddMaxHeight: '155px'});

		showMoreCriteriaHome();
		nightNumberActive();
		miniSitemap();
        hoverReset();
	}

	$('#nav li li:last-child').addClass('last');


	if($('#moteurResa_common').length) {
		if($('#switcherResa_common').length) {
			switcherResaCommon();
			nightNumberActiveCommon();
		}

		$('#moteurResa_common select').sSelect({ddMaxHeight: '155px'});
		/*
    $("#moteurResa_common input.datepicker").datepicker({
			showOn: 'both',
			buttonImage: 'images/common/btn_datepicker.png'	,
			changeMonth: true,
			changeYear: true,
			minDate: 0,
			buttonText: 'Choisissez votre date de dÃ©part'
		});
    */
		$("#sliderBudget").slider({
			range:true,
			min: 0,
			max: 6,
			values:[ $('#valueBudgetMin').val(), $('#valueBudgetMax').val()],
			step: 1,
			stop: function(event, ui) {
        $('#valueBudgetMin').val(ui.values[0]);
        $('#valueBudgetMax').val(ui.values[1]);
			}
		});
		$("#sliderBudget .ui-slider-handle").eq(0).addClass('firstHandle');

		$("#sliderBudgetWE").slider({
			range:true,
			min: 0,
			max: 6,
			values:[ 0, 6],
			step: 1,
			stop: function(event, ui) {
        $('#valueBudgetWEMin').val(ui.values[0]);
        $('#valueBudgetWEMax').val(ui.values[1]);
			}
		});
		$("#sliderBudgetWE .ui-slider-handle").eq(0).addClass('firstHandle');

		showMoreCriteria();
        hoverReset();
	}

	if($('.moteurResa_quick').length) {
		$('.moteurResa_quick select').sSelect({ddMaxHeight: '155px'});
	}

	/*AFO 2012*/
	$('#utilities li.btn_lastSeen > a').click(function() {		
		$('#lastSeen').slideDown(function() {
			$('body').one('click' , function() {
				$('#lastSeen').fadeOut();
			});			
		});		
		return false;	
	});
	/*FIN AFO 2012*/

	if($('#tabResidence').length) {
		switchSeason();
		readMore();
		semainier();
	}

	if($('#filterResults').length) {
		$('#filterResults select').sSelect({ddMaxHeight: '155px'});
		highlightHebType();
	}

	if($('#blocSlider').length) {
		blocSlider();
		/*if($('#blocSlider div.moteurResa_quick').length) {
			$('#blocSlider div.moteurResa_quick select').sSelect({ddMaxHeight: '155px'});
		}*/

		if($('.moteurResa_quick').length) {
		$('.moteurResa_quick select').sSelect({ddMaxHeight: '155px'});
		}

		if($('#flip_dossiers').length) {
			switchFileEditor();

		}
	}

	if($('#events').length) {
		sliderEvent();
	}

	if($('#carouselRecoResidence').length) {
		initCarouselReco();
	}

	if($('#carouselStationProx').length) {
		initCarouselStationProx();
	}

	if($('#carouselStationEquiv').length) {
		initCarouselStationEquiv();
	}

	if($('#selectMonthEvent').length) {
		$('#selectMonthEvent select').sSelect({ddMaxHeight: '155px'});
		selectMonthEvent();
	}

	if($('#quickGeoSearch').length) {
		$('#quickGeoSearch select').sSelect({ddMaxHeight: '155px'});
	}

	if($('#sideBarSearch').length) {
		$('#sideBarSearch select').sSelect({ddMaxHeight: '155px'});
	}

	if($('#cardNav').length) {
		addOptions();
		tip();
		$('div.cartMod select').sSelect({ddMaxHeight: '155px'});
		logSwitch();
		paySwitch();
    $('#paymentMethod_cb').click();
	}

	if($('#globalFeedback').length) {
		$('#filterFeedback > p select ').sSelect({ddMaxHeight: '155px'});
	}

	/*GESTION POPIN*/
	$('a.popinLink').colorbox({opacity:"0.7" , photo: true , scrolling:false , current : "photo {current} sur {total}", scalePhotos:false });
	$('a.popinLink_ajax').colorbox({opacity:"0.7" , width:"650px" , close:"FERMER", maxHeight:"850px" , scalePhotos:false });/* maxHeight a 100% marche bien selon la hauteur du viewport */
	$('a.popinLink_inline').click(function() {
		var popinToShow = $(this).attr('href');
		$.fn.colorbox({opacity:"0.7" , width:"650px", maxHeight:"850px", scalePhotos:false ,inline:true, href:popinToShow});
	});
	$('a.popinLink_meteo').click(function() {
		var popinToShow = $(this).attr('href');
		if($(this).parent().attr('id')) {
			$.fn.colorbox({opacity:"0.7" , width:"450px", maxHeight:"850px", close:"FERMER" , scalePhotos:false , href:popinToShow , onComplete:function(){
				$('#colorbox').addClass('skinSummer');
			}});
		} else {
			$.fn.colorbox({opacity:"0.7" , width:"450px", maxHeight:"850px", close:"FERMER", scalePhotos:false , href:popinToShow , onComplete:function(){
				$('#colorbox').removeClass('skinSummer');
			}});
		}
		return false;
	});


/*only functions for IE 6*/
	if ($.browser.msie && $.browser.version <= 6 ) {
			try {document.execCommand('BackgroundImageCache', false, true);} catch(e) {} //caching CSS images

			navIE6();
		}
/*end IE6*/

});

function navIE6() {
	$('#nav > li').hover(function() {
		$(this).addClass('hovered');
	},function() {
		$(this).removeClass('hovered');
	});
}

function highlightHebType() {
	$('#content table.offersResults .choiceHeb input[type="radio"]:checked').next('label').addClass('mySelection');

	$hebTypeRadio = $('#content table.offersResults .choiceHeb input:radio');
	$hebTypeLabel = $('#content table.offersResults .choiceHeb label');

	$hebTypeRadio.click(function() {
			$brotherLabels = $(this).parent('p').parent('fieldset.choiceHeb').find('label');
			$brotherLabels.removeClass('mySelection');
			$(this).next('label').addClass('mySelection');
		});

	$hebTypeLabel.click(function() {
		$brotherLabels = $(this).parent('p').parent('fieldset.choiceHeb').find('label');
		$brotherLabels.removeClass('mySelection');
		$(this).addClass('mySelection');
	});
}

function hoverInfoHome() {
	$('#moreInfo').click(function() {
		$('#hoverInfo').slideDown(function() {
			$('#closeIt').one('click' , function() {
				$('#hoverInfo').fadeOut();
			});
		});
	});

	/*$('#hoverInfo #closeIt').click(function() {
		$('#hoverInfo').fadeOut();
	});	*/
}

function miniSitemap() {
	$('#mini_sitemap > a.btn').toggle(function() {
		$(this).children('span').text('-').parent('a').prevAll('ul').css('height','auto');
		return false;
	}, function() {
		$(this).children('span').text('+').parent('a').prevAll('ul').css('height', 192);
		return false;
	});
}

function showMoreCriteria() {
	$('#moteurResa_common .btn_moreCrit a.btn').click(function() {
		var moreCritToShow = $(this).attr('href').split('#');

		if($('#'+moreCritToShow[1]).css('display') == 'none') {
		  $('#'+moreCritToShow[1]).slideDown();
    } else {
		  $('#'+moreCritToShow[1]).slideUp();
    }
		return false;
	});

	$('#moteurResa_common span.closeIt').click(function() {
		$(this).parent('fieldset').parent('div').slideUp();
	});
}

function showMoreCriteriaHome() {
	$('#moteurResa_home .btn_moreCrit a.btn').click(function() {
		var moreCritToShow = $(this).attr('href').split('#');

		if($('#'+moreCritToShow[1]).css('display') == 'none') {
  		$('#'+moreCritToShow[1]).show('slide','normal');
    } else {
  		$('#'+moreCritToShow[1]).hide('slide','normal');
    }
		return false;
	});

	$('#moteurResa_home span.closeThis').click(function() {
		$(this).parent('fieldset').parent('div').hide('slide','normal');
	});
}

function switcherResaHome() {
	$switchBlocResa = $('#moteurResa_home .switchBlocResa');
	$switchBlocResa.eq(0).show();
	$('#switcherResa_home > li').eq(0).addClass('active');

	$('#switcherResa_home > li > label').click(function() {
		var blocToShow = $(this).attr('id').split('trig_');
		$switchBlocResa.hide();
		$('#switcherResa_home > li').removeClass('active');
		$('#'+blocToShow[1]).show();
		$(this).parent('li').addClass('active');

		$('#moreCritHome , #moreCritHome2 , #moreCritHome3').css('display','none');
	});
}

function switcherResaCommon() {
	$switchBlocResa = $('#moteurResa_common .switchBlocResa');
	$switchBlocResa.eq(0).show();
	$('#switcherResa_common > li').eq(0).addClass('active');

	$('#switcherResa_common > li > label').click(function() {
		var blocToShow = $(this).attr('id').split('trig_');
		$switchBlocResa.hide();
		$('#switcherResa_common > li').removeClass('active');
		$('#'+blocToShow[1]).show();
		$(this).parent('li').addClass('active');

		$('#moteurResa_common div.moreCrit').css('display','none');
	});
}

function nightNumberActive() {
	$('#blocResaHome_2 label.skinedRadio').click(function() {
		$('#blocResaHome_2 label.skinedRadio').removeClass('selected');
		$(this).addClass('selected');
	});
}

function nightNumberActiveCommon() {
	$('#blocResaCommon_2 label.skinedRadio').click(function() {
		$('#blocResaCommon_2 label.skinedRadio').removeClass('selected');
		$(this).addClass('selected');
	});
}

function skinControlCheckbox() {
	$('#mainContent_panier label.skinnedCheckbox').click(function() {
		$(this).removeClass('selected').parent('td').next('td').children('span').addClass('greyBox');
		$(this).children('input:checked').parent('label').addClass('selected').parent('td').next('td').children('span').removeClass('greyBox');
	});
}

function skinControlRadio() {
	$('#mainContent_panier label.skinnedRadio').click(function() {
		var nameRadio = $(this).children('input:radio').attr('name');
		$("#mainContent_panier label.skinnedRadio input[name="+nameRadio+"]").parent('label.skinnedRadio').removeClass('selected');
		$(this).addClass('selected');

		if($(this).parent('div.paymentType').length) {
			$('#mainContent_panier div.paymentType p').hide();
			$(this).next('p').show();
		}
	});
}

function selectMonthEvent() {
	$('#selectMonthEvent label.skinedRadio').click(function() {
		$('#selectMonthEvent label.skinedRadio').removeClass('selected');
		$(this).addClass('selected');
	})
}

function blocSlider() {
	$blocSliderTrigger = $('#blocSlider li h3');
	$blocSliderContent = $('#blocSlider li .blocSliderContent');

	if($('#blocSlider li h3.active').length) {
		$('#blocSlider li h3.active').next('div.blocSliderContent').show();
	}else {
		$blocSliderContent.eq(0).show();
		$blocSliderTrigger.eq(0).addClass('active');
	}

	$blocSliderTrigger.click(function() {
		$blocSliderContent.slideUp().children('p.priceDetails').find('.btn').css('visibility','visible');
		$blocSliderTrigger.removeClass('active');
		$(this).next('div:hidden').slideDown('normal',function() {
			$(this).prev('h3').addClass('active');
		});
	});
}

function switchFileEditor() {
	$('#blocSlider > li ul.fileEditor > li').live("click", function() {
		if($(this).find('a').length) {
			return true
		} else {
			var fileBlocToShow = $(this).attr('class');
			if($(this).attr('id').length) {
				$(this).removeAttr('id').parent('ul').nextAll('div.filEditorBox').hide();
			}
			else {
				$(this).removeAttr('id').siblings('li').removeAttr('id').parent('ul').nextAll('div.filEditorBox').hide();
				$(this).attr('id','active').parent('ul').nextAll('div.box_'+fileBlocToShow).show();
			}
		}
	});

	$('#blocSlider .box_addFeedback label.labelRating').live("click", function() {
		$(this).removeClass('selected').siblings('label.labelRating').removeClass('selected');
		$(this).addClass('selected').prevAll('label.labelRating').addClass('selected');
	});

	$('#blocSlider table.totalDossier td.payLine a.btn').live("click", function() {
		$('#blocSlider .blocSliderContent .filEditorBox').hide();
		$('#blocSlider .blocSliderContent ul.fileEditor li').removeAttr('id');
		$('#blocSlider .blocSliderContent .box_showPaiment').show();
		$('#blocSlider .blocSliderContent ul.fileEditor li.showPaiment').attr('id','active');
	});

}

function logSwitch() {
	$('#logMod h2 label').click(function() {
		var blocToShow = $(this).attr('for').split('logSwitch_');
		$('#logMod fieldset').css('display','none');
		$("#"+blocToShow[1]).css('display','block');
	});
}

function tip() {
	$('.tip img').hover(function() {
		$(this).next('.tipContent').css('display','block').parent('.tip').css('z-index','1');
	}, function() {
		$(this).next('.tipContent').css('display','none').parent('.tip').css('z-index','0');
	});
}

function addOptions() {
	$('#optionsMod dt').click(function() {

		if(!($(this).hasClass('noClose'))) {
			$('#optionsMod dt:not(.noClose)').next('dd').slideUp();
			$('#optionsMod dt').removeClass('opened');
			$(this).next('dd:hidden').slideDown('normal', function() {
				$(this).prev('dt').addClass('opened');
			});
		}
		return false;
	});
}

function optionSlider() {
	$optionSliderTrigger = $('#mainContent_panier ul.optionSlider > li h3');
	//$optionSliderContent = $('#mainContent_panier ul.optionSlider > li .optionSlider_content');

	$('#mainContent_panier ul.optionSlider').each(function() {
		if($(this).children('li').children('h3.active').length) {
			$('#mainContent_panier ul.optionSlider > li h3.active').next('div.optionSlider_content').show();
		}else {
			$(this).children('li').eq(0).children('h3').addClass('active').next('div.optionSlider_content').show();
		}
	});

	/*$optionSliderTrigger.click(function() {
		$optionSliderContent.slideUp();
		$(this).parent('li').parent('ul').find('h3').removeClass('active');
		$(this).next('div:hidden').slideDown('normal',function() {
			$(this).prev('h3').addClass('active');
		});
	});	*/

	$optionSliderTrigger.click(function() {
		$(this).toggleClass('active');
		$(this).next('div').slideToggle();
	});

	$optionDescTrigger = $('#mainContent_panier ul.optionSlider > li .optionSlider_content dt .knowMore');

	$optionDescTrigger.toggle(function() {
		$(this).parent('dt').nextAll('dd.descOption').show();
	}, function() {
		$(this).parent('dt').nextAll('dd.descOption').hide();
	});
}

function sliderEvent() {
	$('#events > li a.btn').click(function() {
		var myEventHeight = $(this).prev('div.innerEvent').height();
		if (myEventHeight < 145) {
			myEventHeight = 155 ;
		}
		if($(this).parent('li').hasClass('showContent')) {
			$('#events > li').animate({height : 145});
			$(this).parent('li').removeClass('showContent');
			$(this).children('span').text('+');
			return false;
		}
		else {
			$('#events > li').height(145).removeClass('showContent');
			$('#events > li a.btn span').text('+')
			$(this).parent('li').addClass('showContent').animate({height : myEventHeight});
			$(this).children('span').text('-');
			return false;
		}
	});
}

function switchSeason() {

	return false;

	$('#tabResidence li.season a').click(function () {
		var seasonToShow = $(this).attr('href').split('#');

		if(seasonToShow[1] == 'summerInfo') {
			$('#content').addClass('skinSummer');
			$('#mainContent .mainDesc , #mainContent .services , #diaporama .lesPlus').hide();
			$('#mainDesc_summer , #services_summer , #lesPlus_summer').show();

		} else {
			$('#content').removeClass('skinSummer');
			$('#mainContent .mainDesc , #mainContent .services , #diaporama .lesPlus').show();
			$('#mainDesc_summer , #services_summer ,  #lesPlus_summer').hide();
		}
		$(this).parent('li').addClass('active').siblings('li').removeClass('active');
		return false;
	});
}

function readMore() {
	$('#mainContent .mainDesc_txt').each(function() {
		if($(this).parent('.mainDesc').css('display') == 'none') {
			$(this).parent('.mainDesc').css({display:'block', position:'absolute', left:'-999em'});
			var inititalHeight = $(this).innerHeight();
			$(this).parent('.mainDesc').css({display:'none', position:'static', left:'0'});
		}
		else {
			var inititalHeight = $(this).innerHeight();
		}

		if(inititalHeight > 273) {
			$(this).height(273);
			$(this).next('button').css('visibility','visible');
			$(this).next('button').toggle(function() {
				$(this).text('> Replier').prev('div').css('height','auto');
			}, function() {
				$(this).text('> Lire la suite').prev('div').css('height','273px');
			});

		} else {
			$(this).height(273);

		}
	});
}
function semainier() {
	//$('#semainier th select').sSelect({ddMaxHeight: '155px'});
    var inFrame = false;
    if(document.getElementById('inFrame'))
    {
       inFrame = document.getElementById('inFrame').value;
    }

	$("#semainier td.price , #semainier td.promo , #semainier td.fromResults").hover(function() {
		$(this).addClass('hoveredCell');
	}, function() {
		$(this).removeClass('hoveredCell');
	});

	$("#semainier td.price , #semainier td.promo , #semainier td.fromResults").click(function(evt) {

        var popupLinkY = evt.pageY - 240;
		if($(this).hasClass('selected')) {
			$(this).removeClass('selected');

		} else {

			$(this).addClass('selected');

			var url = $(this).children('a').attr('href');
			$.fn.colorbox({opacity:"0.7", width:"420px", scalePhotos:false , href:url, onComplete:function(){
                
                
                if(inFrame == 1)
                {
                    $('#colorbox').css('top',popupLinkY);
                }

				$('#addCart select').sSelect({ddMaxHeight: '80px'});
				$('#addHeb').click(function() {
					$.fn.colorbox.close();
					return false;
				});
			}});
		}

		return false;

	});

		$("#semainier td.hebType a").click(function() {

		if(!($(this).children('.tipKnowMore').css('display') == 'block')) {
			$("#semainier td.hebType .tipKnowMore").fadeOut();
			$(this).children('.tipKnowMore').slideDown();
		}

		$('#semainier td.hebType img.closeKnowMore').click(function() {
			$(this).parent().fadeOut();
		});

		$('#semainier td.hebType p.fermer_ensavoirplus').click(function() {
			$(this).parent().fadeOut();
		});

		return false;
	});
}

function initCarouselReco() {
	if($('#carouselRecoResidence li').length > 1) {
	 $("#carouselRecoResidence").jCarouselLite({
		btnNext: ".recoResidence .btn_next",
        btnPrev: ".recoResidence .btn_prev",
			auto: 5000,
			speed: 1000,
			pauseOnHover : true ,
		visible: 2
    });
	} else {
		$('.recoResidence .btn_prev , .recoResidence .btn_next').css('visibility','hidden');
	}
}

function initCarouselStationProx() {
	if($('#carouselStationProx li').length > 1) {
		 $("#carouselStationProx").jCarouselLite({
			btnNext: "#stationProx .btn_next",
			btnPrev: "#stationProx .btn_prev",
			visible: 1
		});
	} else {
		$('#stationProx .btn_prev , #stationProx .btn_next').css('visibility','hidden');
	}
}

function initCarouselStationEquiv() {
	if($('#carouselStationEquiv li').length > 1) {
		 $("#carouselStationEquiv").jCarouselLite({
			btnNext: "#stationEquiv .btn_next",
			btnPrev: "#stationEquiv .btn_prev",
			visible: 1
		});
	} else {
		$('#stationEquiv .btn_prev , #stationEquiv .btn_next').css('visibility','hidden');
	}
}

function flipTabRecap() {
	$('#tabRecap > li > a').click(function() {
		var recapToShow = $(this).attr('href').split('#');

		if(recapToShow[1] == 'flip_options') {
			$('#flip_options').show();
			$('#flip_hebergement').hide();
		} else {
			$('#flip_hebergement').show();
			$('#flip_options').hide();
		}
		$('#tabRecap > li').removeClass('current');
		$(this).parent('li').addClass('current');
		return false;
	});
}

function flipTabAccount() {
	var defaultBlocToShow = $('#tabAccount > li.current > a').attr('href').split('#');
	$('#'+defaultBlocToShow[1]).show();

	$('#tabAccount > li:not(.print) > a').click(function() {
		var recapToShow = $(this).attr('href').split('#');

		if(recapToShow[1] == 'flip_dossiers') {
			$('#flip_dossiers').show();
			$('#flip_infos').hide();
		} else {
			$('#flip_infos').show();
			$('#flip_dossiers').hide();
		}
		$('#tabAccount > li').removeClass('current');
		$(this).parent('li').addClass('current');
		return false;
	});
}

function pleaseWaitLayer(longL) {
	var viewportHeight = $(document).height();
	//$('body').append('<div id="pleaseWaitLayer"> </div>');


	$('#pleaseWaitLayer').css('height',viewportHeight).show();
	$('#pleaseWaitLoader').show();

	if(longL == true)
	{
		$('#imgLongLoader').show();
		$('#loaderText').show();
	}
	else
		$('#imgLoader').show();


	//$('body').append('<img id="pleaseWaitLoader" src="images/common/pleaseWait.gif" alt="Chargement en cours" />');
}

function killPleaseWaitLayer(longL) {

	var idLoader = 'pleaseWaitLoader';

	$('#pleaseWaitLayer , #pleaseWaitLoader').hide();

	if(longL == true)
	{
		$('#loaderText').hide();
		$('#imgLongLoader').hide();
	}
	else
		$('#imgLoader').hide();

}

function openPopinFromFlash(imgUrlFromFlash, group, rang) {
	var nbPhotos = $("#flashCarousel_container a[rel='"+group+"']").length;
	/*var searchgroup = group+"x";
alert(searchgroup);
	var objectToInit = $("#flashCarousel_container a[rel='"+searchgroup+"']");

	if(objectToInit){
		objectToInit.attr("rel",group);
alert('reinit ok');
	}*/

	for (i=0; i < nbPhotos; i++) {
		if (i != rang) {
			$("#flashCarousel_container a[rel='"+group+"']").eq(i).colorbox({photo: true});
		}
		else{
			myHref = $("#flashCarousel_container a[rel='"+group+"']").eq(i).attr("href");
			/*$("#flashCarousel_container a[rel='"+group+"']").eq(i).attr("rel",group+"x");
			alert('group change ok');*/
		}
	}

	$.fn.colorbox({ opacity:"0.7", scrolling:false , photo: true , scalePhotos:false , rel:group , slideshow:true, slideshowAuto:false, href:myHref });
}

function resertCriteresMotRech(){
    location.href = "ajax/ajax_resetMoteurs.php";
}

function hoverReset() {
	$('#content').find('.btn_reset').hover(function() {
		$(this).children('span').css('display','block');
	}, function() {
		$(this).children('span').css('display','none');
	});
}

/*AFO 2012*/
function flyMeToTheMoon() {
	$mountainTop = $("#montainTop");	
	$mountainTop.animate({top:"265px"},1000,'easeInOutExpo');	

	$(window).scroll(function () { 	 
		var yScroll;
		if (self.pageYOffset) {
		  yScroll = self.pageYOffset;		  
		} else if (document.documentElement && document.documentElement.scrollTop) {
		  yScroll = document.documentElement.scrollTop;		 
		} else if (document.body) {// all other Explorers
		  yScroll = document.body.scrollTop;		 
		}
		
		$mountainTop.stop().animate({top:"-200px"},700,'easeInOutExpo');		
		if(yScroll == 0) {
			$mountainTop.stop().animate({top:"265px"},1200,'easeInOutExpo'); 
		}		
    });
}

function pushHome() {
	$('#pushHome').find('li').click(function() {
		var url = $(this).find('h2 > a').attr('href');
		window.location.href=url;
	});
}
/*FIN AFO 2012*/



/* French initialisation for the jQuery UI date picker plugin. */
jQuery(function($){
	$.datepicker.regional['fr'] = {
		closeText: 'Fermer',
		prevText: '<<',
		nextText: '>>',
		currentText: 'Courant',
		monthNames: ['Janvier','Fevrier','Mars','Avril','Mai','Juin',
		'Juillet','Aout','Septembre','Octobre','Novembre','Decembre'],
		monthNamesShort: ['Jan','Fev','Mar','Avr','Mai','Jun',
		'Jul','Aou','Sep','Oct','Nov','Dec'],
		dayNames: ['Dimanche','Lundi','Mardi','Mercredi','Jeudi','Vendredi','Samedi'],
		dayNamesShort: ['Dim','Lun','Mar','Mer','Jeu','Ven','Sam'],
		dayNamesMin: ['Di','Lu','Ma','Me','Je','Ve','Sa'],
		dateFormat: 'dd/mm/yy', firstDay: 1,
		isRTL: false};
	$.datepicker.setDefaults($.datepicker.regional['fr']);
});





