

function goLeft() {
	travel('fwdscroll',-75)
}
function goRight() {
	travel('fwdscroll',75)
}

var tId = null;
function travel(eid, scrollOff) {
    telem = document.getElementById(eid);
    tfrom = telem.scrollLeft;
    tto = tfrom + scrollOff;
    tId = setInterval('microScroll(\'' + eid + '\','+tfrom+', '+tto+')', 40);
}

function microScroll(eid, tfrom, tto)
{
    telem = document.getElementById(eid);
    cpos = telem.scrollLeft;
	
	step = parseFloat(cpos-Math.floor(tfrom,tto)) / Math.abs(tfrom - tto);
	if (tfrom > tto) {
	    step = 1 - step;	    
	}

	step = (1 + step) * 12;
	
	if (tfrom>tto) {
	    telem.scrollLeft = telem.scrollLeft - step;
		if (telem.scrollLeft<=tto||telem.scrollLeft==0) {
			clearInterval(tId);
			tId = null;
		}
	} else {
    	telem.scrollLeft = telem.scrollLeft + step
    	if (telem.scrollLeft >= tto || telem.scrollLeft >= (telem.scrollWidth - telem.offsetWidth)) {
			clearInterval(tId);
			tId = null;
		}
	}
}
