/*
var obj1;
var obj2;
var rl=0;
var ud=0;
var rht;
var lft;
var upp;
var dwn;
var speed=360;

function start_scroll(){
	obj1=document.getElementById('horizontal');	
	obj2=document.getElementById('vertical');
	
	document.getElementById('right').onmouseover=function() {
		goRight();
	}
	document.getElementById('left').onmouseover=function() {
		goLeft();
	}
	/*
	document.getElementById('up').onmouseover=function() {
		goUp();
	}
	document.getElementById('down').onmouseover=function() {
		goDown();
	}
	
}

function goLeft() {
	if(rl>0) {
	   clearTimeout(lft);
	   return;
	}
	document.getElementById('left').onmouseout=function() {
	   clearTimeout(lft);
	   return;
	}
	obj1.style.left=rl+'px';
	rl+=2;
	lft=setTimeout('goLeft()',120);
}

function goRight() {
	end = parseInt(obj1.style.width)-540;
	if(rl<-end) {
	   clearTimeout(rht);
	   return;
	}
	document.getElementById('right').onmouseout=function() {
	   clearTimeout(rht);
	   return;
	}
   	obj1.style.left=rl+'px';
   	rl-=2;
	rht=setTimeout('goRight()',120);
}


window.onload=function() {
	start_scroll();
}
*/

var amount=0
var amount_hor=0
var go=1
function scroll(merre) {
  go=1
  if (merre == 'left') scrollleft();
  else if (merre == 'right') scrollright();
  else if (merre=='up') scrollup(); 
  else if(merre=='down')  scrolldown();
}

function scrollleft() {
  amount_hor=amount_hor+2
  document.getElementById('horizontal_container').scrollLeft=amount_hor
  if (go==1) setTimeout("scrollleft()",10)
}

function scrollright() { 
  amount_hor=amount_hor-2
  if (amount_hor<0) amount_hor=0
  document.getElementById('horizontal_container').scrollLeft=amount_hor
  if (go==1) setTimeout("scrollright()",10)
}

function scrolldown() {
  amount=amount+2
  document.getElementById('vertical_container').scrollTop=amount
  if (go==1) setTimeout("scrolldown()",10)
}

function scrollup() { 
  amount=amount-2
  if (amount<0) amount=0
  document.getElementById('vertical_container').scrollTop=amount
  if (go==1) setTimeout("scrollup()",10)
}

function scrollstop() {
  go=0
}