var w3c=(document.getElementById)?true:false;
var scrollStop=true;
var ns4=(document.layers)?true:false;
var ie4=(document.all && !w3c)?true:false;
var ie5=(document.all && w3c)?true:false;
var ns6=(w3c && navigator.appName.indexOf("Netscape")>=0)?true:false;

var ob = getObj("scroll");
var box=getObj("newsbar");
var obWid=500; //getWidth(ob);

var boxW = getWidth(box);
var obWidth = getWidth(ob);

var incPos = 10;
var pass = 2;

function overDiv()
{ scrollStop=true;
	if(ob.style.filter) ob.style.filter="progid:DXImageTransform.Microsoft.Alpha(Opacity=95)";
}
function outDiv()
{ scrollStop=false;
	if(ob.style.filter) ob.style.filter="progid:DXImageTransform.Microsoft.Alpha(Opacity=75)";
}

function moveTo(pos)
{ if (ob.style) var sty = ob.style;
	else sty = ob;
	sty.left = pos+'px';	}

function getWidth(obj)
{
	if (!obj) return 0;
	var w;
	if(ns4) w = obj.document.width; //? obj.document.width : (obj.clip.right-obj.clip.left);
	else 	if(ie4||ie5) w= (obj.style.width)? obj.style.width : obj.clientWidth;
					else w = (obj.style.width)? parseInt(obj.style.width):parseInt(obj.offsetWidth);
	return parseInt(w);
}

var timeLine=null;
function moveBy()
{
if(scrollStop) return;
if (ob.style) sty = ob.style;
else sty = ob;
var myleft=parseInt(sty.left);
if (isNaN(myleft)) myleft=0;
sty.left = ''+(myleft-pass)+'px';
}

function initBox()
{	
	if(!ob) return;		
	if (ob.style) ob.style.visibility="visible";
	else ob.visibility="visible";
	moveTo(incPos + boxW); 
	scrollStop=false;	scrollMe();}

function scrollMe()
{ 
obWidth = getWidth(ob);
if (ob.style) obLeft = ob.style.left;
else obLeft = ob.left;
moveBy();

if (parseInt(obLeft)+10<(incPos- obWidth)) 
{scrollStop=true;initBox();window.clearTimeout(timeLine)}
//Scrolling speed set here
timeLine=window.setTimeout("scrollMe()", 20);
//window.status = obWidth;
}

function getObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=getObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

/*function initialize()
{	setTimeout('initBox()',1000);
}
initialize();*/
initBox();
//window.onload = initBox;
