// ********************************************
// Farbaustausch für Subnavigation
// ********************************************



var BGColorDefault = new Array();
var BGColorHighlight = new Array();
var BGColorActive = new Array();
var CurMenuItemID = new Array();


// Hauptnavigation links
BGColorDefault [0] = '#153B63';
BGColorHighlight [0] = '#1B528C';
BGColorActive [0] = '#2269B5';
CurMenuItemID [0] = '';

// Unterkategorie-Navigation rechts
BGColorDefault [1]= '#B4C6D9';
BGColorHighlight [1] = '#A0B7CF';
BGColorActive [1]= '#8CA8C5';
CurMenuItemID [1] = '';

// Produkt-Navigation rechts
BGColorDefault [2]= '#B4C6D9';
BGColorHighlight [2] = '#A0B7CF';
BGColorActive [2]= '#8CA8C5';
CurMenuItemID [2] = '';

// Produkdaten-Kategorie-Navigation mitte
BGColorDefault [3] = '#FFFFFF';
BGColorHighlight [3] = '#A0B7CF';
BGColorActive [3] = '#DFE9F4';
CurMenuItemID [3] = '';


document.write ('<style type="text/css">.script { display: block; }</style>');


function MenuHighlight (MenuItemID, Highlight, MenuID) { // Farbaustausch Mouseover

	if (document.getElementById) {
		var DocMenuItemTD = document.getElementById('menu' + MenuID + 'td' + MenuItemID);
		//alert('document.all.menu' + MenuID + 'td' + MenuItemID);
		var DocMenuItemTDp = document.getElementById('menu' + MenuID + 'td' + MenuItemID + 'p' );
		var Color = Highlight ? BGColorHighlight [MenuID] : BGColorDefault [MenuID];
		if (MenuItemID != CurMenuItemID [MenuID]) {
		  DocMenuItemTD.style.backgroundColor = Color;
		  DocMenuItemTDp.style.backgroundColor = Color;
		}
	}

} // function MenuHighlight


function PageStartup (MenuItemID, MenuID) {

  CurMenuItemID [MenuID] = MenuItemID;
  if (document.all && (navigator.userAgent.indexOf ('Opera') < 0) ) {
    var DocMenuItemTD = document.all['menu' + MenuID + 'td' + MenuItemID];
    var DocMenuItemTDp = document.all['menu' + MenuID + 'td' + MenuItemID + 'p'];
    if (DocMenuItemTD != null) {
      DocMenuItemTD.style.backgroundColor = BGColorActive [MenuID];
      DocMenuItemTDp.style.backgroundColor = BGColorActive [MenuID];
    }
  }

} // function PageStartup


/* -----------------------------------

   Funktionen für Such-Formular

----------------------------------- */

function submitForm () {

	//searchWin = openWindow (globalNeutralRoot + '/program/blank.htm', 438, 410, 20, 20, 'searchwin', wReturnWinHandle, wScrollBars + wResizable + wMenuBar + wLocationBar + wStatusBar);
	searchWin = openWindow('/blank.html', 438, 410, 20, 20, 'searchwin', wReturnWinHandle, wScrollBars + wResizable + wMenuBar + wLocationBar + wStatusBar);
	
	document.forms.searchform.submit ();
	searchWin.focus();
	return true;

} // function submitForm

/* -----------------------------------

   Allgemeine Funktionen

----------------------------------- */

var wScrollBars = 1;
var wResizable = 2;
var wLocationBar = 4;
var wMenuBar = 8;
var wStatusBar = 16;
var wDependent = 32;
var wReturnWinHandle = 64;
var wToolBar = 128;

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,' : '' );
  winToolBar = (winPropsEnable & wToolBar) ? 'toolbar=yes,' : ( (winPropsDisable & wToolBar ) ? 'toolbar=no,' : '' );
  
  newWin = window.open (winUrl, winName, 'left=' + winX + ',top=' + winY + ',innerWidth=' + winWidth + ',width=' + winWidth + ',innerHeight=' + winHeight + ',height=' + winHeight + ',' + winScrollBars + winResizable + winLocationBar + winMenuBar + winStatusBar + winDependent + winToolBar);
  newWin.focus();
  
  return (winPropsEnable & wReturnWinHandle) ? newWin : false;

} // function openWindow

function goToPage (targetUrl, targetWindow, keepCurWindow, keepFocus) {

  if (!targetWindow.closed) {
    targetWindow.location.href = targetUrl;
  }
  if (!keepCurWindow) window.parent.close();
  if (keepFocus) window.focus; else targetWindow.focus();
  return (targetWindow.closed) ? true : false;

} // function goToPage: use onclick="return goToPage (this, parent.opener, true, true);"


function printWindow () {

  if (window.print) window.print();

} // function printWindow

function getDirPath (URL) {

  var result = URL.substring(0,(URL.lastIndexOf('/')) + 1)
  return result

} // function getDirPath

function confirmDelete (id, unique, redirect) {

  if (confirm('Are you sure that you wish to delete this item?')) {
	window.location.href = getDirPath(window.location.href) + redirect + '?' + unique + '=' + id;
  }

} // function confirmDelete

function confirmMultiDelete (formName) {

  if (confirm('Are you sure that you wish to delete this item?')) {
	objForm = eval("document." + formName)
	objForm.submit();
  }

} // function confirmMultiDelete