$(function() {
	$("body.home div#masthead").flash(
		{src:"flash/home.swf",
		 width:833,
		 height:299,
		 wmode:"transparent",
		 quality:"high"},
		 {version:"8"}
	);
	$("body.photo div#photo-tour").flash(
		{src:"flash/photo-tour.swf",
		 width:500,
		 height:350,
		 wmode:"transparent",
		 quality:"high"},
		 {version:"8"}
	);
	$("body.photo div#gallery-tour").flash(
		{src:"flash/gallery.swf",
		 width:465,
		 height:375,
		 wmode:"transparent",
		 quality:"high"},
		 {version:"8"},
			function(htmlOptions) { //Use this to specify a query string, take out if not needed.
				htmlOptions.flashvars.configFile = "flash/xml/gallery_config.xml";
				htmlOptions.flashvars.xmlFile = "flash/xml/images.xml";
				$(this).html($.fn.flash.transform(htmlOptions));
		}
	);
	$("div#boat-basin").flash(
		{src:"video/boat-basin/boat-basin.swf",
		 width:720,
		 height:530,
		 wmode:"transparent",
		 quality:"high"},
		 {version:"8"}
	);
	$("div#jared-coffin").flash(
		{src:"video/jared-coffin/jared-coffin.swf",
		 width:720,
		 height:530,
		 wmode:"transparent",
		 quality:"high"},
		 {version:"8"}
	);
	$("div#the-cottages").flash(
		{src:"video/the-cottages/cottages.swf",
		 width:720,
		 height:530,
		 wmode:"transparent",
		 quality:"high"},
		 {version:"8"}
	);
	$("div#wauwinet").flash(
		{src:"video/wauwinet/wau.swf",
		 width:720,
		 height:530,
		 wmode:"transparent",
		 quality:"high"},
		 {version:"8"}
	);
	$("div#white-elephant").flash(
		{src:"video/white-elephant/white-elephant.swf",
		 width:720,
		 height:530,
		 wmode:"transparent",
		 quality:"high"},
		 {version:"8"}
	);
	// Email Signup Flash
	$("div#flash-signup").flash(
		{src:"flash/email-form.swf",
		 width:232,
		 height:413,
		 wmode:"transparent",
		 quality:"high"},
		 {version:"9"},
			function(htmlOptions) { //Use this to specify a query string, take out if not needed.
				htmlOptions.flashvars.submissionPath = "email-flash-process.php";
				$(this).html($.fn.flash.transform(htmlOptions));
		}
	);



	$("div#diner-card a").mouseover(function(){$(this).find("img").attr("src","images/inset/diner-card-back.gif");});
	$("div#diner-card a").mouseout(function(){$(this).find("img").attr("src","images/inset/diner-card.gif");});
	$("table#housing-rates tr:even td").addClass("even");
	$("table#housing-rates tr:odd td").addClass("odd");

	$("form#check-availability").submit( function(){
			window.location.href = $("form#check-availability select").val();
			return false;
		}
	);
	// intPadding array order is: left, top, right, bottom - must match css for corresponding element
	$('div#content h1').sifr(
		{ strSWF: 'flash/palatino-linotype.swf', strColor: '#977A5C', strLinkColor: '#977A5C', strHoverColor: '#977A5C', strWmode: 'transparent', intPadding: [0, 0, 0, 0] },
		{ expressInstall: true }
	);
	$('body:not(".home") div#content h2').sifr(
		{ strSWF: 'flash/palatino-linotype.swf', strColor: '#8C7256', strLinkColor: '#8C7256', strHoverColor: '#8C7256', strWmode: 'transparent', intPadding: [0, 0, 0, 0] },
		{ expressInstall: true }
	);
	$('div#push-marketing h3').sifr(
		{ strSWF: 'flash/palatino-linotype.swf', strColor: '#6D7E99', strLinkColor: '#6D7E99', strHoverColor: '#6D7E99', strWmode: 'transparent', intPadding: [0, 0, 0, 0], strFlashVars: 'textalign=center&' },
		{ expressInstall: true }
	);
	$('body.experience div#sidebar h3').sifr(
		{ strSWF: 'flash/palatino-linotype.swf', strColor: '#50688C', strLinkColor: '#50688C', strHoverColor: '#50688C', strWmode: 'transparent', intPadding: [0, 0, 0, 0], strFlashVars: 'textalign=right&' },
		{ expressInstall: true }
	);
	$('div#sidebar h3').sifr(
		{ strSWF: 'flash/palatino-linotype.swf', strColor: '#6D7E99', strLinkColor: '#6D7E99', strHoverColor: '#6D7E99', strWmode: 'transparent', intPadding: [0, 0, 0, 0] },
		{ expressInstall: true }
	);
	
	$('div.video-vote a').click(function(){
		$('input#fav-video').val(($(this).attr("id")));
		return false;
	});

	var openFnVideoModal=function(hash){	
		hash.w.show();
		$("div#video-content").html('');
		var videoURL = $(hash.t).attr('href');
		$("div#video-content").flash({src:videoURL,width:560,height:340,wmode:"transparent", quality:"high"}, {version:"7"});
		$('#video-modal').css({left:($(window).width()-$('#video-modal').width())/2,top:$(window).scrollTop()+10});
	};

	var hideFn=function(hash){
		hash.w.hide()
		hash.o.remove();
		$("div#video-content embed").remove();		
	};


	$('div#video-modal').jqm({trigger: 'div.video-thumb a', onShow: openFnVideoModal, onHide: hideFn});
	

});

function resizeSwf(size) {
	if ( size == 413 ) {
		$("#flash-signup").css("height","413px");
	} else {
		$("#flash-signup").css("height","30px");
	}
}


