// CONFIGURATION:  Go to http://www.24fun.com, open category 'text' and download the ZIP-file of this script containing the the script-file with step-by-step instructions for easy configuration. Configure your messages. You may add as many messages as you like.
var message=new Array()
message[0]="Malaysia-New Zealand Business Council "
message[1]="Sarawak Chamber of Commerce & Industry "
message[2]="Malaysian Int Chamber of Commerce & Ind "
message[3]="Sarawak Housing Developers' Association "
message[4]="                    "

var messagelink=new Array()
messagelink[0]="http://www.mnzbc.8m.com"
messagelink[1]="http://www.scci.net.my"
messagelink[2]="http://www.micci.com"
messagelink[3]="http://www.shda.biz"
messagelink[4]=""
var linktarget=new Array()
linktarget[0]="_new"
linktarget[1]="_new"
linktarget[2]="_new"
linktarget[3]="_new"
linktarget[4]=""

var leftposition=8
var topposition=0
var tickerwidth=140
var tickerheight=0
var tickerpadding=0
var borderwidth=0
var fnt="Arial"
var fntsize=9
var fntsizelastletter=9
var fntcolor="CCFFFF"
var fntcolorlastletter="red"
var fntweight=4   // Set a value between 1 to 9 to adjust the boldness
var backgroundcolor="black"
var standstill=2000
var speed=40  // speed (a higher value will slow down the ticker)

// Do not edit the variables below
var i_substring=0
var i_presubstring=0
var i_message=0
var messagecontent=""
var messagebackground=""
var messagepresubstring=""
var messageaftersubstring=""
fntweight=fntweight*100

function initiateticker() {
	getmessagebackground()
	if (document.all) {
		document.all.ticker.style.posLeft=leftposition
		document.all.ticker.style.posTop=topposition
		document.all.tickerbg.style.posLeft=leftposition
		document.all.tickerbg.style.posTop=topposition
		tickerbg.innerHTML=messagebackground
		showticker()
	}
	if (document.layers) {
		document.tickerbg.document.write(messagebackground)
		document.tickerbg.document.close()
		document.ticker.left=leftposition
		document.ticker.top=topposition
		document.tickerbg.left=leftposition
		document.tickerbg.top=topposition
		showticker()
	}
}

function getmessagebackground() {
		messagebackground="<table border="+borderwidth+" width="+tickerwidth+" height="+tickerheight+"><tr><td valign=top>"
		messagebackground+="</td></tr></table>"
}

function getmessagecontent() {
		messagepresubstring=message[i_message].substring(0,i_presubstring)
		messageaftersubstring=message[i_message].substring(i_presubstring,i_substring)
		messagecontent="<table border=0 cellpadding="+tickerpadding+" width="+tickerwidth+" height="+tickerheight+"><tr><td valign=top>"
		messagecontent+="<span style='position:relative; font-family:"+fnt+";color:"+fntcolor+";font-size:"+fntsize+"pt;font-weight:"+fntweight+"'>"
		messagecontent+="<a href='"+messagelink[i_message]+"' target='"+linktarget[i_message]+"' style='text-decoration: none'>"
		messagecontent+="<font color='"+fntcolor+"'>"
		messagecontent+=messagepresubstring
		messagecontent+="</font>"
		messagecontent+="</a>"
		messagecontent+="</span>"
		messagecontent+="<span style='text-decoration: none; position:relative; font-family:"+fnt+";color:"+fntcolor+";font-size:"+fntsizelastletter+"pt;font-weight:900'>"
		messagecontent+="<a href='"+messagelink[i_message]+"' target='"+linktarget[i_message]+"' style='text-decoration:none'>"
		messagecontent+="<font color='"+fntcolor+"' style='text-decoration:none'>"
		messagecontent+=messageaftersubstring
		messagecontent+="</font>"
		messagecontent+="</a>"
		messagecontent+="</span>"
		messagecontent+="</td></tr></table>"
}

function showticker() {
	if (i_substring<=message[i_message].length-1) {
			i_substring++
			i_presubstring=i_substring-1
			if (i_presubstring<0) {i_presubstring00}
			getmessagecontent()
		if (document.all) {
			ticker.innerHTML=messagecontent
			var timer=setTimeout("showticker()", speed)
		}
		if (document.layers) {
			document.ticker.document.write(messagecontent)
			document.ticker.document.close()
			var timer=setTimeout("showticker()", speed)
		}
	}
	else {
		clearTimeout(timer)
		var timer=setTimeout("changemessage()", standstill)
	}
}

function changemessage() {
	i_substring=0
	i_presubstring=0
	i_message++
	if (i_message>message.length-1) {
		i_message=0
	}
	showticker()
}