// This script is copyright (c) 2007 IdeaShops.com
// Use of this script without written permission is forbidden

// Auto Window Sizing Margins IE 7 and NN

var WindowHeight = 1210;
var WindowEnd = null;
var TopDistance = 10;


function windowSize(iY,id)
{

var vY = WindowHeight;

var nn=(navigator.appName.indexOf("Netscape")!=-1);
var dD=document,dH=dD.html,dB=dD.body,px=dD.layers?'':'px';

	var L=dD.getElementById?dD.getElementById(id):dD.all?dD.all[id]:dD.layers[id];
	this[id+'O']=L;
	if(dD.layers)
		L.style=L;
	L.nY=L.iY=iY;
	L.P=function(x,y)
	{
		this.style.top=y+px;
	};
	L.Fm=function()
		{
			var pX, pY;
				pY=nn ? pageYOffset : document.documentElement && document.documentElement.clientHeight ? document.documentElement.scrollTop  : document.body.scrollTop;
				if(this.iY<0) {
					pY+=nn?innerHeight:nn&&dH.clientHeight?dH.clientHeight:dB.clientHeight;
				}
				this.nY+=.1*(pY+this.iY-this.nY);

				if (this.nY < WindowHeight)
						this.nY = WindowHeight;
				if (WindowEnd != null && this.nY > WindowEnd)
						this.nY = WindowEnd;
				this.P(this.nX,this.nY);
				setTimeout(this.id+'O.Fm()',20);
		};
	return L;
}
