
/* Programmierung Christoph Rybacki
 *
 * 1. NEUE SEITE IM FENSTER
 * 2. LINKRAHMEN AUS BEI CLICK
 * 3. ONMOUSEOVER UND ONMOUSEOUT FÜR LAYER
 * 4. ONMOUSEOVER UND ONMOUSEOUT FÜR GRAFIKEN
 * 5. ZWEI FRAMES AKTUALISIEREN BEIM CLICK
 * 6. GRAFIKEN VORLADEN
 * 7. ALLE CHECKBOXEN SELEKTIEREN
 * 8. BILDWECHSEL FUNKTION NACH ZEIT

*/






/*#########################################################
 *#
 *# NEUE SEITE IM FENSTER MITTEN IM BROWSER
 *#
 *# ansprechen mit..    onload="Fenster('../seite.html','','toolbar=no,resizable=no,status=no','400','50');"
 *#
 *#######################################################*/


	var fen = null;
	var width = 0;
	var height = 0;	
	
	function Fenster(Seite,Fenstername,Features,width,height)
	{
		if(window.screen) 
		{
			var hori = screen.availWidth;
			var verti = screen.availHeight;
			
			fen=window.open(Seite,Fenstername,Features +',width='+ width +',height='+ height +',left='+ ((hori - width - 10)* .5) +',top='+ ((verti - height - 30)* .5));
			fen.focus();
		}
	}


/*#########################################################
 *#######################################################*/







/*#########################################################
 *#
 *# LINKRAHMEN AUS BEI CLICK
 *#
 *# ansprechen mit..     onfocus="if(this.blur)this.blur();"
 *#
 *#######################################################*/



/*#########################################################
 *#######################################################*/







/*#########################################################
 *#
 *# ONMOUSEOVER UND ONMOUSEOUT FÜR LAYER
 *#
 *# ansprechen mit..    onmouseover="MM_showHideLayers('layername','','show')" onmouseout="MM_showHideLayers('layername','','hide')"
 *#						
 *# layer..				<div id="layername" style="visibility:hidden;">Text</div>
 *#
 *#######################################################*/


	function MM_findObj(n, d) 
	{ //v4.0
		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 && document.getElementById)
			x=document.getElementById(n);
		
		return x;
	}
	
	
	function MM_showHideLayers()
	{ //v3.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;
			}
	}


/*#########################################################
 *#######################################################*/
 
 
 





/*#########################################################
 *#
 *# ONMOUSEOVER UND ONMOUSEOUT FÜR GRAFIKEN
 *#
 *# ansprechen mit..    onmouseover="MM_swapImage('Bildname','','bilder/bild2.jpg',1)" onmouseout="MM_swapImgRestore()"
 *#						
 *# Bild..				<img src="bilder/bild.jpg" alt="" name="Bildname" border="0">
 *#
 *#######################################################*/



	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_findObj2(n, d) { //v4.0
	  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_findObj2(n,d.layers[i].document);
	  if(!x && document.getElementById) x=document.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_findObj2(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
	}


/*#########################################################
 *#######################################################*/







 
 
 /*#########################################################
 *#
 *# ZWEI FRAMES AKTUALISIEREN BEIM CLICK
 *#
 *# ansprechen mit..    onclick="ZweiFrames('home','Seite1.html','oben','Seite2.html')"
 *#
 *#######################################################*/
 
	function ZweiFrames(Frame1,Seite1,Frame2,Seite2)
	{
		eval("parent."+ Frame1 +".location.href='"+ Seite1 +"'");
		eval("parent."+ Frame2 +".location.href='"+ Seite2 +"'");
	}

/*#########################################################
 *#######################################################*/



 




/*#########################################################
 *#
 *# GRAFIKEN VORLADEN
 *#
 *# ansprechen mit..     <body onload="MM_preloadImages('bilder/1.jpg','bilder/2.jpg')">
 *#
 *#######################################################*/


	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];}}
	}

/*#########################################################
 *#######################################################*/






