var js_ready = false;
function is_javascript_ready() { return js_ready; }

function initPage() { js_ready = true; }

function getMovieById(name) { return (navigator.appName.indexOf("Microsoft") != -1) ? window[name] : document[name]; }

/**
 * Update the image path and text for the featured exhibits banner
 */
function updateFeature(params) { getMovieById("feature-flash").updateFeature(params[0], params[1], params[3].toUpperCase(), params[2], params[4]); }

/**
 * Used by Flash to handle resizing the search banner movie size
 * Due to a bug in the way IE reports object dimensions, we need
 * to pad the values used by IE.
 */
function resize_header(new_height) {
	if (new_height < 187) { new_height += (187-new_height) }
	document.getElementById('banner-flash').style.height = new_height + 'px';
}

/* Load the search banner */
function loadBanner() {
	var flashvars = {
		images: headerImages,
		xml_path: "/XML_museums.cfm"
	};
	var params = {
		bgcolor: '#55676a'
	};
	var attributes = {
		xiRedirectUrl: window.location
		,allowScriptAccess: 'always'
	};

	swfobject.embedSWF("/swf/search_header.swf?2", "banner-flash", "838", "187", "9.0.28.0", "/swf/expressInstall.swf", flashvars, params, attributes);
}

/* Load the featured exhibits banner */
function loadFeature(photo_path, exhibit_url, heading, subheading, description) {
	var flashvars = {
		photo_path: photo_path
		,exhibit_url: exhibit_url
		,heading: heading
		,subheading: subheading
		,description: description
	};
	var params = {
		bgcolor: '#9B5823'
	};
	var attributes = { id: "feature-flash", name: "feature-flash" };
	
	swfobject.embedSWF("/swf/feature_banner.swf", "feature-flash", "569", "248", "9.0.28.0", false, flashvars, params, attributes);
}

/* Load the newsticker for the home page */
function loadTicker() {
	var flashvars = {
		config_path: "/xml_ticker.cfm"
	};
	var params = {
		wmode: 'transparent'
	};
	var attributes = {};
	
	swfobject.embedSWF("/swf/news_ticker.swf", "ticker-flash", "838", "21", "9.0.28.0", false, flashvars, params, attributes);
}