
//***************************************
//        MENU
//***************************************

var arrMenuIds    = new Array();
arrMenuIds[0]     = new Array();
arrMenuIds[0][0]  = 'auftrag';
arrMenuIds[0][1]  = new Array();
arrMenuIds[0][1][0] = 'auftrag_1';
arrMenuIds[0][1][1] = 'auftrag_2';
arrMenuIds[0][1][2] = 'auftrag_3';
arrMenuIds[0][1][3] = 'auftrag_4';
arrMenuIds[0][1][4] = 'auftrag_5';
arrMenuIds[0][2]  = 'auftrag_navi.php';
arrMenuIds[1]     = new Array();
arrMenuIds[1][0]  = 'projekt';
arrMenuIds[1][1]  = new Array();
arrMenuIds[1][1][0] = 'projekt_1';
arrMenuIds[1][1][1] = 'projekt_2';
arrMenuIds[1][1][2] = 'projekt_3';
arrMenuIds[1][2]  = 'projekt_auftraege_navi.php';
arrMenuIds[2]     = new Array();
arrMenuIds[2][0]  = 'periodisch';
arrMenuIds[2][1]  = new Array();
arrMenuIds[2][1][0] = 'periodisch_1';
arrMenuIds[2][1][1] = 'periodisch_2';
arrMenuIds[2][1][2] = 'periodisch_3';
arrMenuIds[2][1][3] = 'periodisch_4';
arrMenuIds[2][1][4] = 'periodisch_5';
arrMenuIds[2][1][5] = 'periodisch_6';
arrMenuIds[2][2]  = 'periodisch_navi.php';
arrMenuIds[3]     = new Array();
arrMenuIds[3][0]  = 'mitarbeiter';
arrMenuIds[3][1]  = new Array();
arrMenuIds[3][1][0] = 'mitarbeiter_1';
arrMenuIds[3][1][1] = 'mitarbeiter_2';
arrMenuIds[3][1][2] = 'mitarbeiter_3';
arrMenuIds[3][2]  = 'mitarbeiter_navi.php';
arrMenuIds[4]     = new Array();
arrMenuIds[4][0]  = 'stammdaten';
arrMenuIds[4][1]  = new Array();
arrMenuIds[4][1][0] = 'stammdaten_1';
arrMenuIds[4][1][1] = 'stammdaten_2';
arrMenuIds[4][1][2] = 'stammdaten_3';
arrMenuIds[4][1][3] = 'stammdaten_4';
arrMenuIds[4][1][4] = 'stammdaten_5';
arrMenuIds[4][1][5] = 'stammdaten_6';
arrMenuIds[4][1][6] = 'stammdaten_7';
arrMenuIds[4][1][7] = 'stammdaten_8';
arrMenuIds[4][1][8] = 'stammdaten_9';
arrMenuIds[4][2]  = 'stammdaten_navi.php';
arrMenuIds[5]     = new Array();
arrMenuIds[5][0]  = 'statistik';
arrMenuIds[5][1]  = new Array();
arrMenuIds[5][1][0] = 'statistik_1';
arrMenuIds[5][1][1] = 'statistik_2';
arrMenuIds[5][1][2] = 'statistik_3';
arrMenuIds[5][1][3] = 'statistik_4';
arrMenuIds[5][1][4] = 'statistik_5';
arrMenuIds[5][1][5] = 'statistik_6';
arrMenuIds[5][1][6] = 'statistik_7';
arrMenuIds[5][1][7] = 'statistik_8';
arrMenuIds[5][1][8] = 'statistik_9';
arrMenuIds[5][1][9] = 'statistik_10';
arrMenuIds[5][1][10] = 'statistik_11';
arrMenuIds[5][2]  = 'statistik_navi.php';
arrMenuIds[6]     = new Array();
arrMenuIds[6][0]  = 'grundeinstellungen';
arrMenuIds[6][1]  = new Array();
arrMenuIds[6][1][0] = 'grundeinstellungen_1';
arrMenuIds[6][2]  = 'grundeinstellungen_navi.php';
arrMenuIds[7]     = new Array();
arrMenuIds[7][0]  = 'bestellungen';
arrMenuIds[7][1]  = new Array();
arrMenuIds[7][1][0] = 'bestellungen_1';
arrMenuIds[7][1][1] = 'bestellungen_2';
arrMenuIds[7][1][2] = 'bestellungen_3';
arrMenuIds[7][1][3] = 'bestellungen_4';
arrMenuIds[7][2]  = 'bestellungen_navi.php';

