
/*************************************************************************
START AREA HOME LAYER DISPLAY
*************************************************************************/

function showHide(layer) {
	var layerToShow = layer;
	var layerToPutContentInto = "areaHomeSelectedContent";
	var objContainer = document.getElementById(layerToPutContentInto);
	if(objContainer){
		var objContent = document.getElementById(layerToShow);
		objContainer.innerHTML = objContent.innerHTML;
	}
}




/*************************************************************************
START COMMENTS DISPLAY
*************************************************************************/


// toggle visibility
function hideLayer(whichLayer) {
	if (document.all) {
		// this is the way old msie versions work
		document.all[whichLayer].style.visibility = "hidden";
		document.all[whichLayer].style.display = "none";
	}
	else if (document.getElementById) {
		// this is the way the standards work
		document.getElementById(whichLayer).style.visibility = "hidden";
		document.getElementById(whichLayer).style.display = "none";
	}
	else if (document.layers) {
		// this is the way nn4 works
		document.layers[whichLayer].visibility = "hidden";
		document.layers[whichLayer].display = "none";
	}
}


function showLayer(whichLayer) {
	if (document.all) {
		// this is the way old msie versions work
		document.all[whichLayer].style.visibility = "visible";
		document.all[whichLayer].style.display = "block";
	}
	else if (document.getElementById) {
		// this is the way the standards work
		if (document.getElementById(whichLayer).style.visibility == "visible") {
			hideLayer(whichLayer);
		}else{
			document.getElementById(whichLayer).style.visibility = "visible";
			document.getElementById(whichLayer).style.display = "block";
		}
	}
	else if (document.layers) {
		// this is the way nn4 works
		document.layers[whichLayer].visibility = "visible";
		document.layers[whichLayer].display = "block";
	}
}
		


/*************************************************************************
SPANNER PLAYER
*************************************************************************/

function spannerPlayer(MP3,playLength,playerType) {
	var playerLayer = document.getElementById("spannerPlayer");
	if (playerLayer) {
		if (playerLayer.className == 'playerHidden') {
			playerLayer.className = 'playerShow';
		}
	}
	if (playerType) {
		if (playerType == 2) {
			var playerW = 320;
			var playerH = 45;
			var playerToUse = "sambacana"
		} else {
			var playerW = 405;
			var playerH = 55;
			var playerToUse = "player"
		}
	}
	var fo = new SWFObject("/apps/audio/" + playerToUse +".swf", "spPlay", playerW, playerH, "6", "#fff");
	fo.addParam("wmode","transparent");
	fo.addParam("swLiveConnect","true");
	fo.addVariable("url", "http://www.span.nered.org" + MP3 + ".mp3");
	fo.addVariable("playlength", playLength);
	fo.write("spannerPlayer");
}


function spannerVision(vidURL,w,h) {
	var playerLayer = document.getElementById("spannerPlayer");
	if (navigator.appVersion.indexOf('MSIE') == -1){
		var visionLayer = document.getElementById("spannerVision");
		visionLayer.innerHTML = "<a href='#TB_inline?bg=1&height=" + (h+80) + "&width=" + w + "&inlineId=spannerPlayer' class='thickbox'><img src='/images/skins/spannered/vidPlaceholder.gif' width='153' height='92' alt='Click to view video' /></a><br /><br /><br />";
	} else {
		if (playerLayer.className == 'playerHidden') {
			playerLayer.className = 'playerShow';
		}
	}
	var fo = new SWFObject("/apps/video/spannerVideo.swf", "spPlay", w, (h+40), "8", "#131D26");
	fo.addVariable("skinName","/apps/video/spannerSkin.swf");
	fo.addVariable("streamName","http://span.nered.org/video/" + vidURL + ".flv");
	fo.addVariable("streamW",w);
	fo.addVariable("streamH",h);
	//fo.addParam("wmode","transparent");
	fo.write("spannerPlayer");
}


function fixH(one,two) {
	if (document.getElementById(one)) {
		var lh=document.getElementById(one).offsetHeight;
		var rh=document.getElementById(two).offsetHeight;
		var nh = Math.max(lh, rh);
		document.getElementById(one).style.height=nh+"px";
		document.getElementById(two).style.height=nh+"px";
	}
}




