var CURRENT_PAGE;
var CURRENT_SIZE = 100;
var PAGES = new Array(
	{div:"home"},
	{div:"about-us"},
	{div:"products"},
	{div:"earth-to-earth"},
	{div:"locate-a-retailer"},
	{div:"faq"},
	{div:"news-and-events"},
	{div:"contact-us"});

function Init()
{
	HideAll();
	CURRENT_PAGE = 0;
	var dim = $('home').getDimensions();
	$('content').style.height = dim.height + "px";
	$('content').style.visibility = "visible";
	$('home').show();
}

function SetPage(n)
{
	SetFlash(n);
	ShowCopy(n);
}

function SetFlash(n)
{
	var flash = GetSWF('ultragreenSWF');
	flash.SetScene(n);
}

function ShowCopy(n)
{
	if(CURRENT_PAGE != n)
	{
		CURRENT_PAGE = n;
		HideAll();
		$(PAGES[n].div).show();
		var dim = $(PAGES[n].div).getDimensions();
		var height = dim.height;
		if(height < 200) { height = 200; }
		$('content').style.height = height + "px";
	}
}

function HideAll()
{
	for(var i = 0; i < PAGES.length; ++i)
	{
		$(PAGES[i].div).hide();
	}
}

function GetSWF(id)
{
	var swf;

	if(navigator.appName.indexOf("Microsoft") != -1)
	{
		swf = window[id];
	}
	else
	{
		swf = document[id];
	}
	return swf;
}

