startPos=30 // Starting Position of First line in Pixels
loop=true // Loop Scrolling (T/F)
iSpeed=180 // Speed of scrolling: Increase to reduce speed
pxStep=1 // Number of Pixels per step

// Initiate News Scroller
function getName(theURL) {
var theName = "";
//find the location of the final slash if it exists
if (theURL.charAt(theURL.length-1) == "/") {
theURL = theURL.slice(0, -1);
}

slashLoc = theURL.lastIndexOf("/");
if (slashLoc > 0) {
theName = theURL.slice(slashLoc+1);

//get rid of trailing .xxx
dotLoc = theName.lastIndexOf(".");
if (dotLoc > 0) {
theName = theName.slice(0, dotLoc);
}

} 
//else {
//theName = "Top";
//}

return theName;
}

function NewsInit(){
	//alert(document.location.href);
	//alert(getName(document.location.href));
	if (getName(document.location.href) != "index")
	{
		return;
	}
	
	if (bw.ns5==1) startPos=0;
	objNewsBox=new createLayer('NewsBox')
	objNewsItems=new createLayer('NewsItems','NewsBox')
	objNewsItems.moveIt(0,startPos)
	objNewsBox.css.visibility='visible'
	objNewsItems.scroller(iSpeed)
}
// Scrolling Function
function scroller(iSpeed){
	if(this.y>-this.scrollHeight){
		this.moveIt(0,this.y-pxStep)
		setTimeout(this.obj+".scroller("+iSpeed+")",iSpeed)
	}else if(loop) {
		this.moveIt(0,startPos)
		eval(this.obj+".scroller("+iSpeed+")")
	  }
}
// Set Browser Object
function setBrObj(){
	this.ver=navigator.appVersion
	this.dom=document.getElementById?1:0
	this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;
	this.ie4=(document.all && !this.dom)?1:0;
	this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0;
	this.ns4=(document.layers && !this.dom)?1:0;
	this.bw=(this.ie5 || this.ie4 || this.ns4 || this.ns5)
	return this
}
// Create Layers
function createLayer(obj,nest){
    nest=(!nest) ? '':'document.'+nest+'.'
	this.el=bw.dom?document.getElementById(obj):bw.ie4?document.all[obj]:bw.ns4?eval(nest+'document.'+obj):0;
  	this.css=bw.dom?document.getElementById(obj).style:bw.ie4?document.all[obj].style:bw.ns4?eval(nest+'document.'+obj):0;
	this.scrollHeight=bw.ns4?this.css.document.height:this.el.offsetHeight
	this.scroller=scroller;
	this.moveIt=b_moveIt; this.x; this.y;
    this.obj = obj + "Object"
    eval(this.obj + "=this")
    return this
}
// Movement of Scroller
function b_moveIt(x,y){
	this.x=x;this.y=y
	this.css.left=this.x
	this.css.top=this.y
}
bw=new setBrObj()
