/* "adapted" from ala's domtricks2 */

var IE;

function getUA()
{
        if (navigator.appName.indexOf("Explorer") >= 0)
        {
            IE = true;
        }

}

function showHide( galNum )
{	
    if (getIdProperty( "gal" + galNum, "display") == "none" )
    
    {
        setIdProperty("gal" + galNum, "display", "block");
	   document.getElementById("h3-" + galNum).innerHTML = '<img src="images/galeria/galeria_abierta.gif" width="18" height="25" style="border:0"> ';
    }
    else
    {
        setIdProperty("gal" + galNum, "display", "none");
        document.getElementById("h3-" + galNum).innerHTML = '<img src="images/galeria/galeria_cerrada.gif" width="18" height="25" style="border:0"> ';
    }
}


function getStyleBySelector( selector )
{
 /*   if (IE)
    {
        return null;
    }
    var sheetList = document.styleSheets;
    var ruleList;
    var i, j;

    for (i=sheetList.length-1; i >= 0; i--)
    {
        ruleList = sheetList[i].cssRules;
        for (j=0; j<ruleList.length; j++)
        {
            if (ruleList[j].type == CSSRule.STYLE_RULE &&
                ruleList[j].selectorText == selector)
            {
                return ruleList[j].style;
            }   
        }
    }*/
    return null;
}

function getIdProperty( id, property )
{
    if (!IE)
    {
        var styleObject = document.getElementById( id );
        if (styleObject != null)
        {
            styleObject = styleObject.style;
            if (styleObject[property])
            {
                return styleObject[ property ];
            }
        }
        styleObject = getStyleBySelector( "#" + id );
        return (styleObject != null) ?
            styleObject[property] :
            null;
    }
    else
    {
        return document.all[id].style[property];
    }
}

function setIdProperty( id, property, value )
{
    if (!IE)
    {
        var styleObject = document.getElementById( id );
        if (styleObject != null)
        {
            styleObject = styleObject.style;
            styleObject[ property ] = value;
        }
        
    }
    else
    {
         document.all[id].style[property] = value;
    }
}

function showGal( galNum )
{	
   
        document.getElementById(showFotos).innerHTML = "<?php include 'gallery/gallery1.html'; ?>";
    
}

