function checs(e)
{
	if(d.all){sy=d.body.scrollTop}else{sy=pageYOffset}
	if(opera){sy=pageYOffset}
	for(a=1;a<menus;a++)
	{
		menu=eval("menu"+a);
		if(menu[9]>0)
		{
			if (df!=0||osy!=sy)
			{				
				mi=gmstyle("menu"+a);
				mit=parseInt(mi.top);
				if(isNaN(menu[0]))menu[0]=0;
				df=parseInt(menu[0])+sy-mit;
				nt=df/followspeed;
				of1=nt.toString();
				ofr=of1.split("\.");
				if(ofr[1]+" "=="undefined ")ofr[1]=0;
				ofrac=ofrac+parseInt(ofr[1]);
				if(ofrac>10)
				{
					ofrac=ofrac-10;
					if(df>=0){nt++}else{nt--}
				}
				mi.top=mit+nt
			}
			osy=sy
		}
	}
	pu=setTimeout('checs()',followrate)
}

function setpos()
{	
	if(d.all){ww=d.body.clientWidth;wh=d.body.clientHeight;}else{ww=window.innerWidth;wh=window.innerHeight;}
	if(opera){ww=window.innerWidth;wh=window.innerHeight;}
	for (a=1;a<menus;a++)
	{
		menu=eval("menu"+a);
		if(!menu[4])menu[4]="";
		if (menu[4].indexOf("center")!=-1||menu[4].indexOf("right")!=-1)
		{
			mn=gmobj("menu"+a);
			mnw=ns6?parseInt(mn.style.width):d.all?mn.style.pixelWidth:mn.clip.width;
			if(opera)mnw=mn.style.pixelWidth;
			nlp=((ww-mnw)/2);
			if(menu[4].indexOf("right")!=-1)nlp=ww-mnw;
			if(ns4){mn.left=nlp}else{mn.style.left=nlp}
		}
		if (menu[4].indexOf("bottom")!=-1||menu[4].indexOf("middle")!=-1)
		{
			mn=gmobj("menu"+a);
			mnh=ns6?parseInt(mn.offsetHeight):d.all?mn.style.pixelHeight:mn.clip.height;
			nlp=wh-mnh-16;
			if(ns4)mnoh=mnh;else mnoh=mn.offsetHeight			
			if(opera)mnoh=mn.style.pixelHeight;
			if(menu[4].indexOf("middle")!=-1)nlp=((wh-mnh)/2)-mnoh/2
			menu[0]=nlp;
			if(ns4){mn.top=nlp}else{mn.style.top=nlp}
		}		
	}
}
el=0
osy=-1
df=-1
for(x=1;x<menus;x++){menu=eval("menu"+x);if(menu[6]==1)popup(x)}
if(!ns4){for(a=1;a<menus;a++){fixb("menu"+a);sub=1;while(eval("window.sub"+a+"_"+sub)){fixb("sub"+a+"_"+sub);sub++}}}
pu=setTimeout('checs()',followrate)
sis();
setpos()
if(ns4)
{
	window.onresize = function (){
	    if (window.innerWidth == ww && window.innerHeight == wh) return;
		window.history.go(0);
		//window.reload()
	}
}
else{window.onresize=setpos;}
sy=1;
checs();
function coc(){closeallmenus()}
if(ns4)d.onmousedown=coc;else d.onclick=coc

	