/***********************************************
* Pausing updown message scroller- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

//configure the below five variables to change the style of the scroller
var scrollerdelay='5000' //delay between msg scrolls. 3000=3 seconds.
var scrollerwidth='170px'
var scrollerheight='150px'
var scrollerbgcolor='#fff'
//set below to '' if you don't wish to use a background image
var scrollerbackground=''

//configure the below variable to change the contents of the scroller
var messages=new Array()

messages[0] = '<dl><dt>Congratulations to Trevor Wilson</dt><dd>We would like to congratulate Trevor Wilson on completing 30 years continuous service <a href="/about/latest_news/">more...</a></dd></dl>';
messages[1] = '<dl><dt>New Managing Director Appointed</dt><dd>Mac Rental announces the appointment of Mr. Pat Lavelle <a href="/about/latest_news/">more...</a></dd></dl>';
messages[2] = '<dl><dt>Lo-Call Number for Dublin</dt><dd>Mac Rental has a new Lo-Call number for our Dublin depots <a href="/about/latest_news/">more...</a></dd></dl>';
messages[3] = '<dl><dt>Used Telehandlers for Sale!</dt><dd>Mac Rental currently has 20 used 13-metre telehandlers that are up for sale <a href="/about/latest_news/">more...</a></dd></dl>';
messages[4] = '<dl><dt>Mac Rental and Arrow Join Forces to Supply Pumps</dt><dd>Mac Rental has announced its intention to withdraw from direct pump hire to form a strategic supply alliance with pump specialist Arrow Rentals <a href="/about/latest_news/">more...</a></dd></dl>';
messages[5] = '<dl><dt>Carlow Depot Special Offer!</dt><dd>Our Carlow Depot would like to announce the following special offer: <a href="/about/latest_news/">more...</a></dd></dl>';
messages[6] = '<dl><dt>Special Offers at New Dublin Depot!</dt><dd>Our newly opened depot at South Circular Road would like to announce the following special offers: <a href="/about/latest_news/">more...</a></dd></dl>';
messages[7] = '<dl><dt>Two New Depots in Dublin</dt><dd>Mac Rental is pleased to announce that we have opened two new depots in Dublin <a href="/about/latest_news/">more...</a></dd></dl>';
messages[8] = '<dl><dt>Mac Rental People Make the Difference</dt><dd>Mac Rental\'s Managing Director, Mark Sharkey, discusses the company\'s progress this year <a href="/about/latest_news/">more...</a></dd></dl>';
messages[9] = '<dl><dt>Charity Digger Stolen</dt><dd>Mac Rental digger used to raise funds for the Laura Lynn Children\'s Hospice Foundation has been stolen <a href="/about/latest_news/">more...</a></dd></dl>';
messages[10] = '<dl><dt>Mac Rental has been Nominated for Awards</dt><dd>The Hire Association of Europe has short-listed Mac Rental for awards <a href="/about/latest_news/">more...</a></dd></dl>';
messages[11] = '<dl><dt>Mac Rental, The CAT Rental Store Supports The Laura Lynn Hospice</dt><dd>Mac Rental recently released three unique pink Caterpillar mini excavators for renting in the Irish market in aid of the Laura Lynn Children’s Hospice Foundation <a href="/about/latest_news/">more...</a></dd></dl>';
messages[12] = '<dl><dt>Tool Sales!</dt><dd>Great deals on Partner saws and 1/2 bag mixers <a href="/about/latest_news/">more...</a></dd></dl>';
messages[13] = '<dl><dt>Mac Rental Lead the Way in Traffic Management</dt><dd>Mac Rental introduce the fully animated PCMS to the Irish Market <a href="/about/latest_news/">more...</a></dd></dl>';
messages[14] = '<dl><dt>Guaranteed Availability!</dt><dd>Mac Rental are offering a possible 2 days free hire on listed items <a href="/about/latest_news/">more...</a></dd></dl>';
messages[15] = '<dl><dt>Acrow - The Cat Rental Store launches their new MevaDec System</dt><dd>Acrow - the Cat Rental store launches their new MevaDec System at the 75,000 square metre development which is currently under construction at Victoria Square in the heart of Belfast city centre <a href="/about/latest_news/">more...</a></dd></dl>';

///////Do not edit pass this line///////////////////////

var ie=document.all
var dom=document.getElementById

if (messages.length>2)
i=2
else
i=0

function move(whichdiv){
tdiv=eval(whichdiv)
if (parseInt(tdiv.style.top)>0&&parseInt(tdiv.style.top)<=5){
tdiv.style.top=0+"px"
setTimeout("move(tdiv)",scrollerdelay)
setTimeout("move2(second2_obj)",scrollerdelay)
return
}
if (parseInt(tdiv.style.top)>=tdiv.offsetHeight*-1){
tdiv.style.top=parseInt(tdiv.style.top)-5+"px"
setTimeout("move(tdiv)",50)
}
else{
tdiv.style.top=parseInt(scrollerheight)+"px"
tdiv.innerHTML=messages[i]
if (i==messages.length-1)
i=0
else
i++
}
}

function move2(whichdiv){
	tdiv2=eval(whichdiv)
	if (parseInt(tdiv2.style.top)>0&&parseInt(tdiv2.style.top)<=5){
		tdiv2.style.top=0+"px"
		setTimeout("move2(tdiv2)",scrollerdelay)
		setTimeout("move(first2_obj)",scrollerdelay)
		return
	}
	
	if (parseInt(tdiv2.style.top)>=tdiv2.offsetHeight*-1){
		tdiv2.style.top=parseInt(tdiv2.style.top)-5+"px"
		setTimeout("move2(second2_obj)",50)
	}
	else
	{
		tdiv2.style.top=parseInt(scrollerheight)+"px"
		tdiv2.innerHTML=messages[i]
		if (i==messages.length-1)
			i=0
		else
			i++
	}
}

function startscroll(){
	first2_obj=ie? first2 : document.getElementById("first2")
	second2_obj=ie? second2 : document.getElementById("second2")
	move(first2_obj)
	second2_obj.style.top=scrollerheight
	second2_obj.style.visibility='visible'
}

if (ie||dom){
	document.writeln('<div id="main2" style="position:relative;width:'+scrollerwidth+';height:'+scrollerheight+';overflow:hidden;background-color:'+scrollerbgcolor+' ;background-image:url('+scrollerbackground+')">')
	document.writeln('<div style="position:absolute;width:'+scrollerwidth+';height:'+scrollerheight+';clip:rect(0 '+scrollerwidth+' '+scrollerheight+' 0);left:0px;top:0px">')
	document.writeln('<div id="first2" style="position:absolute;width:'+scrollerwidth+';left:0px;top:1px;">')
	document.write(messages[0])
	document.writeln('</div>')
	document.writeln('<div id="second2" style="position:absolute;width:'+scrollerwidth+';left:0px;top:0px;visibility:hidden">')
	document.write(messages[dyndetermine=(messages.length==1)? 0 : 1])
	document.writeln('</div>')
	document.writeln('</div>')
	document.writeln('</div>')
}

if (window.addEventListener)
	window.addEventListener("load", startscroll, false)
else if (window.attachEvent)
	window.attachEvent("onload", startscroll)
else if (ie||dom)
	window.onload=startscroll