/****************************************************************************
* scripts.js
* Common JavaScript functions: initialization, text-scroller, window-opener
* author: a.fehn@design-aspekt.com | date: 2003-03-10
*
* produced by design aspekt
* http://design-aspekt.com
***************************************************************************/

// if you're not 'index' go to 'index' ;-) 
//if (top.window.name != "{name}") top.location.href = "index.php"

//______________________________________________________________________
//TEXTSCROLLER
//You set the width and height of the divs inside the style tag, you only have to
//change the divCont, Remeber to set the clip the same as the width and height.
//If you want it to move faster you can set this lower:
var speed=50
//Sets variables to keep track of what's happening
var loop, timer
//Makes the object go up

function goDown(move){
	if(this.y>-this.scrollHeight+clipWindow.clipHeight){
		this.moveIt(0,this.y-move)
			if(loop) setTimeout(this.obj+".down("+move+")",speed)
	}
}
//Makes the object go down
function goUp(move){
	if(this.y<0){
		this.moveIt(0,this.y-move)
		if(loop) setTimeout(this.obj+".up("+move+")",speed)
	}
}
//Calls the scrolling functions. Also checks whether the page is loaded or not.
function scroll(speed){
	if(loaded){
		loop=true;
		if(speed>0) scrolltext.down(speed)
		else scrolltext.up(speed)
	}
}
//Stops the scrolling (called on mouseout)
function noScroll(){
	loop=false
	if(timer) clearTimeout(timer)
}

//______________________________________________________________________
// opens new window
function popup(url) {
	var w = 400; var h = 500;
	l = Math.round(screen.width/2) - Math.round(w/2);
	t = Math.round(screen.height/2) - Math.round(h/2);
	if (screen.height<h) { h = (screen.height-80);}
	owin = open(url,'popup','toolbar=0,status=0,scrollbars=1,width='+w+',height='+h+',resizable=1,top='+t+',left='+l);
	owin.focus();
}
function openwin(url,w,h,r,s) {
	if (screen.height<h) { h = (screen.height-80);}
	owin = open(url,'','toolbar=0,status=1,scrollbars='+s+',width='+w+',height='+h+',resizable='+r+',top=0,left=0');
	owin.focus();
}

//______________________________________________________________________
//pix preloads and swaps
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("n_privacy","pix/n_notice_off.gif","pix/n_notice_on.gif");
vorLader("b_privacy","pix/b_notice_off.gif","pix/b_notice_on.gif");
vorLader("n_sitemap","pix/n_sitemap_off.gif","pix/n_sitemap_on.gif");
vorLader("b_sitemap","pix/b_sitemap_off.gif","pix/b_sitemap_on.gif");
vorLader("n_friend","pix/n_friend_off.gif","pix/n_friend_on.gif");
vorLader("b_friend","pix/b_friend_off.gif","pix/b_friend_on.gif");

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]);
}
function bildAn(bildName,layerID) {
	getImage(bildName,layerID).src=Bilder[bildName]["an"].src;
}
function bildAus(bildName,layerID) {
	getImage(bildName,layerID).src=Bilder[bildName]["aus"].src;
}