/*#########################################################
 *#
 *# ALLE CHECKBOXEN SELEKTIEREN
 *#
 *# ansprechen mit..     onclick="this.value=check(this.form)" name="checken"
 *#
 *#######################################################*/

	var checkflag = "false";

	function check(field)
	{
		if(checkflag == "false")
		{
			for(i = 0; i < field.length; i++)
			{
				field[i].checked = true;
			}
			checkflag = "true";
			return "checken"; 
		}
		else
		{
			for(i = 0; i < field.length; i++)
			{
				field[i].checked = false;
			}
			checkflag = "false";
			return "checken";
		}
	}

/*#########################################################
 *#######################################################*/










/*#########################################################
 *#
 *# Bildwechsel
 *#
 *# ansprechen mit..     <img src="bilder/home_10.jpg" alt="" name="bild1" onload="setTimeout('Bildwechsel(\'bild1\',\'bilder/home_10.jpg\',\'bilder/home_10b.jpg\')', 5000)">
 *#
 *#######################################################*/

	var aktuell = 1;

	function Bildwechsel(bildname,bild1,bild2)
	{
		if (aktuell == 1)
		{
			eval('document.'+ bildname +'.src = "'+ bild1 +'"');
			aktuell = 2;
		}
		else
		{
			eval('document.'+ bildname +'.src = "'+ bild2 +'"');
			aktuell = 1;
		}
	}

/*#########################################################
 *#######################################################*/














/*#########################################################
 *#
 *# Scrolltext
 *#
 *# ansprechen mit..     onload="init();"
 *#
 *#######################################################*/

//ENTER CONTENT TO SCROLL BELOW.

var pixelstep=1;                     //Wieviel Pixel vorwaerts (wg. flüssig)

function init(Nummer)
{
	eval('inner'+ Nummer +'=document.all.inner'+ Nummer +'.style;');
	eval('inner'+ Nummer +'.pixelLeft=(goright'+ Nummer +' == "1")? -elementwidth'+ Nummer +' : boxwidth'+ Nummer +'-2;');
	eval('inner'+ Nummer +'.clip="rect(0px, 0px, 0px, 0px)";');
	eval('inner'+ Nummer +'.visibility="visible";');

	eval('timer'+ Nummer +' = setInterval("scrollbox('+ Nummer +')",speed'+ Nummer +');');
}

function scrollbox(Nummer)
{

	eval('inner'+ Nummer +'.pixelLeft+=(goright'+ Nummer +' == "1")? pixelstep: -pixelstep;');
	eval('inner'+ Nummer +'.clip="rect(0px "+((boxwidth'+ Nummer +'-inner'+ Nummer +'.pixelLeft-2>boxwidth'+ Nummer +')? boxwidth'+ Nummer +'-2 : boxwidth'+ Nummer +'-inner'+ Nummer +'.pixelLeft-2)+"px "+(boxheight'+ Nummer +'-4)+"px "+(-inner'+ Nummer +'.pixelLeft+2)+"px)";');

	if(eval('goright'+ Nummer +' == "1"'))
	{
		if(eval('inner'+ Nummer +'.pixelLeft>boxwidth'+ Nummer +''))
		{
			eval('inner'+ Nummer +'.pixelLeft=-elementwidth'+ Nummer +';');
		}
	}
	else
	{
		if(eval('inner'+ Nummer +'.pixelLeft<-elementwidth'+ Nummer +''))
		{
			eval('inner'+ Nummer +'.pixelLeft=boxwidth'+ Nummer +'+2;');
		}
	}

}


/*#########################################################
 *#######################################################*/
















/*#########################################################
 *#
 *# ScrollBILD
 *#
 *# ansprechen mit..     onload="startscroll()"
 *#
 *#######################################################*/




//set the scrollerwidth and scrollerheight to the width/height of the LARGEST image in your slideshow!
var scrollerwidth=157
var scrollerheight=80
var scrollerbgcolor='#2d4488'
//3000 miliseconds=3 seconds
var pausebetweenimages=3000


