// JavaScript Document
/*Example message arrays for the two demo scrollers*/

var pausecontent=new Array()
pausecontent[0]='<table width="900px"><tr><td align="left">"Good service, good product. Thank you."</td></tr><tr><td align="right"><strong>Robert G. - Wyndmoor, PA</strong></td></tr></table>'
pausecontent[1]='<table width="900px"><tr><td align="left">"All details from order placement, fulfillment to shipping were handled well."</td></tr><tr><td align="right"><strong>Ron R. Arveda, CO</strong></td></tr></table>'
pausecontent[2]='<table width="900px"><tr><td align="left">"Excellent quality windows. Packed very well. Delivery was good. I am definitely recommending Custom Order Online to everyone I know!"</td></tr><tr><td align="right"><strong>Francine L. Gadsden, AL</strong></td></tr></table>'
pausecontent[3]='<table width="900px"><tr><td align="left">"I was very pleased with the windows, I will recommend your windows to all my friends and family."</td></tr><tr><td align="right"><strong>Gary S. Tuttle, Oklahoma</strong></td></tr></table>'
pausecontent[4]='<table width="900px"><tr><td align="left">"Windows were received and installed. Met exepectations. WIll order from you again."</td></tr><tr><td align="right"><strong>Ray W. Superior, CO</strong></td></tr></table>'
pausecontent[5]='<table width="900px"><tr><td align="left">"Very satified with your windows and service."</td></tr><tr><td align="right"><strong>Arnold W. Princeton, MO</strong></td></tr></table>'
pausecontent[6]='<table width="900px"><tr><td align="left">"Great products and great service."</td></tr><tr><td align="right"><strong>Charles H. Raliegh, NC</strong></td></tr></table>'
pausecontent[7]='<table width="900px"><tr><td align="left">"Very happy with my windows. Installation was a breeze. Great price. Thank you."</td></tr><tr><td align="right"><strong>Matthew L. Simpsonville, South Carolina</strong></td></tr></table>'
pausecontent[8]='<table width="900px"><tr><td align="left">"The Windows are great and easy to install and received them without any damage. Will recommend you to all."</td></tr><tr><td align="right"><strong>Cindy R. Saco, MT</strong></td></tr></table>'
pausecontent[9]='<table width="900px"><tr><td align="left">"Thanks! for the great windows! They were the exact size I ordered and I received them Quick and in perfect condition!"</td></tr><tr><td align="right"><strong>Kyle W. Riceville, Iowa</strong></td></tr></table>'
pausecontent[10]='<table width="900px"><tr><td align="left">"The windows are just perfect thank you vary much.I plan to order another 5 windows before the end of the year.Oh the packing was OUTSTANDING!!"</td></tr><tr><td align="right"><strong>Eric W. Grand Heaven, MI</strong></td></tr></table>'
pausecontent[11]='<table width="900px"><tr><td align="left">"Fabulous windows...wonderful company. Very easy, convenient ordering process. Thank you."</td></tr><tr><td align="right"><strong>Mary T. San Antonio, TX</strong></td></tr></table>'
pausecontent[12]='<table width="900px"><tr><td align="left">"The windows arrived yesterday 10/7 2010, and are now installed ,they look as good as shown on your site and fit just as good. Thanks again"</td></tr><tr><td align="right"><strong>Bob. Twinsburg, OH</strong></td></tr></table>'
pausecontent[13]='<table width="900px"><tr><td align="left">"Great online experience. The window came in the very best packaging that I have ever seen. Truly a pleasure to deal with a fine company."</td></tr><tr><td align="right"><strong>George M. - Spring, TX</strong></td></tr></table>'
pausecontent[14]='<table width="900px"><tr><td align="left">"My experience was excellent in every respect right thru final delivery. I will recommend your company to everyone."</td></tr><tr><td align="right"><strong>Robert S. - Cadott, Wi</strong></td></tr></table>'
pausecontent[15]='<table width="900px"><tr><td align="left">"As was my first order, this second order was professionally taken, shipped and the product is better than expected."</td></tr><tr><td align="right"><strong>Rob New Windsor, NY</strong></td></tr></table>'
pausecontent[16]='<table width="900px"><tr><td align="left">"The quality of the windows we ordered are excellent and no issues reguarding delivery. Thanks for a great product."</td></tr><tr><td align="right"><strong>Brad R. - Fort Myers, FL</strong></td></tr></table>'
pausecontent[17]='<table width="900px"><tr><td align="left">"Very pleased with my buying experience. Fast response and you were very knowledgeable about the products."</td></tr><tr><td align="right"><strong>Jason R. - Livingston, Louisiana</strong></td></tr></table>'
pausecontent[18]='<table width="900px"><tr><td align="left">"no issues, thank you !"</td></tr><tr><td align="right"><strong>Linda M. - North Reading, MA</strong></td></tr></table>'
pausecontent[19]='<table width="900px"><tr><td align="left">"Provided excelent customer service and oustanding technical knowledge to make my experience a great one."</td></tr><tr><td align="right"><strong>Enrique P. - Miami, FL</strong></td></tr></table>'
pausecontent[20]='<table width="900px"><tr><td align="left">"Great product. Great price. Would recommend this company to anyone looking for a quality window."</td></tr><tr><td align="right"><strong>Robert H. Pittsfield, MA.</strong></td></tr></table>'
pausecontent[21]='<table width="900px"><tr><td align="left">"Received the windows everything looks good. Thank you for the excellant service. Thank you! Hassan A. Aurora, IL."</td></tr><tr><td align="right"><strong>Hassan A. - Aurora, IL</strong></td></tr></table>'
pausecontent[22]='<table width="900px"><tr><td align="left">"I am very happy with my purchase Thank you! "</td></tr><tr><td align="right"><strong>Sue Anne D. - Aurora, IL</strong></td></tr></table>'
pausecontent[23]='<table width="900px"><tr><td align="left">"We are very happy with the product and enjoyed the whole process with Custom Order Online - Thank you all!"</td></tr><tr><td align="right"><strong>Joan C. -New York, NY</strong></td></tr></table>'
pausecontent[24]='<table width="900px"><tr><td align="left">"I will recommend your company to anyone I know that is planning window replacements."</td></tr><tr><td align="right"><strong>Mathew N. - Austin, TX</strong></td></tr></table>'
pausecontent[25]='<table width="85%"><tr><td align="left">"Companies that put the customer first are not always the norm . . . dealing with one was a very satisfying experience! Thanks!"</td></tr><tr><td align="right"><strong>Jerry W. - Phoenix, AZ</strong></td></tr></table>'
pausecontent[26]='<table width="85%"><tr><td align="left">"I would give your company an A+ rating!"</td></tr><tr><td align="right"><strong>Vern B. - Lexington, TN</strong></td></tr></table>'
pausecontent[27]='<table width="85%"><tr><td align="left">"Excellent windows & great service!"</td></tr><tr><td align="right"><strong>Jonathon J. - Wauconda, IL</strong></td></tr></table>'
pausecontent[28]='<table width="85%"><tr><td align="left">"I will use Custom Order Online again. I was and am a satisfied customer!"</td></tr><tr><td align="right"><strong>Thomas P. - Lansing, MI</strong></td></tr></table>'
pausecontent[29]='<table width="85%"><tr><td align="left">"I would recommend Custom Order Online unconditionally!"</td></tr><tr><td align="right"><strong>Karen S. - Marietta, GA</strong></td></tr></table>'
pausecontent[30]='<table width="85%"><tr><td align="left">"Best experience I have had on the internet."</td></tr><tr><td align="right"><strong>Bobby R. - Montgomery, AL</strong></td></tr></table>'
pausecontent[31]='<table width="85%"><tr><td align="left">"Would recommend your company without hesitation!"</td></tr><tr><td align="right"><strong>Gail S. - Kansas City, KS</strong></td></tr></table>'
pausecontent[32]='<table width="85%"><tr><td align="left">"This was our 3rd purchase from Custom Order Online & each time we have had superior service and the product is even better than expected!"</td></tr><tr><td align="right"><strong>Seth Z. - Sanford, NC</strong></td></tr></table>'
pausecontent[33]='<table width="85%"><tr><td align="left">"Your company is first rate."</td></tr><tr><td align="right"><strong>Teresa S. - Columbia, MD</strong></td></tr></table>'
pausecontent[34]='<table width="85%"><tr><td align="left">"Would recommend your company to anyone needing windows - very good service." </td></tr><tr><td align="right"><strong>Dan G. - Canton, OH</strong></td></tr></table>'
pausecontent[35]='<table width="85%"><tr><td align="left">"Excellent service - that is why I am a repeat customer."</td></tr><tr><td align="right"><strong>Kirk T. - Chicago, IL</strong></td></tr></table>'
pausecontent[36]='<table width="85%"><tr><td align="left">"I will highly recommend Custom Order Online."</td></tr><tr><td align="right"><strong>J. D. - Tulsa, OK </strong></td></tr></table>'
pausecontent[37]='<table width="85%"><tr><td align="left">"I would recommend Custom Order Online without reservation." </td></tr><tr><td align="right"><strong>Fredrick Z. - Brookfield, WI</strong></td></tr></table>'
pausecontent[38]='<table width="85%"><tr><td align="left">"We would highly recommend you to friends and we will be return customers."</td></tr><tr><td align="right"><strong>Jon T. - Prescott, AZ</strong></td></tr></table>'
pausecontent[39]='<table width="85%"><tr><td align="left">"Custom Order Online comes with high recommendation. We love our new windows!!"</td></tr><tr><td align="right"><strong>Steve F. - San Antonio, TX</strong></td></tr></table>'
pausecontent[40]='<table width="85%"><tr><td align="left">"We are very pleased with our new windows. Would highly recommend your company to anyone." </td></tr><tr><td align="right"><strong>Mary H. - Greenwood, SC</strong></td></tr></table>'
pausecontent[41]='<table width="85%"><tr><td align="left">"Great job! I am a very satisfied customer and would do business with Custom Order Online again."</td></tr><tr><td align="right"><strong>James W. - Lafayette, IN</strong></td></tr></table>'
pausecontent[42]='<table width="85%"><tr><td align="left">"We were very pleased and will pass on the name."</td></tr><tr><td align="right"><strong>Hector P. - Temecula, CA</strong></td></tr></table>'
pausecontent[43]='<table width="85%"><tr><td align="left">"I will not hesitate to recommend your company to any of my friends contemplating a window project."</td></tr><tr><td align="right"><strong>Daniel M. - Gainsville, FL</strong></td></tr></table>'
pausecontent[44]='<table width="85%"><tr><td align="left">"Very satisfied - will (and have) recommended your company to others."</td></tr><tr><td align="right"><strong>Gerard P. - San Mateo, CA</strong></td></tr></table>'
pausecontent[45]='<table width="85%"><tr><td align="left">"We are very pleased with the quality of the product. We would not hesitate to recommend your windows to others." </td></tr><tr><td align="right"><strong>Amy and Daren G. - Minneapolis, MN</strong></td></tr></table>'
/*pausecontent[0]='<table width="85%"><tr><td align="left"><strong>Robert G. - Wyndmoor, PA : </strong>"Good service, good product. Thank you."</td></tr></table>'
pausecontent[1]='<table width="85%"><tr><td align="left"><strong>Ron R. Arveda, CO : </strong>"All details from order placement, fulfillment to shipping were handled well."</td></tr></table>'
pausecontent[2]='<table width="85%"><tr><td align="left"><strong>Francine L. Gadsden, AL : </strong>"Excellent quality windows. Packed very well. Delivery was good. I am definitely recommending Custom Order Online to everyone I know!"</td></tr></table>'*/
/*pausecontent[0]='<table width="85%"><tr><td align="left">"Good service, good product. Thank you." - <strong>Robert G. - Wyndmoor, PA</strong></td></tr></table>'
pausecontent[1]='<table width="85%"><tr><td align="left">"All details from order placement, fulfillment to shipping were handled well." - <strong>Ron R. Arveda, CO</strong></td></tr></table>'
pausecontent[2]='<table width="85%"><tr><td align="left">"Excellent quality windows. Packed very well. Delivery was good. I am definitely recommending Custom Order Online to everyone I know!" - <strong>Francine L. Gadsden, AL</strong></td></tr></table>'*/

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