function showMenu(id) {
	for(i=1; i<=7; i++) {
		var obj = document.getElementById("subnav_" + i);
		if (obj != null) obj.style.display = 'none';
	}
	var obj = document.getElementById("subnav_" + id);
	obj.style.display = '';
}

function loadFrames() {
	if(self.location.search.length > 0) {
		var query = location.search;
		var qfind = '?mfID=';
		if (query.indexOf(qfind) != -1) {
			var url = query.substr(qfind.length, query.length);
			self.frames['main'].location.replace(url);
		}
	}
}

function checkFrames(){
	var refreshpage = (location.search.indexOf("norefresh=1") != -1);
	var self = document.URL;
	self = self.substring(self.lastIndexOf('/') + 1, self.length);
	if (top.frames.length < 2 && !refreshpage) location.replace('index.htm?mfID=' + self);
}


function popupopen () {
	var args = popupopen.arguments;
	var name   = typeof(args[0]) == "undefined" ? "images/spacer.gif" : args[0];
	var width  = typeof(args[1]) == "undefined" ? 100 : args[1];
	var height = typeof(args[2]) == "undefined" ? 100 : args[2];
	var title  = typeof(args[3]) == "undefined" || args[3] == ''  ? "Details" : args[3];
	var wname  = typeof(args[4]) == "undefined" || args[4] == '' ? "win" : args[4];
	var leftpos= typeof(args[5]) == "undefined" ? false : args[5];
	var toppos = typeof(args[6]) == "undefined" ? false : args[6];
	var closes = typeof(args[7]) == "undefined" ? true : false;
	var printable = typeof(args[8]) == "undefined" ? false : true;
	
	if (!leftpos || !toppos) {
		var leftpos = (screen.height - height)/2;
		var toppos  = (screen.width - width)/2;
	}
	
	if (!printable) {
		win = window.open("","" + wname + "","width=" + width + ",height=" + height + ",left=" + toppos + ",top=" + leftpos);
	}else{
		win = window.open("","" + wname + "","width=" + width + ",height=" + (height + 24) + ",left=" + toppos + ",top=" + leftpos);
	}
	win.document.open();
	win.document.write('<html><head><title>' + title + '</title><link rel="stylesheet" type="text/css" href="styles.css"><meta http-equiv="imagetoolbar" content="no"></head>');
	if (closes) {
		win.document.write('<body leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" onBlur="self.close();">'); 
	}else{
		win.document.write('<body leftmargin="0" topmargin="0" marginheight="0" marginwidth="0">'); 
	}
	win.document.write('<table cellpadding="0" cellspacing="0" border="0" width="100%" height="100%"><tr><td align="center">');

	if (name.substr(name.length - 3, 3) == "swf") {
		win.document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="' + width + '" height="' + height + '">');
		win.document.write('<param name="movie" value="' + name + '">');
		win.document.write('<param name="quality" value="high">');
		win.document.write('<param name="quality" value="high">');
		win.document.write('<param name="menu" value="false">');
		win.document.write('<embed src="' + name + '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="' + width + '" height="' + height + '"></embed>');
		win.document.write('</object>');
	}else{
		var alt = (title != "Details") ? title : "";
		win.document.write('<a href="javascript:;" onclick="self.close();"><img src="' + name + '" width="' + width + '" height="' + height + '" alt="' + alt + '"></a>');
	}
	
	win.document.write('</td></tr>');
	if (printable) win.document.write('<tr><td align="right" height="20"><a class="printlink" href="javascript:self.print();">Seite drucken / print page</a>&nbsp;&nbsp;&nbsp;</td></tr>');
	win.document.write('</table></body></html>');
	win.document.close();
	win.focus();
}

function openwin(imagename,imagewidth,imageheight,title,left,top) {
	if (screen.width > 800){
		left=screen.width/2 - imagewidth/2;
		top=screen.height/2 - imageheight/2;
	}
	newWindow = window.open("","newWindow","width="+imagewidth+",height="+imageheight+",left="+left+",top="+top+",scrollbars=yes");
	newWindow.document.open();
	newWindow.document.write('<html><title>'+title+'</title><head><link rel="stylesheet" type="text/css" href="styles.css"></head><body class="page" leftmargin="0" topmargin="0" marginheight="0" marginwidth="0">'); 
	newWindow.document.write('<table width="100%" border="0" cellspacing="0" cellpadding="0" height="100%"><tr><td><table width="1%" border="0" cellspacing="0" cellpadding="1" align="center"><tr><td colspan="2"><img src="'+ imagename + '"></td></tr><tr><td colspan="2">&nbsp;</td></tr><tr><td><a href="javascript:self.close();"><b>&raquo; Fenster schliessen / close window</b></a></td><td><div align="right"><a href="#" onClick="window.print();return false"><b>&raquo; Seite drucken / print page</b></a></div></td></tr></table></td></tr></table>'); 
	newWindow.document.write('</body></html>');
	newWindow.document.close();
	newWindow.focus();
}