/*
Embeds the image blender animation panel.

	@[page:String]			name of the page, as defined at 'flash/image_blenders/{page}' (optional, default:'home')
*/

function embedImageBlender(page)
	{
		var flashvars = {standalone:"false"};
		var params = {bgcolor:"#ffffff", menu:"false", quality:"best", wmode:"transparent"};
		var attributes = {};
		var contentPath;
		
		// if no page is defined, default to the home page images
		if (page)
		{
			contentPath = "flash/image_blenders/" + page + "/image_blender_base.swf";
			flashvars.page = page;
		}
		else
		{
			contentPath = "flash/image_blenders/" + "home" + "/image_blender_base.swf";
			flashvars.page = "home";
		}	

		swfobject.embedSWF(
			contentPath,
			"imageBlender",
			"926",
			"180",
			"8.0.24.0",
			"flash/expressInstall.swf",
			flashvars,
			params,
			attributes
		);
	}

/*
Embeds the main flash navigation.
*/

function embedFlash_navigation(pageNum)
	{
		var flashvars = {dataLocation:FLASH_NAV_DATA_LOCATION, pageNum:pageNum};
		var params = {bgcolor:"#f2f2db", menu:"false", quality:"best"};
		var attributes = {};

		swfobject.embedSWF(
			"flash/navigation.swf",
			"flashNav",
			"740",
			"85",
			"8.0.0",
			"flash/expressInstall.swf",
			flashvars,
			params,
			attributes
		);
	}

/*
Embeds the fisherman animation.
*/

function embedFlash_fisherman(box1, box2, box3)
	{
		var flashvars = {
			box1:box1,
			box2:box2,
			box3:box3
		};
		
		//~
		// we must use default scale otherwise things go very weird when the page is zoomed
		// the problem now is that the correct height (translated in flash) is not found
		// we need the zoom ratio of the web page in flash so that we can convert the internal measurements
		// FF works because it is scaling the text and not zooming the page
		
		// salign does not work so set this in Flash: stage.align = StageAlign.TOP
		
		var params = {
			wmode:"transparent",
			menu:"false", 
			quality:"best", 
			//base:"flash", 
			salign:"T", 
			scale:"default"
		};

		var attributes = {};

		// embed at the initial height; this will get increased by css
		swfobject.embedSWF(
			"flash/fisherman.swf",
			"fisherman",
			"200",
			"800",
			"9.0.0.0",
			"flash/expressInstall.swf",
			flashvars,
			params,
			attributes
		);
	}
	
/*
Embeds the contact form.
If the 'interest' value is set in the url query, send it on to flash.
*/

function embedFlash_contactForm()
	{
		var oQueryData = getQueryData();
		var flashvars = {};
		var params = {bgcolor:"#ffffff", menu:"false", quality:"best"};
		var attributes = {};

		if (oQueryData.interest != undefined)
		{
			flashvars.interest = oQueryData.interest;
		}

		swfobject.embedSWF(
			"flash/contact_form.swf",
			"flashContactForm",
			"694",
			"930",
			"8.0.0.0",
			"flash/expressInstall.swf",
			flashvars,
			params,
			attributes
		);
	}

/*
Embeds the wastesafe acronym text.
*/

function embedWastesafeText()
	{
		var flashvars = {};
		var params = {bgcolor:"#ffffff", menu:"false", quality:"best"};
		var attributes = {};
		
		swfobject.embedSWF(
			"flash/wastesafe_text.swf",
			"wastesafeText",
			"686",
			"40",
			"8.0.24.0",
			"flash/expressInstall.swf",
			flashvars,
			params,
			attributes
		);
	}
	
/*
Returns the Flash movie object depending upon whether the browser is IE or not.

	@movieName:String				id/name of the Flash movie
*/

function getFlashMovieObject(movieName)
	{
		if (window.document[movieName]) return window.document[movieName];

		if (navigator.appName.indexOf("Microsoft Internet")==-1)
		{
			if (document.embeds && document.embeds[movieName]) return document.embeds[movieName];
			else return document.getElementById(movieName);
		}
	}

