var swfFile = "";
var screenVisible = "";
var itWebLoaded = 0;
var designLoaded = 0;
function loadScreen(index) {
	var screenText = "";
	// shut off the active screen
	document.getElementById("screenAbout").style.display = "none";
	document.getElementById("screenItWeb").style.display = "none";
	document.getElementById("screenDesign").style.display = "none";
	document.getElementById("screenHome").style.display = "none";
	if (index == menuHomeIndex) {
		document.getElementById("screenHome").style.display = "block";

		var screenText = "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0' width='460' height='308' id='cw_open' align='middle'>";
		screenText += "<param name='allowScriptAccess' value='sameDomain' />";
		screenText += "<param name='allowFullScreen' value='false' />";
		screenText += "<param name='loop' value='false' />";
		screenText += "<param name='movie' value='cw_open.swf' /><param name='quality' value='high' /><param name='bgcolor' value='#000000' /> <embed src='cw_open.swf' quality='high' bgcolor='#000000' width='460' height='308' name='cw_open' align='middle' allowScriptAccess='sameDomain' allowFullScreen='false' loop='false' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />";
		screenText += "</object>";


		document.getElementById('screenHome').innerHTML = screenText;
	}
	else if (index == menuAboutIndex) {
		document.getElementById("screenAbout").style.display = "block";

		screenText = "<div class='screenText'>";
		//screenText += "<br />";
		//screenText += "Creature Works is a digital media design lab and online technologies group. We're celebrating 20+ years of creating successful media solutions for a wide range of clients including government agencies, small to medium sized businesses and Fortune 100 companies. We specialize in designing websites, brands, and marketing and communication collateral for clients who have challenging product, project or branding needs. Our expertise includes hand-coding custom websites and IT systems, developing administration and content management tools and designing e-commerce and database systems. So dream BIG and let's do some brainstorming! We'll find new and inspiring ways for you to reach out to your market. Our designers and developers create, code and optimize web and print media across multiple formats - so you won't be paying for design two or three times over.";
		//screenText += "<br />&#160;<br />";
		//screenText += "Today's market is especially difficult and challenging. There's been a radical shift in how information is experienced and resources are shared. Not only do you need to reach your clients, you need to keep your information safe and your clients' information safe. We are vigilant about online security and safety, and work with some of the best minds in the cyber security industry. We have a deep appreciation for the concerns that face the industry and incorporate best practices across all of our services." 
		screenText += "Creature Works is a digital media design lab and online technologies group. We're celebrating 20+ years of creating successful media solutions for a wide range of clients, including government agencies, and businesses spanning small to Fortune 100 companies. We specialize in web design/development and marketing collateral for clients with challenging products, projects, or branding needs. Our expertise includes hand-coding custom websites, IT systems, and content management tools. We design e-commerce and database systems and whatever specific system you need. So dream BIG and let's do some brainstorming! We'll find inspiring ways for you to reach out to your market. Our designers and developers can reduce your costs by optimizing your media assets across multiple formats.";
		screenText += "<br />&#160;<br />";
		screenText += "Today's market is especially difficult and challenging. There's been a radical shift in how information is experienced and resources are shared. Not only do you need to reach your clients with a professional look and feel, you need to do it in a safe and secure manner. We do this through smart design and secure online strategies. We keep your information safe and your clients' information safe by incorporating best practices across all of our public and private services."
		
		screenText += "<br />&#160;<br />";
		screenText += "View some current and past work in our <a href='#' onclick='doMenuClick(menuItWebIndex);loadScreen(menuItWebIndex)'>IT / Web</a> and <a href='#' onclick='doMenuClick(menuDesignIndex);loadScreen(menuDesignIndex)'>Design</a> portfolios.";
		screenText += "<br />&#160;<br />";
		screenText += "Give us a call or email us, 952-361-9300 or ";
		screenText += "<a href='mailto:sales@creatureworks.com'>sales@creatureworks.com</a>";
		screenText += "</div>";

		document.getElementById('screenAbout').innerHTML = screenText;
	}
	else if (index == menuItWebIndex) {
		document.getElementById("screenItWeb").style.display = "block";
		screenVisible = "screenItWeb";
		swfFile = "xPhoto_generic_wlinks";
		xmlFile = "xPhoto_itweb";
		if (!DetectFlashVer(7,0,0)) {
			// flash is too old or we can't detect the plugin
	                var alternateContent = "<div align='center' style='width:460px;color:white;'>"
                        + "<br />Viewing our IT / Web portfolio will<br />require an upgrade to your Adobe Flash Player.<br />&#160;<br />"
                        + "<a href=http://www.macromedia.com/go/getflash/><img border=0 src='images/flashplayer.jpg' width='72' height='72' alt='Get Flash' /></a></div>";
			// insert non-flash content
			document.getElementById('screenItWeb').innerHTML = alternateContent;
		}
		else if (!itWebLoaded) {
			loadSwf(swfFile,xmlFile);
			itWebLoaded = 1;
		}
	}
	else if (index == menuDesignIndex) {
		document.getElementById("screenDesign").style.display = "block";
		screenVisible = "screenDesign";
		swfFile = "xPhoto_generic_wlinks";
		xmlFile = "xPhoto_design";
		if (!DetectFlashVer(7,0,0)) {
			// flash is too old or we can't detect the plugin
	                var alternateContent = "<div align='center' style='width:460px;color:white;'>"
                        + "<br />Viewing our Design portfolio will<br />require an upgrade to your Adobe Flash Player.<br />&#160;<br />"
                        + "<a href=http://www.macromedia.com/go/getflash/><img border=0 src='images/flashplayer.jpg' width='72' height='72' alt='Get Flash' /></a></div>";
			// insert non-flash content
			document.getElementById('screenDesign').innerHTML = alternateContent;
		}
		else if (!designLoaded) {
			loadSwf(swfFile,xmlFile);
			designLoaded = 1;
		}
	}
}
function loadSwf(swfFile,xmlFile) {
       	if (AC_FL_RunContent == 0) {
		alert("This page requires AC_RunActiveContentD.js.");
        }
        else {
                AC_FL_RunContent(
			'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0',
			'width', '460',
			'height', '308',
			'src', swfFile+'.swf?SWFportfolio='+xmlFile+'.xml',
			'quality', 'high',
			'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
			'align', 'middle',
			'play', 'true',
			'loop', 'false',
			'scale', 'showall',
			'wmode', 'window',
			'devicefont', 'false',
			'id', swfFile,
			'bgcolor', '#000000',
			'name', 'swfFile',
			'menu', 'true',
			'allowFullScreen', 'false',
			'allowScriptAccess','sameDomain',
			'movie', swfFile+'.swf?SWFportfolio='+xmlFile+'.xml',
			'salign', ''
		); //end AC code
        }
}
