function NewWindow(mypage, myname, w, h, scroll ) {
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2 -50;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable'
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

function submitForm(s) {
   s.value = "Bitte haben Sie etwas Geduld, Ihre Anfrage wird verarbeitet ...";
   s.disabled=true;
   return true;
   }


function jumpMenu(targ,selObj,restore){
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;}




function position_left(obj) {
 if (obj.offsetParent == null) {
     return obj.offsetLeft;
  } else {
     return obj.offsetLeft + position_left(obj.offsetParent);
     return obj.offsetLeft + position_left(obj.offsetParent);
  }
}

function position_top(obj) {
 if (obj.offsetParent == null) {
     return obj.offsetTop;
  } else {
      return obj.offsetTop + position_top(obj.offsetParent);
  }
}


function findPos(obj) {
	var curleft = curtop = 0;
	if (obj.offsetParent) {
		curleft = obj.offsetLeft
		curtop = obj.offsetTop
		while (obj = obj.offsetParent) {
			curleft += obj.offsetLeft
			curtop += obj.offsetTop
		}
	}
	return [curleft,curtop];
}

function ShowHide(navTable, id) {
    if (!document.getElementsByTagName) return;
    obj = document.getElementsByTagName("div");
    tables = document.getElementsByTagName("div");
    if (obj[id].style.visibility == 'visible'){
        //obj[id].style.visibility = 'hidden';
    }else {
       obj[id].style.top = position_top(tables[navTable]) + 20 + 'px';
       obj[id].style.left = position_left(tables[navTable]) + 0  + 'px';
       obj[id].style.visibility = 'visible';
     }
}

function ShowHideMenu(navTd, id) {
    if (!document.getElementsByTagName) return;
    obj = document.getElementsByTagName("div");
    tds = document.getElementsByTagName("td");
    var browserName=navigator.appName; 
    if (obj[id].style.visibility == 'visible'){
       //obj[id].style.visibility = 'hidden';
     }else {
        obj[id].style.top = position_top(tds[navTd]) - 1 + 'px';
        obj[id].style.left = position_left(tds[navTd]) + 159 + 'px';
        obj[id].style.visibility = 'visible';
     }
}

function getRealLeft(el) {
  if (el) {xPos = el.offsetLeft;
           tempEl = el.offsetParent;
           while (tempEl != null) {
               xPos += tempEl.offsetLeft;
               tempEl = tempEl.offsetParent;}
           return xPos;}}

function getRealTop(el) {
   if (el) {
      yPos = el.offsetTop;
      tempEl = el.offsetParent;
      while (tempEl != null) {
         yPos += tempEl.offsetTop;
         tempEl = tempEl.offsetParent;}
      return yPos;}} 

function ShowHideSubMenu(menuID, parentDIV, topPixel) {
    if (!document.getElementById) return;
    var browserName=navigator.appName;
    subMenu = document.getElementById(menuID); 
    ParentMenu = document.getElementById(parentDIV); 

    var leftOffset= ParentMenu.offsetLeft + 150;
    var topOffset= -21 + topPixel;
 
   if (subMenu.style.visibility == 'visible'){
        //obj.style.visibility = 'hidden';
     }else {
        subMenu.style.top = topOffset + 0 + 'px';
        subMenu.style.left = leftOffset + 0 + 'px';
        subMenu.style.visibility = 'visible';}}

function HideAll() {
    if (!document.getElementsByTagName) return;
    obj = document.getElementsByTagName("div");
    for (i=0; i < obj.length; i++){if (obj[i].id.match(/^menu.*/i)){obj[i].style.visibility = 'hidden';}}}

function HideAllSubMenus() {
    if (!document.getElementsByTagName) return;
    obj = document.getElementsByTagName("div");
    for (i=0; i < obj.length; i++){if (obj[i].id.match(/^SubMenuID.*/i)){obj[i].style.visibility = 'hidden';}}}

function Hide(id) {
    if (!document.getElementsByTagName) return;
    obj = document.getElementsByTagName("div");
    obj[id].style.visibility = 'hidden';}

var marked_row = new Array;
function setPointer(theRow, theRowNum, theAction, theDefaultColor, thePointerColor, theMarkColor){
    var theCells = null;
    if ((thePointerColor == '' && theMarkColor == '') || typeof(theRow.style) == 'undefined') {return false;}
    if (typeof(document.getElementsByTagName) != 'undefined') {theCells = theRow.getElementsByTagName('td');}
    else if (typeof(theRow.cells) != 'undefined') {theCells = theRow.cells;}
    else {return false;}
    var rowCellsCnt  = theCells.length;
    var domDetect    = null;
    var currentColor = null;
    var newColor     = null;
    if (typeof(window.opera) == 'undefined' && typeof(theCells[0].getAttribute) != 'undefined') {currentColor = theCells[0].getAttribute('bgcolor');domDetect    = true;}
    else {currentColor = theCells[0].style.backgroundColor; domDetect    = false; }
    if (currentColor == '' || currentColor.toLowerCase() == theDefaultColor.toLowerCase()) {
        if (theAction == 'over' && thePointerColor != '') {newColor = thePointerColor;}
        else if (theAction == 'click' && theMarkColor != '') {newColor = theMarkColor; marked_row[theRowNum] = true;}}
    else if (currentColor.toLowerCase() == thePointerColor.toLowerCase() && (typeof(marked_row[theRowNum]) == 'undefined' || !marked_row[theRowNum])) {
        if (theAction == 'out') {newColor = theDefaultColor;}
        else if (theAction == 'click' && theMarkColor != '') {newColor = theMarkColor; marked_row[theRowNum] = true;}}
    else if (currentColor.toLowerCase() == theMarkColor.toLowerCase()) {
        if (theAction == 'click') {
            newColor = (thePointerColor != '')
                                  ? thePointerColor
                                  : theDefaultColor;
            marked_row[theRowNum] = (typeof(marked_row[theRowNum]) == 'undefined' || !marked_row[theRowNum])
                                  ? true
                                  : null;
        }}
    if (newColor) {
        var c = null;
        if (domDetect) {
            for (c = 0; c < rowCellsCnt; c++) {
                theCells[c].setAttribute('bgcolor', newColor, 0);}}
        else {
            for (c = 0; c < rowCellsCnt; c++) {
                theCells[c].style.backgroundColor = newColor;}}}
    return true;} 
