function sfHover() {
  var sfEls = document.getElementById("nav").getElementsByTagName("LI");
  for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			$(this).removeClassName("sfhover");
      this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}

function popup(src, name, width, height) {
  window.open(src,name,"menubar=no,width="+width+",height="+height+",toolbar=no");
}

function externalLinks() {
  if (!document.getElementsByTagName) return;
  var anchors = document.getElementsByTagName("a");
  for (var i=0; i<anchors.length; i++) {
    var anchor = anchors[i];
    if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external") {
      anchor.target = "_blank";
    }
    if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "listenLive") {
      anchor.setAttribute("onclick","window.open('"+anchor.getAttribute("href")+"','listenLive','width=900,height=560,toolbar=no,menubar=no'); return false;");
    }
  }
}

function showCal(element){
	if (element != curCal) {
		document.getElementById(curCal + "-link").className = "";
		document.getElementById(curCal).style.display = "none";
		document.getElementById(element).style.display = "block";
		new Effect.BlindDown(element, {duration:.2});
		document.getElementById(element + "-link").className = "calcurrent";
		curCal = element;
	}
}

function uploadImage(formname,inputname,email) {
	var w = 600; var h = 200;
	var l = (screen.width - w) / 2;
	var t = (screen.height - h) / 2;
	var url = "/addImage.aspx?formname="+formname+"&inputname="+inputname+"&email="+email;
	newwin = window.open(url,"","width="+w+",height="+h+",left="+l+",top="+t+",resizable");
}

function startup() {
  sfHover();
  externalLinks();
  Shadowbox.init();
  curCal = "cal-all";
}
window.onload = startup;