function openMainGrp(strSubModul)
{
	switch(strSubModul)
	{
		case 'auftrag_1':
		case 'auftrag_2':
		case 'auftrag_3':
		case 'auftrag_4':
		case 'auftrag_5':
		case 'projekt_1':
		case 'projekt_2':
		case 'projekt_3':
		case 'periodisch_1':
		case 'periodisch_2':
		case 'periodisch_3':
		case 'periodisch_4':
		case 'periodisch_5':
		case 'periodisch_6':
		case 'bestellungen_1':
		case 'bestellungen_2':
		case 'bestellungen_3':
		case 'bestellungen_4':
			openFolderNaviFromFrame('1','menu1');
			break;
		case 'mitarbeiter_1':
		case 'mitarbeiter_2':
		case 'mitarbeiter_3':
		case 'stammdaten_1':
		case 'stammdaten_2':
		case 'stammdaten_3':
		case 'stammdaten_4':
		case 'stammdaten_5':
		case 'stammdaten_6':
		case 'stammdaten_7':
		case 'stammdaten_8':
		case 'stammdaten_9':
		case 'statistik_1':
		case 'statistik_2':
		case 'statistik_3':
		case 'statistik_4':
		case 'statistik_5':
		case 'statistik_6':
		case 'statistik_7':
		case 'statistik_8':
		case 'statistik_9':
		case 'statistik_10':
		case 'statistik_11':
			openFolderNaviFromFrame('2','menu2');
			break;
		case 'grundeinstellungen_1':
			openFolderNaviFromFrame('3','menu3');
			break;
		default:
			break;
	}
}



function setAllBtnInactive(){
  for(i=0; i<arrMenuIds.length; i++){
    //  Level 1 Button inaktiv setzen
    if( window.top.naviFrame.document.getElementById( arrMenuIds[i][0] ) )
      window.top.naviFrame.setBtnInactive( arrMenuIds[i][0] );
    //  Zu Level 1 geh&ouml;riges Menu ausblenden
    /*if( document.getElementById( arrMenuIds[i][2] ) )
      document.getElementById( arrMenuIds[i][2] ).style.display  = strBtnMenuShowNot;*/
    //  Level 2 Buttons inaktiv setzen
    for(j=0; j<arrMenuIds[i][1].length; j++){
      if( window.top.mainFrame.subnavi.document.getElementById( arrMenuIds[i][1][j] ) )
        window.top.mainFrame.subnavi.setBtnInactive( arrMenuIds[i][1][j] );
    }
  }
}

bolSeitegeladen = false;

function setBtnStatus(objekt, bolActive, intDurchlauf){
	
  //alert('Aufruf: Button setzen: '+objekt);
  if( window.top.mainFrame.subnavi.document.getElementById(objekt) || window.top.naviFrame.document.getElementById(objekt) ){
      // Button gefunden --> setzen
      //alert('Button gefunden - setzen');
      ChangeButtonPic(objekt, bolActive, intDurchlauf);
      
      // Speichern Button inaktiv setzen
      window.top.mainFrame.subnavi.setSaveInactive();
      // Löchen Button inaktiv setzen
      window.top.mainFrame.subnavi.setDeleteInactive();
     // alert(objekt);
      openMainGrp(objekt);
      
  }else{
      // Button nicht gefunden
      //alert('Button nicht gefunden');
      if( bolSeitegeladen == true){
          // Seite wurde bereits neu geladen
          // script in kurzer Zeit wieder starten
          //alert('Seite bereits am laden, warten');
          setTimeout("window.top.mainFrame.content.setBtnStatus('"+objekt+"', "+bolActive+", "+intDurchlauf+")", 500);
          return;
      }else{
          // Seite neu laden
          //alert('Seite falsch, andere laden');
          bolSeitegeladen = reloadSubNavi(objekt);
          setTimeout("window.top.mainFrame.content.setBtnStatus('"+objekt+"', "+bolActive+", "+intDurchlauf+")", 500);
      }
  }
}

