<!--
function Check(Eingabe)
{
	var nur_das ="0123456789[]()-+*%/.";
	for (var i = 0; i < Eingabe.length; i++)
		if (nur_das.indexOf(Eingabe.charAt(i))<0 ) return false;
	return true;
}
function Ergebnis()
{
	var x = 0;
	if (Check(window.document.mainform.Display.value))
		x = eval(window.document.mainform.Display.value);
	window.document.mainform.Display.value = x;
}

function Hinzufuegen(Zeichen)
{
   window.document.mainform.Display.value =
   window.document.mainform.Display.value + Zeichen;
}
function Sonderfunktion(Funktion)
{
	if (Check(window.document.mainform.Display.value))
	{
		if(Funktion == "sqrt")
		{
			var x = 0;
			x = eval(window.document.mainform.Display.value);
			window.document.mainform.Display.value = Math.sqrt(x);
		}
   		if(Funktion == "pow")
   		{
			var x = 0;
			x = eval(window.document.mainform.Display.value);
			window.document.mainform.Display.value = x * x;
		}
		if(Funktion == "log")
		{
			var x = 0;
			x = eval(window.document.mainform.Display.value);
			window.document.mainform.Display.value = Math.log(x);
		}
	}
	else
		window.document.mainform.Display.value = 0
}

function senden(nDLG)
{
	document.mainform.DLG.value = nDLG;
	document.mainform.submit();
}	

function senden1(nDLG, nPage, nRec)
{
	document.mainform.DLG.value = nDLG;
	document.mainform.page.value = nPage;
	document.mainform.htrec.value = nRec;
	document.mainform.submit();
}	

function senden2(nDLG, nRec) //--> kann weg, nur noch zur Sicherheit da
{
	document.mainform.DLG.value = nDLG;
	document.mainform.htrec.value = nRec;
	document.mainform.submit();
}	

function senden3(nDLG, nRec, cLang, cPrint)
{
	document.mainform.DLG.value = nDLG;
	document.mainform.htrec.value = nRec;
	document.mainform.lang.value = cLang;
	document.mainform.print.value = cPrint;
	document.mainform.submit();
}


function senden4(nDLG, nRec, cBild, cLang, cPrint)
{
	document.mainform.DLG.value = nDLG;
	document.mainform.htrec.value = nRec;
	document.mainform.Bild.value = cBild;
	document.mainform.lang.value = cLang;
	document.mainform.print.value = cPrint;
	document.mainform.submit();
}

function setdlg(nDLG)
{
	document.mainform.DLG.value = nDLG;
}	



function KopfLink(stext, simage, slink)
{
	var se = '';
	var imagepath='/Dateien/';
	var target='hauptfenster.';

	target='frames[1].';
	if (stext=="Portal")
		target = 'top.';
	se  ='<td class=portalnavi colSpan=2 onMouseOver="javascript:high1(this);status=\'' + stext + '\';return true;"\n';
        se +='onMouseOut="javascript:low1(this);status=\'\';return true;" onClick="javascript:parent.' + target + 'location.href=\'' + slink + '\'">\n';
        se +='<table cellSpacing=0 cellPadding=0 border=0><tr>\n';
        if (simage == "")
        	simage = "ico_arrow_right_xp.gif";
        se +='<td width="26" align="middle"><img alt="" src="' + imagepath + simage + '"></td>\n';
        se +='<td width="74" class="navtext">' + stext + '</td>\n';
        se +='</tr></table></td>\n';
	document.write(se);
}

function NeuLink(stext, simage, slink)
{
	var se = '';
	var imagepath='/Dateien/';
	var target='hauptfenster.';

	if (stext=="Seidel homepage")
		target = 'top.';
	se  ='<td class=portalnavi colSpan=2 onMouseOver="javascript:high1(this);status=\'' + stext + '\';return true;"\n';
        se +='onMouseOut="javascript:low1(this);status=\'\';return true;" onClick="javascript:oeffnen(\'' + slink + '\')">\n';
        se +='<table cellSpacing=0 cellPadding=0 border=0><tr>\n';
        if (simage == "")
        	simage = "ico_arrow_right_xp.gif";
        se +='<td width="26" align="middle"><img alt="" src="' + imagepath + simage + '"></td>\n';
        se +='<td width="114" class="navtext">' + stext + '</td>\n';
        se +='</tr></table></td>\n';
	document.write(se);
}

function PrintReiter(stext)
{
	var se = '';
	var imagepath='/Dateien/';

	se  ='<table border="0" cellpadding="0" cellspacing="0"><tr><td height="20" class="reitertext">';
	se +='<img src="'+ imagepath +'1ptrans.gif" width="7" height="1" alt="" /><b>' + stext + '</b>';
	se +='<img src="'+ imagepath +'1ptrans.gif" width="24" height="1" alt="" /></td>';
	se +='<td rowspan="2" class="schattenrechts" valign="top">';
	se +='<img src="'+ imagepath +'bg_sh_ecke_or.gif" width="6" height="6" alt="" /></td>';
	se +='</tr><tr><td><img src="'+ imagepath +'1ptrans.gif" width="1" height="1" alt=""></td></tr></table>';
	
	document.write(se);
}

function high(LinkObject)	{
	LinkObject.style.background='rgb(122,187,255)';
	LinkObject.style.border='solid';
	LinkObject.style.borderWidth='1px';
	LinkObject.style.borderColor='rgb(49,106,197)';
}

