$(function() {
	$(document).pngFix();
	$('div#title-wrapper h1').sifr(
		{ strSWF: '/fonts/mrs-eaves-allcaps.swf', strColor: '#6c5438', strWmode: 'transparent', intPadding: [0, 37, 0, 0], strCase: 'upper' },
		{ expressInstall: true }
	);
	/*$('div#title-wrapper h2').sifr(
		{ strSWF: '/fonts/humanst521-bt-roman.swf', strColor: '#6c5438', strWmode: 'transparent', strCase: 'lower' },
		{ expressInstall: true }
	);*/

	$("body.home div#photo-bg").flash(
		{src:"flash/home.swf",
		 width:919,
		 height:670,
		 wmode:"transparent",
		 quality:"high"},
		 {version:"8"});

	$("#spa-photos").flash(
		{src:"flash/photo-gallery.swf",
		 width:550,
		 height:420,
		 wmode:"transparent",
		 quality:"high"},
		 {version:"8"});
	
	
	// Flash masthead JS below:
	
	var leftOffset = 294;

	//var offset = $("#inner-wrapper").offset();
	var innerWrapper = $('#inner-wrapper');
	if ( innerWrapper.length ) {
 		if ($.browser.msie) {
			var left = (innerWrapper.offset().left)/733 + leftOffset; //IE Fix
			
		} else {
			var left = innerWrapper.offset().left + leftOffset;
		};
	};
	
	var width = document.body.clientWidth - left;
		
	$(".masthead").css({marginLeft:left+"px",width:width+"px"});

	$("#title-wrapper").each(function() {
	    
		var maintitle = $("h1", this).text(); 
		var subtitle = $("h2", this).text();

		/* start of replacement flash code
		    var flashMastheads = [
			{
			    id:'philosophy-masthead',
			    xmlPath:'flash/philosophy.xml'
			},
			{
			    id:'another-masthead',
			    xmlPath:'flash/another.xml'
			},
			{
			    id:'another-masthead',
			    xmlPath:'flash/another.xml'
			}
		    ];

		    $( flashMastheads ).each( function( iter, obj ) {
			$('div#' + obj['id']).flash({
			    width:width,
			    height:450,
			    wmode:'transparent',
			    quality:'high'
			},
			{version:'8'},
			function( htmlOptions ) {
			    htmlOptions.flashvars.xmlfile = obj['xmlPath'];
			    htmlOptions.flashvars.maintitle = maintitle;
			    htmlOptions.flashvars.subtitle = subtitle;
			    $( this ).html( $.fn.flash.transform( htmlOptions ));
			});
		    });
		    
		    end of flash replacement code */

			$("div#philosophy-masthead").flash(
			{src:"flash/masthead.swf",
	 			width:width,
				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/philosophy.xml";
					htmlOptions.flashvars.maintitle = maintitle;
					htmlOptions.flashvars.subtitle = subtitle;
					$(this).html($.fn.flash.transform(htmlOptions));
			});
			$("div#wellness-masthead").flash(
			{src:"flash/masthead.swf",
	 			width:width,
				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/wellness.xml";
					htmlOptions.flashvars.maintitle = maintitle;
					htmlOptions.flashvars.subtitle = subtitle;
					$(this).html($.fn.flash.transform(htmlOptions));
			});
			$("div#salon-masthead").flash(
			{src:"flash/masthead.swf",
	 			width:width,
				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/salon.xml";
					htmlOptions.flashvars.maintitle = maintitle;
					htmlOptions.flashvars.subtitle = subtitle;
					$(this).html($.fn.flash.transform(htmlOptions));
			});
			$("div#salon-experience-masthead").flash(
			{src:"flash/masthead.swf",
	 			width:width,
				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/kim-vo-salon.xml";
					htmlOptions.flashvars.maintitle = maintitle;
					htmlOptions.flashvars.subtitle = subtitle;
					$(this).html($.fn.flash.transform(htmlOptions));
			});
			$("div#salon-products-masthead").flash(
			{src:"flash/masthead.swf",
	 			width:width,
				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/kim-vo-products.xml";
					htmlOptions.flashvars.maintitle = maintitle;
					htmlOptions.flashvars.subtitle = subtitle;
					$(this).html($.fn.flash.transform(htmlOptions));
			});
			$("div#salon-services-masthead").flash(
			{src:"flash/masthead.swf",
	 			width:width,
				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/kim-vo-services.xml";
					htmlOptions.flashvars.maintitle = maintitle;
					htmlOptions.flashvars.subtitle = subtitle;
					$(this).html($.fn.flash.transform(htmlOptions));
			});
			$("div#experience-masthead").flash(
			{src:"flash/masthead.swf",
	 			width:width,
				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/experience.xml";
					htmlOptions.flashvars.maintitle = maintitle;
					htmlOptions.flashvars.subtitle = subtitle;
					$(this).html($.fn.flash.transform(htmlOptions));
			});
			$("div#services-masthead").flash(
			{src:"flash/masthead.swf",
	 			width:width,
				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/services.xml";
					htmlOptions.flashvars.maintitle = maintitle;
					htmlOptions.flashvars.subtitle = subtitle;
					$(this).html($.fn.flash.transform(htmlOptions));
			});
			$("div#welcome-masthead").flash(
			{src:"flash/masthead.swf",
	 			width:width,
				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/welcome.xml";
					htmlOptions.flashvars.maintitle = maintitle;
					htmlOptions.flashvars.subtitle = subtitle;
					$(this).html($.fn.flash.transform(htmlOptions));
			});
			$("div#waxing-masthead").flash(
			{src:"flash/masthead.swf",
	 			width:width,
				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/waxing-services.xml";
					htmlOptions.flashvars.maintitle = maintitle;
					htmlOptions.flashvars.subtitle = subtitle;
					$(this).html($.fn.flash.transform(htmlOptions));
			});
			$("div#orchard-masthead").flash(
			{src:"flash/masthead.swf",
	 			width:width,
				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/orchard-therapies.xml";
					htmlOptions.flashvars.maintitle = maintitle;
					htmlOptions.flashvars.subtitle = subtitle;
					$(this).html($.fn.flash.transform(htmlOptions));
			});
			$("div#touch-masthead").flash(
			{src:"flash/masthead.swf",
	 			width:width,
				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/touch-therapies.xml";
					htmlOptions.flashvars.maintitle = maintitle;
					htmlOptions.flashvars.subtitle = subtitle;
					$(this).html($.fn.flash.transform(htmlOptions));
			});
			$("div#factsheet-masthead").flash(
			{src:"flash/masthead.swf",
	 			width:width,
				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/spa-factsheet.xml";
					htmlOptions.flashvars.maintitle = maintitle;
					htmlOptions.flashvars.subtitle = subtitle;
					$(this).html($.fn.flash.transform(htmlOptions));
			});
			$("div#facilities-masthead").flash(
			{src:"flash/masthead.swf",
	 			width:width,
				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/spa-facilities.xml";
					htmlOptions.flashvars.maintitle = maintitle;
					htmlOptions.flashvars.subtitle = subtitle;
					$(this).html($.fn.flash.transform(htmlOptions));
			});
			$("div#treatments-masthead").flash(
			{src:"flash/masthead.swf",
	 			width:width,
				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/signature-treatments.xml";
					htmlOptions.flashvars.maintitle = maintitle;
					htmlOptions.flashvars.subtitle = subtitle;
					$(this).html($.fn.flash.transform(htmlOptions));
			});
			$("div#classes-masthead").flash(
			{src:"flash/masthead.swf",
	 			width:width,
				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/signature-classes.xml";
					htmlOptions.flashvars.maintitle = maintitle;
					htmlOptions.flashvars.subtitle = subtitle;
					$(this).html($.fn.flash.transform(htmlOptions));
			});
			$("div#prenatal-masthead").flash(
			{src:"flash/masthead.swf",
	 			width:width,
				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/prenatal-therapies.xml";
					htmlOptions.flashvars.maintitle = maintitle;
					htmlOptions.flashvars.subtitle = subtitle;
					$(this).html($.fn.flash.transform(htmlOptions));
			});
			$("div#ocean-masthead").flash(
			{src:"flash/masthead.swf",
	 			width:width,
				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/ocean-services.xml";
					htmlOptions.flashvars.maintitle = maintitle;
					htmlOptions.flashvars.subtitle = subtitle;
					$(this).html($.fn.flash.transform(htmlOptions));
			});
			$("div#nail-masthead").flash(
			{src:"flash/masthead.swf",
	 			width:width,
				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/nail-services.xml";
					htmlOptions.flashvars.maintitle = maintitle;
					htmlOptions.flashvars.subtitle = subtitle;
					$(this).html($.fn.flash.transform(htmlOptions));
			});
			$("div#staff-masthead").flash(
			{src:"flash/masthead.swf",
	 			width:width,
				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/meet-the-staff.xml";
					htmlOptions.flashvars.maintitle = maintitle;
					htmlOptions.flashvars.subtitle = subtitle;
					$(this).html($.fn.flash.transform(htmlOptions));
			});
			$("div#hair-masthead").flash(
			{src:"flash/masthead.swf",
	 			width:width,
				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/hair-services.xml";
					htmlOptions.flashvars.maintitle = maintitle;
					htmlOptions.flashvars.subtitle = subtitle;
					$(this).html($.fn.flash.transform(htmlOptions));
			});
			$("div#schedule-masthead").flash(
			{src:"flash/masthead.swf",
	 			width:width,
				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/fitness-schedule.xml";
					htmlOptions.flashvars.maintitle = maintitle;
					htmlOptions.flashvars.subtitle = subtitle;
					$(this).html($.fn.flash.transform(htmlOptions));
			});
			$("div#fitness-masthead").flash(
			{src:"flash/masthead.swf",
	 			width:width,
				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/fitness-activities.xml";
					htmlOptions.flashvars.maintitle = maintitle;
					htmlOptions.flashvars.subtitle = subtitle;
					$(this).html($.fn.flash.transform(htmlOptions));
			});
			$("div#faqs-masthead").flash(
			{src:"flash/masthead.swf",
	 			width:width,
				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/FAQ.xml";
					htmlOptions.flashvars.maintitle = maintitle;
					htmlOptions.flashvars.subtitle = subtitle;
					$(this).html($.fn.flash.transform(htmlOptions));
			});
			$("div#facial-masthead").flash(
			{src:"flash/masthead.swf",
	 			width:width,
				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/facial-therapies.xml";
					htmlOptions.flashvars.maintitle = maintitle;
					htmlOptions.flashvars.subtitle = subtitle;
					$(this).html($.fn.flash.transform(htmlOptions));
			});
			$("div#exclusive-masthead").flash(
			{src:"flash/masthead.swf",
	 			width:width,
				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/exclusive-services.xml";
					htmlOptions.flashvars.maintitle = maintitle;
					htmlOptions.flashvars.subtitle = subtitle;
					$(this).html($.fn.flash.transform(htmlOptions));
			});
			$("div#earth-masthead").flash(
			{src:"flash/masthead.swf",
	 			width:width,
				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/earth-inspired.xml";
					htmlOptions.flashvars.maintitle = maintitle;
					htmlOptions.flashvars.subtitle = subtitle;
					$(this).html($.fn.flash.transform(htmlOptions));
			});
			$("div#water-masthead").flash(
			{src:"flash/masthead.swf",
	 			width:width,
				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/bath-and-water.xml";
					htmlOptions.flashvars.maintitle = maintitle;
					htmlOptions.flashvars.subtitle = subtitle;
					$(this).html($.fn.flash.transform(htmlOptions));
			});
			$("div#signature-masthead").flash(
			{src:"flash/masthead.swf",
	 			width:width,
				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/signature-treatments.xml";
					htmlOptions.flashvars.maintitle = maintitle;
					htmlOptions.flashvars.subtitle = subtitle;
					$(this).html($.fn.flash.transform(htmlOptions));
			});
			$("div#masthead").flash(
			{src:"flash/masthead.swf",
	 			width:width,
				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/services.xml";
					htmlOptions.flashvars.maintitle = maintitle;
					htmlOptions.flashvars.subtitle = subtitle;
					$(this).html($.fn.flash.transform(htmlOptions));
			});
		});

	$(window).resize(function(){ //when user re-sizes window, re-load flash with new width.
		//offset = $("#inner-wrapper").offset();
		var leftOffset = 294;
		if ($.browser.msie) {
			var left = ($("#inner-wrapper").offset().left)/733 + leftOffset; //IE fix
		} else {
			var left = $("#inner-wrapper").offset().left + leftOffset;
		};
		width = document.body.clientWidth - left;
		$(".masthead").css({marginLeft:left+"px",width:width+"px"});
	$("#title-wrapper").each(function() {
		var maintitle = $("h1", this).text(); 
		var subtitle = $("h2", this).text();
			$("div#philosophy-masthead").flash(
			{src:"flash/masthead.swf",
	 			width:width,
				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/philosophy.xml";
					htmlOptions.flashvars.maintitle = maintitle;
					htmlOptions.flashvars.subtitle = subtitle;
					$(this).html($.fn.flash.transform(htmlOptions));
			});
			$("div#wellness-masthead").flash(
			{src:"flash/masthead.swf",
	 			width:width,
				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/wellness.xml";
					htmlOptions.flashvars.maintitle = maintitle;
					htmlOptions.flashvars.subtitle = subtitle;
					$(this).html($.fn.flash.transform(htmlOptions));
			});
			$("div#salon-masthead").flash(
			{src:"flash/masthead.swf",
	 			width:width,
				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/salon.xml";
					htmlOptions.flashvars.maintitle = maintitle;
					htmlOptions.flashvars.subtitle = subtitle;
					$(this).html($.fn.flash.transform(htmlOptions));
			});
			$("div#experience-masthead").flash(
			{src:"flash/masthead.swf",
	 			width:width,
				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/experience.xml";
					htmlOptions.flashvars.maintitle = maintitle;
					htmlOptions.flashvars.subtitle = subtitle;
					$(this).html($.fn.flash.transform(htmlOptions));
			});
			$("div#services-masthead").flash(
			{src:"flash/masthead.swf",
	 			width:width,
				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/services.xml";
					htmlOptions.flashvars.maintitle = maintitle;
					htmlOptions.flashvars.subtitle = subtitle;
					$(this).html($.fn.flash.transform(htmlOptions));
			});
			$("div#welcome-masthead").flash(
			{src:"flash/masthead.swf",
	 			width:width,
				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/welcome.xml";
					htmlOptions.flashvars.maintitle = maintitle;
					htmlOptions.flashvars.subtitle = subtitle;
					$(this).html($.fn.flash.transform(htmlOptions));
			});
			$("div#waxing-masthead").flash(
			{src:"flash/masthead.swf",
	 			width:width,
				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/waxing-services.xml";
					htmlOptions.flashvars.maintitle = maintitle;
					htmlOptions.flashvars.subtitle = subtitle;
					$(this).html($.fn.flash.transform(htmlOptions));
			});
			$("div#touch-masthead").flash(
			{src:"flash/masthead.swf",
	 			width:width,
				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/touch-therapies.xml";
					htmlOptions.flashvars.maintitle = maintitle;
					htmlOptions.flashvars.subtitle = subtitle;
					$(this).html($.fn.flash.transform(htmlOptions));
			});
			$("div#factsheet-masthead").flash(
			{src:"flash/masthead.swf",
	 			width:width,
				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/spa-factsheet.xml";
					htmlOptions.flashvars.maintitle = maintitle;
					htmlOptions.flashvars.subtitle = subtitle;
					$(this).html($.fn.flash.transform(htmlOptions));
			});
			$("div#facilities-masthead").flash(
			{src:"flash/masthead.swf",
	 			width:width,
				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/spa-facilities.xml";
					htmlOptions.flashvars.maintitle = maintitle;
					htmlOptions.flashvars.subtitle = subtitle;
					$(this).html($.fn.flash.transform(htmlOptions));
			});
			$("div#treatments-masthead").flash(
			{src:"flash/masthead.swf",
	 			width:width,
				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/signature-treatments.xml";
					htmlOptions.flashvars.maintitle = maintitle;
					htmlOptions.flashvars.subtitle = subtitle;
					$(this).html($.fn.flash.transform(htmlOptions));
			});
			$("div#classes-masthead").flash(
			{src:"flash/masthead.swf",
	 			width:width,
				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/signature-classes.xml";
					htmlOptions.flashvars.maintitle = maintitle;
					htmlOptions.flashvars.subtitle = subtitle;
					$(this).html($.fn.flash.transform(htmlOptions));
			});
			$("div#prenatal-masthead").flash(
			{src:"flash/masthead.swf",
	 			width:width,
				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/prenatal-therapies.xml";
					htmlOptions.flashvars.maintitle = maintitle;
					htmlOptions.flashvars.subtitle = subtitle;
					$(this).html($.fn.flash.transform(htmlOptions));
			});
			$("div#ocean-masthead").flash(
			{src:"flash/masthead.swf",
	 			width:width,
				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/ocean-services.xml";
					htmlOptions.flashvars.maintitle = maintitle;
					htmlOptions.flashvars.subtitle = subtitle;
					$(this).html($.fn.flash.transform(htmlOptions));
			});
			$("div#nail-masthead").flash(
			{src:"flash/masthead.swf",
	 			width:width,
				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/nail-services.xml";
					htmlOptions.flashvars.maintitle = maintitle;
					htmlOptions.flashvars.subtitle = subtitle;
					$(this).html($.fn.flash.transform(htmlOptions));
			});
			$("div#staff-masthead").flash(
			{src:"flash/masthead.swf",
	 			width:width,
				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/meet-the-staff.xml";
					htmlOptions.flashvars.maintitle = maintitle;
					htmlOptions.flashvars.subtitle = subtitle;
					$(this).html($.fn.flash.transform(htmlOptions));
			});
			$("div#hair-masthead").flash(
			{src:"flash/masthead.swf",
	 			width:width,
				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/hair-services.xml";
					htmlOptions.flashvars.maintitle = maintitle;
					htmlOptions.flashvars.subtitle = subtitle;
					$(this).html($.fn.flash.transform(htmlOptions));
			});
			$("div#schedule-masthead").flash(
			{src:"flash/masthead.swf",
	 			width:width,
				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/fitness-schedule.xml";
					htmlOptions.flashvars.maintitle = maintitle;
					htmlOptions.flashvars.subtitle = subtitle;
					$(this).html($.fn.flash.transform(htmlOptions));
			});
			$("div#fitness-masthead").flash(
			{src:"flash/masthead.swf",
	 			width:width,
				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/fitness-activities.xml";
					htmlOptions.flashvars.maintitle = maintitle;
					htmlOptions.flashvars.subtitle = subtitle;
					$(this).html($.fn.flash.transform(htmlOptions));
			});
			$("div#faqs-masthead").flash(
			{src:"flash/masthead.swf",
	 			width:width,
				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/FAQ.xml";
					htmlOptions.flashvars.maintitle = maintitle;
					htmlOptions.flashvars.subtitle = subtitle;
					$(this).html($.fn.flash.transform(htmlOptions));
			});
			$("div#facial-masthead").flash(
			{src:"flash/masthead.swf",
	 			width:width,
				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/facial-therapies.xml";
					htmlOptions.flashvars.maintitle = maintitle;
					htmlOptions.flashvars.subtitle = subtitle;
					$(this).html($.fn.flash.transform(htmlOptions));
			});
			$("div#exclusive-masthead").flash(
			{src:"flash/masthead.swf",
	 			width:width,
				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/exclusive-services.xml";
					htmlOptions.flashvars.maintitle = maintitle;
					htmlOptions.flashvars.subtitle = subtitle;
					$(this).html($.fn.flash.transform(htmlOptions));
			});
			$("div#earth-masthead").flash(
			{src:"flash/masthead.swf",
	 			width:width,
				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/earth-inspired.xml";
					htmlOptions.flashvars.maintitle = maintitle;
					htmlOptions.flashvars.subtitle = subtitle;
					$(this).html($.fn.flash.transform(htmlOptions));
			});
			$("div#water-masthead").flash(
			{src:"flash/masthead.swf",
	 			width:width,
				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/bath-and-water.xml";
					htmlOptions.flashvars.maintitle = maintitle;
					htmlOptions.flashvars.subtitle = subtitle;
					$(this).html($.fn.flash.transform(htmlOptions));
			});
			$("div#signature-masthead").flash(
			{src:"flash/masthead.swf",
	 			width:width,
				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/signature-treatments.xml";
					htmlOptions.flashvars.maintitle = maintitle;
					htmlOptions.flashvars.subtitle = subtitle;
					$(this).html($.fn.flash.transform(htmlOptions));
			});
			$("div#masthead").flash(
			{src:"flash/masthead.swf",
	 			width:width,
				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/services.xml";
					htmlOptions.flashvars.maintitle = maintitle;
					htmlOptions.flashvars.subtitle = subtitle;
					$(this).html($.fn.flash.transform(htmlOptions));
			});
		});
	});

	
	/* JS to find the last list item in the footer nav and decrease the width by 1px in order to height the border */
	
	$("ul#beverlyhills-footer").each( function () {
		var a = $(this);
		$("li:last-child a", a).css("height","28px");
		$("li:last-child", a).css("height","28px");
	});
	

});
