﻿/*Example message arrays for the two demo scrollers*/

var tickercontent=new Array()
tickercontent[0]='<DIV class=icon><img src="/images/icons/icon_latestNewsPDF.gif"></DIV><DIV class=date>13/12/2011</DIV><a href="/media/press_releases/2011/JLT_Japan_CEO_20111213.pdf" target="_new">JLT Appoints Japan Country Manager</a>'
tickercontent[1]='<DIV class=icon><img src="/images/icons/icon_latestNewsPDF.gif"></DIV><DIV class=date>06/12/2011</DIV><a href="http://www.jltgroup.com/eb/news/eb-news-211111-041211/" target="_new">EB News Services</a>'
tickercontent[2]='<DIV class=icon><img src="/images/icons/icon_latestNewsPDF.gif"></DIV><DIV class=date>08/11/2011</DIV><a href="http://www.jltgroup.com/about/news-press-and-media/group-news/interim-management-statement-081111/" target="_new">Interim Management Statement</a>'
tickercontent[3]='<DIV class=icon><img src="/images/icons/icon_latestNewsPDF.gif"></DIV><DIV class=date>03/11/2011</DIV><a href="http://www.jltgroup.com/about/news-press-and-media/group-news/jlt-announces-its-intention-to-combine-its-italian-business-with-marine-and-aviation-spa-in-italy/" target="_new">JLT announces its intention to combine its Italian business with Marine & Aviation S.p.A in Italy</a>'
tickercontent[4]='<DIV class=icon><img src="/images/icons/icon_latestNewsPDF.gif"></DIV><DIV class=date>02/11/2011</DIV><a href="http://www.jltgroup.com/content/UK/jlt_group/Thailand-Flooding-Report.pdf" target="_new">Thailand Floods 2011</a>'
tickercontent[5]='<DIV class=icon><img src="/images/icons/icon_latestNewsPDF.gif"></DIV><DIV class=date>29/07/2011</DIV><a href="/media/press_releases/2011/Interim-Statement-July-2011.pdf" target="_new">Unaudited Interim results for the six months to 30th June 2011</a>'
tickercontent[6]='<DIV class=icon><img src="/images/icons/icon_latestNewsPDF.gif"></DIV><DIV class=date>26/07/2011</DIV><a href="http://www.jltgroup.com/about/news-press-and-media/group-news/jlt-to-announce-its-2011-interim-results/" target="_new">JLT to announce its 2011 Interim Results</a>'
tickercontent[7]='<DIV class=icon><img src="/images/icons/icon_latestNewsPDF.gif"></DIV><DIV class=date>01/06/2011</DIV><a href="/media/press_releases/2011/20110601_JLT_Asia_named_best_trade_credit_and_political_risks_insurance_broker_in_AP.pdf" target="_new">Jardine Lloyd Thompson Asia Named Region’s "Best Trade Credit and Political Risk Insurance Broker"</a>'


/***********************************************
* DHTML Ticker script- © Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
***********************************************/

function domticker(content, divId, divClass, delay, fadeornot){
this.content=content
this.tickerid=divId //ID of master ticker div. Message is contained inside first child of ticker div
this.delay=delay //Delay between msg change, in miliseconds.
this.mouseoverBol=0 //Boolean to indicate whether mouse is currently over ticker (and pause it if it is)
this.pointer=1
this.opacitystring=(typeof fadeornot!="undefined")? "width: 100%; filter:progid:DXImageTransform.Microsoft.alpha(opacity=100); -moz-opacity: 1" : ""
if (this.opacitystring!="") this.delay+=500 //add 1/2 sec to account for fade effect, if enabled
this.opacitysetting=0 //Opacity value when reset. Internal use.
document.write('<div id="'+divId+'" class="'+divClass+'"><div style="'+this.opacitystring+'">'+content[0]+'</div></div>')
var instanceOfTicker=this
setTimeout(function(){instanceOfTicker.initialize()}, delay)
}

domticker.prototype.initialize=function(){
var instanceOfTicker=this
this.contentdiv=document.getElementById(this.tickerid).firstChild //div of inner content that holds the messages
document.getElementById(this.tickerid).onmouseover=function(){instanceOfTicker.mouseoverBol=1}
document.getElementById(this.tickerid).onmouseout=function(){instanceOfTicker.mouseoverBol=0}
this.rotatemsg()
}

domticker.prototype.rotatemsg=function(){
var instanceOfTicker=this
if (this.mouseoverBol==1) //if mouse is currently over ticker, do nothing (pause it)
setTimeout(function(){instanceOfTicker.rotatemsg()}, 100)
else{
this.fadetransition("reset") //FADE EFFECT- RESET OPACITY
this.contentdiv.innerHTML=this.content[this.pointer]
this.fadetimer1=setInterval(function(){instanceOfTicker.fadetransition('up', 'fadetimer1')}, 100) //FADE EFFECT- PLAY IT
this.pointer=(this.pointer<this.content.length-1)? this.pointer+1 : 0
setTimeout(function(){instanceOfTicker.rotatemsg()}, this.delay) //update container
}
}

// -------------------------------------------------------------------
// fadetransition()- cross browser fade method for IE5.5+ and Mozilla/Firefox
// -------------------------------------------------------------------

domticker.prototype.fadetransition=function(fadetype, timerid){
var contentdiv=this.contentdiv
if (fadetype=="reset")
this.opacitysetting=0.2
if (contentdiv.filters && contentdiv.filters[0]){
if (typeof contentdiv.filters[0].opacity=="number") //IE6+
contentdiv.filters[0].opacity=this.opacitysetting*100
else //IE 5.5
contentdiv.style.filter="alpha(opacity="+this.opacitysetting*100+")"
}
else if (typeof contentdiv.style.MozOpacity!="undefined" && this.opacitystring!=""){
contentdiv.style.MozOpacity=this.opacitysetting
}
else
this.opacitysetting=1
if (fadetype=="up")
this.opacitysetting+=0.2
if (fadetype=="up" && this.opacitysetting>=1)
clearInterval(this[timerid])
}

