// ********************************************
// Farbaustausch für Subnavigation
// ********************************************


var BGColorDefault = '#153B63';
var BGColorHighlight = '#1B528C';
var BGColorActive = '#2269B5';
var subBGColorDefault = '#B4C6D9';
var subBGColorHighlight = '#A0B7CF';
var subBGColorActive = '#8CA8C5';
var intBGColorDefault = '#FFFFFF';

var layerBGColorDefault = '#B4C6D9';
var layerBGColorHighlight = '#A0B7CF';
var layerBGColorActive = '#153B63';

var CurMenuItemID = '';
var subCurMenuItemID = '';

function MenuHighlight (MenuItemID, Highlight) { // Farbaustausch Mouseover

	if (document.all) {
		var DocMenuItemTD = eval ('document.all.menutd' + MenuItemID);
		var DocMenuItemTDp = eval ('document.all.menutd' + MenuItemID + 'p' );
		var Color = Highlight ? BGColorHighlight : BGColorDefault;	
		if (MenuItemID != CurMenuItemID) DocMenuItemTD.style.backgroundColor = Color;
		if (MenuItemID != CurMenuItemID) DocMenuItemTDp.style.backgroundColor = Color;
	}

} // function SubMenuHighlight


function SubMenuHighlight (MenuItemID, Highlight) { // Farbaustausch Mouseover

	if (document.all) {
		var DocMenuItemTD = eval ('document.all.menutd' + MenuItemID);
		var DocMenuItemTDp = eval ('document.all.menutd' + MenuItemID + 'p' );
		var Color = Highlight ? subBGColorHighlight : subBGColorDefault;
		if (MenuItemID != subCurMenuItemID) DocMenuItemTD.style.backgroundColor = Color;
		if (MenuItemID != subCurMenuItemID) DocMenuItemTDp.style.backgroundColor = Color;
	}

} // function IntMenuHighlight

function IntMenuHighlight (MenuItemID, Highlight) { // Farbaustausch Mouseover

	if (document.all) {
		var DocMenuItemTD = eval ('document.all.menutd' + MenuItemID);
		var DocMenuItemTDp = eval ('document.all.menutd' + MenuItemID + 'p' );
		var Color = Highlight ? subBGColorHighlight : intBGColorDefault;
		if (MenuItemID != subCurMenuItemID) DocMenuItemTD.style.backgroundColor = Color;
		if (MenuItemID != subCurMenuItemID) DocMenuItemTDp.style.backgroundColor = Color;
	}

} // function IntMenuHighlight

function layerMenuHighlight (MenuItemID, Highlight) { // Farbaustausch Mouseover

	if (document.all) {
		var DocMenuItemTD = eval ('document.all.menutd' + MenuItemID);
		var DocMenuItemTDp = eval ('document.all.menutd' + MenuItemID + 'p' );
		var Color = Highlight ? layerBGColorHighlight : layerBGColorDefault;
		if (MenuItemID != CurMenuItemID) DocMenuItemTD.style.backgroundColor = Color;
		if (MenuItemID != CurMenuItemID) DocMenuItemTDp.style.backgroundColor = Color;
	}

} // function layerMenuHighlight


function PageStartup (MenuID) { // Farbe der aktiven Seite

  CurMenuItemID = MenuID;
  if (document.all && (navigator.userAgent.indexOf ('Opera') < 0) ) {
    var DocMenuItemTD = document.all['menutd' + MenuID];
    var DocMenuItemTDp = document.all['menutd' + MenuID + 'p'];
    if (DocMenuItemTD != null) {
      DocMenuItemTD.style.backgroundColor = BGColorActive;
      DocMenuItemTDp.style.backgroundColor = BGColorActive;
    }
  }

} // function PageStartup


function SubPageStartup (MenuID) { // Farbe der aktiven Seite

  subCurMenuItemID = MenuID;
  if (document.all && (navigator.userAgent.indexOf ('Opera') < 0) ) {
    var DocMenuItemTD = document.all['menutd' + MenuID];
    var DocMenuItemTDp = document.all['menutd' + MenuID + 'p'];
    if (DocMenuItemTD != null) {
      DocMenuItemTD.style.backgroundColor = subBGColorActive;
      DocMenuItemTDp.style.backgroundColor = subBGColorActive;
    }
  }

} // function SubPageStartup

function layerPageStartup (MenuID) { // Farbe der aktiven Seite

  CurMenuItemID = MenuID;
  if (document.all && (navigator.userAgent.indexOf ('Opera') < 0) ) {
    var DocMenuItemTD = document.all['menutd' + MenuID];
    var DocMenuItemTDp = document.all['menutd' + MenuID + 'p'];
    if (DocMenuItemTD != null) {
      DocMenuItemTD.style.backgroundColor = layerBGColorActive;
      DocMenuItemTDp.style.backgroundColor = layerBGColorActive;
    }
  }

} // function layer PageStartup

function Sub3MenuHighlight (MenuItemID, Highlight) { // Farbaustausch Mouseover 3 Zellen

	if (document.all) {
		var DocMenuItemTD = eval ('document.all.menutd' + MenuItemID);
		var DocMenuItemTDp = eval ('document.all.menutd' + MenuItemID + 'p' );
		var DocMenuItemTDl = eval ('document.all.menutd' + MenuItemID + 'l' );
		var Color = Highlight ? BGColorHighlight : BGColorDefault;
		if (MenuItemID != CurMenuItemID) DocMenuItemTD.style.backgroundColor = Color;
		if (MenuItemID != CurMenuItemID) DocMenuItemTDp.style.backgroundColor = Color;
		if (MenuItemID != CurMenuItemID) DocMenuItemTDl.style.backgroundColor = Color;
	}

} // function SubMenuHighlight



