
/***********************************************
* Pausing up-down scroller- © 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 pausescroller(content, divId, divClass, delay){
this.content=content //message array content
this.tickerid=divId //ID of ticker div to display information
this.delay=delay //Delay between msg change, in miliseconds.
this.mouseoverBol=0 //Boolean to indicate whether mouse is currently over scroller (and pause it if it is)
this.hiddendivpointer=1 //index of message array for hidden div
document.write('<div id="'+divId+'" class="'+divClass+'" style="position: relative; overflow: hidden"><div class="innerDiv" style="position: absolute; width: 100%" id="'+divId+'1">'+content[0]+'</div><div class="innerDiv" style="position: absolute; width: 100%; visibility: hidden" id="'+divId+'2">'+content[1]+'</div></div>')
var scrollerinstance=this
if (window.addEventListener) //run onload in DOM2 browsers
window.addEventListener("load", function(){scrollerinstance.initialize()}, false)
else if (window.attachEvent) //run onload in IE5.5+
window.attachEvent("onload", function(){scrollerinstance.initialize()})
else if (document.getElementById) //if legacy DOM browsers, just start scroller after 0.5 sec
setTimeout(function(){scrollerinstance.initialize()}, 500)
}

// -------------------------------------------------------------------
// initialize()- Initialize scroller method.
// -Get div objects, set initial positions, start up down animation
// -------------------------------------------------------------------

pausescroller.prototype.initialize=function(){
this.tickerdiv=document.getElementById(this.tickerid)
this.visiblediv=document.getElementById(this.tickerid+"1")
this.hiddendiv=document.getElementById(this.tickerid+"2")
this.visibledivtop=parseInt(pausescroller.getCSSpadding(this.tickerdiv))
//set width of inner DIVs to outer DIV's width minus padding (padding assumed to be top padding x 2)
this.visiblediv.style.width=this.hiddendiv.style.width=this.tickerdiv.offsetWidth-(this.visibledivtop*2)+"px"
this.getinline(this.visiblediv, this.hiddendiv)
this.hiddendiv.style.visibility="visible"
var scrollerinstance=this
document.getElementById(this.tickerid).onmouseover=function(){scrollerinstance.mouseoverBol=1}
document.getElementById(this.tickerid).onmouseout=function(){scrollerinstance.mouseoverBol=0}
if (window.attachEvent) //Clean up loose references in IE
window.attachEvent("onunload", function(){scrollerinstance.tickerdiv.onmouseover=scrollerinstance.tickerdiv.onmouseout=null})
setTimeout(function(){scrollerinstance.animateup()}, this.delay)
}


// -------------------------------------------------------------------
// animateup()- Move the two inner divs of the scroller up and in sync
// -------------------------------------------------------------------

pausescroller.prototype.animateup=function(){
var scrollerinstance=this
if (parseInt(this.hiddendiv.style.top)>(this.visibledivtop+5)){
this.visiblediv.style.top=parseInt(this.visiblediv.style.top)-5+"px"
this.hiddendiv.style.top=parseInt(this.hiddendiv.style.top)-5+"px"
setTimeout(function(){scrollerinstance.animateup()}, 50)
}
else{
this.getinline(this.hiddendiv, this.visiblediv)
this.swapdivs()
setTimeout(function(){scrollerinstance.setmessage()}, this.delay)
}
}

// -------------------------------------------------------------------
// swapdivs()- Swap between which is the visible and which is the hidden div
// -------------------------------------------------------------------

pausescroller.prototype.swapdivs=function(){
var tempcontainer=this.visiblediv
this.visiblediv=this.hiddendiv
this.hiddendiv=tempcontainer
}

pausescroller.prototype.getinline=function(div1, div2){
div1.style.top=this.visibledivtop+"px"
div2.style.top=Math.max(div1.parentNode.offsetHeight, div1.offsetHeight)+"px"
}

// -------------------------------------------------------------------
// setmessage()- Populate the hidden div with the next message before it's visible
// -------------------------------------------------------------------

pausescroller.prototype.setmessage=function(){
var scrollerinstance=this
if (this.mouseoverBol==1) //if mouse is currently over scoller, do nothing (pause it)
setTimeout(function(){scrollerinstance.setmessage()}, 100)
else{
var i=this.hiddendivpointer
var ceiling=this.content.length
this.hiddendivpointer=(i+1>ceiling-1)? 0 : i+1
this.hiddendiv.innerHTML=this.content[this.hiddendivpointer]
this.animateup()
}
}

pausescroller.getCSSpadding=function(tickerobj){ //get CSS padding value, if any
if (tickerobj.currentStyle)
return tickerobj.currentStyle["paddingTop"]
else if (window.getComputedStyle) //if DOM2
return window.getComputedStyle(tickerobj, "").getPropertyValue("padding-top")
else
return 0
}


var pausecontent=new Array()
pausecontent[0]="<em>Just got my 8th yes 8th Dell Factory Second from you , this stuff has to be bargain of the century yet again exactly as described in terms of the marks or condition, and again I get more bits than you listed on the item. Loaded great again thanks also for the requested utility disk that arrived in the post within 3 days. Thanks to Richard in Tek support for that.</em><br /><strong>Nigel Adams IT Admin</strong>";
pausecontent[1]="<em>Superb thanks allot Guy's ordered 3 TFT Screens from you after being let down by another Company on delivery ( they had not got stock ) not only were you cheaper but wow the delivery arrived at my door the following day, saved me a lot of Money and great service, Will use you again and again</em><br /><strong>Thanks Again Andrew Ashmore DSG Group.</strong>";
pausecontent[2]="<em>Just a note to say thanks for the great service on my order , The laptop is fantastic value for money got here faster than my local Pizza delivery and saved me over &pound;100 from anywhere else in the UK  Look forward to buying my next bit of hardware,</em><br /><strong>Mark Higgins Leicester</strong>";
pausecontent[3]="<em>Thanks to tech at ITC got my first PC from you last week arrived all safe and sound and great value , but not only that i had a problem loading my operating system and your on line knowledge base saved me a lot of hassle after speaking to you at the on line live support, will be ordering my next stuff from you without any doubt</em><br /><strong>Many Thanks Jason Xander.</strong>";
pausecontent[4]="<em>Guys yet again you have come up trumps needed the 30 systems delivered to my customer direct within 3 days you got them there in 2 and saved me &pound;2000 on retail price Now my 9th order with you and you always keep your promise fantastic, See you soon</em><br /><strong>Phil Stent Computer Reseller and Brokers LTD</strong>";
pausecontent[5]="<em>Like to say thanks to Richard in sales , advised me honestly about my new Dell laptop i told him what i wanted to do with it and he changed my idea on model within 10 Mins at the on line sales support area , saved me &pound;160 and the laptop does exactly what he said it would if not better</em><br /><strong>Sue James Pots and Plants</strong>";
pausecontent[6]="<em>Great service again on the printers the refurbished 30 x HP's are all installed in the building all worked first time and looked like new. </em><br /><strong>Cheers Simon Meason ***** PLC</strong>";
pausecontent[7]="<em>Just like to say how refreshing it is to deal with a Company in the Uk who can supply exactly what they have listed on the site , i have been buying from various UK Companies over the last 6 years and always seems to be problems , now my third order with you and i always get what i ordered on time as listed and ALWAYS cheaper than any other supplier !! Great Web Site as well so easy to use</em><br /><strong>Christopher St'john</strong>";
pausecontent[8]="<em>Like to say thanks for the great service and price , would not had got the laptop from you until i was recommended by our IT Guy , cannot imagine how you can be so much cheaper on my Dell Laptop and give such brill service</em><br /><strong>Sean McNamara</strong>";
pausecontent[9]="<em>Just to let you know that my Dell PC was delivered AT 1pm.UPS had been somewhat “faffing around” so far this morning but, thanks to your help earlier, I’ve since managed to solve their hiccup.I’ve just unpacked it and everything seems to be here.All in all, I’m really, really impressed with your set up at ITC, and am very appreciative of the help & efficiency across your business departments so I thought I’d let you know that too.</em><br /><strong>Regards Robert Clark</strong>";
pausecontent[10]="<em>Dear ITC Sales This is just a quick note to say THANKS for your speedy delivery service.My laptop was delivered and I had it installed and running just 36 hours after ordering it! Speedy efficient and helpful-great service.</em><br /><strong>Julie Wilson Eastshaw Enterprises</strong>";
pausecontent[11]="<em>Hi ITC.A Big Thank you for your excellent all-round service.This has been the most efficient computer buy I have every made. I am delighted with my Dell Laptop. It will make sorting out individual and community problems more efficient and therefore help to give individuals a better quality of life.</em><br /><strong>Thank you.Margaret Allen</strong>";
closetag='</div>';
