function popupOpen() {		// parameter.reihenfolge: URL, WIDTH, HEIGHT
	var w,h,url,aw,ah;
	var a=popupOpen.arguments;
	if (a.length==0) return;
	url=a[0];
	if (a.length>1) {
		w=a[1]; h=a[2];
	}
	else {
		w=500; h=400
	}
	win=window.open(url,'win_front','toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width='+w+',height='+h);
	if (screen) {
		aw=screen.availWidth;
		ah=screen.availHeight;
		win.moveTo(((aw/2)-(w/2)),((ah/2)-(h/2)));
	}
	win.focus();
}

function popupopen() {		// parameter.reihenfolge: URL, WIDTH, HEIGHT
	var w,h,url,aw,ah;
	var a=popupopen.arguments;
	if (a.length==0) return;
	url=a[0];
	if (a.length>1) {
		w=a[1]; h=a[2];
	}
	else {
		w=500; h=400
	}
	win=window.open(url,'win_front','toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width='+w+',height='+h);
	if (screen) {
		aw=screen.availWidth;
		ah=screen.availHeight;
		win.moveTo(((aw/2)-(w/2)),((ah/2)-(h/2)));
	}
	win.focus();
}

function changeGalleryPic(l,g,url) {
	if (typeof old_g_link == "undefined") old_g_link="g_"+g+"_0";
	if (old_g_link==l.id) return true;
	document.getElementById(old_g_link).className="gal";
	l.className="gal_sel";
	old_g_link=l.id;	
	document.getElementById("gallery_"+g).src=url;
}

function openPicture() {		// parameter.reihenfolge: URL, WIDTH, HEIGHT
	var w,h,url,aw,ah;
	var a=openPicture.arguments;
	if (a.length==0) return;
	url=a[0];
	if (a.length>1) {
		w=a[1]; h=a[2];
	}
	else {
		w=500; h=400
	}
	win_pic=window.open(url,'win_pic','toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width='+w+',height='+h);
	if (screen) {
		aw=screen.availWidth;
		ah=screen.availHeight;
		win_pic.moveTo(((aw/2)-(w/2)),((ah/2)-(h/2)));
	}
	win_pic.focus();
}

function game(game, width, height, url, ID) {
	var platform;
	var browser;
	var version;
	
	version = parseInt(navigator.appVersion);
	if(navigator.userAgent.indexOf('Win') >= 0) {
	  platform = 'W';
	} else {
	  platform = 'M';
	}

	if(navigator.appName.indexOf('Netscape') >= 0) {
	  browser = 'N';
	} else {
	  browser = 'I';
	}

	if (browser == 'I' && platform=='W') {
		add_w = 10;
		add_h = 28;
	} else {
		add_w = 0;
		add_h = 0;
	}
	
	if (window.screen) {
		aw = screen.availWidth;
		ah = screen.availHeight;
	}
	url = url +"?base_height="+height+"&base_width="+width+"&win_width="+(width+add_w)+"&win_height="+(height+add_h)+"&ID="+ID+"&game="+game;
	features = "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width="+width+",height="+height;
	win=window.open( url,'win',features); 
}