//MOUSEOVER FADE AND SLIDE IN

function setOpacity(obj, opacity) {
  opacity = (opacity == 100)?99.999:opacity;
  
  // IE/Win
  obj.style.filter = "alpha(opacity:"+opacity+")";
  
  // Safari<1.2, Konqueror
  obj.style.KHTMLOpacity = opacity/100;
  
  // Older Mozilla and Firefox
  obj.style.MozOpacity = opacity/100;
  
  // Safari 1.2, newer Firefox and Mozilla, CSS3
  obj.style.opacity = opacity/100;
}

var tim;
var tim2;
var h=0;
var maxHeight=28;
var heightRatio=(maxHeight/10);
var open_subnav = "";
var open_subnav_opacity = 0; 

function openSubnav(id) {
	clearTimeout(tim);
	clearTimeout(tim2);
	if(open_subnav != "" && open_subnav != id) { 
  // hide open layer
    obj = document.getElementById(open_subnav);
	  setOpacity(obj, 0);
	  open_subnav_opacity = 0;
    obj.style.height="0px";
    obj.style.display="none";
	  obj.style.visibility="hidden";
  //Set new layer properties 
    newobj = document.getElementById(id);
    newobj.style.display="block";
    newobj.style.visibility="visible";
    setOpacity(newobj, 100);
    open_subnav_opacity = 100;
    newobj.style.height=maxHeight+"px";
    open_subnav = id;
    h=maxHeight;
	}else{
	fadeIn2(id, open_subnav_opacity);
	open_subnav = id;
  }
}

function closeSubnav(id)
{
	tim = setTimeout("fadeOut2('"+id+"', open_subnav_opacity)",800);
}

function hideSubnav(id)
{
    obj = document.getElementById(id);
	  setOpacity(obj, 0);
	  open_subnav_opacity = 0;
    obj.style.height="0px";
    obj.style.display="none";
	  obj.style.visibility="hidden";
		open_subnav = "";
    h=0;
}

function fadeIn2(objId,opacity) {
  if (document.getElementById) {
    obj = document.getElementById(objId);
    obj.style.display = "block";
		obj.style.visibility = "visible";
    if ((opacity <= 100)&&(h <= maxHeight)) {
      setOpacity(obj, opacity);
	  	open_subnav_opacity = opacity;
      opacity += 10;
      obj.style.height=h+"px";
      h+=heightRatio;
      tim2 = window.setTimeout("fadeIn2('"+objId+"',"+opacity+")", 30);
    }else{
      h=maxHeight;
      obj.style.height = maxHeight+"px";
      setOpacity(obj, 100);
      opacity=100;
      open_subnav_opacity=100;
    }
  }
}

function fadeOut2(objId,opacity) {
	clearTimeout(tim);
	clearTimeout(tim2);
  if (document.getElementById) {
    obj = document.getElementById(objId);
    if ((opacity >= 0)&&(h > 0)) {
      setOpacity(obj, opacity);
      opacity -= 10;
      obj.style.height=h+"px";
      h-=heightRatio;
      tim2 = window.setTimeout("fadeOut2('"+objId+"',"+opacity+")", 30);
    }	else {
    	obj.style.display="none";
  		obj.style.visibility="hidden";
      h=0;
      obj.style.height="0px";
      open_subnav_opacity = 0;
      open_subnav = "";
      setOpacity(obj, 0);
  	}
	}
}
//END MOUSEOVER FUNCTION

//LISTEN LIVE PLAYER
function openPlayer() {
	new_window = window.open('http://www.wjbr.com/player/player.shtml','wjbrplayer','top=100,left=250,resizable=yes,width=515,height=220,scrollbars=no,menubar=no');
	setTimeout("new_window.focus()",500);
}

//ARTIST FADE

//COMMUNITY CALENDAR
function showCalDetails(ob) {
  content=ob.nextSibling.nextSibling;
  if(content.style.display=="block"){
  	content.style.display="none";
  }else{
  	content.style.display="block";
  }
}
function hideCalDetails(ob) {
content=ob.parentNode;
content.style.display="none";
}