﻿var stageHeight;
var fDivId = "flasharea";

function moveScrollbar(hh)
{
	var rectHeight = getViewportArea().h;
	var sy = hh - (rectHeight / 2);
	
	var areaHeight = stageHeight - rectHeight;
	if(sy > areaHeight) sy = areaHeight;
	frameScroll(0, sy, 0.1);
}

function initFlashArea(hh)
{
	setStageHeight(hh);
	stageHeight = hh;
}

function openWindow(url, target, toTop)
{
	window.open(url, target);
	var w = window.open( url, target );
	if(toTop == true)
	{
		w.focus();
	}
}

function setStageHeight(toH, toY)
{
	if(FIREFOX)
	{
		document.getElementById(fDivId).style.height = toH + "px";
	}
	else
	{
		eval(fDivId).style.height = toH + "px";
	}

	if(toY)
	{
		window.scroll(0, toY);
	}
	else
	{
		window.scroll(0, 0);
	}
}