function ChangeButtonPic(objekt, bolActive, intDurchlauf){
  // erstmal alles deaktivieren
  if(intDurchlauf == 0){
    setAllBtnInactive();
  }
  
  for(i=0; i< arrMenuIds.length; i++){
  
    if( arrMenuIds[i][0]  != objekt ){
      for(k=0; k<arrMenuIds[i][1].length; k++){
        if( arrMenuIds[i][1][k] == objekt ){
          if( window.top.mainFrame.subnavi.document.getElementById( objekt ) ){
            if(bolActive)
              window.top.mainFrame.subnavi.setBtnActive( objekt );
            else
              window.top.mainFrame.subnavi.setBtnInactive( objekt );
          }
          // sublevel button gefunden und gesetzt, nun den hauptlevel setzen
          setBtnStatus(arrMenuIds[i][0], bolActive, ++intDurchlauf);
          break;
        }
      }
    }else{    // hauptlevel button setzen
      if( window.top.naviFrame.document.getElementById( arrMenuIds[i][0] ) ){
        if(bolActive)
          window.top.naviFrame.setBtnActive( arrMenuIds[i][0] );
        else
          window.top.naviFrame.setBtnInactive( arrMenuIds[i][0] );
      }
      break;
    }// ende else if( arrMenuIds[i][0]  != objekt )
    
  } 
    
}


function reloadSubNavi(objekt){
  // sucht die ID im array und gibt die zugehörige Seite dazu aus
  bolIdFound  = false;
  for(i=0; i< arrMenuIds.length; i++){
      if( arrMenuIds[i][0]  == objekt ){
          bolIdFound  = true;
          intIndex    = i;
          break;
      }else{
          for(k=0; k<arrMenuIds[i][1].length; k++){
              if( arrMenuIds[i][1][k] == objekt ){
                  bolIdFound  = true;
                  intIndex    = i;
                  break;
              }
          }
      }
  }
  if( bolIdFound ){     // falls überhaupt gefunden
      // fall die url abweichen sollte von der erwünschten
      if( window.top.mainFrame.subnavi.location && window.top.mainFrame.subnavi.location.href.indexOf( arrMenuIds[intIndex][2] ) <= 0 ){
          window.top.mainFrame.subnavi.location = arrMenuIds[intIndex][2];
          return true;
       }
  }else
      alert('ID "'+objekt+'" konnte nicht im Array gefunden werden!');
  return false;
}



function markActive(setActive){
			anzImages = document.images.length;
			for(i=0; i< anzImages; i++){
				image = document.images[i];
				if(image.src.indexOf('button_neu') == -1 && image.src.indexOf('button_speichern') == -1 && image.src.indexOf('button_drucken') == -1){
					imgExt = image.src.substr(image.src.lastIndexOf('.')+1);
					imgName = image.src.substr(0,image.src.lastIndexOf('.')-1);
					image.src= imgName+'i.'+imgExt;
				}
			}
			image = document.getElementById(setActive);
			imgExt = image.src.substr(image.src.lastIndexOf('.')+1);
			imgName = image.src.substr(0,image.src.lastIndexOf('.')-1);
			image.src= imgName+'a.'+imgExt;
			return true;
}

function setBtnActive(setActive){
      if( document.getElementById(setActive) ){
    			image = document.getElementById(setActive);
    			imgExt = image.src.substr(image.src.lastIndexOf('.')+1);
    			imgName = image.src.substr(0,image.src.lastIndexOf('.')-1);
    			image.src= imgName+'a.'+imgExt;
      }
}

