/**
 * 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=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">Kumar P, Duluth GA</td></tr><tr><td valign="right" class="tan">"Very memorable. I really liked buying my Camry here and will definitely buy from World Toyota again!"</td></tr></table>';
singletext[1]='<table CELLSPACING="0" CELLPADDING="0" align="center"><tr><td valign="right" class="tabb">Jihad M, Atlanta GA</td></tr><tr><td valign="right" class="tan">"Everybody was extremely nice, considerate and respectful when I purchased my 2008 Sienna."</td></tr></table>';
singletext[2]='<table CELLSPACING="0" CELLPADDING="0" align="center"><tr><td valign="right" class="tabb">Maria L, Marietta GA</td></tr><tr><td valign="right" class="tan">"Our salesman worked with us to find the Prius we wanted. Five stars!"</td></tr></table>';
singletext[3]='<table CELLSPACING="0" CELLPADDING="0" align="center"><tr><td valign="right" class="tabb">APandKells, Atlanta GA</td></tr><tr><td valign="right" class="tan">"My family had a wonderful experience at World Toyota.  All the salesmen we dealt with were very kind. I would definitely recommend this dealership to anyone looking for a car. Thank you World Toyota for making our car purchase a very pleasant one."</td></tr></table>';
singletext[4]='<table CELLSPACING="0" CELLPADDING="0" align="center"><tr><td valign="right" class="tabb">ellis05, Atlanta GA</td></tr><tr><td valign="right" class="tan">"I always get great service from Mapp Mouth. Referred to him years ago by a friend who spoke very highly of him. That\'s why I get all my Camry\'s scheduled maintenance service at World Toyota."</td></tr></table>';
singletext[5]='<table CELLSPACING="0" CELLPADDING="0" align="center"><tr><td valign="right" class="tabb">celica9, Atlanta GA</td></tr><tr><td valign="right" class="tan">"I always can trust Map to help me understand what my car needs and take care of me. This is important since I don\'t know very much about cars other then driving them. I have brought my car to World Toyota since I bought it 5 years ago and have been very happy with them."</td></tr></table>';
singletext[6]='<table CELLSPACING="0" CELLPADDING="0" align="center"><tr><td valign="right" class="tabb">amagre, Atlanta GA</td></tr><tr><td valign="right" class="tan">"I just bought a new car from World Toyota. The sales consultant was Roy Samuel. He is a genuinely nice man. The system felt a little long and drawn out at first, but ended working out for us very well."</td></tr></table>';
singletext[7]='<table CELLSPACING="0" CELLPADDING="0" align="center"><tr><td valign="right" class="tabb">Terry C, Atlanta GA</td></tr><tr><td valign="right" class="tan">I do not like to say this often, but I received the best service ever in my whole life with Roy Samuel. He made me feel like he was selling a car to his own family. He really made sure that I got a good deal and that everything was to my advantage...I definitely recommend anyone to go see him if you are planning to buy a car.</td></tr></table>';
singletext[8]='<table CELLSPACING="0" CELLPADDING="0" align="center"><tr><td valign="right" class="tabb">Keshan J, Alpharetta GA</td></tr><tr><td valign="right" class="tan">"As always Phil was a huge help...because of his outstanding customer service with me, that is part of the reason why I will always bring my car to World Toyota....Please continue with the good work and I will remain a longtime customer."</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 -->