function Sub3PageStartup (MenuID) { // Farbe der aktiven Seite 3 Zellen

  CurMenuItemID = MenuID;
  if (document.all && (navigator.userAgent.indexOf ('Opera') < 0) ) {
    var DocMenuItemTD = document.all['menutd' + MenuID];
    var DocMenuItemTDp = document.all['menutd' + MenuID + 'p'];
    var DocMenuItemTDl = document.all['menutd' + MenuID + 'l'];
    if (DocMenuItemTD != null) {
      DocMenuItemTD.style.backgroundColor = BGColorActive;
      DocMenuItemTDp.style.backgroundColor = BGColorActive;
      DocMenuItemTDl.style.backgroundColor = BGColorActive;
    }
  }

} // function SubPageStartup



/* -----------------------------------

   Allgemeine Funktionen

----------------------------------- */ 

var wScrollBars = 1;
var wResizable = 2;
var wLocationBar = 4;
var wMenuBar = 8;
var wStatusBar = 16;
var wDependent = 32;
var wReturnWinHandle = 64;

function openWindow (winUrl, winWidth, winHeight, winX, winY, winName, winPropsEnable, winPropsDisable) {
  
  winScrollBars = (winPropsEnable & wScrollBars) ? 'scrollbars=yes,' : ( (winPropsDisable & wScrollBars ) ? 'scrollbars=no,' : '' );
  winResizable = (winPropsEnable & wResizable) ? 'resizable=yes,' : ( (winPropsDisable & wResizable ) ? 'resizable=no,' : '' );
  winLocationBar = (winPropsEnable & wLocationBar) ? 'location=yes,' : ( (winPropsDisable & wLocationBar ) ? 'location=no,' : '' );
  winMenuBar = (winPropsEnable & wMenuBar) ? 'menubar=yes,' : ( (winPropsDisable & wMenuBar ) ? 'menubar=no,' : '' );
  winStatusBar = (winPropsEnable & wStatusBar) ? 'status=yes,' : ( (winPropsDisable & wStatusBar ) ? 'status=no,' : '' );
  winDependent = (winPropsEnable & wDependent) ? 'dependent=yes,' : ( (winPropsDisable & wDependent ) ? 'dependent=no,' : '' );

  newWin = window.open (winUrl, winName, 'left=' + winX + ',top=' + winY + ',innerWidth=' + winWidth + ',width=' + winWidth + ',innerHeight=' + winHeight + ',height=' + winHeight + ',' + winScrollBars + winResizable + winLocationBar + winMenuBar + winStatusBar + winDependent);

  return (winPropsEnable & wReturnWinHandle) ? newWin : false;
  
} // function openWindow


var popUpWin=0; 
function popUpWindow(URLStr, left, top, width, height) {
	if(popUpWin) {
		if(!popUpWin.closed) popUpWin.close(); 
	} 
	popUpWin = open(URLStr, 'popUpWin', 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=yes, width='+width+', height='+height+', left='+left+', top='+top+', screenX='+left+', screenY='+top+''); 
}

var popUpWinScroll=0; 
function popUpWindowScroll(URLStr, left, top, width, height) {
	if(popUpWinScroll) {
		if(!popUpWinScroll.closed) popUpWinScroll.close(); 
	} 
	popUpWinScroll = open(URLStr, 'popUpWinScroll', 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, copyhistory=yes, width='+width+', height='+height+', left='+left+', top='+top+', screenX='+left+', screenY='+top+''); 
}

// Funciones de mostrar y ocultar tablas

function ocultar_inicial() {
	var num_ini = 0;
	var num_elem = 0;
	while(document.getElementById("tabla" + num_elem)) {
		num_elem++;
	}
	for (num=num_ini; num<num_elem; num++){
		 var obj = document.getElementById("tabla" + num);
		 obj.style.display = "none";
	}
}
function ocultar(num) {
	var obj = document.getElementById("tabla" + num);
	obj.style.display = "none";
}
function mostrar(num_ver) {
	var num_ini = 0;
	var num_elem = 0;
	while(document.getElementById("tabla" + num_elem)) {
		num_elem++;
	}
	for (num=num_ini; num<num_elem; num++){
		 var obj = document.getElementById("tabla" + num);
		 obj.style.display = "none";
	}
	var obj = document.getElementById("tabla" + num_ver) ;
	obj.style.display = "block";
}

// Funciones de mostrar y ocultar tablas

function ocultar_inicial_mostrar_primero() {
	var num_ini = 1;
	var num_elem = 0;
	while(document.getElementById("tabla_mostrar_primero" + num_elem)) {
		num_elem++;
	}
	for (num=num_ini; num<num_elem; num++){
		 var obj = document.getElementById("tabla_mostrar_primero" + num);
		 obj.style.display = "none";
	}
}
function ocultar_mostrar_primero(num) {
	var obj = document.getElementById("tabla_mostrar_primero" + num);
	obj.style.display = "none";
}
function mostrar_mostrar_primero(num_ver) {
	var num_ini = 0;
	var num_elem = 0;
	while(document.getElementById("tabla_mostrar_primero" + num_elem)) {
		num_elem++;
	}
	for (num=num_ini; num<num_elem; num++){
		 var obj = document.getElementById("tabla_mostrar_primero" + num);
		 obj.style.display = "none";
	}
	var obj = document.getElementById("tabla_mostrar_primero" + num_ver) ;
	obj.style.display = "block";
}
