// ########## Men&uuml;-Eintr&auml;ge (Änderungen siehe finanz.js.txt) #########
if (!cWebRoot) {var cWebRoot = "../";}
// Links die nicht der Kapitel Nomenklatur folgen sind so festzulegen:new Array('Strategie & Maßnahmen','Media@Komm','[http://www.bremen.de/verwaltungsreform/Kap7/Kap7_3.html]bremen.online',
var aMenus = new Array(
	new Array('[../pdf/Abschlussbericht_s_102-103_2002.pdf]Ortsgesetz','[../pdf/Abschlussberichtlang2002.pdf]Abschlussbericht (lang)','[../pdf/Abschlussbericht_Kurz2002.pdf]Abschlussbericht (kurz)'),
	new Array('[../pdf/Abschlussbericht_s_4-9_2002.pdf]Seit dem 19. Jahrhundert','[http://www.bremen.de/info/skp/ortsamt/west/geschichte_walle.htm]Vom "Gut Walle" bis heute'),
	new Array('[../pdf/Abschlussbericht_s_23-29_2002.pdf]Ortsteil Walle','[../pdf/Abschlussbericht_s_30-40_2002.pdf]Ortsteil Westend','[../pdf/Abschlussbericht_s_41-43_2002.pdf]Ortsteil Osterfeuerberg','[../pdf/Abschlussbericht_s_44-45_2002.pdf]Untersuchungsergebnisse'),
	new Array('[../pdf/Abschlussbericht_s_46_2002.pdf]Ziele','[../pdf/Abschlussbericht_s_47-48_2002.pdf]Maßnahmentypen','[../static/zeitplan.html]Zeitplan','[../pdf/Abschlussbericht_s_94-95_2002.pdf]Finanzierungsplan'),
	new Array() ,
    new Array('Modernisierung/Instandsetzung','Steuerliche Absetzung','Modernisierung&nbsp;von&nbsp;Mietwohnungen','Bau von Mietwohnungen','Energiesparmaßnahmen'), //Kapitel6
	new Array(),
	new Array(),
	new Array()	
);

// ############### Funktionen f&uuml;r Inhaltseiten ########################		
var nCurrentChapter = null;

function onPageLoad (nChapter, Frameset) {
	if (window.innerWidth == null ||(window.innerWidth != 0 && window.innerHeight != 0)) {
		if ((window.parent.isVerwaltungsreform)||(window.parent.isAusbildung)){}
		else{
			if (window.parent && window.parent.SenatorFuerFinanzen) {
				initSubMenus();
				nCurrentChapter = nChapter;
				if (parent.menu.setCurrent) parent.menu.setCurrent (nChapter);
				var oBgMenu = getLayer ('bgMenu');
				oBgMenu.set('background-image', cWebRoot + 'images/menuBalken_passiv.gif');
				if (document.layers && window.location.hash > '#') window.location = window.location.hash;
			}
			else{
				if (Frameset=='verwreform'){
					top.location.replace ('framesetVerwaltungsreform.html?Seite=' + escape(window.location.pathname+window.location.search+window.location.hash));
				}	
				if (Frameset=='ausbildung'){
					top.location.replace ('framesetAusbildung.html?Seite=' + escape(window.location.pathname+window.location.search+window.location.hash));
				}	
				if ((Frameset!='ausbildung')&&(Frameset!='verwreform')){
					top.location.replace (cWebRoot + 'frames.html?Seite=' + escape(window.location.pathname+window.location.search+window.location.hash));
				}
			}
		}
	}
}
//Parameter &uuml;bergeben, daß anderes Frameset aufgerufen wird
function getCurrentChapter (nMenu) {
	return (nCurrentChapter);
}