//configure the below variable to change the images used in the slideshow. If you wish the images to be clickable, simply wrap the images with the appropriate <a> tag
var slideimages=new Array()
slideimages[0]='<a href="#"><img src="bilder/ani-logos/01.jpg" border=0"></a>'
slideimages[1]='<a href="#"><img src="bilder/ani-logos/02.jpg" border=0"></a>'
slideimages[2]='<a href="#"><img src="bilder/ani-logos/03.jpg" border=0"></a>'
slideimages[3]='<a href="#"><img src="bilder/ani-logos/04.jpg" border=0"></a>'
slideimages[4]='<a href="#"><img src="bilder/ani-logos/05.jpg" border=0"></a>'
slideimages[5]='<a href="#"><img src="bilder/ani-logos/06.jpg" border=0"></a>'
slideimages[6]='<a href="#"><img src="bilder/ani-logos/07.jpg" border=0"></a>'
slideimages[7]='<a href="#"><img src="bilder/ani-logos/08.jpg" border=0"></a>'
//extend this list

///////Ab hier NICHTS mehr veraendern///////////////////////
     

if (slideimages.length>1)
i=2
else
i=0

function move1(whichlayer){
tlayer=eval(whichlayer)
if (tlayer.left>0&&tlayer.left<=5){
tlayer.left=0
setTimeout("move1(tlayer)",pausebetweenimages)
setTimeout("move2(document.main.document.second)",pausebetweenimages)
return
}
if (tlayer.left>=tlayer.document.width*-1){
tlayer.left-=5
setTimeout("move1(tlayer)",100)
}
else{
tlayer.left=scrollerwidth+5
tlayer.document.write(slideimages[i])
tlayer.document.close()
if (i==slideimages.length-1)
i=0
else
i++
}
}

function move2(whichlayer){
tlayer2=eval(whichlayer)
if (tlayer2.left>0&&tlayer2.left<=5){
tlayer2.left=0
setTimeout("move2(tlayer2)",pausebetweenimages)
setTimeout("move1(document.main.document.first)",pausebetweenimages)
return
}
if (tlayer2.left>=tlayer2.document.width*-1){
tlayer2.left-=5
setTimeout("move2(tlayer2)",100)
}
else{
tlayer2.left=scrollerwidth+5
tlayer2.document.write(slideimages[i])
tlayer2.document.close()
if (i==slideimages.length-1)
i=0
else
i++
}
}

function move3(whichdiv){
tdiv=eval(whichdiv)
if (tdiv.style.pixelLeft>0&&tdiv.style.pixelLeft<=5){
tdiv.style.pixelLeft=0
setTimeout("move3(tdiv)",pausebetweenimages)
setTimeout("move4(second2)",pausebetweenimages)
return
}
if (tdiv.style.pixelLeft>=tdiv.offsetWidth*-1){
tdiv.style.pixelLeft-=5
setTimeout("move3(tdiv)",100)
}
else{
tdiv.style.pixelLeft=scrollerwidth
tdiv.innerHTML=slideimages[i]
if (i==slideimages.length-1)
i=0
else
i++
}
}

function move4(whichdiv){
tdiv2=eval(whichdiv)
if (tdiv2.style.pixelLeft>0&&tdiv2.style.pixelLeft<=5){
tdiv2.style.pixelLeft=0
setTimeout("move4(tdiv2)",pausebetweenimages)
setTimeout("move3(first2)",pausebetweenimages)
return
}
if (tdiv2.style.pixelLeft>=tdiv2.offsetWidth*-1){
tdiv2.style.pixelLeft-=5
setTimeout("move4(second2)",100)
}
else{
tdiv2.style.pixelLeft=scrollerwidth
tdiv2.innerHTML=slideimages[i]
if (i==slideimages.length-1)
i=0
else
i++
}
}

function startscroll(){
if (document.all){
move3(first2)
second2.style.left=scrollerwidth
}
else if (document.layers){
document.main.visibility='show'
move1(document.main.document.first)
document.main.document.second.left=scrollerwidth+5
document.main.document.second.visibility='show'
}
}

//window.onload=startscroll

/*#########################################################
 *#######################################################*/

