function checkBrowser(){
	this.win=(navigator.platform=="Win32")?1:0;
	this.mac=(navigator.platform=="MacPPC")?1:0;
	this.ns4 = (document.layers) ? true : false;
	this.ie4 = (document.all && !document.getElementById) ? true : false;
	this.ie5 = (document.all && document.getElementById) ? true : false;
	this.ns6 = (!document.all && document.getElementById) ? true : false;			
	return this
}

function objLayer(id) {
	/* object pointer */ 
	this.obj=document.getElementById(id);
	
	/* style reference */
	this.css=document.getElementById(id).style;

	if (bw.ie5) {this.x=this.css.pixelLeft; this.y=this.css.pixelTop; this.h=this.obj.scrollHeight; this.w=this.obj.scrollWidth}
	if (bw.ns6) {this.x=this.css.left; this.y=this.css.top; this.w=this.css.width; this.h=this.css.height;}
	/* mac variant */
	if (bw.mac && (bw.ie4 || bw.ie5)) {this.h=this.obj.clientHeight; this.w=this.obj.clientWidth}
	
	return this;
}

function obj_moveTo(x,y){
	this.x=x
	this.y=y
	this.css.left=this.x+"px";
	this.css.top=this.y+"px";
}

function obj_moveBy(x,y){
	this.x+=x
	this.y+=y
	this.css.left=this.x+"px";
	this.css.top=this.y+"px";
}

function obj_setSize(w,h) {
	this.css.width=w;
	this.css.height=h;
	this.w=w;
	this.h=h;
}

function obj_hide(){
	this.css.visibility='hidden'
}

function obj_show(){
	this.css.visibility='visible'
}

function obj_setZIndex(z){
	this.css.zIndex = z
}

function obj_changeBackColor(c) {
	this.css.backgroundColor = c;
	this.css.bgColor = c;
}

objLayer.prototype.moveTo=obj_moveTo
objLayer.prototype.moveBy=obj_moveBy
objLayer.prototype.hide=obj_hide
objLayer.prototype.show=obj_show
objLayer.prototype.setSize=obj_setSize
objLayer.prototype.setZIndex=obj_setZIndex
objLayer.prototype.changeBack=obj_changeBackColor

var bw = new checkBrowser();
var tickerTimer;

function windowWidth() {
	return document.body.clientWidth
}

window.onresize=checkscreen

function checkscreen() {
	screenadjust()
}

function screenadjust() {	
	var xloc=Math.round(windowWidth()/2)
	var tempx=xloc-(706/2)
	if ((tempx<0)||isNaN(tempx)) {tempx=0}
	containerobj.moveTo(tempx,0)
	containerobj.show()
}

function init() {
	containerobj=new objLayer("container")
	var xloc=Math.round(windowWidth()/2)
	var tempx=xloc-(706/2)
	if ((tempx<0)||isNaN(tempx)) {tempx=0}
	containerobj.moveTo(tempx,0)
	containerobj.show()
	// ticker
	tickerobj=new objLayer("ticker");
	tickerTimer=setTimeout("moveTicker()",10);
}

function moveTicker() {
	tickerx+=-1;
	tickerobj.moveTo(tickerx,0);
	if ((tickerx*-1)>document.getElementById("ticker").scrollWidth) tickerx=720;
	tickerTimer=setTimeout("moveTicker()",10);
}
tickerx=720;
