$(function() {
// Sample usage of jquery.flash plugin - remove if not needed
	/*	If given the following markup:

	<div id="masthead">
		<img src="images/mastheads/flash-alt.jpg" alt="" /><br />
	</div>
	
	you would use the following to replace the alternate content:

	$("div#masthead").flash(
		{src:"flash/home.swf",
		 width:600,
		 height:300,
		 wmode:"transparent",
		 quality:"high"},
		 {version:"8"},
			function(htmlOptions) { //Use this to specify a query string, take out if not needed.
				htmlOptions.flashvars.xmlfile = "xml/filename.xml";
				$(this).html($.fn.flash.transform(htmlOptions));						
		});
	*/
	
	$("div#homepage-flash").flash(
		{src:"flash/homepage.swf",
		 width:641,
		 height:509,
		 wmode:"transparent",
		 quality:"high"},
		 {version:"8"}
	);
	
	var pageClass = $('body').attr('class');
	var headerID = 0;
	
	switch(pageClass) {
		case "culinary": 
			headerID = 1;
			break;
		case "gallery": 
			headerID = 2;
			break;
		case "planning": 
			headerID = 3;
			break;
		case "registry": 
			headerID = 4;
			break;
		case "fine-print": 
			headerID = 5;
			break;
		case "tale": 
			headerID = 6;
			break;
		case "journey": 
			headerID = 7;
			break;
		case "traditions": 
			headerID = 8;
			break;
		case "menus": 
			headerID = 9;
			break;
		case "cakes": 
			headerID = 10;
			break;
		case "team": 
			headerID = 11;
			break;
		case "expert-advice": 
			headerID = 12;
			break;
		case "news": 
			headerID = 0;
			break;
		default:
			headerID = 0;
			break;
	}		
			
	$("div#masthead").flash(
		{src:"flash/header.swf",
		 width:609,
		 height:416,
		 wmode:"transparent",
		 quality:"high"},
		 {version:"8"},
			function(htmlOptions) { //Use this to specify a query string, take out if not needed.
				htmlOptions.flashvars.page = headerID;
				$(this).html($.fn.flash.transform(htmlOptions));
		});
	
	$("div.photo-gallery").each(function() {
		var file = $(this).attr("id");
		$(this).flash(
			{src:"flash/photo_gallery.swf",
			 width:466,
			 height:416,
			 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_" + file + ".xml";
					$(this).html($.fn.flash.transform(htmlOptions));
			}
		);
	});
	
	$("div.video-gallery").each(function() {
		var file = $(this).attr("id");
		$(this).flash(
			{src:"flash/"+file+".swf",
			 width:466,
			 height:400,
			 wmode:"transparent",
			 quality:"high"},
			 {version:"8"}
		);
	});
	
	$('ul#gallery-links li a span').sifr(
		{ strSWF: 'flash/sloop-script-two.swf', strColor: '#337799', strLinkColor: '#337799', strHoverColor: '#0000000', strWmode: 'transparent', intPadding: [0, 0, 0, 0], strFlashVars: 'textalign=center&'},
		{ expressInstall: true }
	);
	
	$('a.pop-up').click( function () {
		var pLink = this.href;
		window.open( pLink,'PopUp','width=600,height=450, scrollbars=yes')
		return false;
	});
// Sample sifr usage - remove if not needed
	/*
	// intPadding array order is: left, top, right, bottom - must match css for corresponding element
	$('div#content h2').sifr(
		{ strSWF: 'flash/font-name.swf', strColor: '#cc0000', strLinkColor: '#cccc00', strHoverColor: '#cc00cc', strWmode: 'transparent', intPadding: [35, 0, 0, 0], strFlashVars: 'textalign=center&', strCase: 'upper' },
		{ expressInstall: true }
	);
	*/


// Adds hover class for IE and animation for drop down nav - remove if not needed
	/*
	$("ul#nav-primary li").hover(
        function(){ $("ul", this).fadeIn("fast"); }, 
        function() { } 
    );
    if (document.all) {
        $("ul#nav-primary li").hoverClass("over");
		$("ul#nav-primary li ul li").hoverClass("over");
    }
	*/
});


// Function to add/remove "over" class for drop down nav - remove if not needed
$.fn.hoverClass = function(c) {
	return this.each(function(){
		$(this).hover( 
			function() { $(this).addClass(c);  },
			function() { $(this).removeClass(c); }
		);
	});

};   
