// inc_mediaSite.js
// Copyright 2007 Jersey Cow Software


/*************************************************************************************************************/
var gSelectedProduct = 0;	// index of the currently selected product

var siteSections = new Array();
siteSections = ["think","create","process","values", "about", "contact"];

var productComponents = new Array();
productComponents = ["mapview","illustration","demo","fe_demo","be_demo","com_demo","caseStudy"];

var productFilters = new Array();
productFilters = ["fe_demo","be_demo","com_demo","caseStudy","tool_demo"];

var myProducts;
var myTags;
var myConcepts;
var myValues;
var aboutSubs;
var setupID;

var blankSlateStageGraphic = "../images/FPO_generic.gif";
var textDefaultColor = "#FFF";
var tagOverColor = "#FFF";
var tagHiliteColor = "#669900";//"#77AA44";
var tagDefaultColor = "#C1C1C1";
var tagDimmedColor="#896530";
var dimOpacity = 45;
var semidimOpacity = 90;
var hiliteOpacity = 100;
var defaultOpacity = semidimOpacity;
var defaultBorderWidth = "1px";
var hiliteBorderWidth = "4px";
var defaultBorderColor = "#000";
var hiliteBorderColor = "#669900";
var stageBGcolor = "#240000";//"#330000";
var activeSiteSectionIndex;
var activeFlashContentDivID;
var activeProdFilterIndex = null;
var activeFilterSet;
var activeProductID = null;
var activeValueIndex;
var activeAboutIndex;
var defaultTagID;

/*************************************************************************************************************/
/* This is the constructor function for the "product" object.
 *
 * parameters:
 *		id - product id
 *		title - the product title
 *		content - the descriptive content for the product
 * 		tagsList - a comma-delimited list of associated tag id #s

 */
function Product(id, title, content, tagsList, illustration, demo, fe_demo, be_demo, com_demo, mapview, caseStudy, tool_demo,defaultStageContent) {
	this.id = id;
	this.title = title;
	this.content = content;
	this.tagsList = tagsList;
	this.mapview = mapview;
	this.illustration = illustration;
	this.demo = demo;
	this.fe_demo = fe_demo;
	this.be_demo = be_demo;
	this.com_demo = com_demo;
	this.caseStudy = caseStudy;
	this.tool_demo = tool_demo;
	this.defaultStageContent = defaultStageContent;
	this.curStageContent = defaultStageContent;// gets updated when a produceComponent appLinks is selected and the main stage content updates
	this.selected = false;
	this.highlighted = true;
}

function Mapview(id, swfPath) {
	this.id = id;
	this.swfPath = swfPath;
	this.swfName = "stageContent";
	this.swfWidth = "440";
	this.swfHeight = "340";
}
function Illustration(id, imgPath) {
	this.id = id;
	this.imgPath = imgPath;
}
function Demo(id, type, path, swfWidth, swfHeight, desc) {
	this.id = id;
	this.type = type;
	this.path = path;
	this.swfName = "stageContent";
	this.swfWidth = swfWidth;
	this.swfHeight = swfHeight;
	this.desc = desc;
}
function CaseStudy(id, content) {
	this.id = id;
	this.content = content; // this would most likely be url to populate an iframe element
}

/*************************************************************************************************************/
myProducts = new Array();

setupID = 0;
myProducts[setupID] = new Product(setupID,"Generic", 
						"Generic content...",
						"0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16",
						new Illustration(setupID,"images/homeCowGraphic.jpg"),
						"","","","","","","","illustration"
					);

setupID = 1;
myProducts[setupID] = new Product(setupID,"&quot;Who Is Oscar Lake?&quot;", 
						"",
						"1,2,3,4,5,6,7,8,13,14,15,16",
						"",
						"",
						new Demo(setupID,"flash","WhoIsOscarLake.swf","598","411","LPI gained instant recognition as a world-wide product leader with the language learning adventure game, &quot;Who Is Oscar Lake?&quot;<br /><br />Designed and developed for distribution in 25 countries by Jersey Cow&copy;."),
						"","","","","","demo"
					);

setupID = 2;
myProducts[setupID] = new Product(setupID,"&quot;Prince of the Pyramid&quot;", 
						"",
						"1,2,3,4,5,6,7,8,10",
						"",
						"",
						new Demo(setupID,"flash","PoP_ground.swf","600","420","COW created learning adventure games to help the National Theatre for Children reinforce the lessons in nutrition and fitness espoused in their performances in schools across the country, so that they could more fully engage these young audiences with their mission-critical health awareness messaging."),
						"","","","","","demo"
					);

setupID = 3;
myProducts[setupID] = new Product(setupID,"HighlightsKids.com", 
						"COW is a &quot;deep collaborator&quot; to educational providers, a trusted partner who knows its partner's value chains so well that it takes responsibility for strategic portions of them.",
						"1,2,3,7,8,9,10,11,12,13,14,15",
						"",
						"",
						new Demo(setupID,"flash","Demo_baseMovie_HPI.swf","578","446","Highlights for Children fosters its particular brand of personal communication with children through an enterprise-scale children's web community. <br /><br />Designed, implemented and maintained in collaboration with COW&copy;."),
						"",
						new Demo(setupID,"flash","Demo_HFCcommunity.swf","596","446","Cow helped Highlights craft and support opportunities for readers to become creators with its brands.  Self-organizing webs of kids and kid-generated content facilitate investment in creative learning experiences - as individual and as a community - that are truly unique."),
						"",
						new CaseStudy(setupID,"/clients/cs_HFC_08.html"),
						"","demo"//###################################
					);

setupID = 4;
myProducts[setupID] = new Product(setupID,"Nickelodeon Kiosk", 
						"Kids expressing themselves to other kids.<br /><br />Web 2.0 before there was Web 2.0<br /><br />The Nickelodeon boutique video kiosk in the FAO Schwarz NY flagship store",
						"1,2,3,7,8,10,12",
						"",
						new Demo(setupID,"Demo_nickCapture.swf",	"596","430"),
						"","","","","","demo"
					);

setupID = 5;
myProducts[setupID] = new Product(setupID,"&quot;Captain Courage&quot;<br />from Writing to Write <br />by <strong>IBM</strong>", 
						"Children articulate their own ideas in a vairety of creative writing scenarios in this IBM flagship product",
						"1,3,6,7,8",
						"",
						new Demo(setupID,"Demo_courage.swf","550","330"),
						"","","","","","demo"
					);

setupID = 6;
myProducts[setupID] = new Product(setupID,"Online Communities: HighlightsKids.com", 
						"Kids are the creators when Highlights publishes &quot;UGC&quot;, user generated content online in volumes unmatched in print media",
						"7,8,9,10,11,12,13,14,16",
						"",
						new Demo(setupID,"Demo_HFCcommunity.swf","596","446"),
						"","","","",
						new CaseStudy(setupID,"/clients/cs_HFC_08.html"),
						"demo"//###################################
					);

