preloaded = new Array();

function preload(img,filename) { preloaded[img] = new Image();
	preloaded[img].src = filename;
}
if (document.images) {
	preload("fiska","/i/bull-root-items.gif");
	preload("empty","/i/d-t.gif");
}
function rollOverImg(imgName, over){
	window.document.images[imgName].src = (over ? "/i/bull-root-items.gif" : "/i/d-t.gif");
}

function nw(oFile,wWidth,wHeight,wScroll)
{
	var cWidth=window.screen.width;
	var cHeight=window.screen.height;
	if(wScroll==undefined) wScroll=0;

	var rnd=Math.round(Math.random()*1000000);

	var leftOffset=0;
	var topOffset=0;

	if(cHeight && cWidth)
	{
		leftOffset=Math.ceil((cWidth-wWidth)/2);
		topOffset=Math.ceil((cHeight-wHeight)/2);
	}
	
	var a=window.open(oFile, "nw"+String(rnd), 'width='+wWidth+',height='+wHeight+',top='+topOffset+',left=' + leftOffset + ',scrollbars=' + wScroll);
	a.focus();
	
	return false;
}

function switchDiv(divName, checked) {
	divToSwitch = document.getElementById(divName);
	checked ? divToSwitch.style.display = 'block' : divToSwitch.style.display = 'none';
}
