/**
 * 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">Shirley C, Lowell MA</td></tr><tr><td valign="right" class="tan">Service department provides excellent service - the man who did the intake and follow through was most courteous and explained in detail what needed to be done that day and what I should have done next time I brought the car in for service. I feel confident that my vehicle is serviced thoroughly and honestly with Ira Toyota.</td></tr></table>';
singletext[1]='<table CELLSPACING="0" CELLPADDING="0" align="center"><tr><td valign="right" class="tabb">Stacy S, Haverhill, MA </td></tr><tr><td valign="right" class="tan">"Everyone at IRA Toyota was so friendly and helpful. It was a great experience. The customer care representative (Caesar) was excellent. The manager was so friendly and honest (Dan Gilday) and Kenny (sales rep) was terrific."</td></tr></table>';
singletext[2]='<table CELLSPACING="0" CELLPADDING="0" align="center"><tr><td valign="right" class="tabb">Dorothy F, Billerica, MA </td></tr><tr><td valign="right" class="tan">"I like that you drive in, get waited on by courteous advisor and you can wait. I made my appt on line, it was simple and then I received a confirmation of my appt and a phone call."</td></tr></table>';
singletext[3]='<table CELLSPACING="0" CELLPADDING="0" align="center"><tr><td valign="right" class="tabb">William H, Wilmington, MA </td></tr><tr><td valign="right" class="tan">"Service advisor, David Brown, courteous, knowledgeable, helpful. Fast intake and clear explanation of service. Comfortable waiting room and amenities."</td></tr></table>';
singletext[4]='<table CELLSPACING="0" CELLPADDING="0" align="center"><tr><td valign="right" class="tabb">Nina B, Stoneham Ma</td></tr><tr><td valign="right" class="tan">"Everyone was so friendly and knowledgeable, Ed was very funny. He made me less nervous."</td></tr></table>';
singletext[5]='<table CELLSPACING="0" CELLPADDING="0" align="center"><tr><td valign="right" class="tabb">QP, Haverhill MA</td></tr><tr><td valign="right" class="tan">"This was probably the easiest and most enjoyable car buying experience that I have ever experienced."</td></tr></table>';
singletext[6]='<table CELLSPACING="0" CELLPADDING="0" align="center"><tr><td valign="right" class="tabb">Ann T, Wakefield MA</td></tr><tr><td valign="right" class="tan">"Excellent service, friendly, knowledgeable sales staff."</td></tr></table>';
singletext[7]='<table CELLSPACING="0" CELLPADDING="0" align="center"><tr><td valign="right" class="tabb">Kristen T, Chelmsford, MA</td></tr><tr><td valign="right" class="tan">"Zack was very pleasant and a pleasure to work with, They worked with me to meet my required monthly payments, What a nice guy!! Did he job great, The employees made me feel comfortable and they were wonderful to work with to make a smooth transaction.</td></tr></table>';
singletext[8]='<table CELLSPACING="0" CELLPADDING="0" align="center"><tr><td valign="right" class="tabb">Jane C, N Chelmsford MA</td></tr><tr><td valign="right" class="tan">"We were met courtesy and a recognition of the fact that we had done our homework and new what we felt was a fair price for the car. Overall honesty and fairness regarding the purchase price and the turn in. I do not have any suggestions as I was completely satisfied."</td></tr></table>';
singletext[9]='<table CELLSPACING="0" CELLPADDING="0" align="center"><tr><td valign="right" class="tabb">Nancy K, Wilmington MA</td></tr><tr><td valign="right" class="tan">"Everyone was so nice.  Wonderful dealership.  All the sales people and staff were great."</td></tr></table>';
singletext[10]='<table CELLSPACING="0" CELLPADDING="0" align="center"><tr><td valign="right" class="tabb">Jonathan L, Lowell MA</td></tr><tr><td valign="right" class="tan">"Everyone was very pleasant and at no time did I feel any pressure."</td></tr></table>';
singletext[11]='<table CELLSPACING="0" CELLPADDING="0" align="center"><tr><td valign="right" class="tabb">Francis M, Dracut MA</td></tr><tr><td valign="right" class="tan">"Fausto was outstanding. He greeted us promptly and was very thorough and courteous throughout our experience, People seem friendly and honest so I would have no problem servicing my car there"</td></tr></table>';
singletext[12]='<table CELLSPACING="0" CELLPADDING="0" align="center"><tr><td valign="right" class="tabb">Haydee F, Methuen MA</td></tr><tr><td valign="right" class="tan">"I received overall excellent service! Could not have been better! Great team."</td></tr></table>';
singletext[13]='<table CELLSPACING="0" CELLPADDING="0" align="center"><tr><td valign="right" class="tabb">Ralph N, Amherst NH</td></tr><tr><td valign="right" class="tan">"I truly wish that I had visited the Ira dealership before purchasing two new vehicles for my wife and son earlier this year.  I will highly recommend this dealership to anyone who asks!!!"</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 -->