setupID = 7;
myProducts[setupID] = new Product(setupID,"Brand Extension at<br />&quot;Club TUKI&quot;", 
						"",
						"1,2,3,7,8,9,10,11,12",
						"",
						"",
						new Demo(setupID,"flash","TUKI_gamesMenu.swf","594","433","A premier online network for children with core functionality to protect and educate<br /><br />A private label partner program offers companies a unique new online brand extension strategy in Internet safety related marketing"),
						"","","","","","demo"
					);

setupID = 8;
myProducts[setupID] = new Product(setupID,"&quot;Money U&quot;", 
						"MoneyU is a breakthrough in Financial Literacy education!<br /> Here's why: in as little as 10 engaging, well-organized hours of instruction, it's possible to learn more Personal Finance skills than 30 hours in a classroom.<br /><br />Tech & Learning calls MoneyU \"One of the best education offerings of 2008\"",
						"6,9,16",
						"",
						"",
						new Demo(setupID,"image","images/stage_GEMU_fe.gif","","","COW took ownership of the client-side flash application developed in the R&D phase of MoneyU and re-tooled it for architectural extensibility and user-experience enhancements, enabling a commercial grade release of the product for learners and a broader array of business options for the MoneyU team."),
						new Demo(setupID,"image","images/stage_GEMU_be.gif","","","COW customized the open-source Moodle course management framework to serve as a robust delivery system for both the front-end courseware experience and the back-end user management and course registration capabilities."),
						"",
						new Mapview(setupID,"COW_tagMap.swf"),
						"","","fe_demo"
					);

setupID = 9;
myProducts[setupID] = new Product(setupID,"Play With Me Sesame", 
						"Enabling Sesame Workshop to deliver integrated playlists of old and new favorite theatrical and interactive content to their eager audiences -  swiftly, flexibly, and reliably",
						"6,7,8",
						"",
						"","","","",
						new Mapview(setupID,"COW_tagMap.swf"),
						"","mapview"
					);

setupID = 10;
myProducts[setupID] = new Product(setupID,"mREAD", 
						"Developing customized and engaging game-based literacy curricula that leverages Sesame Workshop's old favorites in edutainment programming and new strategies in interactive learning technology<br /><br />A commitment to innovation and research in supporting young learners",
						"5,6,7,8",
						"",
						"","","","",
						new Mapview(setupID,"COW_tagMap.swf"),
						"","mapview"
					);

setupID = 11;
myProducts[setupID] = new Product(setupID,"&quot;Zip Zoom English&quot;", 
						"Working closely with Scholastic to address the unique challenges young English Language Learners face in the United States, once they arrive<br />in the classroom:<br /><i>They must learn English;<br />They must learn to read;<br />They must do both quickly!</i>",
						"2,6,7,8",
						"",
						"",
						new Demo(setupID,"image","images/stage_ZZE_fe.gif","","","COW took ownership of the client-side flash application developed in the R&D phase of Zip Zoom and re-tooled it for architectural extensibility and user-experience enhancements. COW&quot;s development partnership with Scholastic spanned the full life-cycle of the Zip Zoom commercial product emergence, beginning with due-diligence analysis of the legacy research product and culminating with a Gold Master CD-Rom that reflected the pedagogic functional and design upgrades identified by Scholastic as critical to success in the K-3 education market."),
						"","",
						new Mapview(setupID,"COW_tagMap.swf"),
						"","","fe_demo"
					);

setupID = 12;
myProducts[setupID] = new Product(setupID,"Web Design and Interactivity Apprenticeships", 
						"Fostering creativity, collaboration, leadership and technology-based skills, enabling the students in our local Citizen Schools after-school program to act as their own digital journalists, graphic designers, and web development team",
						"7,12",
						"",
						"","","","",
						new Mapview(setupID,"COW_tagMap.swf"),
						"","mapview"
					);

setupID = 13;
myProducts[setupID] = new Product(setupID,"StoryPets", 
						"Crafting a world of storymaking that both nurtures and thrives upon<br />the creative impulses of its young virtual inhabitants. <br /><br />  A close collaboration with Eggshell Games to blaze new trails in fostering a love of stories in young minds",
						"2,5,7,8,13,14",
						"",
						"",
						new Demo(setupID,"image","images/stage_ESG_fe.gif","","","Crafting a world of storymaking that both nurtures and thrives upon the creative impulses of its young virtual inhabitants. <br /><br />  A close collaboration with Eggshell Games to blaze new trails in fostering a love of stories in young minds."),
						"","",
						new Mapview(setupID,"COW_tagMap.swf"),
						"","","fe_demo"
					);

setupID = 14;
myProducts[setupID] = new Product(setupID,"Global Knowledge Exchange", 
						"Integrating professional development for teachers and technology-assisted game-based learning for students embedded within a global online learning community, supporting creative investment and initiative in the cultural exchange activities of learners and educators",
						"7,8,11,12,16",
						"",
						"","","","",
						new Mapview(setupID,"COW_tagMap.swf"),
						"","mapview"
					);

setupID = 15;
myProducts[setupID] = new Product(setupID,"&quot;The Assessment Management System: <br>Academic Language Notebooks: The Language of Math&quot;", 
						"Working closely with Scholastic to address the unique challenges young English Language Learners face in the United States, once they arrive<br />in the classroom:<br /><i>They must learn English;<br />They must learn to read;<br />They must do both quickly!</i>",
						"",	"",	"",	"",	"",	"",	"",	"",
						new Demo(setupID,"image","images/stage_CCAMS_fe.gif","","","COW worked closely with Course Crafters to develop a CD-ROM companion for their Academic Language Notebook series that included both a Resource browser for accessing printable curricular materials and a lightweight yet feature-rich Assessment Management toolset for tracking and reporting the academic progress of their English Language Learners."),
						"tool_demo"
					);

/*************************************************************************************************************/

