/**
 * scrollingtext
 * 
 * Javascript to run the scroller
 * 
 * @version		
 * 
 * @author		vbarsan.com
 * @copyright		Copyright vbarsan.com
 */

/**************************************
* http://vertical-scroller.vbarsan.com/
*    This notice may not be removed 
**************************************/

//-- Begin Scroller's Parameters and messages -->
//scroller's width - set from XML
var swidth=180;

//scroller's height- set from XML
var sheight=150;


//scroller's speed 
var sspeed=2;
var restart=sspeed;
var rspeed=sspeed;

//scroller's pause 
var spause=2000;

//scroller's background - set from XML
//var sbcolor="#ffffff";
var sbcolor="";

//messages - set from XML
var singletext=new Array();
singletext[0]='<table CELLSPACING="0" CELLPADDING="0" align="center"><tr><td valign="right" class="tabb">Jerry C, Tewksbury MA</td></tr><tr><td valign="right" class="tan">"My experience at your agency was exceptional due to Doug Cliffords ability to direct me into the appropriate vehicle for my needs."</td></tr></table>';
singletext[1]='<table CELLSPACING="0" CELLPADDING="0" align="center"><tr><td valign="right" class="tabb">Douglas G, Rye NH</td></tr><tr><td valign="right" class="tan">"Each visit to your place has reaffirmed my feelings about Lexus of Manchester.  I have been treated warmly and professionally on each visit by any employee I have met.  Joe Cardello has made my purchase easier and completely satisfying.  He is a credit to your dealership and to Lexus."</td></tr></table>';
singletext[2]='<table CELLSPACING="0" CELLPADDING="0" align="center"><tr><td valign="right" class="tabb">Mike and Lisa C, Londonderry NH</td></tr><tr><td valign="right" class="tan">"We had a superb buying experience from your dealership due to the efford, hard work and honesty of Joe Cardello.  The quality of the vehicle and the great buying experience will have us coming back to your dealership for our next vehicle."</td></tr></table>';
singletext[3]='<table CELLSPACING="0" CELLPADDING="0" align="center"><tr><td valign="right" class="tabb">Mary Jo C, Portland ME</td></tr><tr><td valign="right" class="tan">"I think Jan Ellen Ryan did an excellent job and in being in sales myself, I appreciated her low-key style."</td></tr></table>';
singletext[4]='<table CELLSPACING="0" CELLPADDING="0" align="center"><tr><td valign="right" class="tabb">Floyd D, Manchester NH</td></tr><tr><td valign="right" class="tan">"I would like to thank Eric Nyberg...Without hesitation I would recommend anyone to speak to Eric if interested in a new Lexus.  I look forward to years of future dealings as well as coming back for service."</td></tr></table>';
singletext[5]='<table CELLSPACING="0" CELLPADDING="0" align="center"><tr><td valign="right" class="tabb">Howard S, Belle Harbor NY</td></tr><tr><td valign="right" class="tan">"I wanted to thank you and Doug Clifford for your exceptional service and cooperation....If there is an award, you should get it."</td></tr></table>';
singletext[6]='<table CELLSPACING="0" CELLPADDING="0" align="center"><tr><td valign="right" class="tabb">Jill R, Londonderry NH</td></tr><tr><td valign="right" class="tan">"I look forward to conducting future business with Doug Clifford and Lexus of Manchester."</td></tr></table>';
singletext[7]='<table CELLSPACING="0" CELLPADDING="0" align="center"><tr><td valign="right" class="tabb">David B, Litchfield NH</td></tr><tr><td valign="right" class="tan">"I will mention Diane Apostoles to all my family and friends, she is the best...and yes, everyone else is nice and a great help also."</td></tr></table>';
singletext[8]='<table CELLSPACING="0" CELLPADDING="0" align="center"><tr><td valign="right" class="tabb">Karen C, Hanover NH</td></tr><tr><td valign="right" class="tan">"Henry Yee was great to work with...Thank you for your help in making this a great experience."</td></tr></table>';
singletext[9]='<table CELLSPACING="0" CELLPADDING="0" align="center"><tr><td valign="right" class="tabb">John H, Stratham NH</td></tr><tr><td valign="right" class="tan">"I commend Bob Vaillancourt and Garrett Green both of whom were really superb in accommodating to my needs and in makeing me feel like Lexus is a premium product line."</td></tr></table>';

//singletext[...]='...';
//-- end Parameters and message -->


//-- begin: Scroller's Algorithm -->
var ii=0;
function goup(){if(sspeed!=rspeed*16){sspeed=sspeed*2;restart=sspeed;}}

function startscrolling(){
if(document.getElementById){ns6div=document.getElementById('iens6div');ns6div.style.top=sheight+"px";ns6div.innerHTML=singletext[0];sizeup=ns6div.offsetHeight;ns6scroll();}
else 
if(document.layers){ns4layer=document.ns4div.document.ns4div1;ns4layer.top=sheight;ns4layer.document.write(singletext[0]);ns4layer.document.close();sizeup=ns4layer.document.height;ns4scroll();}
else 
if(document.all){iediv=iens6div;iediv.style.pixelTop=sheight+"px";iediv.innerHTML=singletext[0];sizeup=iediv.offsetHeight;iescroll();}}
function iescroll(){if(iediv.style.pixelTop>0&&iediv.style.pixelTop<=sspeed){iediv.style.pixelTop=0;setTimeout("iescroll()",spause);}else 
if(iediv.style.pixelTop>=sizeup*-1){iediv.style.pixelTop-=sspeed+"px";setTimeout("iescroll()",100);}else{if(ii==singletext.length-1)ii=0;else ii++;iediv.style.pixelTop=sheight+"px";iediv.innerHTML=singletext[ii];sizeup=iediv.offsetHeight;iescroll();}}
function ns4scroll(){if(ns4layer.top>0&&ns4layer.top<=sspeed){ns4layer.top=0;setTimeout("ns4scroll()",spause);}else 
if(ns4layer.top>=sizeup*-1){ns4layer.top-=sspeed;setTimeout("ns4scroll()",100);}else{if(ii==singletext.length-1)ii=0;else ii++;ns4layer.top=sheight;ns4layer.document.write(singletext[ii]);ns4layer.document.close();sizeup=ns4layer.document.height;ns4scroll();}}
function ns6scroll(){if(parseInt(ns6div.style.top)>0&&parseInt(ns6div.style.top)<=sspeed){ns6div.style.top=0;setTimeout("ns6scroll()",spause);}else 
if(parseInt(ns6div.style.top)>=sizeup*-1){ns6div.style.top=parseInt(ns6div.style.top)-sspeed+"px";setTimeout("ns6scroll()",100);}
else{if(ii==singletext.length-1)ii=0;else ii++;
ns6div.style.top=sheight+"px";ns6div.innerHTML=singletext[ii];sizeup=ns6div.offsetHeight;ns6scroll();}}
//-- end Algorithm -->
