var pos=0;
function scroll(direction, divname ) {
         /* direction (left, up, down right) */

         if (direction == "left") window.setTimeout("move("+Math.abs(1*80)+", 1, 1,'"+divname+"')",100);
         if (direction == "right") window.setTimeout("move("+Math.abs(1*80)+", -1, 1,'"+divname+"')",100);
         if (direction == "up") window.setTimeout("move("+Math.abs(1*80)+", 1, 0,'"+divname+"')",100);
         if (direction == "down") window.setTimeout("move("+Math.abs(1*80)+", -1, 0,'"+divname+"')",100);


}

function move(counter, i, i2,divname) {


	if (counter >= 1 && (pos < 0|| i<0)) {
        	 	pos = pos + (i*counter*0.2)/2;
	        counter--;
                 if (i2 ==0) {
                        document.getElementById(divname).style.marginTop=pos+"px";
                 } else {
                        document.getElementById(divname).style.marginLeft=pos+"px";
                 }

	        window.setTimeout("move("+(counter)+", "+ i +", "+ i2 + ",'"+divname+"')",5);
	}

}