var deceleratevalue=1.1; //the amount by which the scroll slows down - must be at least 1.1
var whitespace=60; //amount of white space to show above scrollin stuff
var scrollspeed=4; //initial speed in pixels of scroll
var maxspeed=100; //max scroll speed
var tp=0; //current photo position
var moveto=0;//current or next move to position
var count=0;//counter for gap below
var gap=250; //pause between movements
var tm=document.getElementById("index_picture_scroller");//picture container


function clock() {
  //move big pictures
  if (moveto<tp) {
	  movespeed=Math.round((tp-moveto)/2);
	  if (movespeed>maxspeed) movespeed=maxspeed;
	  tp=tp-(movespeed/2);
  } else if (moveto>tp) {
	  movespeed=Math.round((moveto-tp)/2);
	  if (movespeed>maxspeed) movespeed=maxspeed;
	  tp=tp+(movespeed/2);
  }
  tm.style.left=tp + "px";
//switch big pictures at timed intervals
  count++;
  if (count==(gap*1)) {
	  moveto=-1490;
  } else if (count==(gap*2)) {
	  moveto=-2980;
  } else if (count==(gap*3)) {
	moveto=-4470;
  } else if (count==(gap*4)) {
	moveto=-5960;
  } else if (count==(gap*5)) {
	moveto=-1490
	tm.style.left="0px";
	tp=0;
	count=151;
  }
}

function changetp(get) {
	moveto=get;
}

var timer=self.setInterval("clock()",20);
