function createFlash()
{
	var cats =
	[
		"/Pages/GeneralInformation/",
		"/Pages/ScientificProgram/",
		"/Pages/RegistrationHousing/",
		"/Pages/ExhibitionInformation/",
		"/Pages/PresenterInformation/",
		"/Pages/MeetingArchives/",
		"/Pages/MembershipInformation/"
	];
	var curcat = 0;
	for(var i = 0; i < cats.length; i++)
	{
		if(window.location.pathname.substr(0, cats[i].length).toLowerCase() == cats[i].toLowerCase())
		{
			curcat = i + 1;
			break;
		}
	}
	var thumbsanim = document.cookie.indexOf("thumbsanim=true") == -1;
	if(thumbsanim)
		document.cookie = "thumbsanim=true";
	swfobject_vars =
	{
		config_url: "/header.xml", // flash XML config file URL
		host_url: window.location.href,
		thumbs_animated: thumbsanim ? "true" : "false",
		button: "0", // top nav item selected
		lk: curcat, // thumb nav item selected
		thumb_1_imgurl: "/Style%20Library/Images/Flash/Thumbs/general.jpg",
		thumb_2_imgurl: "/Style%20Library/Images/Flash/Thumbs/program.jpg",
		thumb_3_imgurl: "/Style%20Library/Images/Flash/Thumbs/registration.jpg",
		thumb_4_imgurl: "/Style%20Library/Images/Flash/Thumbs/exhibits.jpg",
		thumb_5_imgurl: "/Style%20Library/Images/Flash/Thumbs/speaker.jpg",
		thumb_6_imgurl: "/Style%20Library/Images/Flash/Thumbs/archives.jpg",
		thumb_7_imgurl: "/Style%20Library/Images/Flash/Thumbs/membership.jpg",
		thumb_1_text: escape("General Information"),
		thumb_2_text: escape("Scientific Program"),
		thumb_3_text: escape("Registration & Housing"),
		thumb_4_text: escape("Exhibition Information"),
		thumb_5_text: escape("Presenter Information"),
		thumb_6_text: escape("Meeting Archives"),
		thumb_7_text: escape("Membership Information")
	};
	swfobject.embedSWF("/header.swf", "flash", "980", "462", "8.0.0", false, swfobject_vars, {quality: "high", menu: "false", wmode: "opaque", allowscriptaccess: "samedomain"});
}

function thisMovie(movieName)
{
	return document.getElementById(movieName);
}

function flashMenuCallback(itemid)
{
	var urls =
	{
		// logo
		0: "/",
		// top links; 1 is hidden, 5 is search
		2: "/Pages/Other/AboutNass.aspx",
		3: "/Pages/Other/ContactUs.aspx",
		4: "*https://webportal.spine.org/Conference/RegistrationProcessOverview.aspx?id=77",
		// thumbs
		17: "/Pages/GeneralInformation/Default.aspx",
		18: "/Pages/ScientificProgram/Default.aspx",
		19: "/Pages/RegistrationHousing/Default.aspx",
		20: "/Pages/ExhibitionInformation/Default.aspx",
		21: "/Pages/PresenterInformation/Default.aspx",
		22: "/Pages/MeetingArchives/Default.aspx",
		23: "/Pages/MembershipInformation/Default.aspx"
	};
	if(urls[itemid] != null)
		if(urls[itemid].substr(0, 1) == "*")
			window.open(urls[itemid].substr(1), "_blank");
		else
			window.location.href = urls[itemid];
}

function flashSearchCallback(text)
{
	if(text == "null" || text == "") return;
	window.location.href = "/Pages/Other/Search.aspx?k=" + escape(text);
}

function updateSoundControlStatus()
{
	var x = thisMovie("flash");
	var on = document.getElementById("soundOn");
	var off = document.getElementById("soundOff");
	if(x == null || on == null || off == null || typeof(x.jsIsSoundEnabled) != "function")
	{
		setTimeout("updateSoundControlStatus();", 1000);
		return;
	}
	if(x.jsIsSoundEnabled())
	{
		on.style.display = "inline";
		off.style.display = "none";
	}
	else
	{
		on.style.display = "none";
		off.style.display = "inline";
	}
}

function toggleSound()
{
	var x = thisMovie("flash");
	x.jsToggleSound();
	updateSoundControlStatus();
}
