//media archive
function toggleLayer(whichLayer)
{
if (document.getElementById)
{
// this is the way the standards work
var e = document.getElementById(whichLayer)
e.style.display = e.style.display == "block" ? "none":"block";
}
}
//wimpy player
function wimpyPopPlayer(theFile,id,stuff) {
  window.open(theFile,id,stuff);
}

//flash stuff
var currentItem;

function sendEvent(swf,typ,prm) { 
  thisMovie(swf).sendEvent(typ,prm); 
};


function loadFile(swf,obj) { 
  thisMovie(swf).loadFile(obj); 
  
};

	function getUpdate(typ,pr1,pr2,pid) {
		if(typ == "item") { currentItem = pr1; setTimeout("getItemData(currentItem)",100); }
	};

	function getItemData(idx) {		
		if(thisMovie("header_flash")){
		var obj = thisMovie("header_flash").itemData(idx);
			if(obj['link']){
				document.getElementById("from_flash").innerHTML = '<a href="'+obj["link"]+'"><div id="flash_link"></div></a>';
			}else{
				document.getElementById("from_flash").innerHTML = '<div id="flash_link"></div>'; 
			}
		}
		if(thisMovie("footer_flash")){
		var obj = thisMovie("footer_flash").itemData(idx);
			if(obj['link']){
				document.getElementById("from_flash_bot").innerHTML = '<a href="'+obj["link"]+'"><div id="flash_link_bot"></div></a>';
			}else{
				document.getElementById("from_flash_bot").innerHTML = '<div id="flash_link_bot"></div>'; 
			}
		}
		if(thisMovie("sermon_video")){
		var obj = thisMovie("sermon_video").itemData(idx);
		document.getElementById("sermontitle").innerHTML = obj["title"];
		document.getElementById("sermondescript").innerHTML = obj["link"];  
		}
		
	};

	// This is a javascript handler for the player and is always needed.
	function thisMovie(movieName) {
	    if(navigator.appName.indexOf("Microsoft") != -1) {
			return window[movieName];
		} else {
			return document[movieName];
		}
	};
	
function toggle_visibility(id) {
     var e = document.getElementById(id);
     if(e.style.display == 'block')
          e.style.display = 'none';
       else
          e.style.display = 'block';
    }
	
	