//<DIV ID="backgroundimage" style="position:absolute;left:-2000px;display:none;"><IMG SRC="textrighttoleftdesign.gif"></DIV>

//<div id="ticker" style="position:absolute;left:-2000px"></div>

// Your messages. Add as many as you like
//var message=new Array()
//message[0]="澳洲海關查獲大批海洛因"

// the URLs of your messages
//var messageurl=new Array()
//messageurl[0]="news/index.html"

// the targets of the links
// accepted values are '_blank' or '_top' or '_parent' or '_self'
// or the name of your target-window (for instance 'main')
//var messagetarget=new Array()
//messagetarget[0]="_blank"

// font-color of messages
//var messagecolor= new Array()
//messagecolor[0]=""

// distance of the scroller to the left margin of the browser-window (pixels)
var scrollerleft=136

// distance of the scroller to the top margin of the browser-window (pixels)
var scrollertop=172
var scrollertop=197

// speed 1: lower means faster
var pause=15

// speed 2: higher means faster
var step=1

// font-size
var fntsize=12

// font-family
var fntfamily="Arial"

// font-weight: 1 means bold, 0 means normal
var fntweight=0

// do not edit the variables below
var scrollerwidth=338
var scrollerheight=20
var scrollerleft_in=scrollerleft+16
var scrollertop_in=scrollertop+12
var backgroundimagecontent
var clipleft,clipright,cliptop,clipbottom
var i_message=0
var timer
var textwidth
var textcontent=""
if (fntweight==1) {fntweight="700"}
else {fntweight="100"}

function init() {
	gettextcontent()
	
	if (document.layers) {
		document.ticker.document.write(textcontent)
		document.ticker.document.close()
		textwidth=document.ticker.document.width
		document.ticker.top=scrollertop_in
		document.ticker.left=scrollerleft_in+scrollerwidth
		document.backgroundimage.top=scrollertop
        document.backgroundimage.left=scrollerleft
		
		document.ticker.clip.left=0
		document.ticker.clip.right=0
		document.ticker.clip.top=0
		document.ticker.clip.bottom=scrollerheight

        scrolltext()
    }
    if (document.all) {
		ticker.innerHTML=textcontent
		textwidth=ticker.offsetWidth
		document.all.ticker.style.posTop=scrollertop_in
        document.all.ticker.style.posLeft=scrollerleft_in+scrollerwidth
//		document.all.backgroundimage.style.posTop=scrollertop
//        document.all.backgroundimage.style.posLeft=scrollerleft

		clipleft=0
		clipright=0
		cliptop=0
		clipbottom=scrollerheight
		document.all.ticker.style.clip ="rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")"
        scrolltext()
    }
}

function scrolltext() {
    if (document.all) {
		if (document.all.ticker.style.posLeft>=scrollerleft_in-textwidth) {
			document.all.ticker.style.posLeft-=step
			clipright+=step
			if (clipright>scrollerwidth) {
				clipleft+=step
			}
			document.all.ticker.style.clip ="rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")"
			
			timer=setTimeout("scrolltext()",pause)
		}
		else {
			changetext()
		}
	}
   if (document.layers) {
		if (document.ticker.left>=scrollerleft_in-textwidth) {
			document.ticker.left-=step
			document.ticker.clip.right+=step
			if (document.ticker.clip.right>scrollerwidth) {
				document.ticker.clip.left+=step
			}
			timer=setTimeout("scrolltext()",pause)
		}
		else {
			changetext()
		}
	}
}

function changetext() {
    i_message++
	if (i_message>message.length-1) {i_message=0}
	gettextcontent()
	if (document.all) {
		ticker.innerHTML=textcontent
		textwidth=ticker.offsetWidth
		
        document.all.ticker.style.posLeft=scrollerleft_in+scrollerwidth
		clipleft=0
		clipright=0
		document.all.ticker.style.clip ="rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")"
		
        scrolltext()
	}

	if (document.layers) {
   		document.ticker.document.write(textcontent)
		document.ticker.document.close()
		
		textwidth=document.ticker.document.width

		document.ticker.left=scrollerleft_in+scrollerwidth
		document.ticker.clip.left=0
		document.ticker.clip.right=0
		
        scrolltext()
	}
}

function gettextcontent() {
	textcontent="<span style='position:relative;font-size:"+fntsize+"pt;font-family:"+fntfamily+";font-weight:"+fntweight+"'>"
	textcontent+="<a href="+messageurl[i_message]+" target="+messagetarget[i_message]+" onMouseOver='clearTimeout(timer)' onMouseOut='scrolltext()'>"
	textcontent+="<nobr><font color="+messagecolor[i_message]+">"+message[i_message]+"</font></nobr></a></span>"
}

function changespeed(newspeed) {
    if (newspeed=="faster") {
		step=step+1
		if (step>=20) {step=20}
	}
	else if (newspeed=="slower") {
		step=step-1
		if (step<0) {step=0}
	}
}

//window.onresize=init;

// - End of JavaScript - -->
// onload: init(); 

/*
<STYLE>
A {ticker-decoration:none;}
A:Hover {ticker-decoration:underline;}
body{overflow-x:hidden;overflow-y:scroll;}
</STYLE>
*/ 
