//**********************************
//*******message setup**************

/* message setup takes format 
	'new dcsmessage("display_text", "url", "target", "text_color", "text_bold", "text_size")'

bold = 1, not bold = 0

*/ 


var message=new Array()

message[0] = new dcsmessage( 
		"£9m saved",
		"index.htm",
		"",
		"black",
		"0",
		"12")
message[1] = new dcsmessage( 
		"Storage problems solved",
		"index.htm",
		"",
		"#FF6735",
		"1",
		"12")
message[2] = new dcsmessage( 
		"Critical data instantly available",
		"index.htm",
		"",
		"black",
		"0",
		"12")
message[3] = new dcsmessage( 
		"Document Control Services new offices",
		"index.htm",
		"",
		"#FF6735",
		"0",
		"12")
message[4] = new dcsmessage( 
		"Major international pipeline",
		"index.htm",
		"",
		"black",
		"0",
		"12")
message[5] = new dcsmessage( 
		"Asset data management revolutionised",
		"index.htm",
		"",
		"#FF6735",
		"0",
		"12")

//**********************************

//**********************************
//********speed settings***********


// speed 1: (pause between messages) lower means faster
var pause=20

// speed 2: (speed message scrolls)  higher means faster
var step=2


//*********************************




// do not edit the variables below
var fadeimgwidth=60
var fadeimgleftcontent,fadeimgrightcontent
var clipleft,clipright,cliptop,clipbottom
var i_message=0
var timer
var textwidth
var textcontent=""
// font-size
var fntsize=10

// distance of the scroller to the left margin of the browser-window (pixels)
var scrollerleft=229

// distance of the scroller to the top margin of the browser-window (pixels)
var scrollertop=410

// width of the scroller (pixels)
var scrollerwidth=423

// height of the scroller (pixels)
var scrollerheight=22


// font-family
var fntfamily="Arial"

// font-weight: 1 means bold, 0 means normal
var fntweight=1
if (fntweight==1) {fntweight="700"}
else {fntweight="100"}

function init() {
	gettextcontent()
	
	fadeimgleftcontent="<img src='fadeimgleft.gif' width="+fadeimgwidth+" height="+scrollerheight+">"
	fadeimgrightcontent="<img src='fadeimgright.gif' width="+fadeimgwidth+" height="+scrollerheight+">"

    if (document.all) {
		text.innerHTML=textcontent
		fadeimgleft.innerHTML=fadeimgleftcontent
		fadeimgright.innerHTML=fadeimgrightcontent
		textwidth=text.offsetWidth
		document.all.text.style.posTop=scrollertop
        document.all.text.style.posLeft=scrollerleft+scrollerwidth
		document.all.fadeimgleft.style.posTop=scrollertop
        document.all.fadeimgleft.style.posLeft=scrollerleft
		document.all.fadeimgright.style.posTop=scrollertop
        document.all.fadeimgright.style.posLeft=scrollerleft+scrollerwidth-fadeimgwidth

		clipleft=0
		clipright=0
		cliptop=0
		clipbottom=scrollerheight
		document.all.text.style.clip ="rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")"
        scrolltext()
    }
	if (document.layers) {
		document.text.document.write(textcontent)
		document.text.document.close()
		document.fadeimgleft.document.write(fadeimgleftcontent)
		document.fadeimgleft.document.close()
		document.fadeimgright.document.write(fadeimgrightcontent)
		document.fadeimgright.document.close()
		textwidth=document.text.document.width
		document.text.top=scrollertop
		document.text.left=scrollerleft+scrollerwidth
		document.fadeimgleft.top=scrollertop
        document.fadeimgleft.left=scrollerleft
		document.fadeimgright.top=scrollertop
        document.fadeimgright.left=scrollerleft+scrollerwidth-fadeimgwidth
		
		document.text.clip.left=0
		document.text.clip.right=0
		document.text.clip.top=0
		document.text.clip.bottom=scrollerheight

        scrolltext()
    }
}

function dcsmessage(text, url, target, color, bold, size){
	
	this.text 	= text
	this.url 	= url
	this.target 	= target
	this.color 	= color
	  if (bold == 1)  {this.bold="700"}
	  else 		  {this.bold="100"}
	this.size	= size
}


function scrolltext() {
    if (document.all) {
		if (document.all.text.style.posLeft>=scrollerleft-textwidth) {
			document.all.text.style.posLeft-=step
			clipright+=step
			if (clipright>scrollerwidth) {
				clipleft+=step
			}
			document.all.text.style.clip ="rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")"
			
			var timer=setTimeout("scrolltext()",pause)
		}
		else {
			changetext()
		}
	}
   if (document.layers) {
		if (document.text.left>=scrollerleft-textwidth) {
			document.text.left-=step
			document.text.clip.right+=step
			if (document.text.clip.right>scrollerwidth) {
				document.text.clip.left+=step
			}
			var timer=setTimeout("scrolltext()",pause)
		}
		else {
			changetext()
		}
	}
}

function changetext() {
    i_message++
	if (i_message>message.length-1) {i_message=0}
	gettextcontent()
	if (document.all) {
		text.innerHTML=textcontent
		textwidth=text.offsetWidth
		
        document.all.text.style.posLeft=scrollerleft+scrollerwidth
		clipleft=0
		clipright=0
		document.all.text.style.clip ="rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")"
		
        scrolltext()
	}

	if (document.layers) {
   		document.text.document.write(textcontent)
		document.text.document.close()
		textwidth=document.text.document.width

		document.text.left=scrollerleft+scrollerwidth
		document.text.clip.left=0
		document.text.clip.right=0
		
        scrolltext()
	}
}
/*
function gettextcontent() {
	

textcontent="<span style='position:relative;font-size:"+message[i_message].size+
	"pt;font-family:"+fntfamily+
	";font-weight:"+message[i_message].bold+"'>"

textcontent+="<a href='http://pollux/index' >"

textcontent+="<nobr><font color="+message[i_message].color+">"+message[i_message].text+"</font></nobr></a></span>"


textcontent ="<nobr><a href='http://pollux/index' ><font color="+message[i_message].color+">"+message[i_message].text+"</font></a></nobr>"


//+message[i_message].url+ target="+message[i_message].target+"

}

*/



function gettextcontent() {
	textcontent="<span style='position:relative;font-size:"+message[i_message].size+"pt;font-family:"+fntfamily+";font-weight:"+message[i_message].bold+"'>"
	textcontent+="<a href="+message[i_message].url+" target="+message[i_message].target+">"
	textcontent+="<nobr><font color="+message[i_message].color+">"+message[i_message].text+"</font></nobr></a></span>"
}

















