// JavaScript Document
var siteUrl = "http://www.polynesianxplorer.com";

function loadFlash(path, width, height, div){
	var fc = "<object type='application/x-shockwave-flash' data='"+siteUrl+path+"' width='"+width+"' height='"+height+"' id='piVideo'>\n";
	fc += "<param name='movie' value='"+siteUrl+path+"' />\n";
	fc += "<param name='base' value='/video/' />\n";
	fc += "<param name='allowScriptAcess' value='sameDomain' />\n";
	fc += "<param name='quality' value='best' />\n";
	fc += "<param name='salign' value='TL' />\n";
	fc += "<param name='wmode' value='transparent' />\n";
	fc += "</object>";
	$(div).html(fc);
}
$(function(){
//load flash header

	loadFlash("/swf/flashbig1.swf", "920px", "217px", "#flashHeader");
//highlight current page in menu
	var name = document.title;
	var link;
	//highlight the home menu item on these links
	var home = ["Polynesian Xplorer", "About Us", "Our People", "Contact Us", "Affiliates"];
	$.each($("#navMain li a"), function(){
		link = $(this).text();
		if(name == link){
			$(this).parent().addClass("selected");
		}
		if(link == "Home"){
			for(var i=0; i<home.length;i++){
				if(name == home[i]){
					$(this).parent().addClass("selected")
				}
			}
		}
	});

});

