/*Typing Scroller
  Submitted by bengaliboy00@hotmail.com (hp: http://www.angelfire.com/nt/bengaliboy/)
  With modifications by Dynamicdrive.com
  Additional modifications by jscheuer1 29/Dec/2005
  as seen in http://dynamicdrive.com/forums
  For full source code, usage terms, and 100s more scripts, visit http://dynamicdrive.com
  */

//Set pause between messages in milliseconds, use 3000 for default:
var pause=3000

//Set typing speed (higher numbers are slower, use 60 for default)
var speed=60

//Secify scroller contents, links
var line=new Array()

line[1]=["2012 Spring Writing Competition Winner and Runners-Up announced", "/writing/2012_competition_spring.html"]
line[2]=["2012 Calendar for Writing Retreats and Courses now Live", "/writing_calendar_2012.html"]
line[3]=["Cooking and Wine Tasting Calendar 2012 Now Live", "/cooking_calendar_2012.html"]
line[4]=["NEW for 2012 - Half-Day Cooking Courses at La Pomme d'Or", "/cooking/la_pomme_dor.html"]
line[5]=["Wine Tasting Classes and Weekends at Misse", "/wine_tasting.html"]
line[6]=["All CdM courses and materials provided are in English", "#"]

///////////////Stop Editing////////////

if (document.all||document.getElementById){
document.write('<a id="banner" href="'+line[1][1]+'" onmousedown="window.location=this.href;return false;" onclick="return false;"></a>')
}

var lines=line.length-1,
temp="",
ban=document.getElementById? document.getElementById('banner') : document.all.banner,
nextchar=-1,
nextline=1,
cursor="\\";
function animate(){
if (ban.href.indexOf(line[nextline][1])==-1)
ban.href=line[nextline][1]
ban.style.cursor=/void/.test(ban)? 'text': ''
if (temp==line[nextline][0] & temp.length==line[nextline][0].length & nextline!=lines){
nextline++;
nextchar=-1;
ban.innerHTML=temp;
temp="";
setTimeout("nextstep()", pause)
}
else if (nextline==lines & temp==line[nextline][0] & temp.length==line[nextline][0].length){
nextline=1;
nextchar=-1;
ban.innerHTML=temp;
temp="";
setTimeout("nextstep()", pause)
}
else
nextstep()
}

function nextstep() {
    if (cursor=="\\"){
        cursor="|"
    } else if (cursor=="|"){
        cursor="/"
    } else if (cursor=="/"){
        cursor="-"
    } else if (cursor=="-"){
        cursor="\\"
    }
    nextchar++;temp+=line[nextline][0].charAt(nextchar);
ban.innerHTML=temp+cursor
setTimeout("animate()", speed)
}

// if (document.all||document.getElementById)
// window.onload=animate;
//

