compatible = false;
jumpPos = Array();
aktPos = 0;
iHeight = 0;

curryPos = 0;
yDistance = 0;

function jump(base,num){
	num += base-aktPos;
	num = (num+aktPos)<0?-aktPos:(num+aktPos)>=jumps.length?jumps.length-aktPos-1:num;
	
	window.scrollTo(0,curryPos);
	aktDist = 0;
	if(num>0){
		while(num>0){
			aktDist += jumpPos[aktPos];
			aktPos++;
			num--;
		}
	}else{
		while(num<0){
			aktPos--;
			aktDist -= jumpPos[aktPos];
			num++;
		}
	}
	//mao: schränkt die aktuelle Position auf -zulässige- Werte
	aktPos=aktPos>=jumps.length?(jumps.length-1):aktPos<0?0:aktPos;
	scrollG7(aktDist);
}

function scrollG7(aktDist){
	DestY = (curryPos+aktDist);
	
	startPosit = window.pageYOffset ? window.pageYOffset : document.body.scrollTop;
	//alert (startPosit);
	
	if(DestY > curryPos){
		while (curryPos < DestY){
			curryPos = curryPos+iStep;
			self.scroll(0, curryPos);
		}
	}
	else{
		while (curryPos > DestY){
			curryPos = curryPos-iStep;
			var curryPoskorr=0;
			if (curryPos<=61) {curryPoskorr=60} // damit die Seite ganz oben anfängt
			self.scroll(0, curryPos-curryPoskorr);
			curryPoskorr=0;
			}
	}
}

function reSet(){ self.scroll(0, curryPos); }
function reSize(){
	iHeight = window.innerHeight ? window.innerHeight : document.body.clientHeight;
	//curryPos -= (iHeight*0.5)-390;//131 Aktueller Titel auf Mitte des sichtbaren Fensters
	//curryPos -= -25;
	location.reload();
	curryPos = iHeight>300 ? +60 : +60;  //mao Position des aktuellen Titels je nach Grösse des Fensters 40 40
	reSet();
}

function init(){
	iHeight = window.innerHeight ? window.innerHeight : document.body.clientHeight;
	//curryPos -= (iHeight*0.5)-380;//131
	//curryPos -= -25;
	curryPos = iHeight>300 ? +60 : +60;  // 40    40
	//curryPos = startPosit=60 ? 0 : +60;
	
	iStep = navigator.userAgent.indexOf("Gecko")>-1 ? 15 : 5;

	mes = "iHeight: "+iHeight+"\n";
	mes += "curryPos: "+curryPos+"\n";
	for(i=0;i<jumps.length;i++){
		if(document.anchors[jumps[i]])
			if(document.anchors[jumps[i]].y){
				jumpPos[i] = (i+1)<jumps.length ? document.anchors[jumps[(i+1)]].y-64 : document.anchors['end'].y-64;
				for(j=0;j<i;j++)
					jumpPos[i] -= jumpPos[j];
			}else{
				jumpPos[i] = document.images[jumps[i]].height;
				
				jumpPos[1]= document.images[jumps[1]].height-2;
				jumpPos[2]= document.images[jumps[2]].height+36;
				jumpPos[3]= document.images[jumps[3]].height-2;
				
				
			 }
		else
			jumpPos[i] = document.images[jumps[i]].height;

			jumpPos[1]= document.images[jumps[1]].height-2;
			jumpPos[2]= document.images[jumps[2]].height+36;
			jumpPos[3]= document.images[jumps[3]].height-2;
			//jumpPos[5]= document.images[jumps[5]].height-60;
			
	mes += jumps[i]+": "+jumpPos[i]+"\n";
	}
	//alert(mes);
	
	jump(2,0);
}


// DW Funktionen

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_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=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}



	//Random iframe content- © Dynamic Drive (www.dynamicdrive.com)
	//For full source code, and Terms Of use, visit http://dynamicdrive.com
	//This credit MUST stay intact for use

	var ie=document.all&&navigator.userAgent.indexOf("Opera")==-1
	var dom=document.getElementById&&navigator.userAgent.indexOf("Opera")==-1
	
	var iframeprops='width=601 height=430 marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0" name="projectwindow"  scrolling="no" title="projectwindow"  class="projectwindow"' ;
	//URLs to display inside iframe
	var randomcontent=new Array();
	randomcontent[0]="projects/avantix/index.htm";
	randomcontent[1]="projects/axpo/index.htm";
	randomcontent[2]="projects/bitaro/index.htm";
	randomcontent[3]="projects/bmg/index.htm";
	randomcontent[4]="projects/dentocase/index.htm";
	randomcontent[5]="projects/dfv/index.htm";
	randomcontent[6]="projects/ev/index.htm";
	randomcontent[7]="projects/fh_luebeck/index.htm";
	randomcontent[8]="projects/froese_e/index.htm";
	randomcontent[9]="projects/froese_j/index.htm";
	randomcontent[10]="projects/jmd/index.htm";
	randomcontent[11]="projects/kaleso/index.htm";
	randomcontent[12]="projects/kleistforum/index.htm";
	randomcontent[13]="projects/kneerspots/index.htm";
	randomcontent[14]="projects/meducase/index.htm";
	randomcontent[15]="projects/netviewer/index.htm";
	randomcontent[16]="projects/pronautik/index.htm";
	randomcontent[17]="projects/reisemanufaktur/index.htm";
	randomcontent[18]="projects/sak/index.htm";
	randomcontent[19]="projects/sas/index.htm";
	randomcontent[20]="projects/schuetzengarten/index.htm";
	randomcontent[21]="projects/soennichsen/index.htm";
	randomcontent[22]="projects/tangerine/index.htm";
	
	
	//if (ie||dom)
	
	//document.write('<iframe id="projectwindow" src="projects/netviewer/index.htm" '+iframeprops+'></iframe>');

	function random_iframe(){
	if (ie||dom){
	var iframeobj=document.getElementById? document.getElementById("projectwindow") : document.all.projectwindow;
	iframeobj.src=randomcontent[Math.floor(Math.random()*randomcontent.length)];
	}
	}