function initSubMenus() {
	if (window.innerWidth == null ||(window.innerWidth != 0 && window.innerHeight != 0)) {
		if ((!window.parent.isAusbildung)||(!window.parent.isVerwaltungsreform)){
			var nMaxLen = 0;
			for (var i=0; i<aMenus.length; i++) nMaxLen = Math.max (nMaxLen, aMenus[i].length);
	
			//Menü-Layer
			for (var nMenu=0; nMenu<aMenus.length; nMenu++) {
				var cMenuHTML = "";
				cMenuHTML = cMenuHTML + '<table width="235" border="0" cellspacing="0" cellpadding="0">';
				for (var nItem=0; nItem<aMenus[nMenu].length; nItem++) {
					var cItem = aMenus[nMenu][nItem];
					if (cItem.charAt(0) == '[') cItem = cItem.substr (cItem.indexOf(']')+1);
					cMenuHTML = cMenuHTML + '<tr><td width="25" height="24">&nbsp;</td><td width="200" height="24">';
					cMenuHTML = cMenuHTML + '<p align="left"><font color="#003366" face="Arial, Helvetica, sans-serif" size="2" class="submenu">';
					cMenuHTML = cMenuHTML + cItem + '</font></p></td></tr>';
				}
				cMenuHTML = cMenuHTML + '</table>';
				var oMenu = getLayer ('Menu' + nMenu);
				//alert('Menu'+nMenu+' cMenuHTML' + cMenuHTML);
				oMenu.replaceContent(cMenuHTML);
				oMenu.set('visibility', false);
			}
			
			//Klick-Layer
			var cInvisibleHTML = "";
			cInvisibleHTML = cInvisibleHTML + '<table cellspacing="0" cellpadding="0" border="0">';
			for (var j=0; j<nMaxLen; j++) 
				cInvisibleHTML = cInvisibleHTML + '<tr><td><a href="Javascript:clickSub(' + j + ')" onMouseOver="return overSub(' + j + ')" onMouseOut="return outSub()"><img src="' + cWebRoot + 'images/leer.gif" width="250" height="24" border="0"></a></td></tr>';
			cInvisibleHTML = cInvisibleHTML + '</table>';
			var oInvisible = getLayer ('invisibleMenu');
			oInvisible.replaceContent(cInvisibleHTML);
			oInvisible.set('visibility', false);
			
			//Auswahl-Layer
			var cSelectionHTML = '<img src="' + cWebRoot + 'images/menuBalken_aktiv.gif">';
			var oSelection = getLayer ('selectionMenu');
			oSelection.replaceContent(cSelectionHTML);
			oSelection.set('visibility', false);
			
			//Hintergrund-Layer
			var cBgHTML = '<img src="' + cWebRoot + 'images/leer.gif" width=250 height=480 border=0>';
			var oBg = getLayer ('bgMenu');
			oBg.replaceContent(cBgHTML);
			oBg.set('visibility', false);
		}
	}
}

function overSub (nSub){
	var oBgMenu = getLayer ('bgMenu');
	var oSelector = getLayer ('selectionMenu');
	oSelector.set ('top', oBgMenu.get('top') + nSub*24);
	oSelector.set ('left', oBgMenu.get('left'));
	oSelector.set ('visible', true);
	parent.menu.overMenu(null, 3);
	window.status = '';
	return true;
}

function outSub (){
	var oSelector = getLayer ('selectionMenu');
	oSelector.set ('visible', false);
	parent.menu.outMenu(null, 3);
	window.status = '';
	return true;
}

function clickSub (nSub) {
	if (parent.menu.getSelectedMenu) {
		var nKap = parent.menu.getSelectedMenu();
		if (nKap != null) {
			var cItem = aMenus[nKap][nSub];
			if (cItem.charAt(0) == '[') {
				cItem = cItem.substr(1, cItem.indexOf(']')-1);
				var oWin = window.open (cItem, 'Extern');
				if (oWin.focus) oWin.focus();
			}
			
			else			
					window.location = cWebRoot + 'Kap' + (nKap+1) + '/Kap' + (nKap+1) + '_' + (nSub + 1) + '.html';
		}
	}
}

// ################### globale Funktionen #################################		

var __isIE;		
function isIE() {
	if (__isIE == null) __isIE = window.navigator.userAgent.indexOf("MSIE") > 0
	return (__isIE); 
}