function selectProduct(productID) {
	var productIndex, tagIndex, productRef, tagID, selectedProductRef, useStageContent;
	
	//alert("productID: "+productID+ ", activeProductID = "+activeProductID);
	//Handling the case of matching productID and activeProductID before this point in the selectProductFilter function...
	
	if (activeProdFilterIndex == null){
		//alert("activeProdFilterIndex == null");
		selectProductFilter(getProdFilterByProdID(productID), productID);
	}
	
	if (! productInFilterSet(productID) ){
		//alert("! productInFilterSet: "+ activeFilterSet.length);
		return;
	}
	
	activeProductID = productID;
	
	// reset all product icons to non-highlighted, and highlight the selected one
	// reset all product icons to non-selected, except the newly selected one
	for (productIndex = 1; productIndex < myProducts.length; productIndex++) {
		productRef = myProducts[productIndex];
		if ( ! isExcluded(productRef.id, "product") ){
			if (productInFilterSet(productRef.id)){
				if (productRef.id == productID) {	
					productRef.selected = true;
					selectedProductRef = productRef;
					productRef.highlighted = true;
					setBorderStyle("product"+productRef.id, "ridge", hiliteBorderColor, hiliteBorderWidth);
					setOpacity("product"+productRef.id, hiliteOpacity);	
				}else{
					productRef.selected = false;
					productRef.highlighted = false;
					setBorderStyle("product"+productRef.id, "ridge", hiliteBorderColor, defaultBorderWidth);					
					setOpacity("product"+productRef.id, defaultOpacity);
				}				
			} 
		}
	}
		
	// show the tag text
	setTitle("sidebar_create_hdr", selectedProductRef.title);
	setDescription("sidebar_create_blurb", selectedProductRef.content);
	
//	selectedProductRef.curStageContent = selectedProductRef.defaultStageContent;// comment out this line if we want to retain the existing stage content rather than resetting back to default in the case where the user reselects a product they're already viewing... (may or may not be viewing the default stage content for that product...)
	
//	setAppLinks(selectedProductRef,"product");

	switch (selectedProductRef.curStageContent) {
		
		case "illustration": // NOT IN USE
			displayIllustration(selectedProductRef.illustration.imgPath);// toggle the center stage graphic to the selected product
			break;
		case "demo":  // NOT IN USE
			activeFlashContentDivID = "fcontent_"+siteSections[activeSiteSectionIndex];
			displayDemo(selectedProductRef.demo.swfPath, selectedProductRef.demo.swfName, selectedProductRef.demo.swfWidth, selectedProductRef.demo.swfHeight, activeFlashContentDivID);
			break;
		case "fe_demo": 			
			showDemoType(selectedProductRef, "fe_demo");			
			break;
		case "be_demo":
			showDemoType(selectedProductRef, "be_demo");	
			break;
		case "com_demo": 
			showDemoType(selectedProductRef, "com_demo");	
			break;
		case "tool_demo": 
			showDemoType(selectedProductRef, "tool_demo");	
			break;
		case "mapview":  // NOT IN USE
			displayMapview(selectedProductRef.mapview.swfPath, selectedProductRef.mapview.swfName, selectedProductRef.mapview.swfWidth, selectedProductRef.mapview.swfHeight);
			break;
		case "caseStudy": 
			displayCaseStudy(selectedProductRef.caseStudy.content);
			break;
		default: 
			//fe_demo, be_demo, com_demo
			alert("unfamiliar productRef.defaultStageContent: "+selectedProductRef.defaultStageContent);
	}
	
	document.getElementById("ticker_create").innerHTML = "";
	
	displayFlashFile("typer_mktgMsg.swf", "mticker_create", 280, 40, stageBGcolor, "ticker_create");
	
	
/*
	// reset all tags to non-selected
	for (tagIndex = 1; tagIndex < myTags.length; tagIndex++) {
		tagID = myTags[tagIndex].id;
		if ( ! isExcluded(tagID) ){
			setBorderStyle("tag"+tagID, "solid", "#000000");
		}
	}
	
	// highlight the tags that are associated with the current product
	for (tagIndex = 1; tagIndex < myTags.length; tagIndex++) {
		tagID = myTags[tagIndex].id;
		if ( ! isExcluded(tagID) ){
			if (numIsInString(selectedProductRef.tagsList, tagID)) {
				setTagTextColor("tag"+tagID, tagDefaultColor); //setOpacity("tag" + tagNum, 100);
			} else {
				setTagTextColor("tag"+tagID, tagHiliteColor); //setOpacity("tag" + tagNum, 50);
			}
		}		
	}
*/
}

function showDemoType( productRef, prodFilter ){
	if (productRef[prodFilter].type == "image"){
		//alert(selectedProductRef.fe_demo.type);
		displayIllustration(productRef[prodFilter].path, document.getElementById("fcontent_create"));		
	}else{
		activeFlashContentDivID = "fcontent_"+siteSections[activeSiteSectionIndex];
		displayDemo(productRef[prodFilter].path, productRef[prodFilter].swfName, productRef[prodFilter].swfWidth, productRef[prodFilter].swfHeight, activeFlashContentDivID);
	}
	setDescription("sidebar_create_blurb", productRef[prodFilter].desc);
}

function productInFilterSet(productID){
	var setIndex;
	
	if (activeProdFilterIndex == null) return true;
	
	for (setIndex=0; setIndex<activeFilterSet.length; setIndex++){
		if (activeFilterSet[setIndex].id == productID){
			return true;
		}
	}
	return false;
}

function setup_create(){
	var productIndex, productRef;
	//activeProdFilterIndex = null;
	//alert("activeProdFilterIndex = "+activeProdFilterIndex);
	
	if (activeProdFilterIndex == null){	
		for (productIndex = 1; productIndex < myProducts.length; productIndex++) {
			productRef = myProducts[productIndex];
			if ( ! isExcluded(productRef.id, "product") ){
				setOpacity("product"+productRef.id, semidimOpacity);
				productRef.highlighted = false;
			}
		}
	}else{// if they've already been to this site section, just restore the last content shown - note that a fresh (re) select here is necessary to restore the flash demo content that was cleared when we last nav'd away from this section
		for (productIndex = 1; productIndex < myProducts.length; productIndex++) {
			productRef = myProducts[productIndex];
			if (productRef.selected) {
				selectProduct(productRef.id);
			}
		}
	}
}

function getProdFilterByProdID(productID){
	// returns the first product filter for which the selected product has valid content (used in conditions where we're coming from the site section setup state or otherwise have a filter view of 'all' active...
	var productIndex;
	for (productIndex = 1; productIndex < myProducts.length; productIndex++) {
		productRef = myProducts[productIndex];
		if (productRef.id == productID){
			for (pfIndex = 0; pfIndex < productFilters.length; pfIndex++) {
				if (productRef[productFilters[pfIndex]] != ""){
					return pfIndex;
				}
			}
		}
	}
}

