var layerHideFunc = null;

function hideConcurrentLayers(func) {
	if (layerHideFunc) {
		layerHideFunc();
	}
	layerHideFunc = func;
}

/* hides <select> and <applet> objects (for IE only) */
function hideElement( elmID, overDiv )
{

  if( document.all )
  {
	for( i = 0; i < document.getElementsByTagName( elmID ).length; i++ )
	{
	  obj = document.getElementsByTagName( elmID )[i];
	  if( !obj || !obj.offsetParent )
	  {
		continue;
	  }
  
	  // Find the element's offsetTop and offsetLeft relative to the BODY tag.
	  objLeft   = obj.offsetLeft;
	  objTop    = obj.offsetTop;
	  objParent = obj.offsetParent;
	  
	  while( objParent.tagName.toUpperCase() != "BODY" )
	  {
		objLeft  += objParent.offsetLeft;
		objTop   += objParent.offsetTop;
		objParent = objParent.offsetParent;
	  }
  
	  objHeight = obj.offsetHeight;
	  objWidth = obj.offsetWidth;
  
	  if(( overDiv.offsetLeft + overDiv.offsetWidth ) <= objLeft );
	  else if(( overDiv.offsetTop + overDiv.offsetHeight ) <= objTop );
	  else if( overDiv.offsetTop >= ( objTop + objHeight ));
	  else if( overDiv.offsetLeft >= ( objLeft + objWidth ));
	  else
	  {
		obj.style.visibility = "hidden";
	  }
	}
  } else {
	if( elmID = "IFRAME" ) {
		for( i = 0; i < document.getElementsByTagName( elmID ).length; i++ )
		{
		  obj = document.getElementsByTagName( elmID )[i];
		  if( !obj || !obj.parentNode)
		  {
			continue;
		  }
  
		  // Find the element's offsetTop and offsetLeft relative to the BODY tag.
		  objLeft   = obj.offsetLeft;
		  objTop    = obj.offsetTop;
		  objParent = obj.parentNode;

		  while( objParent.tagName.toUpperCase() != "HTML" )
		  {
			if( objParent.tagName == "TR" ) {
				objParent = objParent.parentNode;
				continue
			}
			objLeft  += objParent.offsetLeft;
			objTop   += objParent.offsetTop;
			objParent = objParent.parentNode;
		  }

		  objHeight = obj.offsetHeight;
		  objWidth = obj.offsetWidth;
		
		  if(( overDiv.offsetLeft + overDiv.offsetWidth ) <= objLeft );
		  else if(( overDiv.offsetTop + overDiv.offsetHeight ) <= objTop );
		  else if( overDiv.offsetTop >= ( objTop + objHeight ));
		  else if( overDiv.offsetLeft >= ( objLeft + objWidth ));
		  else
		  {
			obj.contentDocument.body.style.visibility = "hidden";
		  }
		}
	  }
	}
}
 
/*
* unhides <select> and <applet> objects (for IE only)
*/
function showElement( elmID ){
	if (navigator.appName == 'Microsoft Internet Explorer'){
		if( document.all ){
			for( i = 0; i < document.all.tags( elmID ).length; i++ ){
				obj = document.all.tags( elmID )[i];
				if( !obj || !obj.offsetParent ){
					continue;
				}
				obj.style.visibility = "";
			}
		} else {
			if( elmID = "IFRAME" ) {
				for( i = 0; i < document.getElementsByTagName( elmID ).length; i++ ){
					obj = document.getElementsByTagName( elmID )[i];
					if( !obj || !obj.parentNode){
						continue;
					}
					obj.contentDocument.body.style.visibility = "";
				}
			}
		}
	}
}

