$(function() {

    	var ie6 = window.ie6 = /*@cc_on!@*/false && !window.XMLHttpRequest;

	if ( ie6 ) {
	    $('#follow-twitter').css('background-image', 'url(/htc/blank.gif)');
	    $('#follow-facebook').css('background-image', 'url(/htc/blank.gif)');
	}

	//added this so you don't see a flash of the alt image while waiting for onload to fire
	$("body.test div#masthead img").addClass("offset");

	$('body.palace-home #content h1').sifr({ strSWF: 'flash/sifr/helvetica-bold.swf', strColor: '#8c7459', strWmode: 'transparent', strFlashVars: 'textalign=center&letterSpacing=2&', strCase:'upper' },{ expressInstall: true });
	$('body.palace-home #content h2').sifr({ strSWF: 'flash/sifr/helvetica-bold.swf', strColor: '#8c7459', strWmode: 'transparent', strFlashVars: 'textalign=center&letterSpacing=5&', strCase:'upper' },{ expressInstall: true });

	$('#content h2').sifr({ strSWF: 'flash/sifr/avantgarde-bk-bt-normal.swf', strColor: '#ffffff', strWmode: 'transparent', strHoverColor: '#ffffff', strCase:'upper' },{ expressInstall: true });
	
	$('body.custom h3.custom').sifr(
		{ strSWF: 'flash/sifr/avantgarde-bk-bt-normal.swf', strColor: '#E1B55B', strWmode: 'transparent', strHoverColor: '#E1B55B', strCase: 'upper', strFlashVars: 'textalign=center&' },
		{ expressInstall: true }
	);
	
	
	$(this).find("div.print").each( function() {
		var saved = $("div.recipe").html();
		$("div.recipe div").each(function(i){
			$(this).wrap('<table class="recipe-table" cellpadding="0" id="tbl'+i+'"><tr class="wrapped"><td width="425" style="width:425px;" class="wrapped-content"></td></tr></table>');
			$("table.recipe-table#tbl"+i+" tbody").prepend('<tr><td colspan="3"><img src="images/layout/recipe-top.gif" alt="" /></td></tr>').append('<tr><td colspan="3"><img src="images/layout/recipe-bottom.gif" id="recipe-bottom" alt="" /></td></tr>');
			$("table.recipe-table#tbl"+i+" tr.wrapped").prepend('<td width="20"><img src="images/layout/recipe-left.gif" alt="" /></td>').append('<td width="20"><img src="images/layout/recipe-right.gif" alt="" /></td>');
			$("table.recipe-table#tbl"+i+" td.wrapped-content").prepend('<img src="images/layout/spacer.gif" alt="" /><br />');
			if (i>0 && i%2==0) {$("table.recipe-table#tbl"+i).before("<hr />");}
		});
		$("table.recipe-table#tbl0 td.wrapped-content div").prepend('<div class="recipe-inset"><img src="images/layout/logo-print.gif" alt="" /></div>');
		$("table.recipe-table#tbl0 img#recipe-bottom").attr("src","images/layout/recipe-bottom-address.gif");
	});

	$("div#restaurant_bar-flash").flash({
		src:'/flash/virtual-tour.swf',
		width:'800',
		height:'300',
		wmode:'transparent',
		quality:'high'
		},{version:'7'},
		function(htmlOptions) {
			htmlOptions.flashvars.imgPath = "/flash/assets/giltRestaurant.jpg"
			$(this).html($.fn.flash.transform(htmlOptions));
			}
	);

	$("body.palace-home div#home-flash").flash(
		{src:"flash/photo-rotation.swf",
		 width:917,
		 height:361,
		 id:"movie",
		 wmode:"transparent",
		 quality:"high"},
		 {version:"8"}
	);
	

});

// 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); }
		);
	});

};   

function printFrame () {
    frames['TB_iframeContent'+randomIframeNum].focus();
    frames['TB_iframeContent'+randomIframeNum].print();
}

function embedFlash() {
	$("body.home div#masthead").flash(
		{src:"flash/home-masthead.swf",
		 width:677,
		 height:475,
		 id:"movie",
		 wmode:"transparent",
		 quality:"high"},
		 {version:"8"}
	);
	//gives alt image back to users w/o flash
	$("body.home div#masthead img").removeClass("offset");
	

}
