// oeffnet Popup wird für popup-Modul benötigt
function openPopup(URL,popname,W,H,scroll,rezisable,X,Y) {
	var URL,popname,W,H,scroll,rezisable,X,Y;
	if (!popname) { popname='popup'; }
	if (!W) { W=520; }
	if (!H) { H=460; }
	if (!scroll) { scroll=0; }
	if (!rezisable) { rezisable=0; }
	if (!X) { X=screen.width/2-(W/2); }
	if (!Y) { Y=screen.height/2-(H/2)-20; }
	properties = "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars="+scroll+",resizable="+rezisable+",";
	properties += "width="+W+",height="+H+",left="+X+",top="+Y;
	popwin=window.open(URL,popname,properties);
	popwin.focus();
}

// Sitemap
function loadPage(url) {
window.opener.location.href=url;
}


// zeigt Flash direkt an
function showFlash(src, width, height, quality, menu, bgcolor, flashvars) {
	closeTags = "</" + "embed></" + "object>";
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="' + width + '" height="' + height + '" title=""><param name="movie" value="' + src + flashvars + '"><param name="quality" value="' + quality + '"><param name="bgcolor" value="' + bgcolor + '" /><param name="wmode" value="transparent"><param name="menu" value="' + menu + '"><param name="play" value="true"><embed src="' + src + flashvars + '" quality="' + quality + '" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" bgcolor="' + bgcolor + '" width="' + width + '" height="' + height + '" menu="' + menu + '" play="true" wmode="transparent">'+closeTags);
    //##	alert("showFlash() flashvars="+flashvars + " => " + src);
}


function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}


function MM_changeProp(objName,x,theProp,theValue) { //v6.0
  var obj = MM_findObj(objName);
  if (obj && (theProp.indexOf("style.")==-1 || obj.style)){
    if (theValue == true || theValue == false)
      eval("obj."+theProp+"="+theValue);
    else eval("obj."+theProp+"='"+theValue+"'");
  }
}


function hideLayer (setDiv) {
	MM_changeProp(setDiv,'','style.display','none','DIV');
}


function showLayer (setDiv) {
	MM_changeProp(setDiv,'','style.display','block','DIV');
}


function changeImg (setThumb,setDiv,count) {
    // alle Zoombilder hide
    for (var i = 1; i <= count; i++) {
        divname='zoom'+i;
        hideLayer (divname);
    }
    // alle Hi Thumbs hide
    // alle Lo Thumbs show
    for (var i = 1; i <= count; i++) {
        divnamehi='thumb'+i+'_hi';
        hideLayer (divnamehi);
        divnamelo='thumb'+i+'_lo';
        showLayer (divnamelo);
    }
    // hide Thumbnail lo
    setThumblo=setThumb+'_lo';
    hideLayer (setThumblo);
    // show Thumbnail hi
    setThumbhi=setThumb+'_hi';
    showLayer (setThumbhi);
    // show Zoombild
    document.getElementById('zoom').innerHTML = document.getElementById(setDiv).innerHTML;
    //showLayer (setDiv);
}
