var bOK = (document.all || document.getElementById);  // kein document.layers Support!

if (document.all) {
	layerVar = "document.all"; 
	styleVar = ".style"; 
	visVar = "visible";
}

function showLayer(nr, anzLay) {

	if (bOK) {
		lay = 'c' + nr;
		hideAllLayers(anzLay);
		if (document.all) {
			thisLayer = eval(layerVar + '["' + lay + '"]' + styleVar);
			if (thisLayer) eval(layerVar + '["' + lay + '"]' + styleVar + '.visibility="visible"');
		} else if (document.getElementById) {
			thisLayer = document.getElementById(lay);
			thisLayer.style.visibility = "visible";
		}		
		changeMenuColor(nr, anzLay);
	}
}
     
function hideLayer(nr) {
	if (bOK) {
		if (document.all) {
			thisLayer = eval(layerVar + '["' + nr + '"]' + styleVar);
			if (thisLayer) eval(layerVar + '["' + nr + '"]' + styleVar + '.visibility="hidden"');
		} else if (document.getElementById) {
			thisLayer = document.getElementById(nr);
			if (thisLayer) thisLayer.style.visibility = "hidden";
		}
	}
}

function hideAllLayers(count) {
	if (bOK) {
		for ( i=1; i<=count; i++ ) {
			hideLayer( 'c' + i );	
		}
	}
}

function openWindow(theURL,winName,features) { 
  var wind = null;
  wind = window.open(theURL,winName,features);
}

function preloadImg(theSrc) {
	if (document.images) {
		if (document.preloadArray==null) document.preloadArray = new Array();
		var i = document.preloadArray.length;
		document.preloadArray[i] = new Image;
		document.preloadArray[i].src = theSrc;
	}
}

function loadImg(theImg,theSrc) {
	if (document.images) document.images[theImg].src = theSrc;
}

function changeMenuColor(show, total){
	for( i=1; i<=total; i++){
		id = 'img' + i;
		document.getElementById(id).src = "/images/page_nav.gif";		
	}
	id = 'img' + show;
	document.getElementById(id).src = "/images/page_nav1.gif";
}