var __isIE5;
function isIE5() {
	if (__isIE5 == null) __isIE5 = isIE() && window.print;
	return (__isIE5); 
}

var __isW3C;
function isW3C() {
	if (__isW3C == null) __isW3C = document.documentElement;
	return (__isW3C);
}

function getLayer (n) {
	var oLayer = null;
	if (isIE()) {
		oLayer = document.all.tags('div')[n];
		if (oLayer) {
			oLayer.style.parent = oLayer;
			oLayer = oLayer.style;
		}
	}
	else oLayer = _getNsLayer (n);
	if (oLayer) {
		oLayer = initLayer(oLayer);
		oLayer.set ('id', n);
	}
	return (oLayer);
}

// Implementierung für Netscape
function _getNsLayer (n, oParent) {
	var oLayers, oLayer;
	if (oParent == null) oLayers = document.layers;
	else oLayers = oParent.document.layers;
	if (n > 0) { if (n < oLayers.length) oLayer = oLayers[n]; }
	else oLayer = eval('oLayers.' + n);
	for (var i=0; !oLayer && i < oLayers.length; i++)
		oLayer = _getNsLayer (n, oLayers[i]);
	return (oLayer);
}

function initLayer (oLayer) {
	if (!oLayer.get) {
		oLayer.get								= Layer2_get;
		oLayer.set								= Layer2_set;
		oLayer.clipp							= Layer2_clipp;
		oLayer.replaceContent				= Layer2_replaceContent;
	}
	return (oLayer);
}


function Layer2_get (cVar) {
	var Value;
	switch (cVar.toLowerCase()) {
		case 'name':
		case 'id':
			Value = (isIE() ? this.ID : this.name); break;
		case 'left':
			Value = (isIE() ? this.posLeft : this.left); break;
		case 'top':
			Value = (isIE() ? this.posTop : this.top); break;
		case 'visible':
		case 'visibility':
			Value = (this.visibility.substr(0, 3) != 'hid'); break;
		default:
			Value = eval('this.' + cVar);
	}
	return (Value);
}

function Layer2_set (cVar, Value) {
	cVar = cVar.toLowerCase();
	switch (cVar) {
		case 'visible':
		case 'visibility':
			Value = (isIE() ? (Value ? 'visible' : 'hidden') : (Value ? 'show' : 'hide'));
			this.visibility = Value; 
			break;
		case 'background-image':
		case 'backgroundimage':
			if (isIE()) this.backgroundImage = "url(" + Value + ")";
			else this.background.src = Value;
			break;
		case 'clip':
			if (isIE()) {
				Value = 'rect(' + Value.top + 'px ' + (Value.width+Value.left) + 'px ' + (Value.height+Value.top) + 'px ' + Value.left + ')';
				this.clip = Value;
			}
			else {
				this.clip.left = Value.left;
				this.clip.top  = Value.top;
				this.clip.right = Value.left + Value.width;
				this.clip.bottom = Value.top + Value.height;
			}
			break;

		default:
			eval('this.' + cVar + '=Value');
	}
	return (Value);
}

function Layer2_clipp (nClipLeft, nClipTop, nClipWidth, nClipHeight) {
	this.set ('clip', new Rect(nClipLeft, nClipTop, nClipWidth, nClipHeight));
}

function Layer2_replaceContent (cContent) {
	if ((navigator.userAgent.indexOf("Mac") != -1) && (navigator.userAgent.indexOf("MSIE 5.0") != -1)){
		cContent = cContent + '\n'
	}
	if (isIE() || isW3C()){
		this.parent.innerHTML = cContent;
	}
	else {
		this.document.open();
   	this.document.writeln(cContent);
   	this.document.close();
	}
}

function Rect(left, top, width, height) {
	this.left = left;
	this.top  = top;
	this.width = width;
	this.height = height;
}

function getDocumentImage (cImageName) {
	var oImg = document.images[cImageName];
	if (oImg == null && document.layers) 
		for (var i=0; i<document.layers.length; i++) {
			oImg = document.layers[i].document.images[cImageName];
			if (oImg != null) return (oImg);
		}
	return (oImg);
}

