$(function() {
	$('.vcalendar').eventPreview({hideDetails : '<img src="/images/btn-hide-details.gif" alt="Hide Details" />',
			viewDetails : '<img src="/images/btn-view-details.gif" alt="View Details" />'});
	$('.share-link').initializeSharing();
	$('#sidebar-tabs').accordion({
		header: "a.acc-link"
	}).accordion("activate",1);
	
	// Sifr
	$('div#masthead h1').sifr({ strSWF: '/flash/skia.swf', strColor: '#392403', strWmode: 'transparent', strCase: 'upper' }, { expressInstall: true });
	$('div#content h2').sifr({ strSWF: '/flash/helvetica-neue.swf', strColor: '#000000', strWmode: 'transparent', intPadding: [0, 0, 0, 2] }, { expressInstall: true });
	$('div#push-sidebar h4').sifr({ strSWF: 'flash/helvetica-neue.swf', strColor: '#392403', strWmode: 'transparent', strCase: 'upper' }, { expressInstall: true });
	$('div#push-content h4').sifr({ strSWF: 'flash/helvetica-neue.swf', strColor: '#6d4b0c', strWmode: 'transparent', strCase: 'upper' }, { expressInstall: true });
	$('div.package-title h4').sifr({ strSWF: '/flash/tresbuchet-ms-bold.swf', strColor: '#a67c52', strWmode: 'transparent', strCase: 'upper' }, { expressInstall: true });

	$('div#weather-wrapper h4.weather-day').sifr( { strSWF: 'flash/helvetica-neue.swf', strColor: '#836134', strWmode: 'transparent', strFlashVars: 'textalign=center&' }, { expressInstall: true } );
	$('div#weather-wrapper h4.weather-date').sifr( { strSWF: 'flash/helvetica-neue.swf', strColor: '#519eba', strWmode: 'transparent', strFlashVars: 'textalign=center&' }, { expressInstall: true } );
	$('div#weather-wrapper h5.weather-temp').sifr( { strSWF: 'flash/helvetica-neue.swf', strColor: '#519eba', strWmode: 'transparent', strFlashVars: 'textalign=center&' }, { expressInstall: true } );

	//MSN Map
	var openFn=function(hash){
		hash.w.show();
		$('#map-container').css({left:($(window).width()-$('#map-container').width())/2});
		//$('#msn-map').msnMap({listView:true, hotelOnly: true});
		for(var i in $.browser) {
			if ($.browser[i])
				BROWSER = i + (($.browser.msie)?$.browser.version.charAt(0):'');
		}
	
		if (typeof jQuery.prototype.msnMap != 'undefined') {	   
			$('#msn-map').msnMap({hotelOnly:true, listView:true});
		}

	};
	var hideFn=function(hash){
		hash.w.hide()
		hash.o.remove();
		$('.places').remove();
	};
	$('#map-container').each(function() { $(this).jqm({trigger:'#btn-msnmap', onShow: openFn, onHide: hideFn}); });

	// Photo Gallery
	$("div#photo-gallery").flash(
		{src:"flash/photo-gallery.swf", width:560, height:380, wmode:"transparent", quality:"high"}, {version:"8"},
			function(htmlOptions) { 
				htmlOptions.flashvars.xmlFile = "flash/xml/images.xml";
				$(this).html($.fn.flash.transform(htmlOptions));
	});

	// Flash
	$("div#int-map").flash(
		{src:"flash/map(speedUp).swf", width:650, height:490, wmode:"transparent", quality:"high"}, {version:"8"},
			function(htmlOptions) { 
				htmlOptions.flashvars.xmlFile = "flash/xml/data.xml";
				$(this).html($.fn.flash.transform(htmlOptions));
	});
	$("div#masthead-home").flash({src:"flash/flash_masthead.swf", width:726, height:364, wmode:"transparent", quality:"high"}, {version:"8"} );
	$("div#dhr-logo").flash( {src:"http://www.destinationhotels.com/flash/branding/flash_logoDhr.swf?link=stonebridgeinn", width:250, height:25, wmode:"transparent", allowScriptAccess:"always", quality:"high"}, {version:"7"});

	$("ul#nav-primary li").hover(
        function(){ $("ul", this).show(); }, 
        function(){ $("ul", this).hide(); } 
    );
    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); }
		);
	});

};   
