// Javascript Fix for Activation of Flash (in Explorer)
//
// (c) 2007 Cupcake Kawaii. All rights reserved.
//
//------------------------------------------------------
//
// Role: Insert dynamically an embed tag containing the flash object.
// Functions: InsertFlashObject	--	Dynamic insertion
//	      Do		--	Simplified call
//
// Global Vars: FlashParameters 	(array) 	contains the attributes names for the embed tag
//		FlashParametersValues 	(array)		contains the value for the attribute of the same index in FlashParameters
// Important: The source swf file name is contained in FlashParametersValues[0] and need to be initialized prior to using InsertFlashObject.
//
// ------------------------------------------------------


FlashParameters = new Array();
FlashParametersValues = new Array();

FlashParameters[0] = "src";		FlashParametersValues[0] = "websiteintro1.swf";
FlashParameters[1] = "quality";		FlashParametersValues[1] = "high";
FlashParameters[2] = "wmode";		FlashParametersValues[2] = "transparent";
FlashParameters[3] = "bgcolor";		FlashParametersValues[3] = "#FFCCFF";
FlashParameters[4] = "width";		FlashParametersValues[4] = '100%';
FlashParameters[5] = "height";		FlashParametersValues[5] = '100%';
FlashParameters[6] = "type";		FlashParametersValues[6] = "application/x-shockwave-flash";
FlashParameters[7] = "PLUGINPAGE";	FlashParametersValues[7] = "http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash";


function InsertFlashObject(container_id, parametersArray, paramValues)

// Insert an embed tag with proper attributes.
// Input: container_id (string) - Id of the div in which the flash object is inserted.
//	  parametersArray (array of strings) - Usually FlashParameters, contains the attribute tags
//	  paramValues (array of strings) - Usually FlashParametersValues, contains the values for the attributes of corresonding index.
// Ouput: none.
// Event: (usually) onLoad.


{
 y = document.createElement("embed");

 for(i=0;i<parametersArray.length; ++i)
  {
   y.setAttribute(parametersArray[i], paramValues[i]);
  } 
 
 container = document.getElementById(container_id);
 for(tbr = container.firstChild; tbr; tbr = container.firstChild) container.removeChild(tbr);
 container.appendChild(y);
}

function Do(filename)

// Call InsertFlashObject after proper initialization
// Input: filename (string) -- the name of the swf file
// Output: none.
// Event: onLoad

{
 FlashParametersValues[0] = filename;
 InsertFlashObject('flashobj', FlashParameters, FlashParametersValues);
} 

