function datesort(a,b){if(a==b){return 0;}else{return (a>b)?-1:1;}}
function newfeedtype(colour,name,homeurl){ feedtype[feedtype.length]=new Array(colour,name,homeurl);return feedtype.length-1;}
function newstory(feeddate,feedlink,feedhead){splitdate=feeddate.split("/");newdate=new Date(splitdate[2],splitdate[1]-1,splitdate[0]);feed[feed.length]=new Array(newdate.getTime(),feedlink,feedhead,feedno);}
function drawNews(){document.getElementById('thefeed').innerHTML='<a href="'+feedtype[feed[hd][3]][2]+'/'+feed[hd][1]+'"><span style="color: #0F2C58'+feedtype[feed[hd][3]][0]+';font-weight:normal; font-size: 12px;">'+feedtype[feed[hd][3]][1]+' »</span> '+feed[hd][2].substring(0,headlinechars)+'</a>';}
function addHeadline(){clearTimeout(removehead);headlinechars+=2;drawNews();if(headlinechars<feed[hd][2].length){headlinetime=setTimeout("addHeadline()",50);}else{removehead=setTimeout("removeHeadline()",1000);}}
function removeHeadline(){clearTimeout(headlinetime);headlinechars-=4;drawNews();if(headlinechars>0){removehead=setTimeout("removeHeadline()",50);}else{nextStory();}}
function nextStory(){hd=(hd<feed.length-1)?hd+1:0;addHeadline();if(hd==1){feed.sort(datesort);}}
var hd=0,feed=new Array(),feedtype=new Array(),headlinechars=0,removehead,feedno=newfeedtype('##0F2C58',"","");newstory("","","Summerhouse Education & Equitation Centre");addHeadline();