/*
' -------------------------------------------------------------
'' eSRO Basket Site
'' Version 3.2.0
'' May 15, 2005
'' Powered by: TopTix LTD.
'' -------------------------------------------------------------
'' flow_scaling.js - script that handles the resizing of the
'' screenparts when browser window is resized
'' -------------------------------------------------------------
*/
var scrns=new Array();

function clsDiv(_obj,_width,_height)
{
	this.obj=_obj;
	this.width=_width;
	this.height=_height;
}
function onResize()
{
	doResize();
}
function doResize()
{
	resize(document.body.clientWidth/refWidth,document.body.clientHeight/refHeight);
}
function resize(horFactor,vertFactor)
{
	//alert('resize');
	horFactor=parseFloat(horFactor);
	horFactor=(isNaN(horFactor)?1:horFactor);
	vertFactor=parseFloat(vertFactor);
	vertFactor=(isNaN(vertFactor)?1:vertFactor);
	
	if (horFactor>maxGrowHorizontal)
		horFactor=maxGrowHorizontal;
	if (horFactor<minShrinkHorizontal)
		horFactor=minShrinkHorizontal;
	if (vertFactor>maxGrowVertical)
		vertFactor=maxGrowVertical;
	if (vertFactor<minShrinkVertical)
		vertFactor=minShrinkVertical;
	
	if 	(fLockAspectRatio) 
		vertFactor=(horFactor=(vertFactor<horFactor?vertFactor:horFactor))
		
	for (var i=0;i<scrns.length;i++)
	{
		scrns[i].obj.style.width=parseFloat(scrns[i].width)*horFactor;
		scrns[i].obj.style.height=parseFloat(scrns[i].height)*vertFactor;
	}
}

function onLoad()
{
	getScreens();
	doResize();
}
function getScreens()
{
	var divs=document.getElementsByTagName("div");
	for (var i=0;i<divs.length;i++)
		if(divs[i].getAttribute('mark0')!=null)
			scrns[scrns.length]=(new clsDiv(divs[i],divs[i].style.width,divs[i].style.height));
}

if (window.navigator.appName.toLowerCase().indexOf("netscape")>-1)
{
	window.addEventListener('load',onLoad,false);
	window.addEventListener('resize',onResize,true);
}else{
	window.attachEvent('onresize',onResize);
	window.attachEvent('onload',onLoad);
}

