// start
function init()
{
	parent.frames["left"].location.href="border.htm";
	parent.frames["right"].location.href="border.htm";
	layerSwitch('loading','backLay','updates','flash','intro')
}

// Netscape fix
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

// allgemeine Funktionen
function getImage(bildName,layerID)
{
	return (document.all||document.getElementById?window.document.images[bildName]:layerID?document.layers[layerID].document.images[bildName]:window.document.images[bildName]);
}

function getLayer(layerID)
{
	return (document.getElementById?document.getElementById(layerID).style:document.all?document.all[layerID].style:document.layers[layerID]);
}


// Bildwechsel
var Bilder=new Array();					
function vorLader(bildName,src1,src2)
{
	Bilder[bildName]=new Array();
	Bilder[bildName]["aus"]=new Image();
	Bilder[bildName]["aus"].src=src1;
	Bilder[bildName]["an"]=new Image();
	Bilder[bildName]["an"].src=src2;
}
vorLader("home","grafiken/home_out.gif","grafiken/home_ov.gif");
vorLader("eins","grafiken/but1_out.gif","grafiken/but1_ov.gif");
vorLader("zwei","grafiken/but2_out.gif","grafiken/but2_ov.gif");
vorLader("drei","grafiken/but3_out.gif","grafiken/but3_ov.gif");
vorLader("vier","grafiken/but4_out.gif","grafiken/but4_ov.gif");
vorLader("fuenf","grafiken/but5_out.gif","grafiken/but5_ov.gif");
vorLader("next","grafiken/right_out.gif","grafiken/right_ov.gif");
vorLader("back","grafiken/links_out.gif","grafiken/links_ov.gif");

function bildAn(bildName,layerID)
{
	getImage(bildName,layerID).src=Bilder[bildName]["an"].src;
}
	
function bildAus(bildName,layerID)
{
	getImage(bildName,layerID).src=Bilder[bildName]["aus"].src;
}


// Layer umschalten
function layerAn()
{
	for(i=0;i<arguments.length;i++)
	{
		getLayer(arguments[i]).visibility="visible";
	}
}
 	
function layerAus()
{
	for(i=0;i<arguments.length;i++)
	{
		getLayer(arguments[i]).visibility="hidden";
	}
}

function layerSwitch()
{
	for(i=0;i<arguments.length;i++)
	{
		var lay=getLayer(arguments[i]);
		if(lay.visibility=="visible"||lay.visibility=="show")
			lay.visibility="hidden";
		else if(lay.visibility=="hidden"||lay.visibility=="hide")
			lay.visibility="visible";
	}
}


// Hintergrund scrollen
function moveTicker(layerID)
{
	styleObject=getLayer(layerID);
	if(document.all)
		maxWidth=styleObject.pixelWidth;
	else if(document.getElementById)
		maxWidth=styleObject.width;
	else if(document.layers)
		maxWidth=styleObject.clip.width;
	statdyn="dynamic";
	started=0;
	speed=1;
	if(started==0)
	{
		started=1;
		slide();
	}
}

function slide()
{
	if(statdyn=="dynamic")
	{	
		if(parseInt(styleObject.left)<=-((maxWidth/3)*2)+50)
			styleObject.left=-((maxWidth/3)-50);
		if(parseInt(styleObject.left)>=-50)
			styleObject.left=-((maxWidth/3)+50);
		styleObject.left=parseInt(styleObject.left)-speed;
	}
	if(started!=0)
		setTimeout("slide()",10);
}


// JavaScript Fenster
var popUp1;
var popUp2;
var popUp3;
var player;
var xPlayer=(screen.width-330);
var yPlayer=(screen.height-200);
var param="toolbar=no,location=no,status=no,menubar=no,scrollbars=no,width=700,height=200,resizable=no,left=50,top=100";
var param2="toolbar=no,location=no,status=no,menubar=no,scrollbars=no,width=700,height=400,resizable=no,left=50,top=100";
var param4="toolbar=no,location=no,status=no,menubar=no,scrollbars=no,width=305,height=105,resizable=no,left="+xPlayer+",top="+yPlayer;
		
function openPopUp(url)
{
	popUp1=window.open(url,"downloads1",param);
	setTimeout("popUp1.focus()",500);
}

function openPopUpBig(url)
{
	popUp2=window.open(url,"downloads2",param2);
	setTimeout("popUp2.focus()",500);
}

function openGallery(url,name,width,height)
{
	var xpos=(screen.availWidth-width)/2;
	var ypos=(screen.availHeight-height)/2;
	popUp3=window.open(url,name,"toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,width="+width+",height="+height+",resizable=yes,left="+xpos+",top="+ypos);
	setTimeout("popUp3.focus()",500);
}

function openPlayer(url)
{
	player=window.open(url,"flashPlayer",param4);
	setTimeout("player.focus()",500);
}


// Formulare
function menu(type,item)
{
	var external;
	var Suche;
	
	if (item=="nix")
	{
		document.formular.reset();
		document.formular.liste.blur();
		return;
	}
	else if (type=="layer")
	{
		layerAn(item);
		document.formular.reset();
		document.formular.liste.blur();
	}
	else if (type=="link")
	{
		Suche=item.search(/http.+/);
		if(Suche != -1)
 		{
			linkFenster=window.open(item,"extWin","toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,width=785,height=520,resizable=yes,left=0,top=25");
			linkFenster.focus();
		}
		else
		{
			document.location.href=item;
		}
		document.formular.reset();
		document.formular.liste.blur();
	}
}

