function screenshot (name)
{
	MW=window.open (name, "NW1", "width=1100,height=700,resizable=no,left=10,top=10,toolbar=no,status=no,menubar=no,location=no,dependent=yes");
	MW.focus();
}

function popup (name, height)
{
	MW=window.open ("/trivia_popup.php?file="+name, "NW1", "width=400,height="+height+",resizable=no,left=400,top=10,scrollbars=1,toolbar=no,status=no,menubar=no,location=no,dependent=yes");
	MW.focus();
}




function preloadImage (name, width, height)
{
  this.on = new Image (width, height);
  this.on.src = name + "_on.gif"
  this.off = new Image (width, height);
  this.off.src = name + "_off.gif"
}

function new_image (name, width, height)
{
 preloadImage [name] = new preloadImage (name, width, height);
}

function activate(name) {

	if (document.images) {
		var src = document [name].src;
		var off = src.lastIndexOf("off");
		if (off != -1) {
			var newsrc = src.substring(0,off) + "on";
			document [name].src = newsrc + ".gif";
		}
	}
}

function deactivate(name) {
	if (document.images) {
		var src = document [name].src;
		var on = src.lastIndexOf("on");
		if (on != -1) {
			var newsrc = src.substring(0,on) + "off";
			document [name].src = newsrc + ".gif";
		}
	}
}

function deactivatesubmenu(smname, name) {
	document.getElementById(smname).style.display="none";
	if (document.images) {
		var src = document [name].src;
		var on = src.lastIndexOf("on");
		if (on != -1) {
			var newsrc = src.substring(0,on) + "off";
			document [name].src = newsrc + ".gif";
		}
	}
}

function activatesubmenu(smname, name) {

	document.getElementById(smname).style.display="inline";
	document.getElementById(smname).style.height="45";

	if (document.images) {
		var src = document [name].src;
		var off = src.lastIndexOf("off");
		if (off != -1) {
			var newsrc = src.substring(0,off) + "on";
			document [name].src = newsrc + ".gif";
		}
	}
}

function sleep(ms){
	var zeit=(new Date()).getTime();
	var stoppZeit=zeit+ms;
	while((new Date()).getTime()<stoppZeit){};
} 