var shuffle_array = new Array();function make_shuffle(E, nodeName){	if(top.pieceOfJunk || !document.createElement || !E || !nodeName) return;		var ticker = document.createElement('DIV');		E.shuffle_copy = new Array();	E.shuffle_nodeName = nodeName;	E.shuffle_timer = null;	E.shuffle_copy_index = 0;	E.shuffle_array_index = 0;		//create an array of the contents of E broken up by nodeName	var regex = new RegExp(['<' + nodeName],['gi']);	var copy = E.innerHTML.split(regex);	for(var i in copy) {		if(!copy[i].match(/^\W*$/)) {			E.shuffle_copy[E.shuffle_copy.length] = ('<' + nodeName + copy[i]);		}	}	//only continue if there is more than one story	if(E.shuffle_copy.length < 2) return E;	E.shuffle_copy_index = E.shuffle_copy.length;		//do shuffle array stuff for easy global access	E.shuffle_array_index = shuffle_array.length;	shuffle_array[shuffle_array.length] = (E);	if(E.id) shuffle_array[E.id] = E;	//events	E.onmouseover = function ()	{		shuffle_pause(this.shuffle_array_index);	}	E.onmouseout = function ()	{		shuffle_play(this.shuffle_array_index);	}		shuffle_next(E.shuffle_array_index);		return E;}function shuffle_next(index){	var E = shuffle_array[index];	if(E.ticker) E.ticker.timer = clearTimeout(E.ticker.timer);	E.ticker = document.createElement('DIV');	var pause = 0;		++E.shuffle_copy_index;	if(E.shuffle_copy_index > E.shuffle_copy.length - 1) E.shuffle_copy_index = 0;		E.innerHTML = E.shuffle_copy[E.shuffle_copy_index];		//calcuate how long to wait until switching to next story	pause = E.innerHTML.split(/ +/).length * 4 * 100;		E.ticker.wait = pause / 100;	E.ticker.style.width = '0%';	E.ticker.className = 'shuffle_ticker';	E.appendChild(E.ticker);		shuffle_ticker(E.shuffle_array_index);}function shuffle_pause(index){	var E = shuffle_array[index].ticker;	if(!E) return;	E.timer = clearTimeout(E.timer);}function shuffle_play(index){	var E = shuffle_array[index].ticker;	if(!E) return;	E.timer = clearTimeout(E.timer);	E.timer = setTimeout('shuffle_ticker(' + index + ');', E.wait);}function shuffle_ticker(index){	var E = shuffle_array[index].ticker;	if(!E) return;		var width = parseInt(E.style.width) + 1;	if(width < 100) {		E.style.width = width + '%';		E.timer = setTimeout('shuffle_ticker(' + index + ');', E.wait);	}	else {		E.timer = clearTimeout(E.timer);		E.style.width = '100%';		shuffle_next(index);	}}
