﻿onload = function() {
	init();
}

//	DHTML scroller functions
/******************************************
* Scrollable content script II- © Dynamic Drive (www.dynamicdrive.com)
* Visit http://www.dynamicdrive.com/ for full source code
* This notice must stay intact for use
******************************************/
iens6 = ( document.all || document.getElementById );
var scroller_loaded = false;
var crossobj = null;
var containobj = null;
var contentwidth = null;
var arrow_left = null;
var arrow_right = null;
var speed = null;
var moveleftvar = null;
var moverightvar = null;

function init() {
	//specify speed of scroll (greater=faster)
	speed = 3;

	if( iens6 && ( document.getElementById( "vid_scr_content" ) || document.all.vid_scr_content ) ) {
		containobj = document.getElementById ? document.getElementById( "vid_scr_container" ) : document.all.vid_scr_container;
		crossobj = document.getElementById ? document.getElementById( "vid_scr_content" ) : document.all.vid_scr_content;
		contentwidth = crossobj.offsetWidth;
		arrow_left = document.getElementById ? document.getElementById( "vid_scr_arrow_l" ) : document.all.vid_scr_arrow_l;
		arrow_right = document.getElementById ? document.getElementById( "vid_scr_arrow_r" ) : document.all.vid_scr_arrow_r;
		arrow_left.style.visibility = 'hidden';
		crossobj.style.visibility = 'visible';
		getcontent_width();
		scroller_loaded = true;
	}
}

function moveleft() {
	if( scroller_loaded ) {
		arrow_left.style.visibility = "visible";
		if( parseInt( crossobj.style.left ) >= ( contentwidth * ( -1 ) + containobj.offsetWidth ) )
			crossobj.style.left = parseInt( crossobj.style.left ) - speed + "px";
		else
			arrow_right.style.visibility = "hidden";
//		document.getElementById("status").innerHTML = crossobj.style.left;
		moveleftvar = setTimeout( "moveleft()", 15 );
	}
}


function moveright() {
	if( scroller_loaded ) {
		arrow_right.style.visibility = "visible";
		if( parseInt( crossobj.style.left ) <= -10 )
			crossobj.style.left = parseInt( crossobj.style.left ) + speed + "px";
		else
			arrow_left.style.visibility = "hidden";
//		document.getElementById("status").innerHTML = crossobj.style.left;
		moverightvar = setTimeout( "moveright()", 15 );
	}
}

function getcontent_width() {
	 contentwidth = crossobj.offsetWidth;
}