arrNav=new Array()
arrNav[1]=0;
arrNav[2]=0;
arrNav[3]=5;
//arrNav[4]=4;
arrNav[4]=3;
arrNav[5]=3;

var firstload=true;
var oldNav=0;
var oldNavSub=0;
var oldNavSubVis=0;
var aktNav=0;
var aktNavSub=0;
var aktNavSubVis=0;
var iSub=undefined;
var tSub=undefined;
var aktsw=0;
var aktsh=0;
function setSubTo()
{
	tSub=setTimeout("doNav(document.getElementById('NAV_1'))",500);
}

function clearSubTo()
{
	try{clearTimeout(tSub);}catch(e){}
}
function doNav(obj)
{
	if(aktNav>0 && aktNav!=obj.id.substr(4)*1){
		if(oldNav>0){
			for(i=1;i<=arrNav[oldNav];i++){
					document.getElementById("NAV_"+oldNav+"_"+i).style.opacity=".0";
					document.getElementById("NAV_"+oldNav+"_"+i).style.filter = "alpha(opacity=0)";
			}
		}
		oldNav=aktNav;
		oldNavSub=aktNavSub;
		oldNavSubVis=aktNavSubVis;
		aktNav=0;
		aktNavSub=0;
		aktNavSubVis=0;		
	}
	aktNav=obj.id.substr(4)*1;
}

function doSub()
{
	if(aktNav>0){
		if(arrNav[aktNav]>0){
			if(aktNavSub==0 || aktNavSubVis==100){
				aktNavSubVis=0;
				aktNavSub++;
			}
			if(aktNavSub<=arrNav[aktNav]){
				aktNavSubVis=aktNavSubVis+50;
					document.getElementById("NAV_"+aktNav+"_"+aktNavSub).style.opacity=(aktNavSubVis/100);
					document.getElementById("NAV_"+aktNav+"_"+aktNavSub).style.filter = "alpha(opacity="+aktNavSubVis+")";
			}
		}
	}
	if(oldNav>0){
		if(arrNav[oldNav]>0){
			if(oldNavSub>0 && oldNavSubVis==0){
				oldNavSub--;
				if(oldNavSub>0){
					oldNavSubVis=100;
				}
			}
			if(oldNavSub>0){
				oldNavSubVis=oldNavSubVis-50;
				//if(document.getElementById("NAV_"+oldNav+"_"+oldNavSub).className.indexOf("_visible")==-1){
					document.getElementById("NAV_"+oldNav+"_"+oldNavSub).style.opacity=(oldNavSubVis/100);
					document.getElementById("NAV_"+oldNav+"_"+oldNavSub).style.filter = "alpha(opacity="+oldNavSubVis+")";
				//}
			}
		}
	}
}


function adjustMain(){
	if(navigator.appName.indexOf("Microsoft")==-1)
	{
		IE=false;
	}else{
		IE=true;
	}
	if(IE==true)
	{
		sw=document.body.clientWidth;
		sh=document.body.clientHeight;
	}else{
		sw=window.innerWidth;
		sh=window.innerHeight;
	}
	swO=sw;
	shO=sh;
	if(sw<850){
		sw=850;
	}
	if(sh<715){
		sh=715;
	}
	var bgimg=document.body.style.backgroundImage;
	doBG(sw,sh);
	objM=document.getElementById("MAIN");
	objM.style.left=Math.round((sw-800)/2)+"px";
	objM.style.height=(sh-25-70)+"px";
	objC=document.getElementById("CONTENT");
	if(IE==true){
		objC.style.height=(sh-25-70-232)+"px";
	}else{
		objC.style.minHeight=(sh-25-70-232)+"px";
	}
	doUpdateBox();
	objM.style.visibility="visible";
	if(firstload==true){
		setTimeout("iSub=setInterval('doSub()',50)",1000);
		if(arrAktionen.length>1){
			setInterval('doAktionen()',10000);
		}
		if(arrTestimonials.length>1){
			setInterval('doTestimonials()',10000);
		}
		firstload=false;
	}
}
function doAktionen()
{
	aktAktion++;
	if(aktAktion==arrAktionen.length){
		aktAktion=0;
	}
	document.getElementById("AKTIONEN").innerHTML=arrAktionen[aktAktion];
	doUpdateBox();
}
function doTestimonials()
{
	aktTestimonial++;
	if(aktTestimonial==arrTestimonials.length){
		aktTestimonial=0;
	}
	document.getElementById("TESTIMONIALS").innerHTML=arrTestimonials[aktTestimonial];
	doUpdateBox();
}
function doWU()
{
	objW=window.open("http://isi-dp.ch/jupload/", "WEBUPLOAD", "width=630,height=320,left=100,top=100,location=no,menubar=no,resizable=no,scrollbars=no,status=no,toolbar=no");
	objW.focus();
}
function doUpdateBox(){
	var nextt=232;
	for(i=1;i<=4;i++){
		var objB=document.getElementById("BOX"+i);
		if(objB!=undefined){
			var objBG=document.getElementById("BOX"+i+"_BG");
			objB.style.top=nextt+"px";
			objBG.style.top=nextt+"px";
			var bh=objB.offsetHeight;
			objBG.style.height=(196+(bh-188))+"px";
			nextt=nextt+(196+(bh-188))+10;
		}
	}
}
