/**
 * 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=140;

//scroller's height- set from XML
var sheight=90;


//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">C.M., No. Branford</td></tr><tr><td valign="right" class="tan">"I love it! Thank you. You could not ask for a better experience or people"</td></tr></table>';
singletext[1]='<table CELLSPACING="0" CELLPADDING="0" align="center"><tr><td valign="right" class="tabb">P.V., New London</td></tr><tr><td valign="right" class="tan">"I can not believe how much time and attention the salesman and the manager both gave me.  I have moved 11 times in the past 32 years, and I have never been to a car dealership that came close to treating me with the care and respect that I found here!  The owner introduced herself to me and made sure that everything was going well."</td></tr></table>';
singletext[2]='<table CELLSPACING="0" CELLPADDING="0" align="center"><tr><td valign="right" class="tabb">L.F., Hebron</td></tr><tr><td valign="right" class="tan">"The team at Whaling City Ford was always very courteous to us and to the customers around us.  It was nice to be in a place where everyone seemed to care."</td></tr></table>';
singletext[3]='<table CELLSPACING="0" CELLPADDING="0" align="center"><tr><td valign="right" class="tabb">D.S., Lisbon</td></tr><tr><td valign="right" class="tan">"It was nothing less than an outstanding experience.  I recently referred a friend to this dealership and he also bought a new Mazda."</td></tr></table>';
singletext[4]='<table CELLSPACING="0" CELLPADDING="0" align="center"><tr><td valign="right" class="tabb">K.S., Mystic</td></tr><tr><td valign="right" class="tan">"I loved the atmosphere of the dealership. Everyone made us feel very comfortable."</td></tr></table>';
singletext[5]='<table CELLSPACING="0" CELLPADDING="0" align="center"><tr><td valign="right" class="tabb">J.G., Gales Ferry</td></tr><tr><td valign="right" class="tan">"Excellent salesperson. We are new to the area, and he went above and beyond to make sure we got a good overview of the dealership as a whole, as well as the area. He has continued to be very helpful and friendly."</td></tr></table>';
singletext[6]='<table CELLSPACING="0" CELLPADDING="0" align="center"><tr><td valign="right" class="tabb">J.T., Waterford</td></tr><tr><td valign="right" class="tan">"Salesperson was perfect for my needs."</td></tr></table>';
singletext[7]='<table CELLSPACING="0" CELLPADDING="0" align="center"><tr><td valign="right" class="tabb">N.P., New London</td></tr><tr><td valign="right" class="tan">"Whaling City staff are so competent and friendly and treat me so well that I actually look forward to my routine maintenance visits."</td></tr></table>';
singletext[8]='<table CELLSPACING="0" CELLPADDING="0" align="center"><tr><td valign="right" class="tabb">R.B., Craryville</td></tr><tr><td valign="right" class="tan">"You went out of your way to make sure that I got the car that I really wanted.  I could not have asked for a better buying experience."</td></tr></table>';
singletext[9]='<table CELLSPACING="0" CELLPADDING="0" align="center"><tr><td valign="right" class="tabb">M.S., Groton</td></tr><tr><td valign="right" class="tan">"I really appreciate the work that was done on my Ford Focus.  It was awesome."</td></tr></table>';
singletext[10]='<table CELLSPACING="0" CELLPADDING="0" align="center"><tr><td valign="right" class="tabb">W.S., Stonington</td></tr><tr><td valign="right" class="tan">"My recent visit to Whaling City was outstanding -- as usual.  Of all the great assets of your dealership, I feel the greatest is Ron Ellis.  He never fails to go out of his way to be helpful."</td></tr></table>';
singletext[11]='<table CELLSPACING="0" CELLPADDING="0" align="center"><tr><td valign="right" class="tabb">M.S., Groton</td></tr><tr><td valign="right" class="tan">"I wanted you to know what a no stress, hassle free experience I had. I will be back again when I purchase my next Ford."</td></tr></table>';
singletext[12]='<table CELLSPACING="0" CELLPADDING="0" align="center"><tr><td valign="right" class="tabb">J.B., Waterford</td></tr><tr><td valign="right" class="tan">"You make it easy for us, for service, just like you did when we bought our last truck from you."</td></tr></table>';
singletext[13]='<table CELLSPACING="0" CELLPADDING="0" align="center"><tr><td valign="right" class="tabb">J.D., Niantic</td></tr><tr><td valign="right" class="tan">"When you bring your car in, its gotta be to people who you trust."</td></tr></table>';
singletext[14]='<table CELLSPACING="0" CELLPADDING="0" align="center"><tr><td valign="right" class="tabb">B.G., No. Stonington</td></tr><tr><td valign="right" class="tan">"Whaling City personnel all great.  Helping out as best they could. . . . Perfect.  Wonderful!"</td></tr></table>';
singletext[15]='<table CELLSPACING="0" CELLPADDING="0" align="center"><tr><td valign="right" class="tabb">J.D., Niantic</td></tr><tr><td valign="right" class="tan">"Professional and courteous personnel on phone and in service."</td></tr></table>';
singletext[16]='<table CELLSPACING="0" CELLPADDING="0" align="center"><tr><td valign="right" class="tabb">S.G., Groton</td></tr><tr><td valign="right" class="tan">"Friendly, quality service"</td></tr></table>';
singletext[17]='<table CELLSPACING="0" CELLPADDING="0" align="center"><tr><td valign="right" class="tabb">R.P., Groton</td></tr><tr><td valign="right" class="tan">"Personnel, great staff."</td></tr></table>';
singletext[18]='<table CELLSPACING="0" CELLPADDING="0" align="center"><tr><td valign="right" class="tabb">C.B., Oakdale</td></tr><tr><td valign="right" class="tan">"The dealership was flexible in meeting my time constraints, working around my schedule.  Paperwork was explained clearly and did not take too long to complete due to their careful attention to my wishes and getting things arranged ahead of time."</td></tr></table>';
singletext[19]='<table CELLSPACING="0" CELLPADDING="0" align="center"><tr><td valign="right" class="tabb">T.O., Westerly, RI</td></tr><tr><td valign="right" class="tan">"I am a 3-time car buyer at WCF.  Tthe salesteam. Dan Corriveau, is a straightforward, honest and knowledgeable salesperson who really helped me find the best fit and value for my money.  And the service department is fantastic. In my 12 year plus history with WCF, I have always felt well taken care of. I would not dream of going to another dealer!"</td></tr></table>';
singletext[20]='<table CELLSPACING="0" CELLPADDING="0" align="center"><tr><td valign="right" class="tabb">CSM, Niantic</td></tr><tr><td valign="right" class="tan">"The entire purchase experience exceeded my expectations - Jay was helpful, informative, and patient when dealing with my many requests and demands, and Patty was friendly and efficient in the finance office. I am thoroughly enjoying my new car, and I look forward to turning it in come 2012 because I know what an easy process that will be."</td></tr></table>';
singletext[21]='<table CELLSPACING="0" CELLPADDING="0" align="center"><tr><td valign="right" class="tabb">B.V. and E. V., Madison, CT</td></tr><tr><td valign="right" class="tan">"Over the past few years, my family has purchsed 4 vehicles from your company...the last one on Dec 23, 2008. Once again, Brian saw that our every need was met to our satisfaction. As long as Brian works for Whaling City, you can count on our business."</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 -->
