function HideContent(d) {
document.getElementById(d).style.display = "none";
}
function ShowContent(d) {
document.getElementById(d).style.display = "block";
}
function ReverseContentDisplay(d, t) {
	if(document.getElementById(d).style.display == "none") 
	{ 
		document.getElementById(d).style.display = "block";
	}
	else 
	{ 
		document.getElementById(d).style.display = "none";
	}
}

function sendToJavaScript(title, description) {
document.getElementById('galleryTitle').innerHTML = "<h2>" + title + "</h2>\n";
document.getElementById('galleryDescription').innerHTML = "<p>" + description + "</p>\n";
}

function toggleLayer( whichLayer )
{
  	var elem, vis;
  	if( document.getElementById ) // this is the way the standards work
    		elem = document.getElementById( whichLayer );
 	else if( document.all ) // this is the way old msie versions work
      		elem = document.all[whichLayer];
  	else if( document.layers ) // this is the way nn4 works
    		elem = document.layers[whichLayer];
 		vis = elem.style;
				 
  	// if the style.display value is blank we try to figure it out here
  	if(vis.display==''&&elem.offsetWidth!=undefined&&elem.offsetHeight!=undefined)
    	vis.display = (elem.offsetWidth!=0&&elem.offsetHeight!=0)?'block':'none';
  		vis.display = (vis.display==''||vis.display=='block')?'none':'block';
}

function selectCurrentLiInMenu()
{
	var lis = document.getElementsByName ("liLeftMenuItem");
	if (lis != null && lis.length >0)
	{
		var i =0;
		for (i=0; i<lis.length; i++)
			lis[i].setAttribute("class", "");
	}
	var id = "li" + getURLParam ("postid");
	if (id == "li")
		return;
	
	if (document.getElementById(id) == null)
		return;
	document.getElementById(id).setAttribute("class", "current");	
}

function getURLParam(strParamName)
{
	var strReturn = "";
	var strHref = window.location.href;
	if ( strHref.indexOf("?") > -1 )
	{
		var strQueryString = strHref.substr(strHref.indexOf("?")).toLowerCase();
		var aQueryString = strQueryString.split("&");
		for ( var iParam = 0; iParam < aQueryString.length; iParam++ )
		{
			if (aQueryString[iParam].indexOf(strParamName + "=") > -1 )
			{
				var aParam = aQueryString[iParam].split("=");
				strReturn = aParam[1];
				break;
			}
		}
	}
	return strReturn;
}