var cli;
var cre;
var bi;
var stopp;
var scrollen_aktiv;
var balkendiff;

var S_Anfang;
var galeriebreite;

function MiniGalerie_los(){
	bi=1;
	cli=0; 
	cre=FensterWeite;
	if (document.layers){
		window.document.dia.visibility="show";
		window.document.dia.left=400;
		window.document.dia.clip.left=0;
	    window.document.dia.clip.right=FensterWeite-400;
	} else {
		dia.style.visibility="visible";
		dia.style.left=400;
		dia.style.rigth=400+1200;
	}
	window.setTimeout('dia_fahren()',1000);
}

function dia_fahren(){
	if (document.layers){ 
	     window.document.dia.left=window.document.dia.left-2;
	     window.document.dia.right=window.document.dia.right+2;
 	     window.document.dia.clip.left=window.document.dia.clip.left+2;
	     window.document.dia.clip.right=window.document.dia.clip.right+2;
 	     if (window.document.dia.left < (400-670)) {bi=2;}
	} else {
		cli++; cre++;		cli++; cre++;	
		dia.style.left=Pixelwert(dia.style.left)-2;
		dia.style.clip="rect(0px "+cre+"px 60px "+cli+"px)";
		if (Pixelwert(dia.style.left) < (400-670)) {bi=2;}
	}
	if (bi< 2) {window.setTimeout('dia_fahren()',100);}
	if (bi> 1){ dia_zurueck();}
}

function dia_zurueck(){
bi=0;
	if (document.layers){
			window.document.dia.left=400;
   			window.document.dia.clip.left=0;
			window.document.dia.clip.right=400;
	} 
    else{	dia.style.left=400;
			dia.style.clip="rect(0px 400px 60px 0px)";
			cli=0; cre=FensterWeite;
	}	
    dia_fahren();
}


function Pixelwert(yxtext){
var xytext = new String (yxtext);
yxtext = xytext.substr(0,xytext.length-2);
return parseInt(yxtext);
}

function BildAnzeigen(_Bildname){
	var FensterHTML;
	self.focus();
	Bildfenster = open("bild.htm","Bildfenster","width=520,height=535,screenX=5,screenY=5, resizable=no");
	FensterHTML="<body bgcolor=black><img src='kuenstler/"+_Bildname+"'>";
	FensterHTML=FensterHTML+"<a href='Javascript:self.close()'>&nbsp;";
	FensterHTML=FensterHTML+"<img align='right' src='bilder/schliessen.gif' width=93 height=14 border=0></a></body>";
	Bildfenster.document.open();
	Bildfenster.document.write(FensterHTML);
	Bildfenster.document.close();
	Bildfenster.focus();	
}

function BildfensterSchliessen(){
	self.close();
}

function Bildergalerie_bewegen(_richtung){
	var _richtung_neu;
	richtung_neu = _richtung;
	stopp = false;
	window.setTimeout('Bildergalerie_fahren(richtung_neu)',200);
}

function Bildergalerie_fahren(_richtung){
	if ((_richtung ==-1) & (cre < 0)) {stopp=true;}
	if ((_richtung ==1) & (cli > galeriebreite)) {stopp=true;}
	if (stopp==false) {
		if (document.layers){
			cre = cre+ (15* _richtung);
			cli = cli+ (15* _richtung);
			window.document.kunstbilder.left=window.document.kunstbilder.left-(15*_richtung);
 		    window.document.kunstbilder.clip.left=window.document.kunstbilder.clip.left+(15*_richtung);
		    window.document.kunstbilder.clip.right=window.document.kunstbilder.clip.right+(15*_richtung);
		} else {
			cre = cre+ (15* _richtung);
			cli = cli+ (15* _richtung);
			kunstbilder.style.left=Pixelwert(kunstbilder.style.left)-(15*_richtung);
			kunstbilder.style.clip="rect(0px "+cli+"px 63px "+cre+"px)";
		}
		window.setTimeout('Bildergalerie_fahren(richtung_neu)',50);
	}
}

function Bildergalerie_stopp(){
	stopp=true;
}

function scrollen_aktiv_setzen(){
	scrollen_aktiv=true;
	balkendiff=window.event.x-Pixelwert(kunstbalken.style.left);
}

function scrollen_balken(){
	if (scrollen_aktiv && 
		(window.event.x-balkendiff< (530+((FensterWeite-710)/2)-10))&& 
		(window.event.x-balkendiff> (0+((FensterWeite-710)/2)-10))
		) {
		kunstbalken.style.left=window.event.x-balkendiff;
	}
}

function scrollen_stoppen(){
	scrollen_aktiv=false;
}

function Text_scrollen_bewegen(_richtung){
	var _richtung_neu;
	richtung_neu = _richtung;
	stopp = false;
	window.setTimeout('Text_scrollen_fahren(richtung_neu)',500);
	//alert(window.document.layers[layer_aktiv].clip.top);
}

function Text_scrollen_fahren(_richtung){
	if ((_richtung ==-1) & (window.document.layers[layer_aktiv].clip.top < 0)) {stopp=true;}
	if ((_richtung ==1) & (window.document.layers[layer_aktiv].top < (100-layer_laenge))) {stopp=true;}
	if (stopp==false) {
		if (document.layers){
			window.document.layers[layer_aktiv].top=window.document.layers[layer_aktiv].top-(10*_richtung);
			window.document.layers[layer_aktiv].clip.top=window.document.layers[layer_aktiv].clip.top+(10*_richtung);
			window.document.layers[layer_aktiv].clip.bottom=window.document.layers[layer_aktiv].clip.bottom+(10*_richtung);
			
		}
		//Text_scrollbalken_setzen(cre);
		window.setTimeout('Text_scrollen_fahren(richtung_neu)',50);
	}
}

function Text_scrollen_stopp(){
	stopp=true;
}
