var start=150;
var h_mstufe1=15;
var h_mstufe2=15;
var movevar='';
var hidevar='';
var showvar='';
var stopvar=1;

NS = ( document.layers ) ? 1 : 0;
IE = ( document.all ) ? 1: 0;

function stylesabfrage(){
	if(navigator.appName=="Netscape"){
		document.write("<link href='../allgemein/styles_NE.css' rel='styleSheet' type='text/css'>");
	}
	else{
		document.write("<link href='../allgemein/styles_IE.css' rel='styleSheet' type='text/css'>");
	}
}

function speichercache(){
	anfang();
	rearrange();
}

//***********************************************************************************************************
function text_act(imgName){
	if(NS){
		document.layers[imgName].visibility =  'show';
	}
	if(IE){
		document.all[imgName].style.visibility = "visible";
	}
	if(!NS&&!IE){
		document.getElementById(imgName).style.visibility = "visible";
	}
}

//***********************************************************************************************************
function text_inact(imgName){
	if(NS){
		document.layers[imgName].visibility =  'hide';
	}
	if(IE){
		document.all[imgName].style.visibility = "hidden";
	}
	if(!NS&&!IE){
		document.getElementById(imgName).style.visibility = "hidden";
	}
}


//***********************************************************************************************************
function f_pic(pic_name,pic_modus,pic_art){
	if(pic_art==1){
		pic_  = "M_.jpg";
		pic_h = "M_h.jpg";
		pic_m = "M_m.jpg";
	}
	else {
		pic_  = "M_.gif";
		pic_h = "M_h.gif";
		pic_m = "M_m.gif";
	}

//	alert("pic_name = " + pic_name)
//	alert("pic_modus = " + pic_modus)


	if(pic_modus==""){
		pic_pfad   = pic_name.substring(0,pic_name.lastIndexOf("/")+1);
		pic_allein = pic_name.substring(pic_name.lastIndexOf("/")+1,pic_name.length);
		pic_array  = pic_allein.split("-");
		pic_back   = pic_pfad + "-" + pic_array[1] + "-" + pic_;
	}
	if(pic_modus=="h"){
		pic_pfad   = pic_name.substring(0,pic_name.lastIndexOf("/")+1);
		pic_allein = pic_name.substring(pic_name.lastIndexOf("/")+1,pic_name.length);
		pic_array  = pic_allein.split("-");
		pic_back   = pic_pfad + "-" + pic_array[1] + "-" + pic_h;
	}
	if(pic_modus=="m"){
		pic_pfad   = pic_name.substring(0,pic_name.lastIndexOf("/")+1);
		pic_allein = pic_name.substring(pic_name.lastIndexOf("/")+1,pic_name.length);
		pic_array  = pic_allein.split("-");
		pic_back   = pic_pfad + "-" + pic_array[1] + "-" + pic_m;
	}

//	alert("pic_back = " + pic_back)

	return(pic_back);
}

//***********************************************************************************************************
function img_bike_act(pic_nr1,pic_nr2,imgArt){
	divName="b"+pic_nr1+pic_nr2;
	img_act_hi(divName,imgArt);
}

//***********************************************************************************************************
function img_bike_inact(pic_nr1,pic_nr2,imgArt){
	divName="b"+pic_nr1+pic_nr2;
	img_inact_hi(divName,imgArt);
}

//***********************************************************************************************************
function img_act_hi(imgName,imgArt){
	if(stopvar!=0){
		if(NS){
			if(movevar[imgName].document[imgName].src.indexOf("m.gif")!=-1){
				movevar[imgName].document[imgName].src= f_pic(movevar[imgName].document[imgName].src,"m",imgArt);
			}
			else{
				movevar[imgName].document[imgName].src=  f_pic(movevar[imgName].document[imgName].src,"h",imgArt);
			}
		}
		if(IE){
			if(document[imgName].src.indexOf("m.gif")!=-1){
				document[imgName].src= f_pic(document[imgName].src,"m",imgArt);
			}
			else{
				document[imgName].src= f_pic(document[imgName].src,"h",imgArt);
			}
		}              
		if(!NS&&!IE){
			if(document.getElementById(imgName).firstChild.src.indexOf("m.gif")!=-1){
				document.getElementById(imgName).firstChild.src= f_pic(document.getElementById(imgName).firstChild.src,"m",imgArt);
			}
			else{
				document.getElementById(imgName).firstChild.src= f_pic(document.getElementById(imgName).firstChild.src,"h",imgArt);
			}
		}
	}
}
//***********************************************************************************************************
function img_inact_hi(imgName,imgArt){
	if(stopvar!=0){
		if(NS){
			if(movevar[imgName].document[imgName].src.indexOf("m.gif")!=-1){
				movevar[imgName].document[imgName].src= f_pic(movevar[imgName].document[imgName].src,"m",imgArt);
			}
			else{
				movevar[imgName].document[imgName].src= f_pic(movevar[imgName].document[imgName].src,"",imgArt);
			}
		}
		if(IE){
			if(document[imgName].src.indexOf("m.gif")!=-1){
				document[imgName].src= f_pic(document[imgName].src,"m",imgArt);
			}
			else{
				document[imgName].src= f_pic(document[imgName].src,"",imgArt);
			}
		}
		if(!NS&&!IE) {
			if(document.getElementById(imgName).firstChild.src.indexOf("m.gif")!=-1){
				document.getElementById(imgName).firstChild.src= f_pic(document.getElementById(imgName).firstChild.src,"m",imgArt);
			}
			else{
				document.getElementById(imgName).firstChild.src= f_pic(document.getElementById(imgName).firstChild.src,"",imgArt);
			}
		}
	}
}
//***********************************************************************************************************


