function embedFlash() {
	
	var browser =navigator.userAgent;
	var noFlash = (browser.match(/iPhone/i)) || (browser.match(/iPod/i));
	
	function addQuotes(s) {
		var a = s.search(/>/);
		var t ="class='"+s.substr(0,a)+"'"; //this method works only if the tag has one property 

		return t + s.substr(a);
	}
	
	
	if(imagefolder!==null && !noFlash) {
	
		
			var textToPass = $("#content").html();
			var re  = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
  
		
			if (re.exec(navigator.userAgent) != null) {
				
				var array = textToPass.split(/class=/);
				var final= array[0];
			
				for (var i = 1; i < array.length; i++){
				
					final+=(addQuotes(array[i])); //add quotes and concatanate to one string
				
				}
		
				textToPass=final;
			}
			
		$('#main_content').html('');
		// #flash-example-2 is the selector
		$('#main_content').flash(
			{
				// test_flashvars.swf is the flash document
				swf: 'gallery.swf',
				width: 825, 
				height:690,
				// these arguments will be passed into the flash document
				flashvars: {folder: imagefolder, text: textToPass},
				
				params: {wmode: 'transparent'}
			}
		);
	}
	
		
		
}


function setMenu() {
	// MENU STYLES
	$("#sidebar a:contains("+page+")").addClass("active_link");
	if(page=="home") {
		$("#container").addClass("bg_home");
	}
	//hide and show subchildren when a parent page is shown
	if(page=="new builds" || page=="voyages") {
		$("#sidebar li>ul").children().hide();
		$("#sidebar li>ul").children().slideDown("slow");
	}
}