// JavaScript Document


/***********************************************
* 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 = 5000; //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(222,1,10); // 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: bold 11px Arial; text-align:center; height:40px;">'; //set opening tag, such as font declarations
fcontent[0]="The key to accelerating your quality of life and personal wealth is to learn and model the world's most successful achievers";
fcontent[1]="&#8220;I have been to many seminars and conferences on various topics over the years, including one very large financial one, however the 21st Century seminar comes out clearly in the number one position.&#8221; KEN.";
fcontent[2]="I attended the March Gold Coast 2006 seminar. It was mind blowing. I got equity from my home and with using trading strategies created $80,000 plus in the first two months and continuing to grow!";
fcontent[3]="&#8220;...After building a rapport with our real estate agent, she offered us two houses on one sub-dividable title for $450,000. Six months later the property has been revalued at $500,000 and is renting for $600 per week. Positive cashflow - that's great, plus another $50,000 in money out of thin air.&#8221; JOCK &amp; AMY MITCHELL";
fcontent[4]="&#8220;So far I have just renovated our modest home which was valued at about $140,000. I spent $100,000 on renovations and now it's worth about $300,000. Picked up some good capital there and now am using it to secure another property which I am purchasing off the plan, saving on stamp duty and giving me a good debt and tax offsets.&#8221; STEPHEN SCHLINK | Port Lincoln SA";
fcontent[5]="&#8220;Without 21CA we wouldn't be in this great position today and we have confidence with the knowledge we have from the course that we will be in an even greater position tomorrow.&#8221;  JEAN ROGERS";
fcontent[6]="&#8220;Jamie opened up our minds to things we didn't think were possible, and we have taken his teachings and created our own investment Strategies for both the Stock Market &amp; Property Investments, which have propelled us to wealth and a lifestyle we only dreamed of before!&#8221; ANDREW DIMITRI";
fcontent[7]="&#8220;I watched the free DVD that this site handed out. I found it very helpful and made $15,000 on a property in only 2 months.This is a truly inspirational DVD and I recommended it to all.&#8221;  Thanks. CHARLIE";
fcontent[8]="&#8220;Thank you for giving me this opportunity and helping me to grow and learn as a person. Words don't quite explain the gratitude I feel for what you have done. I hope one day I will be able to show you my appreciation&#8221";
fcontent[9]="&#8220;I am over 60 years and have been taken to places I didn't know. This has helped me to have the confidence to take the first step to help me to retire. Thank you Jamie and 21st Century Academy.&#8221;  W.G FITZGERALD";
fcontent[10]="&#8220;...We joined the academy knowing there was so much more to life than our JOB(s). My wife picked up Jamie's book at our local library, we took the ball and ran with it. Action was definitely our missing key for our combination lock.&#8221; DODD23 ";
closetag='</div>';

var fwidth='720px'; //set scroller width
var fheight='35px'; //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="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
