function doPopups() {
  if (!document.getElementsByTagName) return false;
  var links=document.getElementsByTagName("a");
  for (var i=0; i < links.length; i++) {
    if (links[i].className.match("popup")) {
      links[i].onclick=function() {
        window.open(this.href, "");
        return false;
      }
    }
  }
}

/*====
 * rotator
 *================================================ */

var headline_count;
var headline_interval;
var old_headline = 0;
var current_headline = 0;

$(document).ready(function(){
	headline_count = $("div.topStoryItem").size();
	$("div.topStoryItem:eq("+current_headline+")").css('display','block');
	headline_interval = setInterval(headline_rotate,5000); //time in milliseconds
});

function headline_rotate() {
	current_headline = (old_headline + 1) % headline_count; 
	$("div.topStoryItem:eq(" + old_headline + ")").hide();
	$("div.topStoryItem:eq(" + current_headline + ")").show(); 
	old_headline = current_headline;
}

/*
function dropdown () {
	if (document.all&&document.getElementById) {
		var navRoot = document.getElementById("topNav");
		if (!navRoot) { return; }
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName=="LI") {
				node.onmouseover=function() {
					this.className+=" over";
				}
				node.onmouseout=function() {
					this.className=this.className.replace(" over", "");
				}
			}
		}
	}
}
*/
