/********************************************************************************
Copyright (C) 1999 Thomas Brattli
This script is made by and copyrighted to Thomas Brattli at www.bratta.com
Visit for more great scripts. This may be used freely as long as this msg is intact!
I will also appreciate any links you could give me.
********************************************************************************/

//Default browsercheck
function checkBrowser(){
	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
}
bw=new checkBrowser()

function moveIt(x,y){
	this.x=x;this.y=y
	this.css.left=this.x
	this.css.top=this.y
}

function showIt(){
	this.css.visibility="visible"
}

function hideIt(){
	this.css.visibility="hidden"
}

function resized(){
	page2=new makePageObject()
	if(page2.x2!=page.x2 || page2.y2!=page.y2){
		location.reload() //If the width or height have changed we reload the page.
	}
}

//This is the code for the News scroll

//The pixel value of where you want the layer to start (from the top)
lstart=725

//Set this to false if you just want it to go one time
newsLoop=true 

//Set the speed, lower value gives more speed
newsSpeed=20

//Set this to how many pixels you want it to go for each step, this also changes the speed.    
pr_step=2

//Object constructor
function newsMakeObj(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.scrollWidth=bw.ns4?this.css.document.width:this.el.offsetWidth
	this.newsScroll=newsScroll;
	this.moveIt=moveIt; this.x; this.y;
    this.obj = obj + "Object"
    eval(this.obj + "=this")
    return this
}
//Makes the object scroll up
function newsScroll(speed){
	if(this.x>-this.scrollWidth){
		this.moveIt(this.x-pr_step,0)
		setTimeout(this.obj+".newsScroll("+newsSpeed+")",newsSpeed)
	}else if(newsLoop) {
		this.moveIt(lstart,0)
		eval(this.obj+".newsScroll("+newsSpeed+")")
	  }
}
//Makes the object
function newsScrollInit(){
	oNewsCont=new newsMakeObj('divNewsCont')
	oNewsScroll=new newsMakeObj('divNewsText','divNewsCont')
	oNewsScroll.moveIt(lstart,0)
	oNewsCont.css.visibility='visible'
	oNewsScroll.newsScroll(newsSpeed)
}

function init(){
	newsScrollInit();
}

//Call the init on page load
onload=init;


