<!--
//=============================
// Flash Detection Script
// Revision 2001.09.27
// Seb Chevrel for Second Story
//=============================

var isFlash4 = false;
var isFlash5 = false;
var isFlash6 = false;
var isIE45 = false;

var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;		// true if we're on ie
var isWin = (navigator.appVersion.indexOf("Windows") != -1) ? true : false; // true if we're on windows
var isMac= (navigator.userAgent.indexOf('Mac') != -1) ? true : false; 

// VBScript Detection on IE/Windows
if(isIE && isWin){ 
	document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n');
	document.write('on error resume next \n');
	document.write('isFlash4 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.4"))) \n');
	document.write('isFlash5 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.5"))) \n');	
	document.write('isFlash6 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.6"))) \n');	
	document.write('</SCR' + 'IPT\> \n');
}

// Netscape PlugIn Detection
function detectFlash(){	
	if (navigator.plugins){
		if (navigator.plugins["Shockwave Flash 2.0"]
		|| navigator.plugins["Shockwave Flash"]){

			var isVersion2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
			var flashDescription = navigator.plugins["Shockwave Flash" + isVersion2].description;
			var dot_location = flashDescription.indexOf(".");
			var flashVersion = parseInt(flashDescription.slice(dot_location - 2, dot_location));
			isFlash4 = flashVersion >= 4;
			isFlash5 = flashVersion >= 5;
			isFlash6 = flashVersion >= 6;
		}
	}	
}
detectFlash();

if ( (navigator.userAgent.indexOf('MSIE 4.5') != -1) && (navigator.userAgent.indexOf('Mac') != -1)) {
	//alert('This interactive feature requires Macromedia Flash player 5 and will not function properly with an earlier version of Flash.');
	isIE45=true; isFlash5=true;
}

// Returns HTML Code to Embed a SWF File
function flashEmbed(swf,width,height,bgcolor,qual,transp,flashvars) {
		if (!bgcolor) bgcolor="#000000";
		if (!qual) qual='HIGH';
		var code = '<OBJECT CLASSID="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ID="flash" NAME="flash" '
		+ 'WIDTH="'+width+'" HEIGHT="'+height+'" '
		+ 'CODEBASE="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab">'
		+ '<PARAM NAME="MOVIE" VALUE="'+swf+'">'
		+ '<PARAM NAME="PLAY" VALUE="true">'
//		+ '<PARAM NAME="LOOP" VALUE="false">'
		+ '<PARAM NAME="QUALITY" VALUE="'+qual+'">'
		+ '<PARAM NAME="MENU" VALUE="false">';
		
		if (transp) code+='<PARAM NAME=wmode VALUE=transparent>';
		if (flashvars) code+='<PARAM NAME="FlashVars" VALUE="' + flashvars + '">';
		
		code+='<PARAM NAME=bgcolor VALUE="'+bgcolor+'"> '
		+ '<EMBED ID="flash" NAME="flash" SRC="'+swf+'" '
		+ 'WIDTH="'+width+'" HEIGHT="'+height+'" '
		+ 'PLAY="true" '
//		+ 'LOOP="false" '
		+ 'QUALITY="'+qual+'" '
		+ 'MENU="false" '
		+ 'BGCOLOR="'+bgcolor+'" ';
		
		if (transp) code+='wmode=transparent ';
		if (flashvars) code+='FlashVars="' + flashvars + '" ';
		
		code+='TYPE="application/x-shockwave-flash" '
		+ 'PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">'
		+ '</EMBED>'
		+ '</OBJECT>';
		return(code);
}

function embedGame1() {
	document.write(flashEmbed("game1.swf",760,534,"#666666"));
}
function embedGame2() {
	document.write(flashEmbed("game2.swf",760,532,"#387373"));
}
function embedGame3Cover() {
	document.write(flashEmbed("cover.swf",700,450,"#c0c246"));
}
function embedHomeAnimation() {
	document.write(flashEmbed("shell.swf",751,275,"#314D61"));
}
function embedSearchBrowse() {
	document.write(flashEmbed("browse.swf",750,422,"#F5F4EF", false, false, "collectionSearchType=2"));
}
function embedSearchKeyword() {
	document.write(flashEmbed("browse.swf",750,422,"#F5F4EF", false, false, "collectionSearchType=3"));
}
function embedSearchAdvanced() {
	document.write(flashEmbed("browse.swf",750,738,"#F5F4EF", false, false, "collectionSearchType=4"));
}
function embedThemeFinder(themeID) {
	if (themeID) {
		document.write(flashEmbed("themefinder.swf",750,362,"#cdcbc6", false, false, "themeid=" + themeID));
	} else {
		document.write(flashEmbed("themefinder.swf",750,362,"#cdcbc6", false, false));
	}
}
function embedThemeSub(themeID) {
	if (themeID) {
		document.write(flashEmbed("theme_subnav.swf",750,47,"#CDCBC6", false, false, "themeid=" + themeID));
	} else {
		document.write(flashEmbed("theme_subnav.swf",750,47,"#CDCBC6", false, false));
	}
}
function embedExhibitionMenu() {
	document.write(flashEmbed("loader.swf",750,375,"#CDCBC6", false, false));
}
function embedExhibitionSub(itm, subitm) {
	document.write(flashEmbed("subnav.swf",750,47,"#CDCBC6", false, false, "item=" + itm + "&subitem=" + subitm));
}
function embedExhibitionSubDyn(itm, subitm) {
	document.write(flashEmbed("subnav.dynamic.swf",750,47,"#CDCBC6", false, false, "item=" + itm + "&subitem=" + subitm));
}
function embedGame3Cover() {
	document.write(flashEmbed("cover.swf",700,450,"#c0c246"));
}
function embedGame3_1() {
	document.write(flashEmbed("game3.swf",750,174,"#c0c247", false, false, "vMovie=1"));
}
function embedGame3_2() {
	document.write(flashEmbed("game3.swf?vMovie=2",750,174,"#c0c247", false, false, "vMovie=2"));
}

function embedGame3Object(flashvars) {
	document.write(flashEmbed("object.swf",10,10,"#E6E4DE", false, false, flashvars));
}

function embedGameSearch(searchframe) {
	if (!searchframe) {
		searchframe = 5;
	}
	document.write(flashEmbed("browse.swf",750,378,"#F5F4EF", false, false, "collectionSearchType=" + searchframe));
}

function embedThemeHeader(txt, color) {
	alert((txt));
	document.write(flashEmbed("header.swf",465,30,color,false, false, "headertext=" + txt + "&bgcolor=" + color));
}

function embedResultsArrow() {
	document.write(flashEmbed("click_choice.swf",726,40,"#147A7A"));
}
//-->
