function showhide1(what, what2, basisurl)
{
	if (document.getElementById( what ).style.display == "none")
	{
    		document.getElementById( what ).style.display= "block";
    		document.getElementById( what2 ).src= basisurl + "/admin/images/uparrowweiss.gif";
	}
   	else
	{
    		document.getElementById( what ).style.display= "none";
    		document.getElementById( what2 ).src= basisurl + "/admin/images/downarrowweiss.gif";
	}
}
function showhide3(what, what2, basisurl)
{
	if (document.getElementById( what ).style.display == "none")
	{
    		document.getElementById( what ).style.display= "block";
    		document.getElementById( what2 ).src= basisurl + "/admin/images/uparrow.gif";
	}
   	else
	{
    		document.getElementById( what ).style.display= "none";
    		document.getElementById( what2 ).src= basisurl + "/admin/images/downarrow.gif";
	}
}
function minmax(what, what2, basisurl, table_row)
{
	if (document.getElementById( what ).style.display == "none")
	{
    		document.getElementById( what ).style.display= "block";
    		document.getElementById( what2 ).src= basisurl + "/admin/images/minimieren.gif";
			document.getElementById( table_row ).className= "content_header1";
	}
   	else
	{
    		document.getElementById( what ).style.display= "none";
    		document.getElementById( what2 ).src= basisurl + "/admin/images/maximieren.gif";
			document.getElementById( table_row ).className= "content_header";
	}
}
function minmax1(what, what2, basisurl, table_row)
{
	if (document.getElementById( what ).style.display == "none")
	{
    		document.getElementById( what ).style.display= "block";
    		document.getElementById( what2 ).src= basisurl + "/admin/images/minimieren.gif";
			document.getElementById( table_row ).className= "content_header2 tropenclose";
	}
   	else
	{
    		document.getElementById( what ).style.display= "none";
    		document.getElementById( what2 ).src= basisurl + "/admin/images/maximieren.gif";
			document.getElementById( table_row ).className= "content_header2 tropenclose";
	}
}
function showtab(what, table_row)
{
	if (document.getElementById( what ).style.display == "none" && document.getElementById( table_row ).className== "1")
	{
    		document.getElementById( what ).style.display= "block";
    		document.getElementById( table_row ).className= "current_tab";
			if(document.all.className == "1")
			{
				document.all.style.display= "none";
			}
	}
   	else
	{
    		document.getElementById( what ).style.display= "none";
			document.getElementById( table_row ).className= "1";
	}
}
function showhideverz(what, what2)
{

   	if (document.getElementById(what).style.display == "none")
   	{
    	document.getElementById(what).style.display = "block";
    	document.getElementById(what2).src= "images/downarroww.gif";
	}
   	else
   	{
   		document.getElementById(what).style.display = "none";
   		document.getElementById(what2).src= "images/rightarroww.gif";
  	}
}



function cancelClick() {   window.close();   }
function color_insert(form,feldname,farbeback)
{
   var newwin = window.open('../inc/colorpicker.php?formname='+form+'&feldname='+feldname+'&farbeback='+farbeback+'','','top=150,left=150,width=400,height=250');
   if (newwin.opener == null) newwin.opener = window;
   newwin.opener.name = "Colorpickerr";
}

/* eingefügt am 03.08.2005 */
/* Frontend druckansicht öffnen */
function printing(datei)
{
	Fenster = window.open(datei,"Fenster","width=680,height=460,resizable=yes,menubar=no,scrollbars=yes");
	Fenster.moveTo(50,50);
	Fenster.focus();
}
/* eingefügt am 04.08.2005 */
/* Sicherheitsabfrage 'wirklich löschen' */
function del_sure(message)
{
	if(confirm(message))
	return true;
	return false;
}
/* eingefügt am 07.08.2005 */
/* Popup Bildauswahl öffnen und ausgewählte Bildurl zurückgeben */
function insert_image(formname, input, image)
{
	var newwin = window.open('../inc/image.php?formname='+formname+'&feldname='+input+'&bildname='+image+'','','top=150,left=150,width=400,height=300');
	if (newwin.opener == null) newwin.opener = window;
	newwin.opener.name = "InsertImage";
}

/* eingefügt am 07.08.2005 */
/* Bild in Originalgröße anzeigen */
function openPicture(url,pic,title,width,height,wheight)
{
	opup=window.open("inhalt/picture.php?img="+url+"/"+pic+"&titel="+title+"&width="+width+"&height="+height+"", title,'width='+width+',height='+wheight+',toolbar=no,directories=no,status=no,scrollbars=no,resizable=no,menubar=no');
	popup.moveTo(((screen.availWidth-width)/2),((screen.availHeight-height-100)/2))
	popup.focus();
}
/* eingefügt am 12.08.2005 */
/* Baumstruktur im Menü */
function tree(what,classname)
{
	if (document.getElementById(what).style.display == "none")
   	{
    	document.getElementById(what).style.display = "block";
    	document.getElementById(classname).className= "section-open";
	}
   	else
   	{
   		document.getElementById(what).style.display = "none";
		document.getElementById(classname).className= "section";
  	}
}
function tree1(what,classname)
{
	if (document.getElementById(what).style.display == "none")
   	{
    	document.getElementById(what).style.display = "block";
    	document.getElementById(classname).className= "section-open";
	}
   	else
   	{
   		document.getElementById(what).style.display = "none";
		document.getElementById(classname).className= "section";
  	}
}
/* eingefügt am 12.08.2005 */
/* Baumstruktur im Menü  */
function tree_lastnode(what,classname)
{
	if (document.getElementById(what).style.display == "none")
   	{
    	document.getElementById(what).style.display = "block";
    	document.getElementById(classname).className= "section-open-lastnode";
	}
   	else
   	{
   		document.getElementById(what).style.display = "none";
   		document.getElementById(classname).className= "section-lastnode";
  	}
}
/* eingefügt am 14.08.2005 */
/* horizontale Listennavigation öffnen bei hover*/
function opennav(what)
{
	document.getElementById(what).style.display = "block";
}
function closenav(what)
{
	document.getElementById(what).style.display = "none";
}

