  
DOM=0;
if(document.getElementById)
DOM=1;


/******************  POPUP-Div SCHREIBEN ***********************/

document.write ('<div id="popupDiv" style="display:none"><div id="popupTop" style="display:none"></div><div id="popupMain"></div><div id="popupBottom" style="display: none;"></div></div>');


/******************  POPUP-Div schliessen ***********************/

document.onclick=hideDiv;
function hideDiv(){
	document.getElementById("popupDiv").style.display="none";
}

/*******************************************************

B I L D E R 

*******************************************************/

/************** Bilder vorladen */

verweise = new Array; 
verweise = document.links; 

pfadBild= new Array; 
j=0;
for(i=0;i<verweise.length;i++){
	script=verweise[i].href.search(/showSub4/);
	if(script!=-1){
		pos1=verweise[i].href.indexOf("../", script);
		pos2=verweise[i].href.indexOf("'", pos1);
		pfadBild[j]=verweise[i].href.slice(pos1,pos2);
		j++;
	}
}

preloads = new Array;
for (i=0;i<pfadBild.length;i++){
	//preloads[i]=new Image;
	//preloads[i].src=pfadBild[i];
}

/************* Bild aufrufen */

function showSub4(url, text){
//Bildkoordinaten ermitteln
	myBild = new Image;
	for (i=0;i<pfadBild.length;i++){
		if (pfadBild[i]==url){
			myBild=preloads[i];
		}
	}
bildX=myBild.width;
bildY=myBild.height;

//eigenes Fenster oeffnen fuer NS4, etc.

if(!DOM){
	if (!bildX){
		bildX=566; bildY=378;
	}
	else {
		bildX=bildX+15; bildY=bildY+15;
	}

	popupWindow(url,bildX,bildY,"no")
} 
else{
	var myImage= "<img border=0 src="+url+" >"
	if (text==null){
		text="Fenster schlie&szlig;en";
	}
	//popupDiv gestalten
	document.getElementById("popupMain").style.width=bildX+"px";
	document.getElementById("popupMain").style.height=bildY+"px";
	document.getElementById("popupMain").innerHTML=myImage;
	document.getElementById("popupTop").style.display='none';
	//document.getElementById("popupBottom").style.width=bildX+"px";
	//document.getElementById("popupBottom").style.display='block';
	//document.getElementById("popupBottom").innerHTML=text;

	//position des popup-divs
	posDiv(); 

	//Anzeige 
	document.getElementById("popupDiv").style.display="block";
	}
}


function posDiv(){
	divPos = document.getElementById("popupDiv").style;
    if (document.documentElement && document.documentElement.scrollTop){
		divPos.top = document.documentElement.scrollTop+"px";
	}
    else 
	if (self.pageYOffset){
		divPos.top = self.pageYOffset+"px";
	}
	else 
	if (document.body.scrollTop){
		divPos.top = document.body.scrollTop+"px";
	}
	else{
		divPos.top = 0;
	}
}

/*******************************************************

P O P U P   W I N D O W  = echtes popup Fenster fuer alte Browser...

*******************************************************/


function popupWindow(url,x,y,scroll){
	//Fenstergroesse
	if (!x || x==''){
		if(document.all){
			x = document.body.offsetWidth / 3;
		} 
		else{
			x = window.innerWidth / 3;
		}
		x = parseInt(x); 
	} 

	if (!y || y==''){
		y = screen.availHeight;-50;
	}

	Zweitfenster = window.open(url,"Anm","width="+x+",height="+y+",top=0,left=0,dependent=yes,resizable=yes,scrollbars="+scroll);
	Zweitfenster.focus();
	document.onmousedown=popupClose
}

function popupClose(){
	Zweitfenster.close();
}
