//JSON object holding details of slideshow.
var details = {
	top: 53,
	height: 190,
	width: 195,
	left: 22,
	clip: 100
};

//quicker than printing document.getelementbyid everywhere
function get(obj){
	return document.getElementById(obj);
}

//the actual function
function scrollNews(newsDiv, toMove){
	var theDiv = get(newsDiv.toString());
	if (theDiv == null) {
		return;
	}
	if (document.layers) {
		theDiv.clip.top = toMove;
		theDiv.clip.bottom = toMove + details.clip;
		theDiv.top = details.top - toMove;
	}
	else {
		theDiv = theDiv.style;
		theDiv.clip = "rect(" + toMove + "px " + (details.width + details.left) + "px " + (toMove + details.clip) + "px 0px)";
		theDiv.top = details.top - toMove + 'px';
	}
	if ((details.top + details.height - toMove) < (details.top - details.height - 20)) {
		toMove = 0;
		if (document.layers) {
			theDiv.clip.top = details.top;
			theDiv.clip.bottom = details.clip;
			theDiv.top = details.top
		}
		else {
			theDiv.clip = "rect(" + toMove + "px " + (details.width + details.left) + "px " + (toMove + details.clip) + "px 0px)";
			theDiv.top = details.top + 'px';
		}
	}
	toMove = (toMove + 1);
	setTimeout("scrollNews('" + newsDiv + "'," + toMove + ")", 100);
}


