var hmm;

var pictures = new Array("img/Mathew02.jpg", "img/PaulineSmall.jpg", "img/juliaMAThesis.jpg", "img/tyler.jpg", "img/caitlin.jpg");


<!-- Paste this code into an external JavaScript file named: marquee.js  -->



function setupFadeLinks() {
  arrFadeLinks[0] = "http://javascriptsource.com/snippets/popup-blocker-detection.html";
  arrFadeTitles[0] = "Mathew<BR>Taekwon-do World Champs<BR>Tokyo";
  arrFadeLinks[1] = "http://javascriptsource.com/forms/code-box-editor.html";
  arrFadeTitles[1] = "Pauline,<BR> NZ Representative,<BR> World Championships";
  arrFadeLinks[2] = "http://javascriptsource.com/miscellaneous/mailto.html";
  arrFadeTitles[2] = "Julia,<BR> MA Thesis,<BR>Waikato University";
  arrFadeLinks[3] = "http://javascriptsource.com/cookies/delicious-cookies.html";
  arrFadeTitles[3] = "Tyler,<BR>Sporting success<BR>";
  arrFadeLinks[4] = "http://javascriptsource.com/snippets/insertafter.html";
  arrFadeTitles[4] = "Caitlin,<BR> Educational visit to Japan";
}

// You can also play with these variables to control fade speed, fade color, and how fast the colors jump.
// 187(bb) or 221(dd) or 255
var m_FadeOut = 187;
var m_FadeIn=0;
var m_Fade = 0;
var m_FadeStep = 3;
var m_FadeWait = 12500;
var m_bFadeOut = true;

var m_iFadeInterval;

<!-- window.onload = Fadewl; -->

var arrFadeLinks;
var arrFadeTitles;
var arrFadeCursor = 0;
var arrFadeMax;

function Fadewl() {
  m_iFadeInterval = setInterval(fade_ontimer, 10);
  arrFadeLinks = new Array();
  arrFadeTitles = new Array();
  setupFadeLinks();
  arrFadeMax = arrFadeLinks.length-1;
  setFadeLink();
}

function setFadeLink() {
  var ilink = document.getElementById("fade_link");
  ilink.innerHTML = arrFadeTitles[arrFadeCursor];
  ilink.href = arrFadeLinks[arrFadeCursor];
  document["slide"].src = pictures[arrFadeCursor];
}

function fade_ontimer() {
  if (m_bFadeOut) {
    m_Fade+=m_FadeStep;
    if (m_Fade>m_FadeOut) {
      arrFadeCursor++;
      if (arrFadeCursor>arrFadeMax)
        arrFadeCursor=0;
      setFadeLink();
      m_bFadeOut = false;
    }
  } else {
    m_Fade-=m_FadeStep;
    if (m_Fade<m_FadeIn) {
      clearInterval(m_iFadeInterval);
      hmm = setTimeout(Faderesume, m_FadeWait);
      m_bFadeOut=true;
    }
  }
  var ilink = document.getElementById("fade_link");
  if ((m_Fade<m_FadeOut)&&(m_Fade>m_FadeIn))
    ilink.style.color = "#" + ToHex(m_Fade);
}

function Faderesume() {
  m_iFadeInterval = setInterval(fade_ontimer, 10);
}

function ToHex(strValue) {
  try {
    var result= (parseInt(strValue).toString(16));

    while (result.length !=2)
            result= ("0" +result);
    result = result + result + result;
    return result.toUpperCase();
  }
  catch(e)
  {
  }
}

function stopSlideShow()
{
  clearTimeout(hmm)
}

/*###############################################################################################*/
function doNews(){
	var news = document.getElementById("news");
	news.innerHTML = "The closing date for the next round of applications is Friday 16 March 2012.<P>The October funding round saw the Board sign-off on a further 21 bursaries bringing the total number awarded for 2011 to 35.   Once again tertiary education featured prominently along with subsidising the purchase of laptop computers, recognising sporting success, attendance at a Kip McGrath course, facilitating attendance at a dance competition in Sydney, helping with the purchase of a camera required by a Year 13 student and more.      The Board regrets that the number of first time applicants meant it was forced to decline applicants who had previously received assistance from the Trust. <P>Click on left to see the latest Board Report.<P>To date the Board has awarded a total of 382 bursaries ranging from $159 to $2,500.<P>";
}