function selectProductFilter(pfIndex, productID){
	var productIndex, filterIndex, adjusted_pfIndex;
	
	//alert("activeProductIndex: "+activeProductID+"\n productID: "+productID+ "\n activeProdFilterIndex: "+activeProdFilterIndex+ "\n pfIndex: "+pfIndex);

	//if ((activeProdFilterIndex == pfIndex) && (activeProductID == productID)){
	if ((activeProductID == productID) && (productID != null) && (activeProdFilterIndex != pfIndex)){
		//alert("returning b/c the activeProductID == productID and activeProdFilterIndex == pfIndex");
		return;
	}
	
	activeProdFilterIndex = pfIndex;
	activeFilterSet = new Array();	
	
	// identify which products are part of this filter set...
	for (productIndex = 1; productIndex < myProducts.length; productIndex++) {
		productRef = myProducts[productIndex];
		if ( ! isExcluded(productRef.id, "product") ){
			if (productRef[productFilters[pfIndex]] != ""){
				productRef.curStageContent = productFilters[pfIndex];
				setOpacity("product"+productRef.id, hiliteOpacity);
				activeFilterSet.push(productRef);
			}else{
				setOpacity("product"+productRef.id, dimOpacity);
			}
		}
	}
	
	/* //DEBUG
	var afs_string = "";
	for (var a = 0; a < activeFilterSet.length; a++) {
		afs_string += activeFilterSet[a].id+",";		
	}
	alert("activeFilterSet: "+afs_string);
	//END DEBUG */
	
	// knock out all the irrelevant products
	for (productIndex = 1; productIndex < myProducts.length; productIndex++) {
		productRef = myProducts[productIndex];
		if ( ! isExcluded(productRef.id, "product") ){
			if (! productInFilterSet(productRef.id)){
				productRef.selected = false;
				productRef.highlighted = false;				
				setBorderStyle("product"+productRef.id, "solid", defaultBorderColor ,defaultBorderWidth);
				setOpacity("product"+productRef.id, dimOpacity);
				setTagTextColor("prodFilter"+pfIndex, tagDefaultColor); //setOpacity("tag" + tagNum, 100);
			}
		}
	}
	
	// set the color of the filter link in the left nav as selected, and the others to default
	setTagTextColor("prodFilter"+pfIndex, tagHiliteColor); //setOpacity("tag" + tagNum, 100);
	for (filterIndex = 0; filterIndex < productFilters.length; filterIndex++) {
		if (filterIndex != pfIndex){
			setTagTextColor("prodFilter"+filterIndex, tagDefaultColor); //setOpacity("tag" + tagNum, 100);		
		}
	}
	
	if (productID != null){
		selectProduct(productID);		
	}else{
		selectProduct(activeFilterSet[0].id);
	}
}

/*************************************************************************************************************/
/*************************************************************************************************************/
/* This is the constructor function for the "tag" object.
 *
 * parameters:
 *		id - product id
 *		title - the product title
 *		content - the descriptive content for the tag
 * 		productsList - a comma-delimited list of associated product id #s
 */
function Tag(id, title, content, productsList, illustration, demo, mapview, caseStudy, defaultStageContent, addressKey) {
	this.id = id;
	//alert('new Tag('+id+',...)');
	this.title = title;
	this.content = content;
	this.productsList = productsList;
	this.mapview = mapview;
	this.illustration = illustration;
	this.demo = demo;
	this.caseStudy = caseStudy;
	this.defaultStageContent = defaultStageContent;
	this.curStageContent = defaultStageContent;
	this.addressKey = addressKey;
}

myTags = new Array();
defaultTagID = 17;

setupID=0;
myTags[setupID] = new Tag(setupID,"", 
					"<strong>Jersey Cow&reg; helps educational providers<br> put more effective<br> game-based e-learning <br>in the hands of learners<br>via content-rich websites, <br>applications, and <br>online communities.</strong><br /><br /><em>We can build it for you<br />We can build it with you<br />We can teach you to build it yourself</em>",
					"1,2,3,4,5,6,7,8,9,10,11,12,13,14", 
					new Illustration(setupID,"/MediaSite/images/homeCowGraphic.jpg"),
					"","","","illustration",""
				);


setupID=1;
myTags[setupID] = new Tag(setupID,"Interactive Design", 
					"Interactivity is a user-directed investigation of a content domain.<br /><br />Interactive design is the 4-dimensional problem of designing the user's self-directed travel through time and through space with content.", 
					"1,2,3,4,5,7",
					"",
					"",
					new Mapview(setupID,"COW_tagMap.swf?parentNodeSelection="+setupID),
					"","mapview","interactive_design"
				);

setupID=2;
myTags[setupID] = new Tag(setupID,"User experience design", 
					"Turning great content into great experiences", 
					"1,2,3,4,7,11,13",
					"",
					"",
					new Mapview(setupID,"COW_tagMap.swf?parentNodeSelection="+setupID),
					"","mapview","user_experience"
				);

setupID=3;
myTags[setupID] = new Tag(setupID,"Interface Design", 
					"Designing the &quot;interaction zones&quot;:<br /><br />Screens,<br /> buttons,<br />links,<br /> dialogs<br /> and other interface devices through which the users and the product interact", 
					"1,2,3,4,5,7,10",
					"",
					"",
					new Mapview(setupID,"COW_tagMap.swf?parentNodeSelection="+setupID),
					"","mapview","interface_design"
				);

setupID=4;
myTags[setupID] = new Tag(setupID,"Navigation Design", 
					"Designing the pathways through the web:<br /><br /> &quot;Roads&quot;<br /> and &quot;road signs&quot;<br /> embedded in the content architecture<br /><br />The user's GPS system", 
					"1,2,7",
					"",
					"",
					new Mapview(setupID,"COW_tagMap.swf?parentNodeSelection="+setupID),
					"","mapview","navigation_design"
				);

setupID=5;
myTags[setupID] = new Tag(setupID,"Interactive Game Design", 
					"By their very nature games are interactive<br /><br />Technology simply gives us many more ways to increase the value of the game play experience", 
					"1,2,10,13",
					"",
					"",
					new Mapview(setupID,"COW_tagMap.swf?parentNodeSelection="+setupID),
					"","mapview","game_design"
				);

setupID=6;
myTags[setupID] = new Tag(setupID,"Game-based learning", 
					"Many games succeed at being educational while never being marketed as such.<br /><br />They succeed without even trying because they capitalize on a critical underlying principle of all games:<br /><br />To play is to learn.", 
					"1,2,5,8,9,10,11",
					"",
					"",
					new Mapview(setupID,"COW_tagMap.swf?parentNodeSelection="+setupID),
					"","mapview","game-based_learning"
				);

setupID=7;
myTags[setupID] = new Tag(setupID,"Fun", 
					"&quot;A castle, made of cartons, rocks, and old branches, by a group of children for themselves, is worth a thousand perfectly detailed, exactly finished castles, made for them in a factory.&quot;<br /><br />--Christopher Alexander<br /><em>A Pattern Language</em>, 1977", 
					"1,2,3,4,5,6,7,9,10,11,12,13", 
					"",
					"",
					new Mapview(setupID,"COW_tagMap.swf?parentNodeSelection="+setupID),
					"","mapview","fun"
				);

setupID=8;
myTags[setupID] = new Tag(setupID,"Play", 
					"&quot;For many years the conviction has grown upon me that civilization arises and unfolds in and as play.&quot;<br /><br />  --Johan Huizinga<br /><em>homo ludens</em>, 1935<br /><br /><br />&quot;...the skills we acquire through play may have implications for how we learn, work, participate in the political process, and connect with other people around the world.&quot;<br /><br />  --Henry Jenkins<br /><em>Convergence Culture</em>, 2006",
					"1,2,3,4,5,6,7,9,10,11,13,14", 
					"",
					new Demo(setupID,"TAG_playPoetry.swf","596","386"),
					new Mapview(setupID,"COW_tagMap.swf?parentNodeSelection="+setupID),
					"","demo","play"
				);

