/**
 *variable declaration
 *dif. temp. variables
 * (containerwidth must be a number that can be devided through 10)
 */
var oldscrollposition490=0;
var scrolling490=true;
var diff490=0;
var actpos490=0;
var corrpos490=0;
var addedpos490=0;
var btnaktive490 = true;
var cwidth490=150;
/**
 *@methode: hidearrows490 ()
 *hiddes all not needed arrows
 * calls: presscountarrays490(); & contentwidth490();
 */
function hidearrows490 (){
  var arrleng = entries490.length-1;
    for(var i=1; i<=arrleng; i++){
	if(entries490[i] == 2){
	  pathobj1 = document.getElementById("490arrow"+i+"r");
	  pathobj1.style.visibility = "hidden";
	}
        pathobj2 = document.getElementById("490arrow"+i+"l");
        pathobj2.style.visibility = "hidden";
    }
  presscountarrays490();
  contentwidth490();
}
/**
 *@array: presscout
 * counter variable
 */
var presscount = new Array();
/**
 *@methode: presscountarrays490()
  *filles the the presscount array
 */
function presscountarrays490(){
  for (var a=1; a<=(entries490.length-1); a++){
    presscount[a] = 1;
  }
}
/**
 *@methode: contentwidth490()
 *calculates the content container width
 */
function contentwidth490 (){
  var arrleng = entries490.length-1;
    for(var i=1; i<=arrleng; i++){
      pathobj = document.getElementById("490content"+i);
      var contwidht = entries490[i]*cwidth490;
     // pathobj.style.width = contwidht;
    }
}
/**
 *@methode: goTo490()
 *coordinates the content box movement
 */
function goTo490() {
  if ((diff490>0.5)||(diff490<-0.5)){
    crossobj.style.left=oldscrollposition490+(diff490/4);
    oldscrollposition490 += diff490/4;
    diff490 -= diff490/4;
    aktiv = window.setTimeout("goTo490()",20);
  }else{
    window.clearTimeout(aktiv);
    var temp=parseInt(crossobj.style.left);
    corrpos490 = actpos490 + addedpos490;
    crossobj.style.left = corrpos490;
    scrolling490=true;
    btnaktive490=true;
  }
}
/**
 *@methode: arrowvis490 (n)
 *handles the visibility of the arrows
 * n: number of content box
 */
function arrowvis490 (n){
  var totalcount = entries490[n]-4;
  arrowobjl = document.getElementById("490arrow"+n+"l");
  arrowobjr = document.getElementById("490arrow"+n+"r");
  if(presscount[n] == 1){
    arrowobjl.style.visibility = "hidden";
    arrowobjr.style.visibility = "visible";
  }else if(presscount[n] == totalcount){
    arrowobjl.style.visibility = "visible";
    arrowobjr.style.visibility = "hidden";
  }else{
    arrowobjl.style.visibility="visible";
    arrowobjr.style.visibility="visible";
 }
}
/**
 *@methode: goLeft490(whichone)
 *handles the left movement of the content box
 * whichone: actual number of the content item
 */
function goLeft490(whichone){
  if(btnaktive490){
    btnaktive490 = false;
    crossobj = document.getElementById("490content"+whichone);
    oldscrollposition490=parseInt(crossobj.style.left);
    presscount[whichone] = presscount[whichone]-1;
    arrowvis490(whichone);
    if((parseInt(crossobj.style.left))<0){
      setPosition490(cwidth490);
    }
  }
}
/**
 *@methode: goRight490(whichone)
 *handles the right movement of the content box
 * whichone: actual number of the content item
 */
function goRight490(whichone){
  if(btnaktive490){
    btnaktive490 = false;
    crossobj = document.getElementById("490content"+whichone);
    presscount[whichone] = presscount[whichone]+1;
    oldscrollposition490=parseInt(crossobj.style.left);
    arrowvis490(whichone);
    if((parseInt(crossobj.style.left))>-((cwidth490*(entries490[whichone]-4))-cwidth490)){
      setPosition490(-cwidth490);
    }
  }
}
/**
 *@methode: setPosition490(newposition)
 *handles the right movement of the content box
 * newposition: number of new content item
 */
function setPosition490(newposition){
  if(scrolling490){
    diff490=newposition;
	addedpos490=newposition;
    scrolling490=false;
	actpos490 = parseInt(crossobj.style.left);
    goTo490();
  }
}
