// http://www.netlobo.com/div_hiding.html
function showHide( l )
{
  var elem, vis;
  if( document.getElementById ) // this is the way the standards work
    elem = document.getElementById( l );
  else if( document.all ) // this is the way old msie versions work
      elem = document.all[l];
  else if( document.layers ) // this is the way nn4 works
    elem = document.layers[l];
  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 showHideComments( id )
{
	var fix, box, btn, vis;
	
	if ( document.getElementById )
	{
		fix = document.getElementById( 'fix_' + id );
		box = document.getElementById( 'comment_' + id );
		btn = document.getElementById( 'sh_' + id );
	}
	else if ( document.all )
	{
		fix = document.all[ 'fix_' + id ];
		box = document.all[ 'comment_' + id ];
		btn = document.all[ 'sh_' + id ];
	}
	else if ( document.layers )
	{
		fix = document.layers[ 'fix_' + id ];
		box = document.layers[ 'comment_' + id ];
		btn = document.layers[ 'sh_' + id ];
	}
	
	vis = box.style;
	if ( vis.display==''&& box.offsetWidth != undefined && box.offsetHeight != undefined )
	{
		vis.display = ( box.offsetWidth !=0 && box.offsetHeight != 0 ) ? 'block' : 'none';
	}
	
	if ( vis.display == '' || vis.display == 'block' )
	{
		vis.display = 'none';
		fix.style.display = 'block';
		btn.src = "assets/images/div_expand.gif";
		btn.alt = "Show";
	}
	else
	{
		vis.display = 'block';
		fix.style.display = 'none';
		btn.src = "assets/images/div_collapse.gif";
		btn.alt = "Hide";
	}
}
