// JavaScript Document

function go(id){
if(arr_sites[id]){
var pos = divs.style.left.substr(0,divs.style.left.indexOf("px"));
location.href=arr_sites[id]+"?x="+pos
}
}

var timer     = null;
var mouseOvers = new Array();
var mouseOuts = new Array();

function Fensterweite(){
if (window.innerWidth) return window.innerWidth;
else if (document.body && document.body.offsetWidth) return document.body.offsetWidth;
else return 0;
}

function Div_weite(){
divs = document.getElementById('scroll');
if (divs.innerWidth) return divs.innerWidth;
else if (divs && divs.offsetWidth) return divs.offsetWidth;
else return 0;
}


function Divweite(){
divs = document.getElementById('scroll');
if (divs.innerWidth) return divs.innerWidth-(5*boxwidth);
else if (divs && divs.offsetWidth) return divs.offsetWidth-(5*boxwidth);
else return 0;
}

function init()
  { if ( ! (document.createElement && document.getElementsByTagName) ) return;
    var img = document.getElementById('left');
    if ( ! img ) return;
    img.onmouseover = mouseLeftGoesOver;
    img.onmouseout = mouseGoesOut;
   // mouseOuts[0] = new Image();
    // mouseOuts[0].src = img.src;
    // mouseOvers[0] = new Image();
    // mouseOvers[0].src = img.src.replace('.gif','_o.gif');
    img.number = 0;

    img = document.getElementById('right');
    if ( ! img ) return;
    img.onmouseover = mouseRightGoesOver;
    img.onmouseout = mouseGoesOut;
    // mouseOuts[1] = new Image();
    // mouseOuts[1].src = img.src;
    // mouseOvers[1] = new Image();
    // mouseOvers[1].src = img.src.replace('.gif','_o.gif');
    img.number = 1;
    divs = document.getElementById('scroll');
    max = Divweite()
	direction = steps;
	if(divs.style.left=='0px'){
	   document.getElementById('left').style.visibility = 'hidden'
	}
  }



function mouseLeftGoesOver()
  {	direction =steps;
    mouseGoesOver(this);
  }

function mouseRightGoesOver()
  {	direction = -steps;
    mouseGoesOver(this);
  }


function mouseGoesOver( imag )
  { //imag.src = mouseOvers[imag.number].src;
    if ( timer != null ) clearInterval(timer);
    timer = setInterval('step()',50);
  }

function mouseGoesOut()
  {	//this.src = mouseOuts[this.number].src;
  	if(divs.style.left != '0px' && divs.style.left != '0pt'){
		document.getElementById('left').style.visibility = 'visible'
	}else{
	    document.getElementById('left').style.visibility = 'hidden'
	}
    if ( timer != null ) clearInterval(timer);
    timer = null;
  }

function step()
  {
    if ( ! divs ) return;
    if (   (x < -max && direction < 0)  || (x > 0 && direction > 0) ) return;
	if(!((x+direction)<-max) && (x+direction)<=0){
	x += direction;
	divs.style.left = x;
  }
  }

function op( linkobj )
  { w = open(linkobj.href,"details","width=800,height=475,left=0,top=0");
    w.caller = this;
    w.focus();
  }