setupID=9;
myTags[setupID] = new Tag(setupID,"Web-based Systems", 
					"25 years as a full-service development company has given COW the ability to create the robust system architectures, applications and business processes required to deliver richly immersive, interactive brand experiences on any screen", 
					"3,6,7,8", 
					"",
					"",
					new Mapview(setupID,"COW_tagMap.swf?parentNodeSelection="+setupID),
					"","mapview","web-based_systems"
				);

setupID=10;
myTags[setupID] = new Tag(setupID,"Brand Extension", 
					"We help providers extend their brands in a variety of new media and &quot;transmedia&quot; channels by bridging the gap between linear media and interactive media", 
					"2,3,4,6,7", 
					new Illustration(setupID,"/MediaSite/images/stage_brandExtension.jpg"),
					"",
					new Mapview(setupID,"COW_tagMap.swf?parentNodeSelection="+setupID),
					"","illustration","brand_extension"
				);

setupID=11;
myTags[setupID] = new Tag(setupID,"Online Communities", 
					"Technology-assisted...<br /><br />Self-organizing...<br /><br />Webs of people, providers, content and infrastructure creating the human experience in ways truly unique in history", 
					"3,6,7,14", 
					"",
					new Demo(setupID,"TAG_web2-0_pubModel.swf","596","386"),
					new Mapview(setupID,"COW_tagMap.swf?parentNodeSelection="+setupID),
					"","mapview","online_communities"
				);

setupID=12;
myTags[setupID] = new Tag(setupID,"Web 2.0", 
					"What if all &quot;flow&quot; in your body was one-way?<br /><br />What if you body could not send messages to your brain?<br /><br />What if your blood could not circulate?<br /><br />Why should it be any different in a community?", 
					"3,4,6,7,12,14", 
					"",
					new Demo(setupID,"TAG_web2-0_pubModel.swf","596","386"),
					new Mapview(setupID,"COW_tagMap.swf?parentNodeSelection="+setupID),
					"","mapview","web2-0"
				);

setupID=13;
myTags[setupID] = new Tag(setupID,"Process Engineering", 
					"Providers adapt their brands across new media and &quot;transmedia&quot; channels <br /><br />They must also adapt the business processes required to create, support and maintain these new initiaitves", 
					"1,3,6,13", 
					"",
					"",
					new Mapview(setupID,"COW_tagMap.swf?parentNodeSelection="+setupID),
					"","mapview","process_engineering"
				);

setupID=14;
myTags[setupID] = new Tag(setupID,"Agility", 
					"Customer Collaboration<br /><br />Individuals and Interaction<br /><br />Responding to Change<br /><br />Working Software<br /><br /><br /><em>-from the Agile Manifesto of Software Development</em>", 
					"1,3,6,13", 
					"",
					new Demo(setupID,"ChangeCMinor.swf","596","386"),
					new Mapview(setupID,"COW_tagMap.swf?parentNodeSelection="+setupID),
					"","demo","agility"
				);

setupID=15;
myTags[setupID] = new Tag(setupID,"Content Strategy", 
					"Providers tend to sell content<br /><br />Consumers invest themselves in experiences<br /><br />We help clients define strategies that turn their content into great experiences<br /><br />Moral: Create experiences not content", 
					"1,3", 
					"",
					new Demo(setupID,"flash","typer_contentStrategy.swf","440","285"),					
					new Mapview(setupID,"COW_tagMap.swf?parentNodeSelection="+setupID),
					"","demo","content_strategy"
				);

setupID=16;
myTags[setupID] = new Tag(setupID,"Information Architecture", 
					"Information becomes content<br /><br />Content becomes experience<br /><br />The value of content to both the user, and the provider, depends on how it is wired together--its architecture", 
					"1,6,8,14", 
					"",
					"",
					new Mapview(setupID,"COW_tagMap.swf?parentNodeSelection="+setupID),
					"","mapview","info_architecture"
				);
setupID=17;
myTags[setupID] = new Tag(setupID,"The Way of Cow<sup><span class=\"reg\">&reg;</span></sup>", 
					"", 
					"", 
					"",
					"",
					new Mapview(setupID,"COW_tagMap.swf?parentNodeSelection="+setupID),
					"","mapview",""
				);

/*************************************************************************************************************/
/* This function shows the valid product thumbs at 100% opacity, and the
 * invalid ones at a lesser opacity, for the selected tag.
 */
function selectTag(tagID) {
	var tagIndex, tagRef, productIndex, productID, productRef, selectedTagRef, useStageContent;
	
//alert('tagID = '+tagID);

	// reset all tag links to non-highlighted, and highlight the selected one
	for (tagIndex = 1; tagIndex < myTags.length; tagIndex++) {
		tagRef = myTags[tagIndex];
		//alert('tagRef.id = '+tagRef.id);
		if (tagID == tagRef.id) {
			tagRef.selected = true;
			selectedTagRef = tagRef;
		}else{
			tagRef.selected = false;
		}
		
		
		if ( ! isExcluded(tagRef.id, "tag") ){
			// reset all tags to non-selected, except the chosen one
			//alert('tagID '+tagID+' = tagRef.id '+tagRef.id+'?...'+(tagID == tagRef.id) );
			if (tagRef.selected) {
				setTagTextColor("tag"+tagRef.id, tagHiliteColor); //setOpacity("tag" + tagNum, 100);
				//setBorderStyle("tag"+tagRef.id, "ridge", "#DDDDDD");		
			} else {
				setTagTextColor("tag"+tagRef.id, tagDefaultColor); //setOpacity("tag" + tagNum, 50);				
				//setBorderStyle("tag"+tagRef.id, "solid", "#000000");
			}/**/
		}		
	}
	
	// show the tag text
	setTitle("sidebar_process_hdr", selectedTagRef.title);
	setDescription("sidebar_process_blurb", selectedTagRef.content);
	//setAppLinks(selectedTagRef, "tag");
	
	document.getElementById("ticker_process").innerHTML = "";
	
	displayFlashFile("typer_mktgMsg.swf", "mticker_process", 280, 40, stageBGcolor, "ticker_process");
	
	if (selectedTagRef.id == 15){// content strategy exception
		selectedTagRef.defaultStageContent = "demo";
	}else{
		selectedTagRef.defaultStageContent = "mapview";
	}
	
	//alert("defaultStageContent for tag id "+selectedTagRef.id+" = "+selectedTagRef.defaultStageContent);
	
	switch (selectedTagRef.defaultStageContent) {
		case "illustration": // NOT IN USE
			displayIllustration(selectedTagRef.illustration.imgPath);// toggle the center stage graphic to the selected product
			break;
		case "demo":
			activeFlashContentDivID = "fcontent_"+siteSections[activeSiteSectionIndex];
			displayDemo(selectedTagRef.demo.path, selectedTagRef.demo.swfName, selectedTagRef.demo.swfWidth, selectedTagRef.demo.swfHeight, activeFlashContentDivID);
			break;			
		case "mapview": 
			displayMapview(selectedTagRef.mapview.swfPath, selectedTagRef.mapview.swfName, selectedTagRef.mapview.swfWidth, selectedTagRef.mapview.swfHeight);
			break;
		default: 
			alert("unfamiliar productRef.defaultStageContent: "+selectedTagRef.defaultStageContent);
	}
	
	/*
	// reset all product icons to non-selected
	for (productIndex = 1; productIndex < myProducts.length; productIndex++) {
		productID = myProducts[productIndex].id;
		setBorderStyle("product"+productID, "solid", "#000000");
	}

	// highlight the relevant products for this tag
	for (productIndex = 1; productIndex < myProducts.length; productIndex++) {
		productRef = myProducts[productIndex];
		productID = myProducts[productIndex].id;
		if (numIsInString(selectedTagRef.productsList, productID)) {
			setOpacity("product"+productID, hiliteOpacity);
			productRef.highlighted = true;
		} else {
			setOpacity("product"+productID, dimOpacity);
			productRef.highlighted = false;
		}
		// de-selected any previously selected product icon
		productRef.selected = false;
	}
	return "ExternalInterface is a new Flash Player 8 API."
	*/
}

