

function openPop(destination,winname,scroll,winwidth,winheight) {
  satellite =  window.open(destination,winname,"locationbar=no,directories=no,status=no,menubar=no,resizable=no,scrollbars="+scroll+",copyhistory=no,width="+winwidth+",height="+winheight+"");
  satellite.moveTo(((screen.width/2)-(winwidth/2)),((screen.height/2)-(winheight/2)));
}


function change(name,quelle){
  window.status = "";
  document.images[name].src = quelle.src;
}

function getTheBrowser() {
	this.ver			= navigator.appVersion;
	this.dom			= document.getElementById?1:0;
	this.ie6			= (this.ver.indexOf("MSIE 6")>-1 && this.dom)?1:0;
	this.ie5			= (this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;
	this.ie4			= (document.all && !this.dom)?1:0;
	this.ns5			= (this.dom && parseInt(this.ver) >= 5)?1:0;
	this.ns4			= (document.layers && !this.dom)?1:0;
	this.browservers	= (this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns5)

	return this
}


function construct(name,nest) {
	nest				= (!nest) ? '':nest+'.document.'
	this.el				= browservers.dom?document.getElementById(name):browservers.ie4?document.all[name]:browservers.ns4?eval('document.'+nest+name):0;
	this.css			= browservers.dom?document.getElementById(name).style:browservers.ie4?document.all[name].style:browservers.ns4?eval('document.'+nest+name):0;
	this.right			= MoveAreaRight;
	this.left			= MoveAreaLeft;
	this.up				= MoveAreaUp;
	this.down			= MoveAreaDown;
	this.MoveArea			= MoveArea;
	this.obj 			= name + "Object";

	eval(this.obj + "= this");

	return this;
}

function MoveArea(x,y) {

	this.x=x;
	this.y=y
	this.css.left=this.x
	this.css.top=this.y
	
	searchparam = this.x;
}


function MoveAreaLeft(layerLeft,layerTop,move) {
	if(this.x>layerLeft){

		this.MoveArea(this.x+move,layerTop)
		
		if(loop){
			setTimeout(this.obj+".left("+layerLeft+","+layerTop+","+move+")",speed);
		}
	}
}


function MoveAreaRight(layerLeft,layerTop,move) {
	if(this.x<layerLeft){
		this.MoveArea(this.x+move,layerTop)
		if(loop){
			setTimeout(this.obj+".right("+layerLeft+","+layerTop+","+move+")",speed);
		}
	}
}


function MoveAreaDown(layerLeft,layerTop,move) {
	if(this.y>layerTop){
		this.MoveArea(layerLeft,this.y-move)
		if(loop){
			setTimeout(this.obj+".down("+layerLeft+","+layerTop+","+move+")",speed);
		}
	}
}


function MoveAreaUp(layerLeft,layerTop,move) {
	if(this.y>layerTop) {
		this.MoveArea(layerLeft,this.y-move)
		if(loop){
			setTimeout(this.obj+".up("+layerLeft+","+layerTop+","+move+")",speed);
		}
	}
}


function PerformScroll(objNr,layerTop,speed,direction) {

	if(initialized){
		loop=true;
		
		if(speed>0){
			
			divLayerObjects[objNr].right(0,layerTop,speed);
		}
		else {

			divLayerObjects[objNr].left(this.scrollLeftX,layerTop,speed);
		}
	}
}


function CeaseScroll() {
	loop=false
	if(timer) clearTimeout(timer)
}

function setUrl(url){

	window.location.href = url+'?pos='+searchparam;
}

function getBrowserWidth(){

	if (self.innerHeight) // all except Explorer
	{
		return self.innerWidth;
	}
	else if (document.documentElement && document.documentElement.clientHeight)
		// Explorer 6 Strict Mode
	{
		return document.documentElement.clientWidth;
	}
	else if (document.body) // other Explorers
	{
		return document.body.clientWidth;
	}
}

function reloadBrowser(){
		
	if(window.location.href.indexOf("?") > 0){

		window.location.href = window.location.href.substring(0,(window.location.href.indexOf("?")));
	}
	else{

		window.location.href = window.location.href;
	}
}


function InitializeObjects(menuID){

	if(targetstring != ""){
		if(tmpparams.length == 1){
		
			myparam = tmpparams[0].split("=");
			searchparam = parseInt(myparam[1]); 
		}
		else{
			for(i=0;i<tmpparams.length;i++){
		
				myparam[i] = tmpparams[i].split("=");
				
				if(myparam[i] != ""){
				
					if(myparam[i][0] == "pos"){
				
						searchparam = parseInt(myparam[i][1]); 				
						break;
					}
				}
			}
		}
	}
	
	divLayerObjects[0] = new construct("submenu"+menuID);
	divLayerObjects[1] = new construct("subnav");
	initialized 	 = true;
	
	divLayerObjects[0].MoveArea(searchparam,0);
	divLayerObjects[0].css.visibility = 'visible';
	
	if(getBrowserWidth() < divLayerObjects[0].el.offsetWidth){
	
		divLayerObjects[1].css.visibility = 'visible';
		
		this.scrollLeftX = (getBrowserWidth() - divLayerObjects[0].el.offsetWidth);
		
	}
	
}




var browservers		= new getTheBrowser();
var divLayerObjects	= new Array();
var speed		= 30;
var scrollLeftX		= 0;
var loop, timer;
var initialized;

var searchparam 	= 0;
var myparam 		= new Array();
var targetstring 	= window.location.search;	
var mystring 		= targetstring.substring((targetstring.indexOf("?")+1));
var tmpparams 		= mystring.split("&");




		
		