/* sitefunction.js */
/* sitestyle.css */
/* 2008 hinzugefügt - Sebastian May */

status = ""
browserName = navigator.appName;
browserVer = parseInt(navigator.appVersion);
if ((browserName == "Netscape" && browserVer >= 3) ||
  (browserName == "Microsoft Internet Explorer" && browserVer >= 4))
  version = "n3";
else version = "n2";

function KickIt(qq,xx) {
  if (version == "n3") {
    pic = document[qq];
    picsrc = "../../images/KickIt/" + pic.name + xx +".jpg";
    pic.src = picsrc;
    status = qq;
  }
}

var scrolling = false;
var actualPos = 0;
var width = 600;
var thePos=dimx=Dimx=0,time;

function stopMove()
{
  scrolling = false;
}

function moveLeft()
{
  scrolling = true;
  
  moveLeft2();
}

function moveLeft2()
{
  var divElement = document.getElementById("scrollDiv");
  
  actualPos = actualPos - 2;
  getPos(actualPos);

  if (scrolling && actualPos >= 0)
    setTimeout("moveLeft2();",1);
}

function moveRight() 
{
  scrolling = true;
  
  moveRight2();
}

function moveRight2() 
{
  var divElement = document.getElementById("scrollDiv");
  
  actualPos = actualPos + 2;
  getPos(actualPos);

  if (scrolling && actualPos <= maxPos - width)
    setTimeout("moveRight2();", 1);
}

function getPos(pos)
{
	thePos 	= pos-(pos*2);

	browser	= navigator.appName;
	usAgent = navigator.userAgent;

	if (browser == "Microsoft Internet Explorer" || usAgent.indexOf("Opera") >- 1) 
	clearTimeout(time);

	dmx();
}

function dmx()
{
	srollVarianten = 1;
    
	time 	= setTimeout("dmx()",0);

	dimx 	= Math.round(Dimx+=((thePos)-Dimx)*4/20);

	if (document.getElementById)
	{
		(srollVarianten==0) ?
		document.getElementById("scrollDiv").style.top  = dimx :
		document.getElementById("scrollDiv").style.left = dimx;
	}
	else if (document.all)
	{
		(srollVarianten==0) ?
		document.all["scrollDiv"].style.top  = dimx :
		document.all["scrollDiv"].style.left = dimx;
	}

	if (thePos == dimx) clearTimeout(time);
}