myConcepts = new Array();
myConcepts = [ ["abstraction","concepts_abstraction.swf",2], ["architecture","concepts_architecture.swf",7], ["contentStrategy","typer_contentStrategy_onWhite.swf",22], ["craftsmanship","concepts_craftsmanship-innovation.swf",25], ["cultural","concepts_cultural.swf",29], ["games","concepts_game.swf",48], ["innovation","concepts_craftsmanship-innovation.swf",61], ["learner","concepts_learner.swf",71], ["mentoring","concepts_mentoring.swf",75], ["model","concepts_model.swf",76], ["play","concepts_play.swf",87], ["theory","concepts_theory.swf",130], ["transference","concepts_transference.swf",135] ];
function selectConcept(conID){
	//alert("conID = "+conID);
	var swfName, so, cIndex, conRef, bgColor;
	if (conID == null){
		killConceptOverlay();
	}else{
		document.getElementById("shade").style.display = "block";
		document.getElementById("think_overlay").style.display = "block";
		
		//alert("myConcepts.length = "+myConcepts.length);
		for (cIndex=0; cIndex<myConcepts.length; cIndex++){
			conRef = myConcepts[cIndex];
			if (conRef[2] == conID){
				//alert("conRef[1] = "+conRef[1]);
				swfName = conRef[1];
				bgColor = "#ffffff";
				break;
			}else{
				bgColor = stageBGcolor;
			}
		}
			
		activeFlashContentDivID = "fcontent_think_overlay";
		displayFlashFile(swfName, "content", 596, 386, bgColor, activeFlashContentDivID);
		document.getElementById("ticker_think").style.visibility = "hidden";
	}/**/
}

function killConceptOverlay(){
	document.getElementById("shade").style.display = "none";
	document.getElementById("fcontent_think_overlay").innerHTML = "";
	document.getElementById("think_overlay").style.display = "none";
	document.getElementById("ticker_think").style.visibility = "visible";
}

myValues = new Array();
myValues = [ ["creativity",0,"",""], ["innovation",1,"",""], ["learning",2,"",""], ["values_fun",3,"",""], ["TAG_playPoetry.swf",4,"596","386"], ["ChangeCMinor.swf",5,"596","386"], ["craftsmanship",6,"",""], ["aesthetics",7,"",""], ["values_community_09.swf",8,"700","630"],  ["commitment",9,"",""] ];
//"386"
function selectValue(valIndex){
	var swfName, vIndex;
	
	activeValueIndex = valIndex;
	
	// set the color of the filter link in the left nav as selected, and the others to default
	setTagTextColor("val"+valIndex, tagHiliteColor); //setOpacity("tag" + tagNum, 100);
	for (vIndex = 0; vIndex < myValues.length; vIndex++) {
		if (valIndex != vIndex){
			if ( myValues[vIndex][0].indexOf(".") > -1 ){// valid link
				setTagTextColor("val"+vIndex, tagDefaultColor); //setOpacity("tag" + tagNum, 100);	
			}else{// coming soon...
				setTagTextColor("val"+vIndex, tagDimmedColor); //setOpacity("tag" + tagNum, 100);	
			}
		}
	}
	
	swfName = myValues[valIndex][0];
	activeFlashContentDivID = "fcontent_values";	
	displayFlashFile(swfName, "content", myValues[valIndex][2], myValues[valIndex][3], stageBGcolor, activeFlashContentDivID);
	
	document.getElementById("ticker_values").innerHTML = "";
	
	//displayFlashFile("typer_mktgMsg.swf", "mticker_values", 280, 40, stageBGcolor, "ticker_values");

}

aboutSubs = ["mission", "testimonials", "bios"];
function selectAbout(aboutIndex){
	var aboutContentPath;
	var aIndex;
	
	activeAboutIndex = aboutIndex;
	
	// set the color of the filter link in the left nav as selected, and the others to default
	setTagTextColor("about"+aboutIndex, tagHiliteColor); //setOpacity("tag" + tagNum, 100);
	for (aIndex = 0; aIndex < aboutSubs.length; aIndex++) {
		if (aboutIndex != aIndex){
			setTagTextColor("about"+aIndex, tagDefaultColor); //setOpacity("tag" + tagNum, 100);	
		}
	}	
	
	switch (aboutIndex) {
		case 0://mission/bus vision
			aboutContentPath = "About_mission.swf"
			break;
		case 1://testimonials
			aboutContentPath = "About_testimonials.swf"
			break;
		case 2://bios
			aboutContentPath = "About_bios.swf"
			break;
		default:
	}
	activeFlashContentDivID = "fcontent_about";
	displayFlashFile(aboutContentPath, "content", 700, 386, stageBGcolor, activeFlashContentDivID);
}

/*************************************************************************************************************/
function selectHome(){
	var sectIndex, myElement, so;
	// show the tag text
	//setTitle("appTitle", myTags[0].title);
	//setDescription("appDescription", myTags[0].content);
	//displayIllustration(myTags[0].illustration.imgPath);// toggle the center stage graphic to the selected product
	
	/*for (tagIndex = 1; tagIndex < myTags.length; tagIndex++) {
		tagRef = myTags[tagIndex];
		setTagTextColor("tag"+tagRef.id, tagHiliteColor); //setOpacity("tag" + tagNum, 50);
		setBorderStyle("tag"+tagRef.id, "solid", "#000000");
	}
	for (productIndex = 1; productIndex < myProducts.length; productIndex++) {
		productRef = myProducts[productIndex];
		if ( ! isExcluded(productRef.id, "product") ){			
			productID = productRef.id;
			setBorderStyle("product"+productID, "solid", "#000000");
			setOpacity("product"+productID, defaultOpacity);
			productRef.highlighted = false;
		}
	}*/
	
	for (sectIndex = 0; sectIndex < siteSections.length; sectIndex++) {
		myElement = document.getElementById(siteSections[sectIndex]);
		myElement.style.display = "none";
		//myElement.style.visibility = "hidden";
	}	
	
	document.getElementById('home').style.display = "block";
	
	displayFlashFile("typer_mktgMsg.swf", "marketingTicker", 280, 40, stageBGcolor, "ticker_home");
}

