/*function toggleLayer(whichLayer)
{
if (document.getElementById)
{
// this is the way the standards work
var style2 = document.getElementById(whichLayer).style;
style2.display = style2.display? "":"none";

var style3 = document.getElementById('section_header').style;
style3.background = style3.background? "":"#fff";
}
else if (document.all)
{
// this is the way old msie versions work
var style2 = document.all[whichLayer].style;
style2.display = style2.display? "":"none";

var style3 = document.all['section_header'].style;
style3.background = style3.background? "":"#fff";
}
else if (document.layers)
{
// this is the way nn4 works
var style2 = document.layers[whichLayer].style;
style2.display = style2.display? "":"none";

var style3 = document.layers['section_header'].style;
style3.background = style3.background? "":"#fff";
}
}*/

function setLayersBasedOnCookies()
{
	var mypodcasts 	= readCookie("mypodcasts");
	var myfriends 	= readCookie("myfriends");
	var mysearches 	= readCookie("mysearches");

	if (document.getElementById("mypodcasts")) {
		if (mypodcasts == "collapsed") {
			collapseLayer('mypodcasts', 'section_header');
		} else {
			expandLayer('mypodcasts', 'section_header');
		}
		if (myfriends == "collapsed") {
			collapseLayer('myfriends', 'section_header2');
		} else {
			expandLayer('myfriends', 'section_header2');
		}
		if (mysearches == "collapsed") {
			collapseLayer('mysearches', 'section_header3');
		} else {
			expandLayer('mysearches', 'section_header3');
		}
	}
}

function toggleLayer(whichLayer, whichSection) {
	if (document.all) {
		// this is the way old msie versions work
		var style2 = document.all[whichLayer].style;
		if (style2.display) {
			style2.display = "";
			createCookie(whichLayer,"expanded",2000);
		} else {
			style2.display = "none";
			createCookie(whichLayer,"collapsed",2000);
		}

		var style3 = document.all[whichSection].style;
		// Uncomment the below to see why a simple match doesn't work :)
		//alert(style3.backgroundImage);
		//style3.background = (style3.background.indexOf('none') < 0) ? "none" :"#fff";
		if (style3.backgroundImage.indexOf("collapsed") < 0) {
			style3.backgroundImage = "url(images/h3_bg_collapsed.png)";
		} else {
			style3.backgroundImage = "url(images/h3_bg_expanded.png)"
		}
		style3.backgroundPosition = "left";
		style3.backgroundRepeat = "no-repeat";
	} else if (document.getElementById) {
		// this is the way the standards work
		var style2 = document.getElementById(whichLayer).style;
		if (style2.display) {
			style2.display = "";
			createCookie(whichLayer,"expanded",2000);
		} else {
			style2.display = "none";
			createCookie(whichLayer,"collapsed",2000);
		}

		var style3 = document.getElementById(whichSection).style;

		if (style3.background) {
			style3.background = "";
		} else {
			style3.background = "url(images/h3_bg_collapsed.png)"
		}
	}
}

function expandLayer(whichLayer, whichSection) {
	if (document.all) {
		// this is the way old msie versions work
		var style2 = document.all[whichLayer].style;
		style2.display = "";
		var style3 = document.all[whichSection].style;
		// Uncomment the below to see why a simple match doesn't work :)
		//alert(style3.backgroundImage);
		//style3.background = (style3.background.indexOf('none') < 0) ? "none" :"#fff";
		style3.backgroundImage = "url(images/h3_bg_expanded.png)";
		style3.backgroundPosition = "left";
		style3.backgroundRepeat = "no-repeat";
	} else if (document.getElementById) {
		// this is the way the standards work
		var style2 = document.getElementById(whichLayer).style;
		style2.display = "";
		var style3 = document.getElementById(whichSection).style;
		style3.background = "";
	}
}

function collapseLayer(whichLayer, whichSection) {
	if (document.all) {
		// this is the way old msie versions work
		var style2 = document.all[whichLayer].style;
		style2.display = "none";
		var style3 = document.all[whichSection].style;
		// Uncomment the below to see why a simple match doesn't work :)
		//alert(style3.backgroundImage);
		//style3.background = (style3.background.indexOf('none') < 0) ? "none" :"#fff";
		style3.backgroundImage = "url(images/h3_bg_collapsed.png)";
		style3.backgroundPosition = "left";
		style3.backgroundRepeat = "no-repeat";
	} else if (document.getElementById) {
		// this is the way the standards work
		var style2 = document.getElementById(whichLayer).style;
		style2.display = "none";
		var style3 = document.getElementById(whichSection).style;
		style3.background = "url(images/h3_bg_collapsed.png)";
	}
}

function toggleDivDisplay(divName)
{
	oDiv = document.getElementById(divName);
	if (oDiv.style.display == "block") {
		oDiv.style.display = "none";
	} else {
		oDiv.style.display = "block";
	}
}