
function content_layer() {

browser_version= parseInt(navigator.appVersion);
browser_type = navigator.appName;

document_offset = 200;

if ((navigator.userAgent.indexOf("Win") != -1)){

	if (browser_type == "Netscape") {
	
	document.write(' <div id="content" style="WIDTH: 530px; HEIGHT: '+(window.innerHeight-document_offset)+'px; overflow: auto; margin-top: 15px; padding: 0px 20px 0px 0px; line-height: 1.5em"> ');

	}
	
	else {
	
	document.write(' <div id="content" style="WIDTH: 530px; HEIGHT: '+(document.body.clientHeight-document_offset)+'px; overflow: auto; margin-top: 15px; padding: 0px 20px 0px 0px; line-height: 1.5em"> ');

	}
}

if (navigator.userAgent.indexOf('Mac') != -1){

	if (navigator.appName.indexOf('Microsoft') != -1) {
	
	document.write(' <div id="content" style="WIDTH: 520px; HEIGHT: '+(document.body.clientHeight-document_offset)+'px; overflow: auto; margin-top: 15px; padding: 0px 20px 0px 0px; line-height: 1.5em"> ');
	
	}
	
	else {
	
	document.write(' <div id="content" style="WIDTH: 520px; HEIGHT: '+(window.innerHeight-document_offset)+'px; overflow: auto; margin-top: 15px; padding: 0px 20px 0px 0px; line-height: 1.5em"> ');
	
	}
}

}

function set_content() {
	browser_version= parseInt(navigator.appVersion);
	browser_type = navigator.appName;

	if (browser_type == "Netscape") {
		document.getElementById('content').style.height=window.innerHeight-document_offset;
	}
	else {
		document.getElementById('content').style.height=document.body.clientHeight-document_offset;
	}
}

function swapImgRestore() { //v3.0
  var i,x,a=document.sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.p) d.p=new Array();
    var i,j=d.p.length,a=preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.p[j]=new Image; d.p[j++].src=a[i];}}
}

function findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function swapImage() { //v3.0
  var i,j=0,x,a=swapImage.arguments; document.sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=findObj(a[i]))!=null){document.sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.pgW=innerWidth; document.pgH=innerHeight; onresize=reloadPage; }}
  else if (innerWidth!=document.pgW || innerHeight!=document.pgH) location.reload();
}
reloadPage(true);

function FindObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=FindObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function tmt_findObj(n){
	var x,t; if((n.indexOf("?"))>0&&parent.frames.length){t=n.split("?");
	x=eval("parent.frames['"+t[1]+"'].document.getElementById('"+t[0]+"')");
	}else{x=document.getElementById(n)}return x;
}

function ShowHideLayers() { //v3.0A Modified by Al Sparber and Massimo Foti for NN6 Compatibility
  var i,p,v,obj,args=ShowHideLayers.arguments;if(document.getElementById){
   for (i=0; i<(args.length-2); i+=3){ obj=tmt_findObj(args[i]);v=args[i+2];
   v=(v=='show')?'visible':(v='hide')?'hidden':v;
   if(obj)obj.style.visibility=v;}} else{
  for (i=0; i<(args.length-2); i+=3) if ((obj=FindObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }}
}

function display_team(id) {

	if (document.getElementById(id).style.display == 'none') {
		document.getElementById(id).style.display='block';
	}
	else {
		document.getElementById(id).style.display='none';
	}
	
}

var active_project='p_0';

function display(id) {

	if (active_project!='p_0') {
		document.getElementById(active_project).style.display='none';
		if (document.getElementById('sd_'+active_project.substring(2))) {
			document.getElementById('sd_'+active_project.substring(2)).style.display='block';
		}
	}
	if (active_project==id) {
		active_project='p_0';
	}
	else {
		document.getElementById(id).style.display='block';
		if (document.getElementById('sd_'+id.substring(2))) {
			document.getElementById('sd_'+id.substring(2)).style.display='none';
		}
		active_project=id;
	}
}

function checkStelleCount(plattformId,maxCount) {
	var total = 0;
	var max = eval("document.myform.chk"+ plattformId +".length");
	for (var idx = 0; idx < max; idx++) {
		if (eval("document.myform.chk" + plattformId + "[" + idx + "].checked") == true) {
			total += 1;
		}
	}
	if (total<maxCount) {
		for (var idx = 0; idx < max; idx++) {
			eval("document.myform.chk" + plattformId + "[" + idx + "].disabled=false");
		}
	}
	else {
		for (var idx = 0; idx < max; idx++) {
			if (eval("document.myform.chk" + plattformId + "[" + idx + "].checked") == false) {
				eval("document.myform.chk" + plattformId + "[" + idx + "].disabled=true");
			}
		}
	}
}

function openPrint(id){
	window.open("printstelle.asp?id="+id,"printwindow","toolbar=no,location=no,directories=no,scrollbars=no,status=no,menubar=no,resizable=no,width=400,height=300")
}

function openPrint2(id){
	window.open("printspezialisten.asp","printwindow","toolbar=no,location=no,directories=no,scrollbars=no,status=no,menubar=no,resizable=no,width=400,height=600")
}

function openPrintKand(id){
	window.open("printmitarbeiter.asp?id="+id,"printwindow","toolbar=no,location=no,directories=no,scrollbars=no,status=no,menubar=no,resizable=no,width=400,height=300")
}

function toggle(branch) {
	navRoot=document.getElementById(branch);
	for (i=0; i<navRoot.childNodes.length; i++) {
		node = navRoot.childNodes[i];
		if (node.nodeName=="UL") {
			if (node.style.display == 'block') {
				node.style.display='none';
			}
			else {
				node.style.display='block';
			}
		}
	}
}

function expand_all(rootId) {
	var i;
	var navRoot=document.getElementById(rootId);
	if (navRoot.hasChildNodes()) {
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName=="UL") {
					node.style.display='block';
			}
			if (node.id) {
				expand_all(node.id);
			}
		}
	}
}

function collapse_all(rootId) {
	var i;
	var navRoot=document.getElementById(rootId);
	for (i=0; i<navRoot.childNodes.length; i++) {
		node = navRoot.childNodes[i];
		if (node.nodeName=="UL" && node.id!="u_") {
				node.style.display='none';
		}
		if (node.id) {
			collapse_all(node.id);
		}
	}
}

function togglecheckbox(chkthis,branch) {
	var i;
	var navRoot=document.getElementById(branch);
	for (i=0; i<navRoot.childNodes.length; i++) {
		node = navRoot.childNodes[i];
		if (node.nodeName=="INPUT") {
			node.checked=chkthis.checked;
		}
		if (node.id) {
			togglecheckbox(chkthis,node.id);
		}
	}
}