/*************************************************************************************************************/
function selectSiteSection(sectIndex){	
	//alert("selectSiteSection("+sectIndex+")");
	var sIndex, myElement;
	document.getElementById('home').style.display = "none";
	killConceptOverlay();
	clearResidualFlashContent(sectIndex);
			
	for (sIndex = 0; sIndex < siteSections.length; sIndex++) {
		myElement = document.getElementById(siteSections[sIndex]);		
		if (sIndex != sectIndex){			
			myElement.style.display = "none";
			//myElement.style.visibility = "hidden";
		}else{
			activeSiteSectionIndex = sIndex;
			myElement.style.display = "block";
			myElement.style.height = "100%";
			//myElement.style.visibility = "visible";
			switch (sIndex) {
				case 0://think
					document.getElementById("ticker_think").style.visibility = "visible";
					displayFlashFile("typer_mktgMsg.swf", "marketingTicker", 280, 40, stageBGcolor, "ticker_think");
					break;
				case 1: //create
					setup_create();
					break;
				case 2: //process
					//show the first tag as a test...
					selectTag(defaultTagID);// this is set in the tags objects array setup...
					break;
				case 3: //values
					selectValue(4);
					break;
				case 4:
					selectAbout(0);
					break;
				default: 
					// contact, doesn't really need special actions at the moment...
			}			
		}
	}	
}

function resetHomeContent(){
	clearResidualFlashContent("home");
	myElement = document.getElementById(siteSections[activeSiteSectionIndex]);
	//alert(myElement);
	myElement.style.display = "none";
	
	document.getElementById('home').style.display = "block";
}

function clearResidualFlashContent(sectIndex){
	if (activeSiteSectionIndex != undefined){
		if (activeSiteSectionIndex != sectIndex){
			if (document.getElementById(activeFlashContentDivID) != undefined){
				document.getElementById(activeFlashContentDivID).innerHTML = "";
			}
		}
	}
}

/*************************************************************************************************************/
function isExcluded( targetID, itemType ){	
	var eIndex, useSourceArray, myElement;
	if (itemType == "tag"){
		useSourceArray = myTags;
	}else{
		useSourceArray = myProducts;
	}
	
	
	for (eIndex = 0; eIndex < useSourceArray.length; eIndex++) {
		if (useSourceArray[eIndex].id == targetID){
			myElement = document.getElementById(itemType+eIndex);
			if (myElement == null){
				return true;
			}
		}

		/*if ( useSourceArray[eIndex] == targetID ){
			//alert( excludedTagIDs[eIndex]+ " = " +targetTagID);
			return true;
		}*/
	}
	return false;
}

/*************************************************************************************************************/
function getProductRefByID(pID){
	var prodRef, pIndex;
	for (pIndex = 0; pIndex < myProducts.length; pIndex++) {
		prodRef = myProducts[pIndex];
		if (prodRef.id == pID){
			return prodRef;
		}
	}
}
function getTagRefByID(tID){
	var tagRef, tagIndex;
	for (tagIndex = 0; tagIndex < myTags.length; tagIndex++) {
		tagRef = myTags[tagIndex];
		if (tagRef.id == tID){
			return tagRef;
		}
	}
}
function getTagIDByAddressKey(aKey){
	var tagRef, tagIndex;
	for (tagIndex = 1; tagIndex < myTags.length; tagIndex++) {
		tagRef = myTags[tagIndex];
		//if (tagRef.addressKey == "") return defaultTagID;
		if (aKey.indexOf(tagRef.addressKey) > -1){
			return tagRef.id;
		}
	}
}
/*************************************************************************************************************/

/* This function sets the opacity of the given productNum icon to the given opacityPercent.
 * Each product has its own style id, allowing us to change the opacity setting of that style.
 */ 
function setOpacity(elementID, opacityPercent) {
	var myElement = document.getElementById(elementID);
	//alert("setOpacity("+elementID+", "+opacityPercent+")");
	
	myElement.style.opacity = opacityPercent / 100;
	myElement.style.filter = "alpha(opacity=" + opacityPercent + ")";
}

function setTagTextColor(elementID, textColor) {
	//alert('elementID = '+elementID);
	var myElement = document.getElementById(elementID);
	//alert("setOpacity("+elementID+", "+opacityPercent+")");
	
	myElement.style.color = textColor;
}

function setBorderStyle(elementID, borderStyle, borderColor, borderWidth) {
	var myElement = document.getElementById(elementID);
	//alert("setBorderStyle("+elementID+", "+borderStyle+", "+borderColor+")");
	
	myElement.style.borderStyle = borderStyle;
	myElement.style.borderColor = borderColor;
	if (borderWidth != null){
		myElement.style.borderWidth = borderWidth;
	}
}
/*************************************************************************************************************/
function setTitle(elementID, title) {
	var myElement = document.getElementById(elementID);
	
	myElement.innerHTML = title.toUpperCase();
}

function setDescription(elementID, content) {
	var myElement = document.getElementById(elementID);
	
	myElement.innerHTML = content;
}

/* NOT CURRENTLY IN USE
function setAppLinks(objectRef, objectRefType) {
	var myElement = document.getElementById("appLinks");
	var cIndex, component; 
	
	myElement.innerHTML = "";
	for (cIndex = 0; cIndex < productComponents.length; cIndex++){
		component = productComponents[cIndex];
		//alert('objectRef['+component+'] = '+objectRef[component]+'\nobjectRef.curStageContent: '+objectRef.curStageContent+' == '+component+'? ...'+ (objectRef.curStageContent == component) );

		//alert('objectRefType = '+objectRefType);
		if ( (objectRef[component] != "") && (objectRef.curStageContent != component) ){
			myElement.innerHTML += 'See <a href="#" onclick="swapStageContent('+objectRef.id+',\''+objectRefType+'\',\''+component+'\');">'+component+'</a><br />';
		}
	}
	//myElement.innerHTML = content;
}

function swapStageContent(objectRefID, objectRefType, selectedStageContent){	
	var selectedObjectRef;
	
	//alert('objectRefType = '+objectRefType+', selectedStageContent = '+selectedStageContent);
	if (objectRefType == "product"){
		selectedObjectRef = getProductRefByID(objectRefID);
	}else{
		selectedObjectRef = getTagRefByID(objectRefID);
	}
	//alert('selectedObjectRef = '+selectedObjectRef);
	//alert('selectedObjectRef.id = '+selectedObjectRef.id);
	switch (selectedStageContent) {
		case "illustration": 
			displayIllustration(selectedObjectRef.illustration.imgPath);// toggle the center stage graphic to the selected product
			break;
		case "demo": 
			displayDemo(selectedObjectRef.demo.swfPath, selectedObjectRef.demo.swfName, selectedObjectRef.demo.swfWidth, selectedObjectRef.demo.swfHeight);
			break;			
		case "mapview": 
			displayMapview(selectedObjectRef.mapview.swfPath, selectedObjectRef.mapview.swfName, selectedObjectRef.mapview.swfWidth, selectedObjectRef.mapview.swfHeight);
			break;
		case "caseStudy": 
			displayCaseStudy(selectedObjectRef.caseStudy.content);
			break;
		default: 
			alert("unfamiliar selectedStageContent: "+selectedStageContent);
	}
	
	selectedObjectRef.curStageContent = selectedStageContent;
	setAppLinks(selectedObjectRef, objectRefType);
} */

