//var strNewsLink='sw319.asp'//'graphics/systemgraphics/frontpage/news.html'
var iNewsW=266
var iNewsH=128
var iContentWidth=730
var iTopPos=160
var iLeftMargin=452

var strStyle = "";
strStyle += '<STYLE type="text/css">'

strStyle += '.news	{'
strStyle += '			position:absolute;'
strStyle += '			border:0;'
strStyle += '			top:100;'
strStyle += '			left:100;'
strStyle += '			width:'+iNewsW+';'
strStyle += '			height:'+iNewsH+';'
strStyle += '			clip: rect(0px '+iNewsW+'px '+iNewsH+'px 0px);'
strStyle += '			visibility:	hidden;'
//strStyle += '			overflow:hidden;'
strStyle += '			z-index:10;'
strStyle += '		}'
strStyle += '</STYLE>'
document.write(strStyle)

function bwcheck(){
	this.ver=navigator.appVersion; this.agent=navigator.userAgent
	this.dom=document.getElementById?1:0
	this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;
	this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom)?1:0;
	this.ie4=(document.all && !this.dom)?1:0;
	this.ie=this.ie4||this.ie5||this.ie6
	this.mac=this.agent.indexOf("Mac")>-1
	this.opera5=this.agent.indexOf("Opera 5")>-1
	this.ns6=(this.dom && parseInt(this.ver) >= 5) ?1:0; 
	this.ns4=(document.layers && !this.dom)?1:0;
	this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.opera5 || this.dom)
	return this
}
var bw=new bwcheck()


function layerObj(obj,nest) {
	if(!bw.bw) return message('Old browser')
	this.evnt=bw.dom && document.getElementById(obj)||bw.ie4 && document.all[obj]|| (nest?bw.ns4 && document[nest].document[obj]:bw.ns4 && document.layers[obj]);
	if(!this.evnt) return message('The layer does not exist ('+obj+') - Exiting script\n\nIf your using Netscape please check the nesting of your tags!')
	this.css=bw.dom||bw.ie4?this.evnt.style:this.evnt;     
	this.ref=bw.dom||bw.ie4?document:this.css.document;
	this.x=this.css.left||this.css.pixelLeft||this.evnt.offsetLeft||0;
	this.y=this.css.top||this.css.pixelTop||this.evnt.offsetTop||0;
	this.w=this.ref.width||this.evnt.offsetWidth||this.css.pixelWidth||0;
	this.h=this.ref.height||this.evnt.offsetHeight||this.css.pixelHeight||0
	if (bw.dom) this.h=this.evnt.offsetHeight;
	this.obj = obj + "Object"; 	eval(this.obj + "=this")
	this.zindex = bw.dom && this.css.zIndex||bw.ie4 && this.css.zOrder||bw.ns4 && this.evnt.zIndex;
	return this;
}

function makePageCoords(){
	this.x=0;this.x2=(bw.ns4 || bw.ns5)?innerWidth:document.body.offsetWidth-20;
	this.y=0;this.y2=(bw.ns4 || bw.ns5)?innerHeight:document.body.offsetHeight-5;
	this.x50=this.x2/2;	this.y50=this.y2/2;
	return this;
}
function resized(){
		page2=new makePageCoords()
		if(page2.x2!=page.x2 || page.y2!=page2.y2) location.reload()
}

function lib_moveIt(x,y){
	this.x=x;this.y=y
	this.css.left=x;this.css.top=y;
}
layerObj.prototype.moveTo = lib_moveIt;

function lib_showIt(iVisibility){ // show - Show a layer
	this.css.visibility=(iVisibility == 1) ? "visible" : "hidden";
	this.bSwitch = (iVisibility == 1 ) ? 1: -1;
}
layerObj.prototype.show = lib_showIt;

//Iframe and layer with news
var newsLayer='<DIV id="textDiv" class="news">\n'
+'<LAYER NAME="textLayer" src="'+strNewsLink+'" LEFT=0 TOP=0 WIDTH="'+iNewsW+'" HEIGHT="'+iNewsH+'"></LAYER>\n'
+'<IFRAME SRC="'+strNewsLink+'" NAME="textFrame" border="0" SCROLLING="auto" WIDTH="'+iNewsW+'" '
+'HEIGHT="'+iNewsH+'" MARGINWIDTH=0 MARGINHEIGHT=0 FRAMEBORDER="No"></IFRAME>\n'
+'</DIV>\n'


function load(page) {
        if (bw.ns4) document.textDiv.document.textLayer.src = page
        else if (bw.dom) parent.textFrame.document.location = page
}
//browser width

function fncInit() {
	bWidth=(bw.ie || bw.dom)? document.body.offsetWidth-5:innerWidth;
	
	xPos=(bWidth>iContentWidth)? (bWidth-iContentWidth)/2+iLeftMargin:0+iLeftMargin; //in pixel or %
	//xPos=500
	//xPos+=300
	lNews=new layerObj('textDiv')
	lNews.moveTo(xPos,iTopPos)
	if (bw.mac && bw.ie) window.resizeBy(1,0);
	lNews.show(1);
	page=new makePageCoords()
	window.onresize=resized;
}
document.write(newsLayer)