netscape=(document.layers) ? 1:0;
goodIE=(document.all) ? 1:0;

NS = ( document.layers ) ? 1 : 0;
IE = ( document.all ) ? 1: 0;

var startpos=267;
var starthm1=5;
var wohinhm1;
var zielhm1;
var schrittweitehm1=8;
var tempohm1=1;
var tempo=10;
var ziel=0;
var startpospan=35;
var tempopan=10;
var zielpan=0;
var schrittweite=5;
var schrittweitepan=45;
var wohin;
var wohinfu=0;
var spotanzahl=7;

function schrittweitefu(wohinfu){
	schrittweite = Math.abs((startpos - wohinfu) / 10);
}

function schrittweitepanfu(wohinpanfu){
	schrittweitepan = Math.abs((startpospan - wohinpanfu) / 15);
}

function panit(wohinpan){
	if(startpospan != wohinpan){
		zielpan = wohinpan;

		if(Math.abs(startpospan - wohinpan) < schrittweitepan){
			startpospan = wohinpan;
		}
		else{
			if(startpospan - wohinpan > 0){
				startpospan -= schrittweitepan; 		//nach links
			}
			else{
				startpospan += schrittweitepan; 		//nach rechts
			}
		}

		if(netscape){
			document.layers['panorama'].left = startpospan;
		}
		else{
			document.all.panorama.style.left = startpospan;
		}

		if(startpospan != wohinpan){
			window.setTimeout("panit(zielpan)", tempopan);
		}
	}
}


function stylesabfrage(){	
	if(goodIE){
		document.write("<link href='MSstyle.css' rel='styleSheet' type='text/css'>");
	}
}


function img_act(imgName){
	if(document.getElementById(imgName).firstChild.src.indexOf("_lo.gif") != -1 ){
		document.getElementById(imgName).firstChild.src = "bilder/" + imgName + "_hi.gif";
	}
}


function img_inact(imgName){
	if(document.getElementById(imgName).firstChild.src.indexOf("_hi.gif") != -1 ){
		document.getElementById(imgName).firstChild.src = "bilder/" + imgName + "_lo.gif";
	}
}

function tausch(auswahl){
	if(netscape){
		window.document.layers['panorama'].document.layers['extern1'].src = 'seite'+auswahl+'_1.html';
		document.layers['panorama'].left=35;
	}
	else if(goodIE){
/*		document.all['iextern1'].src = 'seite'+auswahl+'_1.html';
		document.all.panorama.style.left=35; */
	}
	startpospan=35;
}

function hmmove(wohinhm1){
	if(startpos != wohinhm1){

		zielhm1 = wohinhm1;
		if(Math.abs(starthm1 - wohinhm1) < schrittweitehm1){
			starthm1 = wohinhm1;
		}
		else{
			if(starthm1 - wohinhm1 > 0){
				starthm1 -= schrittweitehm1; 		//nach links
			}
			else{
				starthm1 += schrittweitehm1; 		//nach rechts
			}
		}

		document.getElementById('hmslide').style.left = starthm1 +"px";

		if(starthm1 != wohinhm1){
			window.setTimeout("hmmove(zielhm1)", tempohm1);
		}
	}
}

function img_tausch(imgName,imgnr)
{
	for(x=1;x<=spotanzahl;x++){
		lovar="spot"+x;
		document.getElementById(lovar).firstChild.firstChild.src = "bilder/hm" + x + "_lo.gif";
	}
	if(document.getElementById(imgName).firstChild.firstChild.src.indexOf("_lo.gif") != -1 ){
		document.getElementById(imgName).firstChild.firstChild.src = "bilder/hm" + imgnr + "_hi.gif";
	}
}

function nsc()
{
	newstuff = window.open("ns1.html", "newstuff", "width=440,height=410,screenX=20,screenY=20,dependent=yes,resizable=no");
	newstuff.focus();
}

function img_blitz(imgName){
	if(document.getElementById(imgName).firstChild.firstChild.src.indexOf("_lo.gif") != -1 ){
		document.getElementById(imgName).firstChild.firstChild.src = "bilder/" + imgName + "_hi.gif";
		window.setTimeout("img_blitz(imgName)", 5000);
	}
	else{
		document.getElementById(imgName).firstChild.firstChild.src = "bilder/" + imgName + "_lo.gif";
		window.setTimeout("img_blitz(imgName)", 5000);
	}
}

var time_out;

function bildertausch_auto(imgName,b_max,b_zeit)
{
	b_akt		= document.getElementById(imgName).firstChild.src;
	b_laenge	= b_akt.length;
	b_akt_nr	= b_akt.charAt(b_laenge-5);

	if ( b_akt_nr < b_max ) {
		b_akt_nr++;
		b_name		= b_akt.substring(0, b_laenge-5) + b_akt_nr + b_akt.substring(b_laenge-4, b_laenge);
	}
	else {
		document.getElementById(imgName).style.display = 'none'
		document.getElementById('inhalttext').style.display = 'block';
		document.getElementById('uebbox').style.display = 'block';
		return;
	}
			
	document.getElementById(imgName).firstChild.src = b_name;

	befehlsausgabe = 'setTimeout("bildertausch_auto(' + "'anime'," + b_max + ',2000)",b_zeit);'
	time_out = eval(befehlsausgabe);
}

function bilderfunktionen(){
	document.getElementById('animeo').style.display = 'none';
	document.getElementById('animel').style.display = 'none';
	document.getElementById('anime').style.display = 'none';
	document.getElementById('animer').style.display = 'none';
	document.getElementById('animelogo').style.display = 'none';

//	bildertausch_auto('anime',1,10000);
}



