var nn4=(document.layers)?true:false;
var nn6=(document.getElementById)?true:false;
var iex4=(document.all)?true:false;
var is_ope = (navigator.userAgent.toLowerCase().indexOf("opera")!=-1)?true:false;

var layers_arr = new Array('layprofil','layprojekte','layangebot','laylounge');

function write_text(id,text) {
	if (!iex4 && nn6) {
		for (i=0;i<document.getElementById(id).childNodes.length;i++){
			document.getElementById(id).removeChild(document.getElementById(id).childNodes[i]);
		}
		var newText=document.createTextNode(text);
		document.getElementById(id).appendChild(newText);
	}
	if (iex4) {
		document.all[id].innerText = text;
	}
}

function hide_layer(id,toplayer) {
    if (nn4) document.layers[toplayer].document.layers[id].visibility='hide';
    if (nn6) document.getElementById(id).style.visibility='hidden'; 
    if (iex4) document.all[id].style.visibility='hidden';
}

function show_layer(id,toplayer) {
    if (nn4) document.layers[toplayer].document.layers[id].visibility='show';
    if (nn6) document.getElementById(id).style.visibility='visible'; 
    if (iex4&&!is_ope) {
		document.all[id].style.filter="progid:DXImageTransform.Microsoft.Fade(duration=0.50)";
		document.all[id].filters[0].Apply();
		document.all[id].style.visibility='visible';
		document.all[id].filters[0].Play();
	}
}

function hide_layers(toplayer) {
	for (layer_id in layers_arr) {
		hide_layer(layers_arr[layer_id],toplayer);
	}
}