function low(LinkObject)	{
	LinkObject.style.background='rgb(227,224,221)';
	LinkObject.style.border='solid';
	LinkObject.style.borderWidth='1px';
	LinkObject.style.borderColor='rgb(227,224,221)';
}

function high1(LinkObject)	{
	LinkObject.style.background='rgb(239,119,119)';
	LinkObject.style.border='solid';
	LinkObject.style.borderWidth='1px';
	LinkObject.style.borderColor='rgb(175,15,10)';
}

function low1(LinkObject)	{
	LinkObject.style.background='rgb(255,255,255)';
	LinkObject.style.border='solid';
	LinkObject.style.borderWidth='1px';
	LinkObject.style.borderColor='rgb(255,255,255)';
}

function high2(Objekt)	{
	Objekt.style.backgroundColor='rgb(255,255,255)';
	return;
}

function low2(Objekt, Farbe)	{
	Objekt.style.backgroundColor=Farbe;
	return;
}
function GoForIt(wohin)	{
	if(wohin == "nolink")	{
  		return;
	}
	else	{
		window.location.href = wohin;
	}
}

function oeffnen(wohin) {
	F1 = window.open(wohin,"Fenster1","width=850,height=570,resizable,dependant=yes,scrollbars,status=no");
}


//--> ab hier : cascading menu
  function InitMenu()
   {
     var bar = menuBar.children     

     for(var i=0;i < bar.length;i++) 
        {
          var menu=eval(bar[i].menu)
          menu.style.visibility = "hidden"
          bar[i].onmouseover = new Function("ShowMenu("+bar[i].id+")")
          var Items = menu.children
          for(var j=0; j<Items.length; j++)
            {
              var menuItem = eval(Items[j].id)
                
                if(menuItem.menu != null)
                   { 
                    menuItem.innerHTML += "<Span Id="+menuItem.id+"_Arrow class='Arrow'>4</Span>"
                    //var tmp = eval(menuItem.id+"_Arrow")
                    // tmp.style.pixelLeft = menu.getBoundingClientRect().Right //- tmp.offsetWidth - 15
                    FindSubMenu(menuItem.menu)}
               
                 if(menuItem.cmd != null) 
                   {
                   menuItem.onclick = new Function("Do("+menuItem.id+")") } 
                   
              menuItem.onmouseover = new Function("highlight("+Items[j].id+")")
            
            }    
        
        }  
   }
   function FindSubMenu(subMenu)
   {
         var menu=eval(subMenu)
         var Items = menu.children
          for(var j=0; j<Items.length; j++)
            {
              menu.style.visibility = "hidden"
              var menuItem = eval(Items[j].id)
              
              
              if(menuItem.menu!= null)
                 {
                    menuItem.innerHTML += "<Span Id="+menuItem.id+"_Arrow class='Arrow'>4</Span>"
                    // var tmp = eval(menuItem.id+"_Arrow")
                    //tmp.style.pixelLeft = 35 //menuItem.getBoundingClientRect().right - tmp.offsetWidth - 15
                    FindSubMenu(menuItem.menu)
                 }

                 if(menuItem.cmd != null) 
                   {
                   menuItem.onclick = new Function("Do("+menuItem.id+")") } 
                  
              menuItem.onmouseover = new Function("highlight("+Items[j].id+")")
                 
            }  
   } 
   function ShowMenu(obj)
   {
     HideMenu(menuBar)
     var menu = eval(obj.menu)
     var bar = eval(obj.id)
     bar.className="barOver"
     menu.style.visibility = "visible"
     menu.style.pixelTop =  obj.getBoundingClientRect().top + obj.offsetHeight + Bdy.scrollTop
     menu.style.pixelLeft = obj.getBoundingClientRect().left + Bdy.scrollLeft
   }
   
   function highlight(obj)
   {
     var PElement = eval(obj.parentElement.id)
     if(PElement.hasChildNodes() == true)
     {  var Elements = PElement.children
       for(var i=0;i<Elements.length;i++)
       {
          TE = eval(Elements[i].id)
          TE.className = "menuItem"
       }
      } 
     obj.className="ItemMouseOver"
     window.defaultStatus = obj.title
     ShowSubMenu(obj)
   }
   
   function Do(obj)
   {
    var cmd = eval(obj).cmd	
    window.navigate(cmd)
     
   }
   
   function HideMenu(obj)
   {
          if(obj.hasChildNodes()==true)
              {  
                 var child = obj.children     
                 
                 for(var j =0;j<child.length;j++)
                  {
                     if (child[j].className=="barOver")
                     {var bar = eval(child[j].id)
                      bar.className="Bar"}
                      
                     if(child[j].menu != null)
                       {
                          var childMenu = eval(child[j].menu)
                          if(childMenu.hasChildNodes()==true) 
                               HideMenu(childMenu)
                          
                           childMenu.style.visibility = "hidden" 
                         }
                  }
              
              }
   }
  function ShowSubMenu(obj)
  {
     PMenu = eval(obj.parentElement.id)
      HideMenu(PMenu)
     if(obj.menu != null)
     {
     var menu = eval(obj.menu)
     menu.style.visibility = "visible"
     menu.style.pixelTop =  obj.getBoundingClientRect().top + Bdy.scrollTop
     menu.style.pixelLeft = obj.getBoundingClientRect().right + Bdy.scrollLeft
     if(menu.getBoundingClientRect().right > window.screen.availWidth )
       menu.style.pixelLeft = obj.getBoundingClientRect().left - menu.offsetWidth
    }
  } 
//--> bis hier : cascading menu
//-->
