﻿/***********************************************
* 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 = 6000; //set delay between message change (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(192,192,192); // start color (red, green, blue)
var endcolor=new Array(255,255,255); // end color (red, green, blue)

var fcontent=new Array();
begintag='<div style="font: normal 11px Arial; padding: 5px;">'; //set opening tag, such as font declarations

fcontent[0]="<font face='Arial' style='font-size:11pt'><a href='testimonials_cn.html' style='color:ffffff;text-decoration:none' target='_top'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;谢谢您和您团队出色的工作……！我真为您的高效和快捷赶到惊讶。再次诚挚地感谢您巨大而重要的帮助……<p><div align='right'><b>» 更多</b></div></a></font></P>";

fcontent[1]="<font face='Arial' style='font-size:11pt'><a href='testimonials_cn.html' style='color:ffffff;text-decoration:none' target='_top'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;您就像对我们的申请施了魔法，为此我们深深的感谢您。我们从来没有想到事情可以这么快就处理完毕……<br><br><br><div align='right'><b>» 更多</b></div></a></font></P>";

fcontent[2]="<font face='Arial' style='font-size:11pt'><a href='testimonials_cn.html' style='color:ffffff;text-decoration:none' target='_top'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;您确实知道如何流畅地处理这些繁杂而艰难的过程。谢谢您的帮助和为我们所做的一切。不管是我们花的时间还是费用，都是非常值得……<p><div align='right'><b>» 更多</b></div></a></font></P>";

fcontent[3]="<font face='Arial' style='font-size:11pt'><a href='testimonials_cn.html' style='color:ffffff;text-decoration:none' target='_top'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;签证官告诉Svitlana我们的文件准备得非常完美。Svitlana告诉我她是在基辅找到您的助手的……在她准备面试的时候提供了非常多的帮助……<br><div align='right'><b>» 更多</b></div></a></font></P>";

fcontent[4]="<font face='Arial' style='font-size:11pt'><a href='testimonials_cn.html' style='color:ffffff;text-decoration:none' target='_top'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;感谢您为了实现我们的梦想而付出的耐心、支持和贡献。我就知道您的经验是我们成功的决因素……<br><div align='right'><b>» 更多</b></div></a></font></P>";

fcontent[5]="<font face='Arial' style='font-size:11pt'><a href='testimonials_cn.html' style='color:ffffff;text-decoration:none' target='_top'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;让我对您致以最诚挚的感谢。您让我获得了重生。因为您的帮助，我妈妈的梦想成为了现实，您真是\"伟大的律师\"!……<p><div align='right'><b>» 更多</b></div></a></font></P>";

fcontent[6]="<font face='Arial' style='font-size:11pt'><a href='testimonials_cn.html' style='color:ffffff;text-decoration:none' target='_top'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;非常感谢您的帮助，您让整个过程变成了轻松而愉快的经历……面试只用了五分钟……<p><div align='right'><b>» 更多</b></div></a></font></P>";

fcontent[7]="<font face='Arial' style='font-size:11pt'><a href='testimonials_cn.html' style='color:ffffff;text-decoration:none' target='_top'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;是您让一切产生了影响，Irina告诉我她是五个女孩中唯一获得签证的人…<br><br><br><div align='right'><b>» 更多</b></div></a></font></P>";

fcontent[8]="<font face='Arial' style='font-size:11pt'><a href='testimonials_cn.html' style='color:ffffff;text-decoration:none' target='_top'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;谢谢您对我们申请这么灵敏的注意，以及您在整个申请过程中体现出的专业修养。我保证将向所有我认识的朋友强烈推荐您的服务！……<br><div align='right'><b>» 更多</b></div></a></font></P>";

fcontent[9]="<font face='Arial' style='font-size:11pt'><a href='testimonials_cn.html' style='color:ffffff;text-decoration:none' target='_top'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;罗斯先生，每次我有疑问的时候，您的全体职员都给予了我非常重要的帮助，总是让我受到最好的服务。而且我们申请所花的时间（这么短），真是太棒了……<p><div align='right'><b>» 更多</b></div></a></font></P>";



closetag='</div>';

var fwidth='189px'; //set scroller width
var fheight='147px'; //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" style="border:0px solid black;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