/***********************************************
* Fading Scroller- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

var delay = 8500; //set delay between message change (in miliseconds)
var maxsteps=40; // number of steps to take to change from start color to endcolor
var stepdelay=50; // time in miliseconds of a single step
//**Note: maxsteps*stepdelay will be total time in miliseconds of fading effect
var startcolor= new Array(255,255,255); // start color (red, green, blue)
var endcolor=new Array(0,0,0); // end color (red, green, blue)

var fcontent=new Array();
begintag='<div class="clientspeak">'; //set opening tag, such as font declarations
fcontent[0]=' "For our place up at the Russian River, we needed to have a sofa which was not only sturdy and comfortable, but had to be a very specific extra large size.   At BuildASofa, we were able to make our sectional sofa to the exact lengths, widths and depths we needed. Every single aspect of our order was custom down to the color of the feet.   We were so pleased to be able to spec our own sizes to the inch and received exactly what we ordered.<br/><br/>Ann was very professional and helpful. She knows her stuff and was very patient with us. "<div><div class="clientname1">Mo. L.</div><div class="clientname2">San Francisco, CA </div><div class="clientname3"> 5/1/2011 </div>';

fcontent[1]=' "This is the perfect place for people like me.  You select the style you want as well as the fabric.  Great quality and very comfortable."<div><div class="clientname1">Blu N.  </div><div class="clientname2">San Francisco, CA </div><div class="clientname3"> 3/24/2011  </div>';

fcontent[2]=' "Great furniture! I have spent the past four weekends shopping around SF for furniture for my new apartment.  A friend recommended Buildasofa and I am so grateful.  I was able to customize my purchase to what I was looking for.  Their customer service was great too, they had great suggestions and were so patient with me while I made my decision."<div><div class="clientname1">Amanda C.</div><div class="clientname2">San Francisco, CA </div><div class="clientname3"> 8/10/2010 </div>';

fcontent[3]=' "Well, we got our couch!  It was done and in the store in just over 2 weeks.  Totally unbelievable.  It was completely custom!  Crate and Barrell "custom" (which only means you can pick your fabric) takes 12-14 weeks.  What a joke.  Anyway, the couch is perfect.  It&acute;s exactly what we wanted.  There&acute;s not even a tiny scratch on the feet.  We are so happy with it." <div><div class="clientname1"> Sholly G.</div><div class="clientname2">Dallas, TX  </div><div class="clientname3"> 11/23/2009 </div>';

fcontent[4]=' "My experience with BuildASofa was nothing short of stellar. We shopped around quite a bit, as we wanted a new sectional sleeper that promised to be pricey...and when you&acute;re sinking several thousand dollars into something, you don&acute;t want to compromise.   The service was great, the style, fabric and color selection was better than anyone else&acute;s and the quality is incredible.  Better yet, our salesman (who was just about the nicest man in the world) called us before we bought to tell us about their upcoming special, so we saved both delivery cost AND tax! "<div><div class="clientname1">Tamara G. </div><div class="clientname2">Dallas, Tx  </div><div class="clientname3"> 6/30/2010</div>';

fcontent[5]=' "This place was nearly half as much as Jennifer convertibles, and my sofa was done in 10 days instead of the 4 months I&acute;d been quoted for a non-tan sofa!   I toured the store, checked out the fabrics and then we sat down and built it out! Cushion firmness, amount of pillows for the back and bottom took record time, which is great because I shop quickly.<br/><br/>PLUS--made locally. No cheap chinese import! I love this place…"<div><div class="clientname1"> Tanya C. </div><div class="clientname2">San Francisco, Ca  </div><div class="clientname3"> 10/19/2009 </div>';

fcontent[6]=' "What a great couch. We just got it delivered today, and it&acute;s fantastic. The buying process was relaxed and straightforward, and we ended up adding some crazy customizations that would have been really expensive elsewhere. (9" wide armrests are great for laptops.)  It took about 4 weeks to arrive.  The staff was helpful but not overbearing, and they really know sofas."<div><div class="clientname1"> Joe G. </div><div class="clientname2">San Francisco </div><div class="clientname3"> 5/31/2009 </div>';

fcontent[7]=' "We love our new sofa from Build a Sofa. Every night we enjoy snuggling up and watching television and enjoying how comfortable the sofa is. It fits our room perfectly, has been ideal for entertaining and is one of the best pieces of furniture we have purchased. It s comfortable, wearing nicely, and always gets amazing compliments from our friends. We are very happy to have purchased from BuildASofa and for such great support from the in store staff. "<div><div class="clientname1"> Jim H.</div><div class="clientname2">San Francisco, CA </div>';

fcontent[8]=' "We ordered our sectional and ottoman after closing on our house in April and had it delivered by Memorial Day.  And we love both pieces; they go well in our new home- everyone comments on them!!"<div><div class="clientname1"> Aaron S.</div><div class="clientname2">Dallas, TX</div>';

fcontent[9]=' "I love my couch from BuildASofa.  I loved all the options available and quick delivery!"<div><div class="clientname1">Laura T</div><div class="clientname2">Austin, TX</div>';

fcontent[10]=' "My sofa-buying experience from your company was memorable....in a positive way! I had been looking a long time for a smaller sized sofa and somehow I stumbled upon a link to your website last May. Voila! There was the perfect size -- the condo-size sofa you offer. I thought shipping my sofa out of state would be an issue, but the salesperson kept me informed every step of the way, and bent over backwards to help me navigate the delivery issues.Thanks for offering a fine service and a product that is well made. The sofa is comfy, beautifully upholstered, and a perfect size/style for my needs. "<div><div class="clientname1">Janice G.</div><div class="clientname2">Austin, TX</div>';

fcontent[11]=' "Love my sectional sofa!"<div><div class="clientname1">Helen R.</div><div class="clientname2">Austin, TX</div>';

fcontent[12]=' "I wanted to write and tell you how happy we are with our new furniture!!! We love it! It is so comfortable and turned out so nice! Our entire experience with Build-a-sofa was spectacular from beginning to end and I thank you for that! :)"<div><div class="clientname1">Jill.</div><div class="clientname2">Austin, TX</div>';
fcontent[13]=' "I am writing to tell you of my experience with Build-A-Sofa.  My husband and I happened to see your site after a google search of "sectional couch + Austin texas".  Your site popped up.  I\'d not seen your store, so my husband and I literally went that afternoon to the store.  That very day, we picked the couch we wanted, the size and shape, the seat cushion feel and the fabric.  We went that night with the fabric sample to our lake house and made sure that was the fabric (it was!) and we placed the order the next day.  The couch was made and delivered as and when promised.  We love it!  We could not be happier with the look, feel or quality of workmanship.  Thanks for making such an outstanding product!"<div><div class="clientname1">Leslie S.</div><div class="clientname2">Austin, TX</div>';
fcontent[14]=' "My wife and I did in fact purchase a beautiful sectional from your Irvine location.  The salespersons knowledge and personality were superb.  We are very happy with our new sofa. Ol Santa and Mrs. Claus are enjoying kicking back and watching TV in comfort."<div><div class="clientname1">Jim & Annie S.</div><div class="clientname2">Irvine, CA</div>';

closetag='</div>';

var fwidth='185px'; //set scroller width
var fheight=''; //set scroller height

var fadelinks=1;  //should links inside scroller content also fade like text? 0 for no, 1 for yes.

///No need to edit below this line/////////////////


var ie4=document.all&&!document.getElementById;
var DOM2=document.getElementById;
var faderdelay=0;
var index=Math.floor(Math.random()*16);


/*Rafael Raposo edited function*/
//function to change content
function changecontent(){
  if (index>=fcontent.length)
    index=0
  if (DOM2){
    document.getElementById("fscroller").style.color="rgb("+startcolor[0]+", "+startcolor[1]+", "+startcolor[2]+")"
    document.getElementById("fscroller").innerHTML=begintag+fcontent[index]+closetag
    if (fadelinks)
      linkcolorchange(1);
    colorfade(1, 15);
  }
  else if (ie4)
    document.all.fscroller.innerHTML=begintag+fcontent[index]+closetag;
  index++
}

