var message=new Array()
message[0]="CJL Exec launches its new offices in Brussels to manage its mainland European business..."
message[1]="Requests for risk assessments increase post Madrid bombings..."
message[2]="CJL Exec warns of complacency as the US warns of possible terror attacks"
message[3]="CJL Exec announces involvement with this years' leading UK Diplomatic Event..."
message[4]="CJL Exec announces arrival of armoured executive saloon vehicle for diplomatic and corporate clients..."

var messagelink=new Array()
messagelink[0]="press-releases.php"
messagelink[1]="news-04.php"
messagelink[2]="news-03.php"
messagelink[3]="news-02.php"
messagelink[4]="news-01.php"

// link specific targets
var linktarget=new Array()
linktarget[0]="_top"
linktarget[1]="_top"
linktarget[2]="_top"
linktarget[3]="_top"
linktarget[4]="_top"

var leftposition=0
var topposition=0
var tickerwidth=134
var tickerheight=60
var tickerpadding=0
var borderwidth=0
var fnt="Arial"
var fntsize=8
var fntsizelastletter=8
var fntcolor="ffffff"
var fntcolorlastletter="red"
var fntweight=1
var backgroundcolor="FFFFFF"
var standstill=2000
var speed=80
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 bgcolor='"+backgroundcolor+"'>"
		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='position:relative; font-family:"+fnt+";color:"+fntcolor+";font-size:"+fntsizelastletter+"pt;text-decoration:underline'>"	
		messagecontent+="<a href='"+messagelink[i_message]+"' target='"+linktarget[i_message]+"'>"
		messagecontent+="<font color='"+fntcolor+"'>"
		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()
}