/*
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 appriciate any links you could give me. 
*/
// Courtesy of SimplytheBest.net (http://simplythebest.net/info/dhtml_scripts.html)
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()

//lstart=75
loop=true 
speed=100//120//		75//10//
pr_stepx=(Math.random()>0.5)?1:-1;
pr_stepy=(Math.random()>0.5)?1:-1;//0.2
viewwidth=830
viewheight=80+3
scrollon=false

function makeObj(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=b_moveIt; this.x; this.y;
    this.obj = obj + "Object"
    eval(this.obj + "=this")
    return this
}
function b_moveIt(x,y){
	this.x=x;this.y=y
	this.css.left=this.x
	this.css.top=this.y
}
function newsScroll(speed){
	
	
	
	
		if (this.x<-this.scrollWidth+viewwidth || this.x>0) 
		{
			pr_stepx = -pr_stepx;//0.5 + Math.random();
		}
		if (this.y<-this.scrollHeight+viewheight || this.y>0) 
		{
			pr_stepy = -pr_stepy;//0.5 + Math.random();
		}
		
		this.moveIt(this.x-pr_stepx,this.y-pr_stepy)//this.moveIt(0,this.y-pr_step)
		if (scrollon){setTimeout(this.obj+".newsScroll("+speed+")",speed)}
      
      
      /*
      if ((yp[i] > doc_height) | (yp[i] < 10 )) {
        sty[i] = -sty[i];//0.5 + Math.random();
      } */    
	
	/*else if(loop) {
		pr_step=-pr_step
		//this.moveIt(0,lstart)
		eval(this.obj+".newsScroll("+speed+")")
	  }*/
}
function newsScrollInit(){


	//lstart=75
	loop=true 
	speed=20 + Math.random()*100//		75//10//
	pr_stepx=(Math.random()>0.5)?1:-1;
	pr_stepy=(Math.random()>0.5)?1:-1;//0.2
	viewwidth=830
	viewheight=80+3
	scrollon=false


	//oNewsCont=new makeObj('divaltimage')
	//oNewsCont.css.visibility='hidden'
	//oNewsCont.css.display='none'
	
	scrollon=true;
	oNewsCont=new makeObj('divNewsContpan')
	oNewsScroll=new makeObj('divNewsTextpan','divNewsContpan')
	//oNewsScroll.moveIt(-430,-5)//-30
	oNewsScroll.moveIt(-(Math.random()*(oNewsScroll.scrollWidth-viewwidth-50)),-(Math.random()*(oNewsScroll.scrollHeight-viewheight-50)))//-30
	
	//oNewsCont.css.display=''
	oNewsCont.css.visibility='visible'
	
	oNewsScroll.newsScroll(speed)
	
			
		
		
}

function newsScrollExit(){

	scrollon=false;
	oNewsCont=new makeObj('divNewsContpan')
	oNewsCont.css.visibility=''
	oNewsScroll.newsScroll(10000)
	
}