// colorfade() partially by Marcio Galli for Netscape Communications.  ////////////
// Modified by Dynamicdrive.com

function linkcolorchange(step){
  var obj=document.getElementById("fscroller").getElementsByTagName("A");
  if (obj.length>0){
    for (i=0;i<obj.length;i++)
      obj[i].style.color=getstepcolor(step);
  }
}

/*Rafael Raposo edited function*/
var fadecounter;
function colorfade(step) {
  if(step<=maxsteps) {	
    document.getElementById("fscroller").style.color=getstepcolor(step);
    if (fadelinks)
      linkcolorchange(step);
    step++;
    fadecounter=setTimeout("colorfade("+step+")",stepdelay);
  }else{
    clearTimeout(fadecounter);
    document.getElementById("fscroller").style.color="rgb("+endcolor[0]+", "+endcolor[1]+", "+endcolor[2]+")";
    setTimeout("changecontent()", delay);
	
  }   
}

/*Rafael Raposo's new function*/
function getstepcolor(step) {
  var diff
  var newcolor=new Array(3);
  for(var i=0;i<3;i++) {
    diff = (startcolor[i]-endcolor[i]);
    if(diff > 0) {
      newcolor[i] = startcolor[i]-(Math.round((diff/maxsteps))*step);
    } else {
      newcolor[i] = startcolor[i]+(Math.round((Math.abs(diff)/maxsteps))*step);
    }
  }
  return ("rgb(" + newcolor[0] + ", " + newcolor[1] + ", " + newcolor[2] + ")");
}

if (ie4||DOM2)
  document.write('<div id="fscroller" style="border:none;width:'+fwidth+';height:'+fheight+'"></div>');

if (window.addEventListener)
window.addEventListener("load", changecontent, false)
else if (window.attachEvent)
window.attachEvent("onload", changecontent)
else if (document.getElementById)
window.onload=changecontent

