if (document.getElementById) {
	ns = 0; ie = 0;
} else if (document.all) {
	ns = 0; ie = 1;
} else if (document.layers) {
	ns = 1; ie = 0;
}
function SendSearchForm() {
	document.forms.forSearch.submit();
}

var pagestartup_index=-1;

function PageStartUp(id) {
	if (pagestartup_index != -1) {
		old_pagestartup_index = pagestartup_index;
		pagestartup_index=id;
		MenuHighlight(old_pagestartup_index, false, 3);
		pagestartup_index=old_pagestartup_index;
	}
	if (document.getElementById(id)) {
		MenuHighlight(id, true, 3);
		pagestartup_index=id;
	}
}

// Browser-Fenster öffnen (V3)
function OpenWindow (URL, Width, Height, Left, Top, Name, Resizable, ScrollBars, MenuBar, ToolBar, LocationBar, BookmarkBar, StatusBar, Dependent, HotKeys) {

	// Vorsicht bei NN: Wird die MenuBar angezeigt, wird ab Breiten kleiner 303 die Fensterhöhe vom NN falsch berechnet.

	// Testen, ob Positions- und Größen-Parameter angegeben und nicht zu groß sind
	if ( (Top == null) || isNaN (Top) ) Top = 20;
	if ( (Left == null) || isNaN (Left) ) Left = 20;
	if ( (Height == null) || isNaN (Height) || (Height + Top > screen.availHeight - 10) ) Height = screen.availHeight - 10 - Top;
	if ( (Width == null) || isNaN (Width) || (Width + Left > screen.availWidth - 10) ) Width = screen.availWidth - 10 - Left;
	Name = (Name == null) ? '' : Name; // Name = Leerstring, wenn kein Name angegeben ist
	// Testen, ob alle Parameter vorhanden sind, sonst Default-Werte vergeben

	Resizable = ((Resizable == null) || (Resizable == true)) ? 'yes' : 'no';
	ScrollBars = ((ScrollBars == null) || (ScrollBars == true)) ? 'yes' : 'no';
	MenuBar = ((MenuBar == null) || (MenuBar == false)) ? 'no' : 'yes';
	ToolBar = ((ToolBar == null) || (ToolBar == false)) ? 'no' : 'yes';
	LocationBar = ((LocationBar == null) || (LocationBar == false)) ? 'no' : 'yes';
	BookmarkBar = ((BookmarkBar == null) || (BookmarkBar == false)) ? 'no' : 'yes';
	StatusBar = ((StatusBar == null) || (StatusBar == true)) ? 'yes' : 'no';
	Dependent = ((Dependent == null) || (Dependent == true)) ? 'yes' : 'no';
	HotKeys = ((HotKeys == null) || (HotKeys == true)) ? 'yes' : 'no';

	// Für IE Fenstergrößen extra berechnen, da IE "innerWidth" und "InnerHeight" nicht beachtet.
	if (document.all) {
		Height += 31; // 31 Pixel höher für Fensterrahmen und Titelleiste des Fensters
		Width = Width + 12; // 12 Pixel breiter für den Fensterrahmen
		Height = (Resizable == 'no') ? Height - 2 : Height; // Der Fensterrahmen von Nicht-"Resizable"-Fenstern ist 2 Pixel schmaler.
		Width = (Resizable == 'no') ? Width - 2 : Width; // dto.
		Width = (ScrollBars == 'yes') ? Width + 16 : Width;
		Height = (MenuBar == 'yes') ? Height + 29 : Height;
		Height = (ToolBar == 'yes') ? Height + 47 : Height;
		Height = (LocationBar == 'yes') ? Height + 29 : Height; 
		var BarCompensation = (MenuBar == 'yes') ? 1 : 0; // je "Bar"-Paar werden wiederum 5 Pixel eingespart
		BarCompensation = (ToolBar == 'yes') ? BarCompensation + 1 : BarCompensation;
		BarCompensation = (LocationBar == 'yes') ? BarCompensation + 1 : BarCompensation;
		BarCompensation = (BarCompensation < 1) ? 1 : BarCompensation;
		Height -= ( (BarCompensation - 1) * 5);
		Height = (StatusBar == 'yes') ? Height + 20 : Height;
		// Fenster wieder verkleinern, falls es jetzt wieder zu groß ist
		if (!Width || isNaN (Width) || (Width > screen.availWidth - 10)) Width = screen.availWidth - 10;
		if (!Height || isNaN (Height) || (Height > screen.availHeight - 10)) Height = screen.availHeight - 10;
	}
	
	// Fenster mit den gegebenen Parametern öffnen
	NewWindow = window.open(URL, Name, 'screenX=' + Left + ',screenY=' + Top 
	+ ',height=' + Height + ',width=' + Width + ',innerHeight=' + Height + ',innerWidth=' + Width
	+ ',resizable=' + Resizable + ',scrollbars=' + ScrollBars + ',menubar=' + MenuBar 
	+ ',toolbar=' + ToolBar + ',location=' + LocationBar + ',directories=' + BookmarkBar 
	+ ',status=' + StatusBar + ',dependent=' + Dependent);

	if (navigator.appVersion.indexOf ('MSIE 5.0')) NewWindow.focus (); // IE 5.0 bricht hier sonst ab

	URL += ''; // IE versteht die URL nur so als String ...

	// Für IE muss extra positioniert. Der Fenster-Zugriff wird aber verweigert, wenn eine 
	// komplette HTTP-Adresse aufgerufen wird ...

	if (!NewWindow.innerWidth && (URL.indexOf ('http://') < 0)) {
		NewWindow.moveTo (Left, Top);
	}

	NewWindow.focus (); // Fenster ganz nach vorn stellen, also Focus auf das Fenster
} // function OpenWindow

