var ie=document.all
var ns6=document.getElementById&&!document.all


function ieobjekt(){
return (document.compatMode && document.compatMode!="BackCompat" && !window.opera)? document.documentElement : document.body
}

function date() {
	var Jahr= new Date().getYear()
	if (Jahr < 999)
	    Jahr += 1900;
	document.write(Jahr);
}

function wechsel() {
		bilder = new Array("k_leiste.jpg", "k_leiste_sommer.jpg", "k_leiste_winter.jpg"); 
		document.write("<td colspan=3 height=90px width=770px style=\"border:0; background:url('/images/" + bilder[Math.floor(Math.random()*3)] + "') no-repeat 2px;\"><td>");
}


function vergroessern(welche, e, position, imgwidth, imgheight, dia){

if (ie||ns6){
	aufbau=document.getElementById? document.getElementById("zeigedasbild") : document.all.zeigedasbild

if (position=="center"){
	seite_y_stellung=ns6? parseInt(pageYOffset) : parseInt(ieobjekt().scrollTop)
	horizoposi=ns6? pageXOffset+window.innerWidth/2-imgwidth/2 : ieobjekt().scrollLeft+ieobjekt().clientWidth/2-imgwidth/2-9
	
	if (!dia){
		vertiposi=ns6? seite_y_stellung+210: seite_y_stellung+220
	} else {
		vertiposi=ns6? seite_y_stellung+window.innerHeight/2-imgheight/2 : seite_y_stellung+ieobjekt().clientHeight/2-imgheight/2
	}
	
	if (window.opera && window.innerHeight) //Ausgleich fuer Opera
		vertiposi=seite_y_stellung+window.innerHeight-587
		vertiposi=Math.max(seite_y_stellung, vertiposi)
	}

else{
var horizoposi=ns6? pageXOffset+e.clientX : ieobjekt().scrollLeft+event.clientX
var vertiposi=ns6? pageYOffset+e.clientY : ieobjekt().scrollTop+event.clientY
}

if (!dia){
	aufbau.style.left=horizoposi+"px"
	aufbau.style.top=vertiposi+"px"
	aufbau.innerHTML='<div style="width:100%" align="right" id="leiste"><div style="height:20px; width:100%; background-color:#FBFFED"></div><span id="schliessen_text" onClick="vorschau_zu()">&nbsp;Schlie&szlig;en <div style="height:330px; width:100%; background-color:#FBFFED"><img style="border:1px solid black" width="'+imgwidth+'" src="../fotos/'+welche+'"></span></div></div>'
} else {
	aufbau.style.left="0px"
	aufbau.style.top=vertiposi+"px"
	aufbau.innerHTML='<div align="right" id="leiste"><div style="height:20px; width:100%; background-color:#FBFFED"></div><span id="schliessen_text" onClick="vorschau_zu()">&nbsp;Schlie&szlig;en <div style="height:2000px; width:100%; background-color:#FBFFED"><img style="border:1px solid black" width="'+imgwidth+'" src="../fotos/'+welche+'"></span></div></div>'
}

aufbau.style.visibility="visible"
return false
}
else //falls kein IE 4+ oder NS 6+, zeige das Bild einfach in einem neuen Browser-Fenster
return true
}


function vorschau_zu(){
aufbau.style.visibility="hidden"
}


function drag_and_drop(e){
if (ie&&dragapproved){
aufbau.style.left=tempx+event.clientX-offsetx+"px"
aufbau.style.top=tempy+event.clientY-offsety+"px"
}
else if (ns6&&dragapproved){
aufbau.style.left=tempx+e.clientX-offsetx+"px"
aufbau.style.top=tempy+e.clientY-offsety+"px"
}
return false
}


function initiiere_drag(e){
if (ie&&event.srcElement.id=="leiste"||ns6&&e.target.id=="leiste"){
offsetx=ie? event.clientX : e.clientX
offsety=ie? event.clientY : e.clientY

tempx=parseInt(aufbau.style.left)
tempy=parseInt(aufbau.style.top)

dragapproved=true
document.onmousemove=drag_and_drop
}
}

document.onmousedown=initiiere_drag
document.onmouseup=new Function("dragapproved=false")