/*************************************************************************************************************/
function displayIllustration(illoPath, elementID){
	elementID.innerHTML = "<img src='"+illoPath+"'>";
}

function displayDemo(swfPath, swfName, swfWidth, swfHeight, divID){
	displayFlashFile(swfPath, swfName, swfWidth, swfHeight, stageBGcolor, divID);	
}

function displayMapview(swfPath, swfName, swfWidth, swfHeight){
	activeFlashContentDivID = "fcontent_"+siteSections[activeSiteSectionIndex];
	displayFlashFile(swfPath, swfName, swfWidth, swfHeight, stageBGcolor, activeFlashContentDivID);
}

function displayFlashFile(swfPath, swfName, swfWidth, swfHeight, bgColor, divID){
	//alert("activeSiteSectionIndex = "+activeSiteSectionIndex);
	//restoreDefaultStageConfig();
	
	// var so = new SWFObject(swf, id, width, height, version, background-color [, quality, xiRedirectUrl, redirectUrl, detectKey]);	
	var so = new SWFObject(swfPath, swfName, swfWidth, swfHeight, 8, bgColor);
	so.addParam("swliveconnect", "true"); 
	if (swfPath.indexOf("values_community") > -1){
		// get the string location
		var url_string = String(document.location);
		// seperate the url and the GET data
		var url_array = url_string.split('?');
		// get the url
		page_url = url_array[0];
		// create the GET object for storing the data
		GET = Object();
		// init the values
		GET.gallery_id = "";
		GET.image_id = "";
		so.addParam("FlashVars", "_IW_PAGE_TITLE_=Welcome to Jersey Cow Software&_IW_HTML_FILE_="+page_url+"&_IW_GALLERY_ID_="+GET.gallery_id+"&_IW_IMAGE_ID_="+GET.image_id);	
	}
	so.addParam("scale", "showall");	
	
	so.write(divID);	
	
	//MM_swapImage('illustration','',blankSlateStageGraphic,1);	
}
function displayFlashFile_IW(swfPath, swfName, swfWidth, swfHeight, bgColor, divID){
	write_imageWeaver_flash_obj();
}

function displayCaseStudy(content){
	//alert("content = "+content);	
	document.getElementById("fcontent_create").innerHTML = "<iframe src="+content+" width=596 height=420 />";
}

function restoreDefaultStageConfig(){
	document.getElementById("stagecontent").innerHTML = "<img src=\""+blankSlateStageGraphic+"\" alt=\"Demo Graphic\" id=\"illustration\" /><div id=\"flashcontent\"></div>";
}
/*************************************************************************************************************/
function numIsInString(myString, myNum) {
	var index;
	var myStrArray = myString.split(",");
	//alert("numIsInString('"+myString+"', "+myNum+")");
	
	for (index = 0; index < myStrArray.length; index++) {
		if (myStrArray[index] == myNum) {
			return true;
		}
	}
	return false;
}
/*************************************************************************************************************/
function mouseoverProduct(productID) {
	if (! productInFilterSet(productID)) return;
							 
	if (!myProducts[productID].selected) {
		setOpacity("product"+productID, hiliteOpacity);
	}
}

function mouseoutProduct(productID) {
	if (! productInFilterSet(productID)) return;
	
	if (myProducts[productID].highlighted) {
		setOpacity("product"+productID, hiliteOpacity);
	} else {
		setOpacity("product"+productID, defaultOpacity);
	}
}
/*************************************************************************************************************/
function mouseoverTag(tagID) {
	if (!myTags[tagID].selected) {
		setTagTextColor("tag"+tagID, tagOverColor);
	}
}

function mouseoutTag(tagID) {
	if (!myTags[tagID].selected) {
		setTagTextColor("tag"+tagID, tagDefaultColor);
	}
}
/*************************************************************************************************************/
function mouseoverProductFilter(pfIndex) {
	if (pfIndex != activeProdFilterIndex) {
		setTagTextColor("prodFilter"+pfIndex, tagOverColor);
	}
}

function mouseoutProductFilter(pfIndex) {
	if (pfIndex != activeProdFilterIndex) {
		setTagTextColor("prodFilter"+pfIndex, tagDefaultColor);
	}
}
/*************************************************************************************************************/
function mouseoverValue(valIndex) {
	if (activeValueIndex != valIndex) {
		setTagTextColor("val"+valIndex, tagOverColor);
	}
}

function mouseoutValue(valIndex) {
	if (activeValueIndex != valIndex) {
		setTagTextColor("val"+valIndex, tagDefaultColor);
	}
}
/*************************************************************************************************************/
function mouseoverAbout(aboutIndex) {
	if (activeAboutIndex != aboutIndex) {
		setTagTextColor("about"+aboutIndex, tagOverColor);
	}
}

function mouseoutAbout(aboutIndex) {
	if (activeAboutIndex != aboutIndex) {
		setTagTextColor("about"+aboutIndex, tagDefaultColor);
	}
}
/*************************************************************************************************************/
function getTagKeyByID(tagID){
	var useAddress = "/process/";
	tagID = Number(tagID);
	return getTagRefByID(tagID).addressKey;
}

//this function called from flash's ExternalInterface.call method
function processSelectTag(tagID){ 
	var newAddress = "/process/"+getTagKeyByID(tagID);
	$.address.value(newAddress);
}


function mticker_create__loaded(){
	var so, freezeTickerIndex
	//alert("mticker_create__loaded");
	
	switch (activeProdFilterIndex) {
		case 0: //games
			freezeTickerIndex = 4;
			break;
		case 1: //systems
			freezeTickerIndex = 1;
			break;			
		case 2: //communities
			freezeTickerIndex = 1;
			break;
		case 3: //partnerships
			freezeTickerIndex = 0;
			break;
		case 4: //tools
			freezeTickerIndex = 3;
			break;
		default: 
			//alert("unfamiliar activeProdFilterIndex: "+activeProdFilterIndex);
	}
	
	so_obj = document.getElementById("mticker_create");
	if (so_obj && typeof so_obj.SetVariable != "undefined") {
		so_obj.SetVariable("freezeText", freezeTickerIndex);//Math.floor(Math.random()*5));
	}
}

/*************************************************************************************************************/