function setBtnInactive(setActive){
      if( document.getElementById(setActive) ){
    			image = document.getElementById(setActive);
    			imgExt = image.src.substr(image.src.lastIndexOf('.')+1);
    			imgName = image.src.substr(0,image.src.lastIndexOf('.')-1);
    			image.src= imgName+'i.'+imgExt;
      }
}




//***************************************
//        TOOLBAR
//***************************************

function setSaveActive() {
  if( window.top.mainFrame.subnavi && window.top.mainFrame.subnavi._setSaveActive )
    window.top.mainFrame.subnavi._setSaveActive();
  else
    setTimeout("window.top.mainFrame.subnavi._setSaveActive();", 500);
}

function setDeleteActive() {
	
  if( window.top.mainFrame && window.top.mainFrame.subnavi && window.top.mainFrame.subnavi._setDeleteActive )
    window.top.mainFrame.subnavi._setDeleteActive();
  else
    setTimeout("window.top.mainFrame.subnavi._setDeleteActive();", 500);
}


function checkSaveNeeded(strAction) {
	
	if(top.mainFrame.content && top.mainFrame.content.saveNeeded) {
		
		if(top.mainFrame.content.saveNeeded == 'yes') {
			
			check = confirm('Möchten Sie fortfahren ohne zu speichern ?\n'+
			'\n'+
			'Die Änderungen an diesem Datensatz wurden noch nicht gespeichert!\n'+
			'Wenn Sie diese speichern möchten, klicken Sie auf "Abbrechen" und\n'+
			'anschließend oben auf "Speichern".');
			
			if(check) {
				eval(strAction);
				return true;
			}else{
				return false;
			}
			
		}else{
			eval(strAction);
		}
	}else{
		eval(strAction);
	}
	
}




//***************************************
//        SONSTIGES
//***************************************

var lastClass = "";
var lastRowClass = "";
	
function fieldFocus(obj) {
	lastClass = obj.className;
	obj.className = 'form_detail_active';
	if(parent.subnavi) {
		parent.subnavi.setSaveActive();
	}
	if(self.saveNeeded) {
		saveNeeded = 'yes';	
	}
}
		
function doSetSaveActive()
{
	if(parent.subnavi) 
	{
		parent.subnavi.setSaveActive();
	}
	if(self.saveNeeded) {
		saveNeeded = 'yes';	
	}		
}

function fieldBlur(obj) {
	obj.className = lastClass;
}

function optionOver(obj) {
	obj.style.cursor = 'hand';
	obj.style.cursor = 'pointer';
}

function rowOver(obj) {
	lastRowClass = obj.className;
    if(lastRowClass == 'bgGelb') {
    	obj.className = 'rowActiveGelb';
    }else{
        if(lastRowClass == 'bgHellblau'){
        	obj.className = 'rowActiveBlau';
        }else{
	        if(lastRowClass == 'bgHellrot'){
        		obj.className = 'rowActiveRot';
    	    }else{
        		obj.className = 'rowActive';
    	    }
        }
    }
}

function rowOut(obj) {
	obj.className = lastRowClass;
}

function changeOption(str) {
	top.document.myFormOptions.mode.value = str;
	top.document.myFormOptions.submit();
}





//***************************************
//        KALENDER
//***************************************

function openCalender(strField) {
	if(document.getElementById(strField)) {
		objField = document.getElementById(strField);
	    show_calendar(strField, objField.value);
		//alert('Kalender für ' + objField.id + ' öffnen.');
	}else{
		alert('Feld [' + strField + '] nicht gefunden.');	
	}	
}

// Title: Timestamp picker
// Description: See the demo at url
// URL: http://us.geocities.com/tspicker/
// Script featured on: http://javascriptkit.com/script/script2/timestamp.shtml
// Version: 1.0
// Date: 12-05-2001 (mm-dd-yyyy)
// Author: Denis Gritcyuk <denis@softcomplex.com>; <tspicker@yahoo.com>
// Notes: Permission given to use this script in any kind of applications if
//    header lines are left unchanged. Feel free to contact the author
//    for feature requests and/or donations

