function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v3.0
  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); return x;
}

function tmt_findObj(n){
 var x,t; if((n.indexOf("?"))>0&&parent.frames.length){t=n.split("?");
 x=eval("parent.frames['"+t[1]+"'].document.getElementById('"+t[0]+"')");
 }else{x=document.getElementById(n)}return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function bildanzeige(bildname) {
top.bilder.document.images["bild"].src=bildname;
}

function return_date(wert, ziel)
{
top.document.getElementsByName(ziel)[0].value=wert;
}

var altmenu = 1;

function Wechsel(menunr, aktion) {
var verStr=navigator.appVersion, app=navigator.appName, version=parseFloat(verStr);
    if (app.indexOf('Microsoft') != -1) {
    var ie = 1, ns = 0;
    }
 if (app.indexOf('Netscape') != -1) {
       if (version < 5) {
           var ie = 0, ns = 1;
       }
       else {
           var ie = 1, ns = 0;
       }
    }

if(ns) {
var obj_neu=MM_findObj("M" + menunr);
var obj_alt=MM_findObj("M" + altmenu);
if(aktion=="an") document["M" + menunr].visibility="show";
if(aktion=="aus") document["M" + menunr].visibility="hide";
if(aktion=="an_aus") {
	document["M" + menunr].visibility="show";
	document["M" + altmenu].visibility="hide";
	}
}

if(ie) {
var obj_neu=tmt_findObj("M" + menunr);
var obj_alt=tmt_findObj("M" + altmenu);
if(aktion=="an") obj_neu.style.visibility="visible";
if(aktion=="aus") obj_neu.style.visibility="hidden";
if(aktion=="an_aus") {
	obj_neu.style.visibility="visible";
	obj_alt.style.visibility="hidden";
	}
}

altmenu = menunr;
}

function Fensterauf(URL,Name,breite,hoehe,feat) { 
	var br;
	var ho;
	br = (window.screen.width/2) - breite/2;
	ho = (window.screen.height/2) - hoehe/2;
    window.open(URL,Name,'width=' +breite+ ',height=' +hoehe+ ',left=' +br+ ',top=' +ho + feat);
}

function archive_link(loc)
{
loc_utf=encode_utf8(loc);
location.href=escape(loc_utf);
}

function encode_utf8(rohtext) {
	 // dient der Normalisierung des Zeilenumbruchs
	 rohtext = rohtext.replace(/\r\n/g,"\n");
	 var utftext = "";
	 for(var n=0; n<rohtext.length; n++)
		 {
		 // ermitteln des Unicodes des  aktuellen Zeichens
		 var c=rohtext.charCodeAt(n);
		 // alle Zeichen von 0-127 => 1byte
		 if (c<128)
			 utftext += String.fromCharCode(c);
		 // alle Zeichen von 127 bis 2047 => 2byte
		 else if((c>127) && (c<2048)) {
			 utftext += String.fromCharCode((c>>6)|192);
			 utftext += String.fromCharCode((c&63)|128);}
		 // alle Zeichen von 2048 bis 66536 => 3byte
		 else {
			 utftext += String.fromCharCode((c>>12)|224);
			 utftext += String.fromCharCode(((c>>6)&63)|128);
			 utftext += String.fromCharCode((c&63)|128);}
		 }
	 return utftext;
 }

function alert_del(text, loc)
{
$aktion=confirm(text+" wirklich löschen?");
if ($aktion) { location.href=loc }
}

function alert_norm(text, loc)
{
$aktion=confirm(text);
if ($aktion) { location.href=loc }
}

function alert_confirm(text)
{
var aktion=confirm(text);
if (aktion)
	document.mailbox.submit();
else
	{ location.href=loc } ;
}


function buchung_on(bild1, bild2, bild3, bild4)
{
if(bild1!="") document.images[bild1].src="/portal/img/pixel_gruen.gif";
if(bild2!="") document.images[bild2].src="/portal/img/pixel_gruen.gif"
if(bild3!="") document.images[bild3].src="/portal/img/pixel_gruen.gif"
if(bild4!="") document.images[bild4].src="/portal/img/pixel_gruen.gif"
//alert(bild1);
}

function buchung_off(bild1, bild2, bild3, bild4)
{
if(bild1!="") document.images[bild1].src="/portal/img/transp.gif";
if(bild2!="") document.images[bild2].src="/portal/img/transp.gif";
if(bild3!="") document.images[bild3].src="/portal/img/transp.gif";
if(bild4!="") document.images[bild4].src="/portal/img/transp.gif";
}


function encodeEmail(param1, param2, subject) {
	var v2=param1;
	var v7=unescape(param2);
	var v5=v2.length;
	var v1="";
	for(var v4=0;v4<v5;v4++){
		v1+=String.fromCharCode(v2.charCodeAt(v4)^v7.charCodeAt(v4));
	}
	window.location='mail\u0074o\u003a'+v1+'?subject='+subject;
}


function changeImageComment(action,field,id) {
	//alert('sedn');
 try {
   xmlhttp = window.XMLHttpRequest?new XMLHttpRequest():
        new ActiveXObject("Microsoft.XMLHTTP");
   xmlhttp.onreadystatechange = triggeredChangeImageComment;
   xmlhttp.open('GET', 'siteRequest?action='+action+'&id='+id+'&data='+escape(field.value));
   xmlhttp.send(null);
 }
 catch (e) { alert('Leider unterstützt Ihr Browser diese Funktion nicht.'); }
}

function triggeredChangeImageComment() { }