function Navegador()
	{
	this.ver    = navigator.appVersion
	this.app    = navigator.appName
	this.dom    = document.getElementById ? 1 : 0
	this.ie4    = ( document.all && !this.dom ) ? 1 : 0
	this.ie5    = ( this.ver.indexOf( "MSIE 5" ) >-1 && this.dom ) ? 1 : 0
	this.ie55   = ( this.ver.indexOf( "MSIE 5.5" ) >-1 && this.dom ) ? 1 : 0 
	this.ie6    = ( this.ver.indexOf( "MSIE 6" ) >-1 && this.dom ) ? 1 : 0
	this.ie7    = ( this.ver.indexOf( "MSIE 7" ) >-1 && this.dom ) ? 1 : 0
	this.ns4    = ( document.layers && !this.dom ) ? 1 : 0
	this.moz    = ( this.dom && parseInt( this.ver ) >= 5) ? 1 : 0
	this.op5    = ( this.app.indexOf( "Opera" ) > -1 && this.dom ) ? 1 : 0
	this.ie4mac = ( this.ie4 && navigator.userAgent.indexOf( "Mac" ) >-1 ) ? 1 : 0
	this.ie5mac = ( this.ie5 && navigator.userAgent.indexOf( "Mac" ) >-1 ) ? 1 : 0
	this.ie     = ( this.ie7 || this.ie6 || this.ie55 || this.ie5 || this.ie4 || this.ie5mac || this.ie4mac )
	return this
}

function isCapaVisible(oObj)
{
	var Nav = Navegador();
	if(typeof(Nav)=="undefined") return;
	if ( Nav.ie || Nav.moz ) return (oObj.style.visibility == "visible" || oObj.style.visibility == "");
	if ( Nav.ns4 ) return (oObj.visibility == "show"  || oObj.style.visibility == "" );
}

function fnCapas(pName)
{
	
	var Nav = Navegador();

	if(typeof(Nav)=="undefined") return;
	
	var oObj=null;
	// Internet Explorer
	if ( Nav.ie )
	{
		oObj = eval( "document.all." + pName );

		if(oObj.style.visibility == "")
		{
			oObj.style.visibility = "visible"
		}
		if ( oObj.style.visibility == "visible" )
		{
			oObj.style.visibility = "hidden";
			oObj.style.position = "absolute";
		}
		else
		{
			oObj.style.visibility = "visible";
			oObj.style.position = "relative"
		}
	}
	else 
		if ( Nav.ns4 )
		{	// Netscape
			oObj = eval( "document." + pName )
			if(oObj.visibility == "")
			{
				oObj.visibility = "visible"
			}		
			if ( oObj.visibility == "show" )
			{
				oObj.visibility = "hide";
				oObj.style.position = "absolute";
			}
			else
			{
				oObj.visibility = "show";
				oObj.position = "relative"
			}
		}
		else 
			if ( Nav.moz )
			{ // Mozilla
				oObj = eval( "document.getElementById( '" + pName + "' )" )
				if(oObj.style.visibility == "")
				{
					oObj.style.visibility = "visible"
				}
				if ( oObj.style.visibility == "visible" )
				{
					oObj.style.visibility = "hidden";
					oObj.style.position = "absolute";
				}
				else
				{
					oObj.style.visibility = "visible";
					oObj.style.position = "absolute";
				}
			}
}


function fnCapas2(pName,pDisplay){
	var Nav = Navegador();

	if(typeof(Nav)=="undefined") return;
	
	var oObj=null;
	
	//if ( Nav.ie ){			// Internet Explorer
	//	oObj = eval( "document.all." + pName );
	//}else if ( Nav.ns4 ){	// Netscape
	///		oObj = eval( "document." + pName );
	//}else if ( Nav.moz ){   // Mozilla
	//	oObj = eval( "document.getElementById( '" + pName + "' )" );
	//}

	oObj = document.getElementById(pName);

	
	if(oObj.style.display==pDisplay){
		oObj.style.display='none';
	}else{
		oObj.style.display = pDisplay;
	}
}