function show_calendar(str_target, str_datetime) {
	var arr_months = ["January", "February", "March", "April", "May", "June",
		"July", "August", "September", "October", "November", "December"];
	var week_days = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"];
	var n_weekstart = 1; // day week starts from (normally 0 or 1)

	var dt_datetime = (str_datetime == null || str_datetime =="" ?  new Date() : str2dt(str_datetime));
	var dt_prev_month = new Date(dt_datetime);
	dt_prev_month.setMonth(dt_datetime.getMonth()-1);
	var dt_next_month = new Date(dt_datetime);
	dt_next_month.setMonth(dt_datetime.getMonth()+1);
	var dt_firstday = new Date(dt_datetime);
	dt_firstday.setDate(1);
	dt_firstday.setDate(1-(7+dt_firstday.getDay()-n_weekstart)%7);
	var dt_lastday = new Date(dt_next_month);
	dt_lastday.setDate(0);
	
	// html generation (feel free to tune it for your particular application)
	// print calendar header
	var str_buffer = new String (
		"<html>\n"+
		"<head>\n"+
		"	<title>Calendar</title>\n"+
    "<style>A{text-decoration:none;}</style>"+
		"</head>\n"+
		"<body bgcolor=\"#FFFFFF\">\n"+
		"<table class=\"clsOTable\" cellspacing=\"0\" border=\"0\" width=\"100%\">\n"+
		"<tr><td bgcolor=\"#003399\">\n"+
		"<table cellspacing=\"1\" cellpadding=\"3\" border=\"0\" width=\"100%\">\n"+
		"<tr>\n	<td bgcolor=\"#003399\"><a href=\"javascript:window.opener.show_calendar('"+
		str_target+"', '"+ dt2dtstr(dt_prev_month)+"');\">"+
		"<img src=\"shared/images/kalender_prev.gif\" width=\"16\" height=\"16\" border=\"0\""+
		" alt=\"Previous month\"></a></td>\n"+
		"	<td bgcolor=\"#003399\" colspan=\"5\">"+
		"<font color=\"#FFCC66\" face=\"tahoma, verdana\" size=\"2\"><b>"
		+arr_months[dt_datetime.getMonth()]+" "+dt_datetime.getFullYear()+"</b></font></td>\n"+
		"	<td bgcolor=\"#003399\" align=\"right\"><a href=\"javascript:window.opener.show_calendar('"
		+str_target+"', '"+dt2dtstr(dt_next_month)+"');\">"+
		"<img src=\"shared/images/kalender_next.gif\" width=\"16\" height=\"16\" border=\"0\""+
		" alt=\"Next month\"></a></td>\n</tr>\n"
	);
  
	var dt_current_day = new Date(dt_firstday);
	// print weekdays titles
	str_buffer += "<tr>\n";
	for (var n=0; n<7; n++)
		str_buffer += "	<td bgcolor=\"#C3D9F8\">"+
		"<font color=\"#000000\" face=\"tahoma, verdana\" size=\"2\">"+
		week_days[(n_weekstart+n)%7]+"</font></td>\n";
	// print calendar table
	str_buffer += "</tr>\n";
	while (dt_current_day.getMonth() == dt_datetime.getMonth() ||
		dt_current_day.getMonth() == dt_firstday.getMonth()) {
		// print row heder
		str_buffer += "<tr>\n";
		for (var n_current_wday=0; n_current_wday<7; n_current_wday++) {
				if (dt_current_day.getDate() == dt_datetime.getDate() &&
					dt_current_day.getMonth() == dt_datetime.getMonth())
					// print current date
					str_buffer += "	<td bgcolor=\"#FFB6C1\" align=\"right\">";
				else if (dt_current_day.getDay() == 0 || dt_current_day.getDay() == 6)
					// weekend days
					str_buffer += "	<td bgcolor=\"#B3C2E1\" align=\"right\">";
				else
					// print working days of current month
					str_buffer += "	<td bgcolor=\"#ffffff\" align=\"right\">";

				if (dt_current_day.getMonth() == dt_datetime.getMonth())
					// print days of current month
					str_buffer += "<a href=\"javascript:window.opener.document.getElementById('"+str_target+
					"').value='"+dt2dtstr(dt_current_day)+"'; if(window.opener.document.getElementById('"+str_target+
					"').focus) window.opener.document.getElementById('"+str_target+
					"').focus(); window.close();\">"+
					"<font color=\"black\" face=\"tahoma, verdana\" size=\"2\">";
				else 
					// print days of other months
					str_buffer += "<a href=\"javascript:window.opener.document.getElementById("+str_target+
					").value='"+dt2dtstr(dt_current_day)+"'; if(window.opener.document.getElementById('"+str_target+
					"').focus) window.opener.document.getElementById('"+str_target+
					"').focus(); window.close();\">"+
					"<font color=\"gray\" face=\"tahoma, verdana\" size=\"2\">";
				str_buffer += dt_current_day.getDate()+"</font></a></td>\n";
				dt_current_day.setDate(dt_current_day.getDate()+1);
		}
		// print row footer
		str_buffer += "</tr>\n";
	}
	// print calendar footer
	str_buffer +=
		"<form name=\"cal\"></form>"+
		/*
		"<form name=\"cal\">\n<tr><td colspan=\"7\" bgcolor=\"#87CEFA\">"+
		"<font color=\"White\" face=\"tahoma, verdana\" size=\"2\">"+
		"Time: <input type=\"text\" name=\"time\" value=\""+dt2tmstr(dt_datetime)+
		"\" size=\"8\" maxlength=\"8\"></font></td></tr>\n</form>\n" +
		*/
		"</table>\n" +
		"</tr>\n</td>\n</table>\n" +
		"</body>\n" +
		"</html>\n";

	var vWinCal = window.open("", "Calendar", 
		"width=200,height=212,status=no,resizable=yes,top=200,left=200");
	vWinCal.opener = self;
	var calc_doc = vWinCal.document;
	calc_doc.write (str_buffer);
	calc_doc.close();
}
// datetime parsing and formatting routimes. modify them if you wish other datetime format
function str2dt (str_datetime) {
//	var re_date = /^(\d+)\.(\d+)\.(\d+)\s+$/;
	var re_date = /^(\d+)\/(\d+)\/(\d+)\s*$/;
	if (!re_date.exec(str_datetime))
		return alert("Ungültiges Datumsformat: "+ str_datetime);
	return (new Date (RegExp.$3, RegExp.$2-1, RegExp.$1));
}
function createTwoDigit(intNumber){
  return (intNumber < 10) ? '0'+intNumber : intNumber;
}
function dt2dtstr (dt_datetime) {
	return (new String (
			createTwoDigit(dt_datetime.getDate())+"/"+createTwoDigit((dt_datetime.getMonth()+1))+"/"+dt_datetime.getFullYear()+" "));
}
function dt2tmstr (dt_datetime) {
	return (new String (
			dt_datetime.getHours()+":"+dt_datetime.getMinutes()+":"+dt_datetime.getSeconds()));
}




