var crossobj1;
var contentwidth;
function jsScroller (o, w, h) {
	var self = this;
	var list = o.getElementsByTagName("div");
	for (var i = 0; i < list.length; i++) {
		if (list[i].className.indexOf("Scroller-Container") > -1) {
			o = list[i];
		}
	}
	
	//Private methods
	this._setPos = function (x, y) {
		if (x < this.viewableWidth - this.totalWidth) 
			x = this.viewableWidth - this.totalWidth;
		if (x > 0) x = 0;
		if (y < this.viewableHeight - this.totalHeight) 
			y = this.viewableHeight - this.totalHeight;
		if (y > 0) y = 0;
		this._x = x;
		this._y = y;
		with (o.style) {
			left = this._x +"px";
			top  = this._y +"px";
		}
	};
	
	//Public Methods
	this.reset = function () {
		this.content = o;
		this.totalHeight = o.offsetHeight;
		this.totalWidth	 = o.offsetWidth;
		this._x = 0;
		this._y = 0;
		with (o.style) {
			left = "0px";
			top  = "0px";
		}
	};
	this.scrollBy = function (x, y) {
		this._setPos(this._x + x, this._y + y);
	};
	this.scrollTo = function (x, y) {
		this._setPos(-x, -y);
	};
	this.stopScroll = function () {
		if (this.scrollTimer) window.clearInterval(this.scrollTimer);
	};
	this.startScroll = function (x, y) {
		this.stopScroll();
		this.scrollTimer = window.setInterval(
			function(){ self.scrollBy(x, y); }, 40
		);
	};
	this.swapContent = function (c, w, h) {
		o = c;
		var list = o.getElementsByTagName("div");
		for (var i = 0; i < list.length; i++) {
			if (list[i].className.indexOf("Scroller-Container") > -1) {
				o = list[i];
			}
		}
		if (w) this.viewableWidth  = w;
		if (h) this.viewableHeight = h;
		this.reset();
	};
	
	//variables
	this.content = o;
	this.viewableWidth  = w;
	this.viewableHeight = h;
	this.totalWidth	 = o.offsetWidth;
	this.totalHeight = o.offsetHeight;
	this.scrollTimer = null;
	this.reset();
};

var scroller = null;
window.onload = function () {
    if (iens6){
     try{
	    crossobj1=document.getElementById? document.getElementById("content1") : document.all.content1;
		    var contentheight=crossobj1.offsetHeight;
	    contentwidth=450; //crossobj.offsetWidth;
        getcontent_height();
	    }
	    catch(ex){}
    }
    var el = document.getElementById("Scroller-1");
    scroller = new jsScroller(el, 180,130);
}

//scroll left js....................................................................................
//specify speed of scroll (greater=faster)

var speed=5;
iens6=document.all||document.getElementById;
ns4=document.layers;


function moveright(n){
	if ( eval('window.moveleftvar' + n) ) clearTimeout( eval('window.moveleftvar' + n) );
	if (iens6 && parseInt( eval('crossobj' + n + '.style.left') ) >= (contentwidth*(-1)-715))
		eval('crossobj' + n + '.style.left=parseInt(crossobj' + n + '.style.left)-speed+"px"');
	eval('moverightvar' + n + '=setTimeout("moveright(' + n + ')", 1)');
}

function moveleft(n){
	if ( eval('window.moverightvar' + n) ) clearTimeout( eval('window.moverightvar' + n) );

	if (iens6 && parseInt( eval('crossobj' + n + '.style.left') ) <= -3 )
		eval( 'crossobj' + n + '.style.left=parseInt(crossobj' + n + '.style.left)+speed+"px"' );
	eval('moveleftvar' + n + '=setTimeout("moveleft(' + n + ')", 1)');
}


function stopscroll(n){
	if ( eval('window.moverightvar' + n) ) clearTimeout( eval('window.moverightvar' + n) );
	if ( eval('window.moveleftvar' + n) ) clearTimeout( eval('window.moveleftvar' + n) );
}

function getcontent_height(){
if (iens6)
	contentheight=crossobj1.offsetHeight;
	
else if (ns4)
	document.nscontainer.document.nscontent.visibility="show";
}
//window.onload=getcontent_height




