/* Modified by Adrian Birch - OneSmartdesign.co.uk 19-April-09 */
/* Message arrays for the two scrollers*/

var pausecontent=new Array()
pausecontent[0]='<div class="snippetdate">01/04/09</div> The OneSmartDesign revamped website is live!!<br/><a href="newsforonesmartdesign.php#newwebsite" class="nav3" title="Click here to see the full article.">Click to read more..</a>'
pausecontent[1]='<div class="snippetdate">01/04/09</div> The OneSmartDesign revamped website is live!!<br/><a href="newsforonesmartdesign.php#newwebsite" class="nav3" title="Click here to see the full article.">Click to read more..</a>'

/* Pausecontent2 array below for Websites and logo links */
var pausecontent2=new Array()
pausecontent2[0]='<div><a href="http://www.dragoncomputing.co.uk/" title="Click here to visit Dragon Computing Ltd website, designed and hosted by OneSmartDesign.co.uk." style="border: 0px; text-decoration: none;" target="_blank"><img src="images/customers/dragoncomputingweb.gif" class="partnerslide" alt="Thumbnail of the Dragon Computing Ltd website, designed and hosted by OneSmartDesign.co.uk."></a><br/><a href="http://www.dragoncomputing.co.uk/" title="Click here to visit the Dragon Computing website, this logo for Dragon Computing Ltd website was designed by OneSmartDesign.co.uk" style="border: 0px; text-decoration: none;" target="_blank"><img src="images/customers/dragoncomputinglogo.gif" class="partnerslide" alt="This logo for Dragon Computing Ltd website was designed by OneSmartDesign.co.uk!"></a></div>'
pausecontent2[1]='<div><a href="http://www.somersetpvcuwindows.co.uk" title="Click here to visit the Somersert PVCu Windows website." style="border: 0px; text-decoration: none;" target="_blank"><img src="images/customers/somersetpvcucompanyweb.gif" class="partnerslide" alt="Thumbnail of the Somerset Pvcu windows website, designed and hosted by OneSmartDesign.co.uk."></a><br/><a href="http://www.somersetpvcuwindows.co.uk" title="Click here to visit Somerset pvcu windows website." style="border: 0px; text-decoration: none;" target="_blank"><img src="images/customers/somersetpvcucompanylogo.gif" class="partnerslide" alt="Click here to visit the Somerset pvcu windows website, this logo for the Somsert pvcu website was designed by OneSmartDesign.co.uk"></a></div>' 
pausecontent2[2]='<div><a href="http://www.newlookwindows.co.uk" title="Click here to visit the Newlook Windows Somerset website." style="border: 0px; text-decoration: none;" target="_blank"><img src="images/customers/newlookwindowswebsite.gif" class="partnerslide" alt="Thumbnail of the Newlook Windows Somerset website, designed and hosted by OneSmartDesign.co.uk."></a><br/><a href="http://www.newlookwindows.co.uk" title="Click here to visit Newlook Windows Somerset website." style="border: 0px; text-decoration: none;" target="_blank"><img src="images/customers/newlookwindowslogo.gif" class="partnerslide" alt="Click here to visit the Newlook Windows Somerset website."></a></div>'
pausecontent2[3]='<div><a href="http://www.stormerclan.com" title="Click here to visit the StormerClan gaming community website." style="border: 0px; text-decoration: none;" target="_blank"><img src="images/customers/stormerclanwebsite.gif" class="partnerslide" alt="Thumbnail of the StormerClan gaming community website, designed and hosted by OneSmartDesign.co.uk."></a><br/><a href="http://www.stormerclan.com" title="Click here to visit StormerClan gaming community website." style="border: 0px; text-decoration: none;" target="_blank"><img src="images/customers/stormerclanlogo.gif" class="partnerslide" alt="StormerClan.com logo, designed by OneSmartDesign.co.uk. Click here to visit the StormerClan gaming community website."></a></div>'
pausecontent2[4]='<div><a href="http://www.mijasgolf.info" title="Click here to visit the Mijas Golf apartment in costa del sol spain website." style="border: 0px; text-decoration: none;" target="_blank"><img src="images/customers/mijasgolfwebsite.gif" class="partnerslide" alt="Thumbnail of the Mijas Golf apartment in costa del sol spain website, designed and hosted by OneSmartDesign.co.uk."></a><br/><a href="http://www.mijasgolf.info" title="Click here to visit Mijas Golf apartment in costa del sol spain website." style="border: 0px; text-decoration: none;" target="_blank"><img src="images/customers/mijasgolflogo.gif" class="partnerslide" alt="Mijas Golf apartment in costa del sol spain logo, designed by OneSmartDesign.co.uk. Click here to visit the StormerClan gaming community website."></a></div>'
pausecontent2[5]='<div><a href="http://www.newlookproperties.co.uk" title="Click here to visit the Newlook Properties Somerset website." style="border: 0px; text-decoration: none;" target="_blank"><img src="images/customers/newlookpropertieswebsite.gif" class="partnerslide" alt="Thumbnail of the Newlook Properties Somerset website, designed and hosted by OneSmartDesign.co.uk."></a><br/><a href="http://www.newlookproperties.co.uk" title="Click here to visit Newlook Properties Somerset website." style="border: 0px; text-decoration: none;" target="_blank"><img src="images/customers/newlookpropertieslogo.gif" class="partnerslide" alt="Click here to visit the Newlook Properties Somerset website."></a></div>'
pausecontent2[6]='<div><a href="http://www.windjammeruk.com" title="Click here to visit the WindJammer UK windows, doors &amp; conservatories website." style="border: 0px; text-decoration: none;" target="_blank"><img src="images/customers/windjammerwebsite.gif" class="partnerslide" alt="Thumbnail of the WindJammer UK windows, doors &amp; conservatories website, designed and hosted by OneSmartDesign.co.uk."></a><br/><a href="http://www.windjammeruk.com" title="Click here to visit WindJammer UK windows, doors &amp; conservatories website." style="border: 0px; text-decoration: none;" target="_blank"><img src="images/customers/windjammerlogo.gif" class="partnerslide" alt="WindJammer UK logo, designed by OneSmartDesign. Click here to visit the WindJammer UK windows, doors &amp; conservatorieswebsite."></a></div>'
pausecontent2[7]='<div><a href="http://www.somersetwoodenwindowcompany.co.uk" title="Click here to visit the Somerset Wooden Windows Company website." style="border: 0px; text-decoration: none;" target="_blank"><img src="images/customers/somersetwoodenwindowcompanywebsite.gif" class="partnerslide" alt="Thumbnail of the Somerset Wooden Windows Company website, re-constructed and hosted by OneSmartDesign.co.uk."></a><br/><a href="http://www.somersetwoodenwindowcompany.co.uk" title="Click here to visit Somerset Wooden Windows Company website." style="border: 0px; text-decoration: none;" target="_blank"><img src="images/customers/somersetwoodenwindowcompanylogo.gif" class="partnerslide" alt="Click here to visit the Somerset Wooden Windows Company website."></a></div>'
pausecontent2[8]='<div><a href="http://www.newlookbuilders.com" title="Click here to visit the Newlook Builders Somerset website." style="border: 0px; text-decoration: none;" target="_blank"><img src="images/customers/newlookbuilderswebsite.gif" class="partnerslide" alt="Thumbnail of the Newlook Builders Somerset website, designed and hosted by OneSmartDesign.co.uk."></a><br/><a href="http://www.newlookbuilders.com" title="Click here to visit Newlook Builders Somerset website." style="border: 0px; text-decoration: none;" target="_blank"><img src="images/customers/newlookbuilderslogo.gif" class="partnerslide" alt="Click here to visit the Newlook Builders Somerset website."></a></div>'
/* Pausecontent3 array below for headlines */
var pausecontent3=new Array()
pausecontent3[0]='<div class="snippetdate">Andy Fletcher - Lowestoft</div> Having trawled through the ocean of web designers and coming to grief on more than one occasion, I was lucky to stumble across Adrian..<br/><br/><a href="smartdesigntestimonials.php#andywindjammer" class="testimonial" title="Click here to see the full testimonial.">Click to read more..</a>'
pausecontent3[1]='<div class="snippetdate">Steve Tomkins - Chicago USA</div> You will not go wrong with One Smart Design I urge you to call Adrian today and discuss your project you will not be disappointed..<br/><br/><a href="smartdesigntestimonials.php#stevetomkins" class="testimonial" title="Click here to see the full testimonial.">Click to read more..</a>'
pausecontent3[2]='<div>..on their way!</div>'

/***********************************************
* 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
}