//***************************************
//        SERIENMUSTER
//***************************************

  function checkBrowser(){
    this.ver=navigator.appVersion
    this.dom=document.getElementById?1:0
    this.mac=(this.ver.indexOf("Mac")>-1)?1:0;
    this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;
    this.ie4=(document.all && !this.dom)?1:0;
    this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0;
    this.ns4=(document.layers && !this.dom)?1:0;
    this.ie4mac=this.ie4 && navigator.userAgent.indexOf("Mac")>-1
    this.ns4mac=this.ns4 && navigator.appVersion.indexOf("Mac")>-1
    this.ie5mac=this.ie5 && navigator.userAgent.indexOf("Mac")>-1
    this.ie55=(this.ver.indexOf("MSIE 5.5")>-1 && this.dom)?1:0;
    this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom)?1:0;
    this.ns = ( this.ns4 || this.ns5 );
    this.ie = ( this.ie6 || this.ie5 || this.ie4 );
    this.bw=( this.dom ||  this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns5 || this.ie5mac)
    return this;
  }
  bw = new checkBrowser();
  
  function layerlib_error(s){
  	//uncomment for debugging...
    //alert(s);
  }
	
  function getlayer(divname) {
    if(bw.dom) return document.getElementById(divname);
    if(bw.ie4) return document.all[divname];
    if(bw.ns4) return window.document[divname];
    return null;
  }
	
  function getlayerstyle(divname) {
    var tmpObj = getlayer(divname);
    if (tmpObj) {
      if(bw.dom || bw.ie4) {
        return tmpObj.style;
      }
      if(bw.ns4) {
        return tmpObj;
      }
    }
    return null;
  }
	
  function setinvisible (divname) {
    var tmpObj = getlayerstyle(divname);
    if(tmpObj) {
      tmpObj.display="none";
    } else {
      //alert("setinvisible Cannot find '"+divname+"'.")
      layerlib_error("setinvisible: Cannot find '"+divname+"'.");
    }
  }
  
  function setInvisibleAll() {
	  if(typeof(arrDivs) != 'undefined') {
		  for(i=0;i<arrDivs.length;i++) {
			if(document.getElementById(arrDivs[i])) {
		  		setinvisible(arrDivs[i]);
			} 
		  }
	  }
  }
  
  function setvisible(divname) {
	setInvisibleAll();
    var tmpObj = getlayerstyle(divname);
    if(tmpObj) {
      tmpObj.display="";
      //alert("setvisible  '"+divname+"'.visibility="+tmpObj.visibility)
    } else {
      //alert("setvisible Cannot find '"+divname+"'.")
      layerlib_error("setvisible: Cannot find '"+divname+"'.");
    }
  }
  
  function getPos(el) 
{ 
   var pos = {left:0, top:0}; 
    
   var o = el; 
   while(o) 
   { 
   pos.top += o.offsetTop; 
   pos.left += o.offsetLeft; 
   o = o.offsetParent; 
   } 
   return pos; 
} 
  
  /*************************************************************************************************************
  *						Navigation
  *************************************************************************************************************/
  // Hilfsfunktion für weniger Quellcode
	function getE(obj) {
		return document.getElementById(obj);
	}
	
	// Verzeichnisstatus wechseln (öffnen oder schließen)
	function changeFolderNavi(strIDDivNavi, strIDtdNavi) {
		if(getE(strIDDivNavi).style.display == 'none') {
			openFolderNavi(strIDDivNavi, strIDtdNavi);
		}
	}
	
	// Verzeichnis öffnen
	function openFolderNavi(strIDDivNavi, strIDtdNavi) {
		//document.getElementById("menu1").style.height = 'auto';
		//document.getElementById("menu2").style.height = 'auto';
		//document.getElementById("menu3").style.height = 'auto';
		document.getElementById("menu1").style.display = 'none';
		document.getElementById("menu2").style.display = 'none';
		document.getElementById("menu3").style.display = 'none';
		document.getElementById("1").style.display = 'none';
		document.getElementById("2").style.display = 'none';
		document.getElementById("3").style.display = 'none';
		getE(strIDtdNavi).style.display = '';
		getE(strIDDivNavi).style.display = '';
		getE(strIDtdNavi).style.height = '100%';
	}
	function openFolderNaviFromFrame(strIDDivNavi, strIDtdNavi)
	{
		window.top.naviFrame.document.getElementById("menu1").style.display = 'none';
		window.top.naviFrame.document.getElementById("menu2").style.display = 'none';
		window.top.naviFrame.document.getElementById("menu3").style.display = 'none';
		window.top.naviFrame.document.getElementById("1").style.display = 'none';
		window.top.naviFrame.document.getElementById("2").style.display = 'none';
		window.top.naviFrame.document.getElementById("3").style.display = 'none';
		window.top.naviFrame.getE(strIDtdNavi).style.display = '';
		window.top.naviFrame.getE(strIDDivNavi).style.display = '';
		window.top.naviFrame.getE(strIDtdNavi).style.height = '100%';
	}