/* eingefügt am 03.03.2006 */
/* Ceckboxen für Multilöschabfrage */
function setCheckboxes(the_form, do_check)
{
    var elts      = (typeof(document.forms[the_form].elements['selected_db[]']) != 'undefined')
                  ? document.forms[the_form].elements['selected_db[]']
                  : (typeof(document.forms[the_form].elements['multi_del[]']) != 'undefined')
          ? document.forms[the_form].elements['multi_del[]']
          : document.forms[the_form].elements['selected_fld[]'];
    var elts_cnt  = (typeof(elts.length) != 'undefined')
                  ? elts.length
                  : 0;

    if (elts_cnt) {
        for (var i = 0; i < elts_cnt; i++) {
            elts[i].checked = do_check;
        } // end for
    } else {
        elts.checked        = do_check;
    } // end if... else

    return true;
}

function insert_tag(aTag, eTag, the_form, eingabe)
{
  var input = document.forms[the_form].elements[eingabe];
  input.focus();
  /* für Internet Explorer */
   if(typeof document.selection != 'undefined')
   {
    /* Einfügen des Formatierungscodes */
    var range = document.selection.createRange();
    var insText = range.text;
    range.text = aTag + insText + eTag;
    /* Anpassen der Cursorposition */
    range = document.selection.createRange();
    if (insText.length == 0)
    {
      range.move('character', -eTag.length);
    }
    else
    {
      range.moveStart('character', aTag.length + insText.length + eTag.length);
    }
    range.select();
  }
  /* für neuere auf Gecko basierende Browser */
  else if(typeof input.selectionStart != 'undefined')
  {
    /* Einfügen des Formatierungscodes */
    var start = input.selectionStart;
    var end = input.selectionEnd;
    var insText = input.value.substring(start, end);
    input.value = input.value.substr(0, start) + aTag + insText + eTag + input.value.substr(end);
    /* Anpassen der Cursorposition */
    var pos;
    if (insText.length == 0)
    {
      pos = start + aTag.length;
    }
    else
    {
      pos = start + aTag.length + insText.length + eTag.length;
    }
    input.selectionStart = pos;
    input.selectionEnd = pos;
  }
  /* für die übrigen Browser */
  else
  {
    /* Abfrage der Einfügeposition */
    var pos;
    var re = new RegExp('^[0-9]{0,3}$');
    while(!re.test(pos)) {
      pos = prompt("Einfügen an Position (0.." + input.value.length + "):", "0");
    }
    if(pos > input.value.length)
    {
      pos = input.value.length;
    }
    /* Einfügen des Formatierungscodes */
    var insText = prompt("Bitte geben Sie den zu formatierenden Text ein:");
    input.value = input.value.substr(0, pos) + aTag + insText + eTag + input.value.substr(pos);
  }
}
function insert_image1(formname, input, user)
{
	var newwin = window.open('../inc/image2.php?formname='+formname+'&feldname='+input+'&user='+user+'','','top=150,left=150,width=600,height=430');
	if (newwin.opener == null) newwin.opener = window;
	newwin.opener.name = "InsertImage";
}
function insert_table(formname, input, user)
{
	var newwin = window.open('../inc/table.php?formname='+formname+'&feldname='+input+'&user='+user+'','','top=150,left=150,width=380,height=220');
	if (newwin.opener == null) newwin.opener = window;
	newwin.opener.name = "InsertImage";
}
function insert_sonderzeichen(formname, input, user)
{
	var newwin = window.open('../inc/charmap.php?formname='+formname+'&feldname='+input+'&user='+user+'','','top=150,left=150,width=550,height=260');
	if (newwin.opener == null) newwin.opener = window;
	newwin.opener.name = "InsertImage";
}
function insert_list(formname, input, user)
{
	var newwin = window.open('../inc/list.php?formname='+formname+'&feldname='+input+'&user='+user+'','','top=150,left=150,width=300,height=140');
	if (newwin.opener == null) newwin.opener = window;
	newwin.opener.name = "InsertImage";
}
function gen_pdf(filename)
{
	var newwin = window.open('inc/generatepdf.php?filename='+filename,'');
	if (newwin.opener == null) newwin.opener = window;
	newwin.opener.name = "InsertImage";
}

function openBilder(val)
{
	document.getElementById('objimg').value = val;
	document.getElementById('editIMMO').submit();
}

/**
 *
 * @access public
 * @return void
 **/
function ShowThisImg(val,val1)
{
	document.getElementById('imagegross').src = val;
	document.getElementById('imgtext').innerHTML = val1;
}