﻿function myEDIT_swapImgRestore() { //v3.0
  var i,x,a=document.myEDIT_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}



function myEDIT_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.myEDIT_p) d.myEDIT_p=new Array();
    var i,j=d.myEDIT_p.length,a=myEDIT_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.myEDIT_p[j]=new Image; d.myEDIT_p[j++].src=a[i];}}
}



function myEDIT_findObj(n, d) { //v4.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=myEDIT_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}



function myEDIT_showHideLayers() { //v3.0
  var i,p,v,obj,args=myEDIT_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=myEDIT_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}



function myEDIT_showHideDisplay() { //v3.0
  var i,p,v,obj,args=myEDIT_showHideDisplay.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=myEDIT_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'block':(v='hide')?'none':v; }
    obj.display=v; }
}



function myEDIT_swapImage() { //v3.0
  var i,j=0,x,a=myEDIT_swapImage.arguments; document.myEDIT_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=myEDIT_findObj(a[i]))!=null){document.myEDIT_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

	

function showdiv(myShowID, myHideID) {
  document.getElementById(myHideID).style.display = "none";
  document.getElementById(myShowID).style.display = "";
}	


function helpAuf (x,wid,hei)
{
props = 'width=' + wid + ',height=' + hei + ',resizable=no, scrollbars';
pictWin = window.open(x,"pict",props);
if (pictWin.closed != true)		
	{
	pictWin.resizeTo(wid,hei);
	}
}

function fenster(name,ort,w,h,scrl)
{
  	win = window.open(ort,name,'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars='+scrl+',resizable=yes,copyhistory=no,width='+w+',height='+h);
	win.focus();
	return false;
}


function checkDel(url,confirmtext){
	//var url = "" + url;
	if (url.indexOf("delpage") > -1){
	  var msg = "Moechten Sie die aktuelle Seite mit allen Elementen wirklich loeschen?";
	  }
	if (url.indexOf("katdelp2") > -1){
	  var msg = "Moechten Sie die aktuelle Kategorie wirklich loeschen?";
	  }
	if (url.indexOf("del_element") > -1){
	  var msg = CheckUml(confirmtext);
	  }
	if(confirm(msg)) top.location.href = url;
}

function CheckUml(toCheck) {
	len = toCheck.length;
	countUml = 0;
	final = "";
	while (countUml < len){
	step = 1;
	if (toCheck.substr(countUml, 6) == "&auml;"){
	final = final + "ae";
	step = step + 5;
	} else if (toCheck.substr(countUml, 6) == "&ouml;"){
	final = final + "oe";
	step = step + 5;
	} else if (toCheck.substr(countUml, 6) == "&uuml;"){
	final = final + "ue";
	step = step + 5;
	} else if (toCheck.substr(countUml, 6) == "&Auml;"){
	final = final + "Ae";
	step = step + 5;
	} else if (toCheck.substr(countUml, 6) == "&Ouml;"){
	final = final + "Oe";
	step = step + 5;
	} else if (toCheck.substr(countUml, 6) == "&Uuml;"){
	final = final + "Ue";
	step = step + 5;
	} else if (toCheck.substr(countUml, 3) == "<b>"){
	final = final + "<b>";
	step = step + 2;
	} else if (toCheck.substr(countUml, 4) == "</b>"){
	final = final + "</b>";
	step = step + 3;
	} else if (toCheck.substr(countUml, 7) == "&szlig;"){
	final = final + "ß";
	step = step + 6;
	} else {
	final = final + toCheck.substr(countUml, 1);
	}	
	countUml = countUml + step;
	}
	return final;
}

var first = true;
function chkPara(x){
if(document.location.search && document.location.search.indexOf('m=') != -1 && first) {
  srStr = "&" + document.location.search.substring(1,document.location.search.length);
  x.src += srStr;
  first = false;
  dynIFrameHoehe()}}

  

function fensterHoehe(win) {
if (win == undefined) win = window; 
if (win.innerHeight) { return win.innerHeight; } 
else { 
	if (win.document.documentElement && win.document.documentElement.clientHeight) { 
		return win.document.documentElement.clientHeight; } 
	return win.document.body.offsetHeight; 
}}


function dynIFrameHoehe(){
if(document.getElementById('myframe')){
var myFrameObjectStyle = document.getElementById('myframe').style;
// höhe anpassen
thisHeight = fensterHoehe()- 264 + "px";	
myFrameObjectStyle.height=thisHeight;}}	


window.onload = dynIFrameHoehe;




