/***********************************************
* 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 = 10000; //set delay between message change2000 (in miliseconds)
var maxsteps=30; // number of steps to take to change from start color to endcolor
var stepdelay=40; // 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 style="font: normal 13px Arial; padding: 5px; height:130px;">'; //set opening tag, such as font declarations
fcontent[0]="The staff and results are what keep me coming back to Atlantic Plastic Surgery Center. I recommend them to anyone I can. The fact that it's a private, real facility with the same familiar faces is A #1. <br><strong>Yours,<br>Kate<br>Stratham, NH</strong>";
fcontent[1]="Thank you for all of your support. I can&acute;t tell you how happy I am with my result. I still can&acute;t believe it&acute;s me&#33; Dr. Gray, you and your staff were wonderful to me. If at an time I can be of any help to your with my wonderful results, all you need to do is ask&#33; Once again, thank you!<br><strong>Sincerely,<br> P<br>Portsmouth NH</strong>";
fcontent[2]="Dr. Gray&acute;s work is wonderful and speaks for itself. The staff at Atlantic Plastic Surgery was very friendly and upbeat. It was a very easy to reach location, yet very private and comfortable. I did  not feel like I was at a hospital but I felt very safe with the professionalism and care. <br><strong>Sincerely, <br>J.<br>Stratham, NH</strong>";
fcontent[3]="A friend referred me to your website and your before and after shots, so I chose you. I was a very small 34A before my surgery. I showed you several pictures of what I wanted to look like. You helped me decide what size to be. Now I am a full 34C. I am extremely happy with my size. I would say you are an artist. My friends can&acute;t believe that you actually made my breasts look like the picture I had shown you. My recovery was speedy, I was back to work after 4 days and doing international travel 2 weeks later. All had been a wonderful experience for me. <br><strong>Sincerely, <br>A<br>Newfields, NH</strong>";
fcontent[4]="My thanks to you for my &#8220;neckectomy&#8221; and blepharoplasty.  The results are so pleasing and natural. Much to my surprise, I had no pain and my fast recovery was really amazing. Dr. Gray, you have an absolutely top notch staff, especially to Cherie, who held my hands and head. After all my worries for upteem  years, I finally did it.<br><strong>My heartfelt thanks,<br>D.<br>North Hampton, NH </strong> ";
/*fcontent[4]="I wanted to thank you so much for helping to co-ordinate a wonderful experience for me at your office.  As a first time patient, everyone was so professional and friendly and Dr. Ballentyne was wonderful!  I am very happy with the results of my Botox treatment.  As my friends and I approach our late thirties, we will be looking for more opportunities to improve our appearance with a natural subtle result.  Your office is whom I would recommend to any family members or friends that inquire about plastic surgery or skin rejuvenation procedures.  Thanks  again for helping to co-ordinate a fantastic experience for me <br><strong>Sincerely, <br>S.</strong>";*/
fcontent[5]="I wanted to let you know how happy I am with the outcome of my liposuction breast reduction. I&acute;ve gone from 44DDD to a 40D. I&acute;ve been self-conscious my whole life. It was hard to find clothing. People made remarks about my being big-busted.   feel so much better about how I look now.  When I wok up from surgery, I was 8 pounds lighter and the best thing is I have no scars and I was back at my job fast.<br><strong>Thanks, <br>A.<br>Stratham, NH</strong>";
fcontent[6]="I went to SEVERAL doctors before I chose you. I am so glad I made the right choice. Your work and your staff are both impeccable. I am so happy wth what you have done for me. I can&acute;t say enough--you and your staff go above and beyond.<br><strong>Thank you&#33;<br>G.<br>Wilmington, Massachusetts</strong>";
/*fcontent[7]="Late in 2005, I had the good fortune to met with you and your staff to learn more about breast reduction surgery by liposuction, a procedure you pioneered, and, as I can attest, perform successfully at your very comfortable center in Portsmouth.  I underwent the surgery in January 2006.<br><br>I would be remiss if I did not write to tell you how happy I am with the process and the results. I feel like a new , younger, lighter woman.  I move more confidently and am without the back pain that has plagued me for years.  I no longer need to strategize about which dress (blouse, shirt, bathing suit&#8230;) might &#8211; just might&#8211; fit and flatter my top heavy frame.  It&acute;s downright liberating &#33;<br><br>I extend sincere thanks to you and your staff, al of whom, were  friendly, professional, caring and knowledgeable. I would recommend the procedure to anyone considering it. <br><strong>Sincerely, <br>C.<br>Swampscott, Ma</strong>";*/
fcontent[7]="It has been one year this month that I came to your facility to have breast liposuction performed, and I just wanted to let you know how pleased I am with the results. I&acute;ve had no problems with recovery, and my breasts look like they haven&acute;t looked in years! Thank you to you and all your staff for being so helpful and thoughtful thorough out the procedure. I definitely came to the right place&#33;<br><strong>Fondly, <br>T<br>Dover, NH</strong>";
fcontent[8]="Besides my great results, I liked the fact that I felt like someone would be available to reach anytime if I needed help. Dr. Gray&acute;s flexibility made my surgeries more affordale---very important&#33; And the personal attention from everyone meant a lot.<br><strong>With many thanks,<br>H.<br>Somerworth, NH</strong>";
fcontent[9]="I was in  awe of the  professionalism, courtesy, respect, professionalism, timeliness, accurate information I found at your facility. I also appreciated the step by step instructions I received always a the right time. Your work exceeded my expectations. Months later, I remain very pleased.<br><strong>Thank you,<br>S.<br>Rye, NH</strong>";
/*fcontent[11]="Dr. Gray&acute;s entire staff worked together to make my surgeries what they should be comfortable, relaxed, and catered to what I wanted the end results to be. Plastic surgeries can be life changing and Dr. Gray has a knack for understanding this. His staff went over my options several times and gave me guidance that allowed me to make decisions I will be comfortable with for a lifetime.<br><br>The nurses and staff put me at ease immediately on the day of surgery and the anesthesiologist gave me medication to calm the few anxieties I had while I relaxed before hand in Dr. Gray&acute;s  beautiful private rooms with warm, heated blankets. <br><br>Recovery from my surgeries were without complications and the follow up visits and long term care instructions were perfectly explained to me.  I have already sent several friends to Dr. Gray an I will return to him in the future. I am thrilled with the results <br><strong>Thanks for helping me achieve my goals. T<br>North Hampton</strong> ";*/
/*fcontent[9]="Your thoughtfulness meant so much.  You put yourselves in the patients shoes and made sure it never felt impersonal. I will always remember what a big difference your &#8220;TLC&#8221; and kindness made n the healing process.  All those things were truly appreciated. <br><strong>Best Wishes to all of you.<br>S.<br>York, Maine</strong> ";
fcontent[10]="Thank you for the extra special care &#33;&#33; You are amazing and are a wonderful team &#33;<br><strong>Lori<br>Portsmouth, NH </strong>";
fcontent[11]="Everyone was so wonderful It was the perfect experience and it exceeded my expectations &#33;<br><strong>Fondly,<br>Beth <br>Exeter</strong>";
fcontent[12]="The care and efforts I received post&#8211;op by all the nurses and both Dr. Gray and Dr. Baker showed so clearly that they are all concerned in reaching the best possible outcome and will go to any length to make me happy&#8230; I'm very happy! <br><strong>Yours Truly,<br >Sandy<br>Ipswich</strong>";*/
closetag='</div>';

var fwidth='150px'; //set scroller width
var fheight='150px'; //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=0;


/*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" 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


