//Variable for popup-timer
zu = '';
activeSubnav = 0;
mouseCount = 0;

function menuItem(whichImg,offsrc,onsrc){
	this.imgname = new Object(whichImg);
	this.imgname.createHiliteImages = createImgObjs;
	this.imgname.createHiliteImages(offsrc,onsrc);
}

//hilite-image method
function createImgObjs(offsrc,onsrc){
	this.offimg = new Image();
    	this.offimg.src = offsrc;
	this.onimg = new Image();
	this.onimg.src = onsrc;
}

function showHigh(whichButton,whichPic){
         //imagechange
         if(whichPic != 0) document.images[whichButton.imgname].src = whichButton.imgname.onimg.src;
}

function resetHigh(whichButton,whichPic){
	if(whichPic != 0) document.images[whichButton.imgname].src = whichButton.imgname.offimg.src;

}

function showInputHigh(whichButton,whichPic){
	//alert(whichButton.imgname.onimg.src);
	if(whichPic != 0) document.getElementById(whichButton.imgname).src = whichButton.imgname.onimg.src;
}

function resetInputHigh(whichButton,whichPic){
	if(whichPic != 0) document.getElementById(whichButton.imgname).src = whichButton.imgname.offimg.src;
}

//layer show/hide
function showLayer(whichMenue){
         //alten layer ausblenden, falls vorhanden
         if(document.getElementById(activeSubnav)){
          menuCollaps();
         }
         //neuen layer anzeigen, falls vorhanden
         if(document.getElementById(whichMenue)) showSubnav(whichMenue);

}

function hideLayer(whichMenue){
         if(document.getElementById(whichMenue)) dropdown_mouseLeave();

}


function showSubnav(whichMenu) {
         document.getElementById(whichMenu).style.visibility = "visible";
         activeSubnav=whichMenu;
         //disable timeout
	if (zu) window.clearTimeout(zu);
}

function dropdown_mouseEnter() {
	window.clearTimeout(zu);

}

function dropdown_mouseLeave() {
         zu = window.setTimeout("menuCollaps()",50);
}

function menuCollaps(){
                 //hide popup-menu
		window.clearTimeout(zu);
		if(document.getElementById(activeSubnav)) document.getElementById(activeSubnav).style.visibility="hidden";
}

//flash

function writeFlash(){
plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
flashcode = "";

if (plugin) {
	plugin = parseInt(plugin.description.substring(plugin.description.indexOf(".")-1)) >= v;
}

else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 && (navigator.userAgent.indexOf("Windows 95")>=0 || navigator.userAgent.indexOf("Windows 98")>=0 || navigator.userAgent.indexOf("Windows NT")>=0)) {
	//alert("ie");
	document.write('<script type="text\/vbscript"\>\n');
         document.write('on error resume next\n');
	document.write('plugin = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.'+v+'")))\n');
         document.write('<\/script\>\n');
}
if (plugin) {
         //alert("plugin");
         document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
	document.write(' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version='+v+',0,0,0"');
	document.write(' id='+i+' width='+w+' height='+h+'>\n');
	document.write(' <param name=movie value="'+f+'">\n');
	document.write(' <param name=loop value='+l+'>\n');
	document.write(' <param name=menu value='+m+'>\n');
	document.write(' <param name=quality value='+q+'>\n');
	document.write(' <param name=bgcolor value='+b+'>\n');
	document.write(' <embed src="'+f+'" loop="'+l+'" menu="'+m+'" quality="'+q+'" bgcolor="'+b+'"');
	document.write(' swLiveConnect="false" width="'+w+'" height='+h+'"');
	document.write(' type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">\n');
	document.write(' <\/embed>\n');
	document.write(' <\/object>\n');
} else if (!(navigator.appName && navigator.appName.indexOf("Netscape")>=0 && navigator.appVersion.indexOf("2.")>=0)){
	//document.write('<img src="'+a+'" width='+w+' height='+h+' border=0>\n');
}
}

//bildergalerie
//new window
function magnifyImage(whichFile) {
 //defining new popup-window
	var winProperties = "toolbar=no,location=no,directories=no,status=no,copyhistory=no,width=400,height=500,left=300,top=150,resizable=no,scrollbars=no";
         zoomWin=window.open(whichFile,"zoomWin",winProperties);
  	zoomWin.focus();
}