/*	
	Copyright 2006 Framfab A/S
*/

var minContentWidth		= 1000;
var minContentHeight	= 0;
var flashMovie;


function FramfabControl(){} // Used as namespace

FramfabControl.onResize = function()
{
	FramfabControl.setupScroll( "swfDIV" )
}

FramfabControl.setStageHeight = function( height )
{
	minContentHeight = height;
	FramfabControl.setupScroll( "swfDIV" )
	FramfabControl.onScroll();
}

FramfabControl.onLoad = function()
{
	FramfabControl.setupScroll( "swfDIV" );
}

FramfabControl.setupScroll = function( swfDIV )
{
	if ( document.getElementById( swfDIV ) != null )
	{
		// http://www.howtocreate.co.uk/tutorials/javascript/browserwindow
		var myWidth = 0, myHeight = 0;
		if( typeof( window.innerWidth ) == 'number' )
		{
			//Non-IE
			myWidth = window.innerWidth;
			myHeight = window.innerHeight;
		}
		else if(document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight))
		{
			//IE 6+ in 'standards compliant mode'
			myWidth = document.documentElement.clientWidth;
			myHeight = document.documentElement.clientHeight;
		}
		else if(document.body && (document.body.clientWidth || document.body.clientHeight))
		{
			//IE 4 compatible
			myWidth = document.body.clientWidth;
			myHeight = document.body.clientHeight;
		}
		
		document.getElementById( swfDIV ).style.width = ( myWidth <= minContentWidth ) ? (minContentWidth + "px") : "100%";
		document.getElementById( swfDIV ).style.height = ( myHeight <= minContentHeight ) ? (minContentHeight + "px") : "100%";
	}
}

FramfabControl.getScrollPosition = function()
{
	var returnValue = "";
	
	if ( document.all && !window.opera )
	{
		returnValue = document.documentElement.scrollTop+document.body.scrollTop;
	}
	else
	{
		returnValue = document.documentElement.scrollTop;
	}

	return returnValue;
}

FramfabControl.setScroll = function( scrollValue )
{
	//alert("FramfabControl.setScroll: "+scrollValue);
	window.scrollTo( 0, scrollValue );
}
