$(function() {

	$('div#content h1').sifr({ strSWF: '/flash/adobe-caslon-pro.swf', strColor: '#4f1e42', strWmode: 'transparent' },{ expressInstall: true });

    $('#home-reserve').each(function() {
	var o = this,
	    hotel = $('#hotel')
		.change(function() {
		    setHotelId( this )
		});

	function setHotelId( obj ) {
	    obj = $(obj);
	    var val = $(obj).val(),
		map = {
		    'HOUHZ':14987,
		    'DALHZ':12689
		};
	    $.data(o, 'hotel', map[val]);
	}
	setHotelId( hotel )
    });
		   
	URCHIN = typeof(pageTracker)=='undefined'?true:false;
	$('.track').each(function() {
		var tag = '/'+this.name.replace(/:/g,'/');
		if($(this).is('form')) {
			$(this).submit(function() {
				URCHIN?urchinTracker(tag):pageTracker._trackEvent('form', 'submit', tag);
			});
		} else {
			$(this).click(function() {
				URCHIN?urchinTracker(tag):pageTracker._trackPageview(tag);				   
			});
		}		
	});

	$(document).pngFix(); 
// 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:
*/


	$("body.houston-home div#masthead").flash(
		{src:"/flash/houston-home.swf",
		 width:477,
		 height:424,
		 wmode:"transparent",
		 quality:"high"},
		 {version:"8"});
	$("body.dallas-home div#masthead").flash(
		{src:"/flash/dallas-home.swf",
		 width:477,
		 height:424,
		 wmode:"transparent",
		 quality:"high"},
		 {version:"8"});
	$("body.houston-photo-gallery div#masthead").flash(
		{src:"/flash/photo-gallery-houston.swf",
		
		 width:477,
		 height:550,
		 wmode:"transparent",
		 quality:"high"},
		 {version:"8"},
		 	function(htmlOptions) { //Use this to specify a query string, take out if not needed.
				htmlOptions.flashvars.myfolder = "/photo_gallery/houston-flash-gallery";
				htmlOptions.flashvars.xmlFile = "/photo_gallery/xml/galleryImages.xml";
				htmlOptions.flashvars.configFile = "/photo_gallery/xml/galleryImages.xml";
				$(this).html($.fn.flash.transform(htmlOptions));
			});

	$("body.dallas-photo-gallery div#masthead").flash(
		{src:"/flash/photo-gallery.swf",
		
		 width:477,
		 height:550,
		 wmode:"transparent",
		 quality:"high"},
		 {version:"8"},
		 	function(htmlOptions) { //Use this to specify a query string, take out if not needed.
				htmlOptions.flashvars.myfolder = "/flash/flash-gallery/";
				$(this).html($.fn.flash.transform(htmlOptions));
			});
	
	$("body.dallas-specials-packages div#masthead").flash(
		{src:"/flash/dallas-specials-packages.swf",
		 width:191,
		 height:371,
		 wmode:"transparent",
		 quality:"high"},
		 {version:"8"});
	$("body.dallas-guestrooms div#masthead").flash(
		{src:"/flash/dallas-rooms.swf",
		 width:191,
		 height:371,
		 wmode:"transparent",
		 quality:"high"},
		 {version:"8"});
	$("body.dallas-mag-seven div#masthead").flash(
		{src:"/flash/dallas-mag-seven.swf",
		 width:191,
		 height:371,
		 wmode:"transparent",
		 quality:"high"},
		 {version:"8"});
	$("div#monarch").flash(
		{src:"/flash/monarch.swf",
		 width:173,
		 height:319,
		 wmode:"transparent",
		 quality:"high"},
		 {version:"8"});
	$("div#dragon").flash(
		{src:"/flash/dragon.swf",
		 width:173,
		 height:319,
		 wmode:"transparent",
		 quality:"high"},
		 {version:"8"});
	$("div#dragon-birthday").flash(
		{src:"/flash/dragonfly-birthday.swf",
		 width:848,
		 height:361,
		 wmode:"transparent",
		 quality:"high"},
		 {version:"8"},
		 	function(htmlOptions) { //Use this to specify a query string, take out if not needed.
				htmlOptions.flashvars.link = "/dallas/dallas_restaurant";
				$(this).html($.fn.flash.transform(htmlOptions));
			});
	$("div#dragon-birthday-int").flash(
		{src:"/flash/dragonfly-birthday.swf",
		 width:848,
		 height:361,
		 wmode:"transparent",
		 quality:"high"},
		 {version:"8"},
		 	function(htmlOptions) { //Use this to specify a query string, take out if not needed.
				htmlOptions.flashvars.link = "/dallas/dallas_restaurant";
				htmlOptions.flashvars.interior = "true";
				$(this).html($.fn.flash.transform(htmlOptions));
			});

//	$("div#content > ul.secondary-menu:last").addClass("last-secondary-menu");

// Sample sifr usage - remove if not needed
	/*
	$('div#content h1').sifr(
		{ strSWF: 'flash/garamond.swf', strColor: '#e2e3c4', 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");
    }
	
	$(".popup-window").click(function() {window.open($(this).attr("href"), 'newWin', 'scrollbars=yes,resizable=yes,status=no,toolbar=no,location=1,top=0,left=0,width=616,height=400'); return false;});
	*/
	$(".popup-window").click(function() {window.open($(this).attr("href"), 'newWin',
	'width=645,height=600,toolbar=0,titlebar=0,status=0,scrollbars=1,resizable=1,menubar=0,location=0,top=0,left=0'); return false;});
	
	$('select.jump-menu').change( function () { 
			document.location=$(this).val();
	});
	
	$('#halloween-popup').each(function() {
		$(this).jqm().jqmAddClose($('#trigger-close', this)).jqmShow();					   
	});

	window.flashResize = function () {		
		$("div#dragon-birthday").css("z-index","1");
		$("div#dragon-birthday-int").css("z-index","1");
	};
	
	window.flashResize2 = function () {
		$("div#dragon-birthday").css("z-index","200");
		$("div#dragon-birthday-int").css("z-index","200");
	};

	 $('#push-easter-houston').jqm({trigger:'.jqModalEaster'});

});



// 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); }
		);
	});

};   
