var menue;
var theTop = 0;
var old = theTop;


function init(){
	menue = new getObj('menue');
	
	if(window.innerHeight>400 || document.body.offsetHeight>400 ){
		move_menue();
	}
}


function getObj(name){
	if (document.getElementById){
		this.obj = document.getElementById(name);
		this.style = document.getElementById(name).style;
	}
	else if (document.all){
		this.obj = document.all[name];
		this.style = document.all[name].style;
	}
	else if (document.layers){
		this.obj = getObjNN4(document,name);
		this.style = this.obj;
	}
}


function move_menue(){
	if(window.innerHeight){	
		pos = window.pageYOffset;
	}	
	else if(document.documentElement && document.documentElement.scrollTop){
		pos = document.documentElement.scrollTop;
	}	
	else if(document.body){
		pos = document.body.scrollTop;
	}

	if(pos < theTop){
		pos = theTop;
	}
	else{
		pos += 0;
	}

	if(pos != old){
		pos = (.1 *(pos-old))+old;
		menue.style.top = pos +"px";
	}
	
	old = pos;
	temp = setTimeout('move_menue()',20);
}
//****************** Rolloverfunktion Preloader ***********************
function preLoadImages() {
	preLoadBilder = new Array();
	for (xx=0;xx<document.images.length;xx++) {
		var Bildname = document.images[xx].name;
		if (Bildname  && Bildname != "") {
			preLoadBilder[Bildname+"_h"] = new Image();
			preLoadBilder[Bildname+"_h"].src = Bildname+"_h.gif";
			//alert(preLoadBilder[Bildname+"_h"].src);
		}
	}
}

//****************** Rolloverfunktion***********************
function setRolloverBild(Bildname) {
//alert(Bildname);
	if (!window.preLoadBilder){ return false; }
	
	if (preLoadBilder[Bildname+"_h"].complete) {
		document.images[Bildname].src = Bildname+"_h.gif";
		
	}
	else{
		document.images[Bildname].src = Bildname+"_h.gif";
	}
}

//****************** ***********************

function setNormalBild(Bildname) {
	document.images[Bildname].src = Bildname+".gif";
	return;		
}

// *******************************************************************************************
function mail_bauen(suffix,name,homepage){ 
	var str="";
	str +='<a href="';
	str +='mailto:' + name;
	str +='@' + homepage + '.' + suffix + '">';
	str +=name + '@';
	str +=homepage + '.';
	str +=suffix + '</a>'
	document.write(str);
}

// *******************************************************************************************

function pop_window_big(){
	popwindow_big =  window.open('ladefenster.html','popwindow_big','width=750,height=700,left=0,top=0,scrollbars=auto,menubar=no');
	popwindow_big.focus();
}

function pop_window_shop(){
	popwindow_big =  window.open('ladefenster.html','popwindow_big','width=500,height=500,left=0,top=0,scrollbars=auto,menubar=no');
	popwindow_big.focus();
}

function pop_window_docid(){
	popwindow_big =  window.open('ladefenster.html','popwindow_big','width=500,height=500,left=0,top=0,scrollbars=auto,menubar=no');
	popwindow_big.focus();
}

function pop_window_news(){
	popwindow_big =  window.open('ladefenster.html','popwindow_big','width=500,height=600,left=0,top=0,scrollbars=auto,menubar=no');
	popwindow_big.focus();
}

function pop_window_galerie(){
	popwindow_big =  window.open('ladefenster.html','popwindow_big','width=500,height=600,left=0,top=0,scrollbars=auto,menubar=no');
	popwindow_big.focus();
}


// *******************************************************************************************
/*
// neue ebene einblenden, alte ausblenden
function MM_showHideLayers() { //v6.0
  	var i,p,v,obj,args=MM_showHideLayers.arguments;
  	for (i=0; i<(args.length-2); i+=3) if ((obj=MM_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 hide_menue(nrh){
	eval("MM_showHideLayers('menue_layer_"+nrh+"','','hide')");
}
*/

