// Dynamic Feed (Wide) v1.0
// By Maxx Blade
// http://www.maxxblade.co.uk
var ns4 = (document.layers) ? 1 : 0;
var ie4 = (document.all) ? 1 : 0;
var ns6 = (document.getElementById && !document.all) ? 1 : 0;
var headlinedisplay="", removehead;
var headlinechars=0;

var feedno, hd = 0, feed = new Array(), feedtype=new Array();
function datesort(a,b){
c=new Date(a[0]);
d=new Date(b[0]);
if(c.getTime()>d.getTime()) return 1;
if(c.getTime()<d.getTime()) return -1;
return 0;
}
function goStory(){
open(feedtype[feed[hd][3]][2]+'/'+feed[hd][1],"");
}
function newfeedtype(colour,name,homeurl){ feedtype[feedtype.length]=new Array(colour,name,homeurl); return feedtype.length-1; }
function newstory( feeddate,feedlink,feedhead){ feed[feed.length] = new Array(feeddate,feedlink,feedhead,feedno); }
function drawNews(){ document.getElementById('thefeed').innerHTML='<font color="'+feedtype[feed[hd][3]][0]+'"><b>'+feedtype[feed[hd][3]][1]+' .:.</b></font> '+'<font color="#669933">'+headlinedisplay+'</font>'; }
function addHeadline(){
	clearTimeout(removehead);
	headlinechars++;
	headline=feed[hd][2].split('');
	headlinedisplay="";
	for(n=0;n<headlinechars;n++){ headlinedisplay+=headline[n]; }
	drawNews();
	if(headlinechars<headline.length){ headlinetime=setTimeout("addHeadline()",50); }else{ removehead=setTimeout("removeHeadline()",3000); }
}

function removeHeadline(){
	clearTimeout(headlinetime);
	headlinechars--;
	headlinedisplay="";
	headline=feed[hd][2].split('');
	for(n=0;n<headlinechars-1;n++){ headlinedisplay+=headline[n]; }
	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 hand=(document.all)?'hand':'pointer';
feedno=newfeedtype("#336600","Michigan ASLA","http://www.michiganasla.org"); newstory("April 6, 2005","#","Welcome to the new Michigan ASLA web site");
document.write('<style>.newshand {cursor:'+hand+'}</style>');
document.write('<div align="left"><left><table width="100%" border="0" cellpadding="0" cellspacing="0"><tr><td width="100%" class="headline2" onclick="goStory()"><p><span class="newshand" id="thefeed"></span></p></td></tr></table></center></div>');

addHeadline();

