// Feed (Dynamic) v1.1b (16/02/2006) http://www.maxxblade.co.uk/feed
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]+'" target="_blank"><span style="color:'+feedtype[feed[hd][3]][0]+';font-weight:bold">'+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()",3000);}}
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('#444444',">","http://www.maxxblade.co.uk");newstory("01/01/2000","feed/index.htm","Feed v1.1b is loading...");addHeadline();