var delay = 10000; //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(255,255,255); // start color (red, green, blue)
var endcolor=new Array(255,255,255); // end color (red, green, blue)

var fcontent=new Array();
begintag='<div  style="border: 0px solid #000000; text-align: left;width:204px;">';
//starttestimonial@@
/*fcontent[0]='<div><div style="margin:0px auto;padding:2px 11px 2px 3px;float:left;position:relative;font-family:Verdana, Arial, Helvetica, sans-serif;font-size:12px;line-height:18px;color:#4e4e4e;text-align:justify;">Master Del Pe’s Healthy Professionals Program brings broadness, depth and practicality which are rare to find in any wellness pr...</div><div style="margin:0px auto;padding:0px 11px 2px 9px !important;padding:2px 11px 2px 9px;float:right;position:relative;font-family:Verdana, Arial, Helvetica, sans-serif;font-size:12px;line-height:18px;font-weight:bold;color:#008ecc;text-align:right;">- KS, Financial Investor , New Delhi, India</div></div>';
			fcontent[1]='<div><div style="margin:0px auto;padding:2px 11px 2px 3px;float:left;position:relative;font-family:Verdana, Arial, Helvetica, sans-serif;font-size:12px;line-height:18px;color:#4e4e4e;text-align:justify;">After 15 years of attending numerous leadership training sessions, I thought I had seen it all, but the GLOCEN Wisdom MBA workshop...</div><div style="margin:0px auto;padding:0px 11px 2px 9px !important;padding:2px 11px 2px 9px;float:right;position:relative;font-family:Verdana, Arial, Helvetica, sans-serif;font-size:12px;line-height:18px;font-weight:bold;color:#008ecc;text-align:right;">- CEO, North Carolina , USA</div></div>';
			fcontent[2]='<div><div style="margin:0px auto;padding:2px 11px 2px 3px;float:left;position:relative;font-family:Verdana, Arial, Helvetica, sans-serif;font-size:12px;line-height:18px;color:#4e4e4e;text-align:justify;">When a company is going through important changes, it is necessary to strengthen its strategy with practical knowledge that can ef...</div><div style="margin:0px auto;padding:0px 11px 2px 9px !important;padding:2px 11px 2px 9px;float:right;position:relative;font-family:Verdana, Arial, Helvetica, sans-serif;font-size:12px;line-height:18px;font-weight:bold;color:#008ecc;text-align:right;">- Monica Garcia, Human Resources Director, Colgate-Palmolive, Ecuador</div></div>';
			fcontent[3]='<div><div style="margin:0px auto;padding:2px 11px 2px 3px;float:left;position:relative;font-family:Verdana, Arial, Helvetica, sans-serif;font-size:12px;line-height:18px;color:#4e4e4e;text-align:justify;">Companies these days are in a marathon for success and sustainable growth. It is hard to manage and implement strategies without h...</div><div style="margin:0px auto;padding:0px 11px 2px 9px !important;padding:2px 11px 2px 9px;float:right;position:relative;font-family:Verdana, Arial, Helvetica, sans-serif;font-size:12px;line-height:18px;font-weight:bold;color:#008ecc;text-align:right;">- RL, CEO, North Carolina, USA</div></div>';
			
*/
var fcontent = new Array();
			fcontent[0] = "<div><div class=\"left_text\">";
            fcontent[0] += "Most of the patients are very happy with the healing method… and are already giving landmark testimonies. Mrs T came to this healing project with HIV-TB. Her CD4 count was just 78. ";
			fcontent[0] += "</div><div class=\"client\">- BV., Washington DC</div></div>";
			
			fcontent[1] = "<div><div class=\"left_text\">";
            fcontent[1] += "When I was diagnosed with ovarian cancer, I started doing yoga and was taught pranayama breathing. After a few months, the cancer spread fast even with medical intervention. Fortunately, I found Del Pe, who told me that yogic breathing awakens the sacred fire called kundalini and this can accelerate the growth of cancer because of its energetic heat. Kundalini is a fertilizer for cancer cells to grow faster. Thanks to Del Pe, who knew how to help me in the recovery process.";
			fcontent[1] += "</div><div class=\"client\">- P.D., Restaurant Owner, New York</div></div>";
			
			fcontent[2] = "<div><div class=\"left_text\">";
            fcontent[2] += "Despite being a healer and trainer in other disciplines for several years, I was unable to shed victimhood and guilt in many areas of my life. This manifested in a number of ailments including Type 2 Diabetes and Cancer. My tests are normal now, after having received healing and coaching from Master. I live a life of gratitude and look forward to serving others and helping them transform the quality of their lives. There is no looking back now.";
			fcontent[2] += "</div><div class=\"client\">- SK, India</div></div>";

			
			
			

//endtestimonial@@
closetag='</div>';

var fwidth='180px'; //set scroller width
var fheight='120px'; //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:0 solid black;width:140;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
