$(function() {
		   
	for(var i in $.browser) {
		if ($.browser[i])
			BROWSER = i + (($.browser.msie)?$.browser.version.charAt(0):'');
	}
	
		//Rotating Push Marketing
	$('#mycarousel').each(function() { 
		$(this).jcarousel({
			scroll: 1,
			size: 2, 
			buttonNextHTML: '<div><span href="#" class="next-offer"></span></div>', 
			buttonPrevHTML: '<div><span href="#" class="prev-offer"></span></div>'
		});
	});
	
	// Flash masthead
	
	$("div#photo-tour-flash").flash(			
			 {src:"/flash/photos.swf",
			 width:675,
			 height:450,
			 wmode:"transparent",
			 quality:"high"},
			 {version:"7"});
	
	$("div#email-form").flash(			
			 {src:"/flash/email-form.swf",
			 width:235,
			 height:245,
			 wmode:"transparent",
			 quality:"high"},
			 {version:"9"});
	
	$("div#video-youtube").flash(			
			 {src:"http://www.youtube.com/v/LcvnBUjT6q4&hl=en_US&fs=1&",
			 width:480,
			 height:394,
			 wmode:"transparent",
			 quality:"high"},
			 {version:"7"});

	$("div.video-link a").click(function() { 
		var videoURL = $(this).attr('href');
		$("div#video-youtube").flash({src:videoURL,width:480,height:394,wmode:"transparent", quality:"high"}, {version:"7"});
		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 h1.sifr-title').sifr(
		{ strSWF: 'flash/kabel-bk-bt-bold.swf', strColor: '#6B4F30',  strWmode: 'transparent', intPadding: [0, 0, 0, 0], strCase: 'lower' },
		{ expressInstall: true }
	);
	$('div#content h2').sifr(
		{ strSWF: 'flash/kabel-bk-bt-bold.swf', strColor: '#6B4F30', strWmode: 'transparent', intPadding: [0, 0, 0, 0], strCase: 'lower' },
		{ expressInstall: true }
	);
	$('div#hotel-details h3').sifr(
		{ strSWF: 'flash/kabel-bk-bt-bold.swf', strColor: '#FFFFFF', strWmode: 'transparent', intPadding: [0, 0, 0, 0], strCase: 'lower' },
		{ expressInstall: true }
	);
	$('div#push-details h3').sifr(
		{ strSWF: 'flash/kabel-bk-bt-bold.swf', strColor: '#FFFFFF', strWmode: 'transparent', intPadding: [0, 0, 0, 0], strCase: 'lower' },
		{ expressInstall: true }
	);
	   
	$('ul#mycarousel h3').sifr(
		{ strSWF: 'flash/kabel-bk-bt-bold.swf', strColor: '#0d0c0f', strWmode: 'transparent', intPadding: [0, 0, 0, 0], strCase: 'capitalize' },
		{ expressInstall: true }
	);
	
	$('div#blog-push h3').sifr(
		{ strSWF: 'flash/kabel-bk-bt-bold.swf', strColor: '#6A4F31', strWmode: 'transparent', intPadding: [0, 0, 0, 0]},
		{ expressInstall: true }
	);
	
	$('div#archives-wrapper h3').sifr(
		{ strSWF: '/flash/kabel-bk-bt-bold.swf', strColor: '#6B4F30', strWmode: 'transparent', intPadding: [0, 0, 0, 0] },
		{ expressInstall: true }
	);
	
	$('div#blog-flickr h3').sifr(
		{ strSWF: '/flash/kabel-bk-bt-bold.swf', strColor: '#6B4F30', strWmode: 'transparent', intPadding: [0, 0, 0, 0] },
		{ expressInstall: true }
	);
	$('div#blog-calendar h3').sifr(
		{ strSWF: '/flash/kabel-bk-bt-bold.swf', strColor: '#6B4F30', strWmode: 'transparent', intPadding: [0, 0, 0, 0] },
		{ expressInstall: true }
	);
	$('div#twitter-roll h3').sifr(
		{ strSWF: '/flash/kabel-bk-bt-bold.swf', strColor: '#6B4F30', strWmode: 'transparent', intPadding: [0, 0, 0, 0] },
		{ expressInstall: true }
	);
	$('div#blog-offers h3').sifr(
		{ strSWF: '/flash/kabel-bk-bt-bold.swf', strColor: '#FFFFFF', strWmode: 'transparent', intPadding: [0, 0, 0, 0] },
		{ expressInstall: true }
	);

	$('div#header h1').sifr(
		{ strSWF: '/flash/kabel-bk-bt-bold.swf', strColor: '#6B4F30', strWmode: 'transparent', intPadding: [0, 0, 0, 0] },
		{ expressInstall: true }
	);
	
	$('div#content h3:not(".pr")').sifr(
		{ strSWF: '/flash/kabel-bk-bt-bold.swf', strColor: '#6B4F30', strWmode: 'transparent', intPadding: [0, 0, 0, 0], strCase: 'lower' },
		{ expressInstall: true }
	);
	
	// Blog Entry Form - help links
	$('div.form-help').hide();
	$('a.help-link').toggle( function() {
		$(this).parents('div.field').children('div.form-help').show();
		return false;
	},function(){ 
	  $(this).parents('div.field').children('div.form-help').hide();
	  return false;
	});
	
	//Dropdowm menu
/* 
		$("ul#nav-primary li").hover(
			function(){ $("ul", this).show("fast"); }, 
			function(){ } 
		);
		
		if (document.all) { $("ul#nav-primary li").hoverClass("sfHover"); }
*/
// 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");
    }
	*/
	
	/*Jump Menu for world-class-resorts pages */
	
		$("#site").change(function() { if (this.value=="") { return false;}
	else { window.location = this.value;} } );
		//Expand-collapse for event calendar	
		$("div.event-description").hide();
	//$("li.event").each(function() {
	$("li.event").not('.rss-item').each(function() {
	// Div for the Toggler to be Held
	$(this).find("div.event-description").hide().after("<div class=\"event-toggle\" style=\"clear:both;\"><a href=\"#\">View Details</a></div>");
	});
		// Once the Package Toggler Control is clicked
// Toggle the details and chance the text
	$("div.event-toggle a").toggle(function() {
		$(this).parents("li.event").find("div.event-description").animate({
			height: 'show'
		}, 'slow');
		// Changes the Text of the Control
		$(this).html("Hide Details");
	}, function() {
		$(this).parents("li.event").find("div.event-description").animate({
			height: 'hide'
		}, 'slow');
		// Changes the Text of the Control
		$(this).html("View Details");
	});

    $(this).find("div.permalink").show();

//end of expand collapse for calendar

	//MSN Map
	if (typeof jQuery.prototype.msnMap != 'undefined') {	   
		$('#map').msnMap({simpleMap:false});
	}

	$("body.home div#branding").flash(
	{src:"/flash/homepage.swf",
	 width:936,
	 height:316,
	 wmode:"transparent",
	 quality:"high"},
	 {version:"7"},
		function(htmlOptions) { //Use this to specify a query string, take out if not needed.
			htmlOptions.flashvars.xmlPath = "/flash/xml/home-masthead.xml";
			htmlOptions.flashvars.flvPath = "/flash/assets/wave_4.flv";
			$(this).html($.fn.flash.transform(htmlOptions));
	});	
	
	$("body.stay div#branding").flash(
	{src:"/flash/interior-masthead.swf",
	 width:936,
	 height:185,
	 wmode:"transparent",
	 quality:"high"},
	 {version:"7"},
		function(htmlOptions) { //Use this to specify a query string, take out if not needed.
			htmlOptions.flashvars.xmlPath = "/flash/xml/interior-resort.xml";
			htmlOptions.flashvars.flvPath = "/flash/assets/wave_4.flv";
			$(this).html($.fn.flash.transform(htmlOptions));
	});	
	
	$("body.home div#special").flash(

	{src:"/flash/interior-masthead.swf",

	 width:936,

	 height:185,

	 wmode:"transparent",

	 quality:"high"},

	 {version:"7"},

		function(htmlOptions) { //Use this to specify a query string, take out if not needed.

			htmlOptions.flashvars.xmlPath = "/flash/xml/interior-resort.xml";

			htmlOptions.flashvars.flvPath = "/flash/assets/wave_4.flv";

			$(this).html($.fn.flash.transform(htmlOptions));

	});	

	$("body.explore div#branding").flash(
	{src:"/flash/interior-masthead.swf",
	 width:936,
	 height:185,
	 wmode:"transparent",
	 quality:"high"},
	 {version:"7"},
		function(htmlOptions) { //Use this to specify a query string, take out if not needed.
			htmlOptions.flashvars.xmlPath = "/flash/xml/interior-explore.xml";
			htmlOptions.flashvars.flvPath = "/flash/assets/wave_4.flv";
			$(this).html($.fn.flash.transform(htmlOptions));
	});	

	$("body.do div#branding").flash(
	{src:"/flash/interior-masthead.swf",
	 width:936,
	 height:185,
	 wmode:"transparent",
	 quality:"high"},
	 {version:"7"},
		function(htmlOptions) { //Use this to specify a query string, take out if not needed.
			htmlOptions.flashvars.xmlPath = "/flash/xml/interior-things.xml";
			htmlOptions.flashvars.flvPath = "/flash/assets/wave_4.flv";
			$(this).html($.fn.flash.transform(htmlOptions));
	});	
	
	$("body.packages div#branding").flash(
	{src:"/flash/interior-masthead.swf",
	 width:936,
	 height:185,
	 wmode:"transparent",
	 quality:"high"},
	 {version:"7"},
		function(htmlOptions) { //Use this to specify a query string, take out if not needed.
			htmlOptions.flashvars.xmlPath = "/flash/xml/interior-specials.xml";
			htmlOptions.flashvars.flvPath = "/flash/assets/wave_4.flv";
			$(this).html($.fn.flash.transform(htmlOptions));
	});	
	
	$("body.meeting-venues div#branding").flash(
	{src:"/flash/interior-masthead.swf",
	 width:936,
	 height:185,
	 wmode:"transparent",
	 quality:"high"},
	 {version:"7"},
		function(htmlOptions) { //Use this to specify a query string, take out if not needed.
			htmlOptions.flashvars.xmlPath = "/flash/xml/interior-meeting.xml";
			htmlOptions.flashvars.flvPath = "/flash/assets/wave_4.flv";
			$(this).html($.fn.flash.transform(htmlOptions));
	});	
		
	$("body.dining div#branding").flash(
	{src:"/flash/interior-masthead.swf",
	 width:936,
	 height:185,
	 wmode:"transparent",
	 quality:"high"},
	 {version:"7"},
		function(htmlOptions) { //Use this to specify a query string, take out if not needed.
			htmlOptions.flashvars.xmlPath = "/flash/xml/interior-dining.xml";
			htmlOptions.flashvars.flvPath = "/flash/assets/wave_4.flv";
			$(this).html($.fn.flash.transform(htmlOptions));
	});	
	$("body.chef div#branding").flash(
	{src:"/flash/interior-masthead.swf",
	 width:936,
	 height:185,
	 wmode:"transparent",
	 quality:"high"},
	 {version:"7"},
		function(htmlOptions) { //Use this to specify a query string, take out if not needed.
			htmlOptions.flashvars.xmlPath = "/flash/xml/interior-dining-chef.xml";
			htmlOptions.flashvars.flvPath = "/flash/assets/wave_4.flv";
			$(this).html($.fn.flash.transform(htmlOptions));
	});	
	$("body.recipe div#branding").flash(
	{src:"/flash/interior-masthead.swf",
	 width:936,
	 height:185,
	 wmode:"transparent",
	 quality:"high"},
	 {version:"7"},
		function(htmlOptions) { //Use this to specify a query string, take out if not needed.
			htmlOptions.flashvars.xmlPath = "/flash/xml/interior-dining-recipe.xml";
			htmlOptions.flashvars.flvPath = "/flash/assets/wave_4.flv";
			$(this).html($.fn.flash.transform(htmlOptions));
	});	
	$("body.spa div#branding").flash(
	{src:"/flash/interior-masthead.swf",
	 width:936,
	 height:185,
	 wmode:"transparent",
	 quality:"high"},
	 {version:"7"},
		function(htmlOptions) { //Use this to specify a query string, take out if not needed.
			htmlOptions.flashvars.xmlPath = "/flash/xml/interior-spa.xml";
			htmlOptions.flashvars.flvPath = "/flash/assets/wave_4.flv";
			$(this).html($.fn.flash.transform(htmlOptions));
	});	
	$("body.plan div#branding").flash(
	{src:"/flash/interior-masthead.swf",
	 width:936,
	 height:185,
	 wmode:"transparent",
	 quality:"high"},
	 {version:"7"},
		function(htmlOptions) { //Use this to specify a query string, take out if not needed.
			htmlOptions.flashvars.xmlPath = "/flash/xml/interior-about.xml";
			htmlOptions.flashvars.flvPath = "/flash/assets/wave_4.flv";
			$(this).html($.fn.flash.transform(htmlOptions));
	});
	
	$("div#pelicanhill-gallery").flash(
		{src:"/flash/propertySSP.swf",
		 width:675,
		 height:450,
		 wmode:"transparent",
		 quality:"high"},
		 {version:"8"},
			function(htmlOptions) { //Use this to specify a query string, take out if not needed.
				htmlOptions.flashvars.xmlfile = "/flash/xml/pelican-hill.xml";
				$(this).html($.fn.flash.transform(htmlOptions));
		});
	
	$("div#ritzcarlton-gallery").flash(
		{src:"/flash/propertySSP.swf",
		 width:675,
		 height:450,
		 wmode:"transparent",
		 quality:"high"},
		 {version:"8"},
			function(htmlOptions) { //Use this to specify a query string, take out if not needed.
				htmlOptions.flashvars.xmlfile = "/flash/xml/ritz-carlton.xml";
				$(this).html($.fn.flash.transform(htmlOptions));
	});
	
	$("div#hyatt-huntington-gallery").flash(
		{src:"/flash/propertySSP.swf",
		 width:675,
		 height:450,
		 wmode:"transparent",
		 quality:"high"},
		 {version:"8"},
			function(htmlOptions) { //Use this to specify a query string, take out if not needed.
				htmlOptions.flashvars.xmlfile = "/flash/xml/hyatt-regency-huntington.xml";
				$(this).html($.fn.flash.transform(htmlOptions));
		});
	
	$("div#montage-resort-gallery").flash(
		{src:"/flash/propertySSP.swf",
		 width:675,
		 height:450,
		 wmode:"transparent",
		 quality:"high"},
		 {version:"8"},
			function(htmlOptions) { //Use this to specify a query string, take out if not needed.
				htmlOptions.flashvars.xmlfile = "/flash/xml/montage.xml";
				$(this).html($.fn.flash.transform(htmlOptions));
		});
	
	$("div#surf-sand-gallery").flash(
		{src:"/flash/propertySSP.swf",
		 width:675,
		 height:450,
		 wmode:"transparent",
		 quality:"high"},
		 {version:"8"},
			function(htmlOptions) { //Use this to specify a query string, take out if not needed.
				htmlOptions.flashvars.xmlfile = "/flash/xml/surf-sand.xml";
				$(this).html($.fn.flash.transform(htmlOptions));
		});
	
	$("div#hilton-waterfront-gallery").flash(
		{src:"/flash/propertySSP.swf",
		 width:675,
		 height:450,
		 wmode:"transparent",
		 quality:"high"},
		 {version:"8"},
			function(htmlOptions) { //Use this to specify a query string, take out if not needed.
				htmlOptions.flashvars.xmlfile = "/flash/xml/hilton-waterfront.xml";
				$(this).html($.fn.flash.transform(htmlOptions));
		});
	
	$("div#balboa-gallery").flash(
		{src:"/flash/propertySSP.swf",
		 width:675,
		 height:450,
		 wmode:"transparent",
		 quality:"high"},
		 {version:"8"},
			function(htmlOptions) { //Use this to specify a query string, take out if not needed.
				htmlOptions.flashvars.xmlfile = "/flash/xml/balboa-bay.xml";
				$(this).html($.fn.flash.transform(htmlOptions));
		});
	
	$("div#island-newport-gallery").flash(
		{src:"/flash/propertySSP.swf",
		 width:675,
		 height:450,
		 wmode:"transparent",
		 quality:"high"},
		 {version:"8"},
			function(htmlOptions) { //Use this to specify a query string, take out if not needed.
				htmlOptions.flashvars.xmlfile = "/flash/xml/island-hotel.xml";
				$(this).html($.fn.flash.transform(htmlOptions));
		});


});


// 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); }
		);
	});

};
