$(document).ready(function(){

	
	if ($('#accueil-intro-flash').size()>0){
		var so = new SWFObject("/flash/player_flv_maxi.swf", "accueil-intro-flash-swf", "652", "344", "7", "#FFFFFF");
		so.addParam("quality", "high");
		so.addParam("allowScriptAccess", "always");
		so.addParam("allowFullScreen", "true");
		so.addParam("wmode", "transparent");
		so.addParam("FlashVars", "flv=/flash/presentation-chalet-prestige.flv&amp;autoplay=1&amp;buttonovercolor=f2f2f2&amp;loadingcolor=d1d1d1&amp;sliderovercolor=f2f2f2&amp;autoload=1&amp;volume=0&amp;margin=0&amp;showstop=1&amp;showvolume=1&amp;showtime=1&amp;playeralpha=50");
		so.write("accueil-intro-flash");		
	}
	
	if ($('#video-chalet-grande-course').size()>0){
		var so = new SWFObject("/flash/grande-ours.swf", "video-chalet-grande-course-flash-swf", "399", "224", "7", "#FFFFFF");
		so.addParam("quality", "high");
		so.addParam("allowScriptAccess", "always");
		so.addParam("wmode", "transparent");
		so.write("video-chalet-grande-course");
	}
	

	if ($('#formulaire').size()>0){
		$('.frm-text input').example(function() {
		  return $(this).attr('title');
		},{className: 'dfv'});
		$('#message-fr').example('Votre message ici', {
			className: 'dfv'
 		});
		if (document.location.hash != ""){
			$("#frm-chalet").attr("value",unescape(document.location.hash.replace("#chalet=", ""))).removeClass('dfv'); 
		}

	}

	/* 
	a voir pour deplacement du menu
	var htmlStr = $("#dynamo ul").html();
	$("#dynamo").html('');
    $("#dynamo_ul").html(htmlStr);
	*/
	
	$('.nav','#nav').hover(
		function() {
			$(this).addClass('nav-hover');
			$('div', this).fadeIn("fast");			
			// $('div', this).css('display', 'block');
		},function() {
			$(this).removeClass('nav-hover');
			$('div', this).css('display', 'none');
		}
	);
	
	
	$("a","#galerie-chalet").fancybox({
		'zoomSpeedIn': 300,
		'zoomSpeedOut': 300
	});


	
	$('.sub-nav-list li').css('cursor','pointer').hover(function(){
			$(this).addClass('sub-nav-list-item-hover');
		}, function(){
			$(this).removeClass('sub-nav-list-item-hover');
		}).click(function(){
		document.location.href  = $(this).find('a:last')[0].href;
	});

	$('.bloc-presentation-chalet').css('cursor','pointer').hover(function(){
			$(this).find('img').fadeTo("slow", 0.75);
		}, function(){
			$(this).find('img').fadeTo("fast", 1);
		}).click(function(){
		document.location.href  = $(this).find('a:last')[0].href;
	});	
	
	if ($('#diapo-950').size()>0){
		$('#diapo-950').innerfade({
			animationtype: 'fade',
			speed: 'slow',
			timeout: '4000',
			type: 'sequence',
			containerheight: '404px'
		}); 
	}
	
	if ($('#diapo-photo').size()>0){
		$('#diapo-photo').innerfade({
			animationtype: 'fade',
			speed: 'slow',
			timeout: '4000',
			type: 'sequence'
			// containerheight: '344px'
		}); 
	}
	
});

$.fn.hoverClass = function(c) {
    return this.each(function(){
        $(this).hover( 
            function() { $(this).addClass(c);  },
            function() { $(this).removeClass(c); }
        );
    });
};