function SCROLL(){
	this._direction =	1;
	this.scroll_speed = null;
	this._name = null;
	this.stop_scroll = false;
	this.tmp_stop_scroll = false;
	this.ObjToScroll	=	null;
	return this;
}

SCROLL.prototype.init = function(){
	this.ObjToScroll.style.position = "absolute";
	this.ObjToScroll.style.width = "150px";
	this.ObjToScroll.style.top = (this._direction == 1)?  0:0 - this.ObjToScroll.clientHeight + this.container_height ;
}

SCROLL.prototype.makeMove = function(){ 
	if(parseInt(this.ObjToScroll.style.top) >= 0 && this._direction == 1){	
		this.stop_scroll = true;
	} 
	if(parseInt(this.ObjToScroll.style.top) + this.ObjToScroll.clientHeight - this.container_height <= 0 && this._direction == -1){	
		this.stop_scroll = true;
	}

	if(this.stop_scroll == false){   
		this.ObjToScroll.style.top = parseInt(this.ObjToScroll.style.top) + (this._direction * 20 ) ; 
		setTimeout((this._name+".makeMove()"), this.scroll_speed); 	
	}
}

var nScroll = null;

function doNEWSINIT(){
	try	{

		nScroll = new SCROLL();
		if(null != nScroll){
			nScroll.ObjToScroll	= getElt("CurrentVisitationsScroller");
			nScroll.stop_scroll = true;
			nScroll._direction =	1;
			nScroll.scroll_speed = 170;
			nScroll._name = "nScroll";
			nScroll.container_height = getElt("CurrentVisitationsContainer").clientHeight;
			nScroll.init();
		}
	}
	catch(e)
	{
		alert(e.description)
	}
}

function stopScroll(){
	if(nScroll){
		nScroll.stop_scroll = true;
	}
}

function startScroll(direction){
	if(nScroll){
		nScroll._direction = direction;
		nScroll.stop_scroll = false;
		nScroll.makeMove();
	} else {
		doNEWSINIT();
		startScroll(direction);
	}
}


function getElt(sElement){
    if( document.layers ){
        var currentLayer = document.layers[sElement];
        for( var i = 1 ; i < getElt.arguments.length && currentLayer ; i++ ){
            currentLayer = currentLayer.document.layers[getElt.arguments[i]];
        }
        return currentLayer;
    }  else if( document.getElementById && document.getElementsByName )    {
        var name = getElt.arguments[getElt.arguments.length - 1];

        if( document.getElementById( name ) )       {
          return document.getElementById( name );
        } else if( document.getElementsByName( name ) ) {
					return document.getElementsByName( name )[0];
        }
    } else if( document.all ){
        var elt = document.all[getElt.arguments[getElt.arguments.length - 1]];
        return( elt );
    }
    return null;
}