// preload many images for flicker-free rollovers
function preloadImages() { 
  var d=document; if(d.images){ if(!d.arr) d.arr=new Array();
	var i,j=d.arr.length,a=preloadImages.arguments; for(i=0; i<a.length; i++)
	if (a[i].indexOf("#")!=0){ d.arr[j]=new Image; d.arr[j++].src=a[i];}}
}

// load image for rollovers
function loadImg(theImg,theSrc) {
if (document.images) document.images[theImg].src = theSrc;
}

// open new window
function openWin(url,winName,opts) {
	
	// changed width=600,height=400, because safari showed white borders
	if(!opts) opts = "width=598,height=399,toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollBars=0,resizable=1";
	else opts += ",toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollBars=0,resizable=1";

	// if screensize bigger than 1024x768 than adjust left and top position
	if (screen.width > 800) { wleft = 50;	} else { wleft = 20 }
	if (screen.height > 600) { wtop = 50;	} else { wtop = 20 }
	opts = "left="+wleft+",top="+wtop+","+opts;

	if(!winName) winName = "blank";
	win = window.open(url,winName,opts);
	win.focus();
}