function MenuHighlight (cellId, Highlight, colorid) {
	if (cellId != pagestartup_index) {
		if (colorid == 8) {
			var BGColorDefault = '#CC0003';	// Bosch-telecom piros menuje
			var BGColorHighlight = '#CC7777';
		}	else if (colorid == 7) {
			var BGColorDefault = '#FFFFFF';	// car_equip/productkatalog
			var BGColorHighlight = '#A0B7CF';
		} else if (colorid == 6) {				// Diagnost alá
			var BGColorDefault = '#b4c6de';
			var BGColorHighlight = '#a4b6cd';
		} else if (colorid == 5) {				//Jobs
			var BGColorDefault = '#153B63';
			var BGColorHighlight = '#1b528c';	//#B4C6D9', '#A0B7CF', '#8CA8C5
		} else if (colorid == 4) {				//További Hírek
			var BGColorDefault = '#B4C6D9';
			var BGColorHighlight = '#A0B7CF';	//#B4C6D9', '#A0B7CF', '#8CA8C5
		} else if (colorid == 3) {				//PageStartUphoz
			var BGColorDefault = '#153b63';
			var BGColorHighlight = '#2269b5';
		} else if (colorid == 2) {			//További Hírek
			var BGColorDefault = '#FFFFFF';
			var BGColorHighlight = '#DFE9F4';
		} else if (colorid == 1) {			//News COLORS
			var BGColorDefault = '#DFE9F4';
			var BGColorHighlight = '#B4C6D9';
		} else {
			var BGColorDefault = '#153b63';
			var BGColorHighlight = '#1b528c';
		}
		var Color = Highlight ? BGColorHighlight : BGColorDefault;
		if (ns || ie) {
			eval(cellId+'.bgColor= "'+ Color +'"');
		} else {
			document.getElementById(cellId).bgColor = Color;
		}
	}
}

function partnerpopup() {
	contactfile="/scripts/windows/supply/partners/"
	params = "width=737,height=510,resizable=1,status=0,scrollbars=1,toolbar=1,location=0,directories=0,menubar=0"
	newwin = window.open( contactfile , "hsuche", params);
}

