// Parts derived from:
//    Opacity Displayer, Version 1.0
//    Copyright Michael Lovitt, 6/2002.
//    Distribute freely, but please leave this notice intact.
//    http://www.alistapart.com/articles/pngopacity/

// Parts derived from:
//    Natural Docs
//    Copyright (C) 2003-2004 Greg Valure
//    http://www.naturaldocs.org/


var browserType;
var browserVer;
var pngTransform;
var pngNormal;
var stretchyControls;

var agt=navigator.userAgent.toLowerCase();

if (agt.indexOf("opera") != -1)
    {
    browserType = "Opera";

    if (agt.indexOf("opera 5") != -1 || agt.indexOf("opera/5") != -1)
        {
        browserVer = "Opera5";

        if (agt.indexOf("mac") != -1)
            {  pngNormal = 1;  };
        }
    else if (agt.indexOf("opera 6") != -1 || agt.indexOf("opera/6") != -1)
        {
        browserVer = "Opera6";
        pngNormal = 1;
        }
    else if (agt.indexOf("opera 7") != -1 || agt.indexOf("opera/7") != -1)
        {
        browserVer = "Opera7";
        pngNormal = 1;
        }
    }

else if (agt.indexOf("khtml") != -1 || agt.indexOf("konq") != -1)
    {
    browserType = "KHTML";
    }

else if (agt.indexOf("msie") != -1)
    {
    browserType = "IE";

    if (agt.indexOf("msie 4") != -1)
        {  browserVer = "IE4";  }

    else if (agt.indexOf("msie 5.5") != -1)
        {
        browserVer = "IE55";

        if (agt.indexOf("mac") != -1)
            {  pngNormal = 1;  }
        elsif (agt.indexOf("win") != -1)
            {  pngTransform = 1;  };
        }

    else if (agt.indexOf("msie 5") != -1)
        {
        browserVer = "IE5";

        if (agt.indexOf("mac") != -1)
            {  pngNormal = 1;  };
        }

    else if (agt.indexOf("msie 6") != -1)
        {
        browserVer = "IE6";

        if (agt.indexOf("win") != -1)
            {  pngTransform = 1;  }
        else if (agt.indexOf("mac") != -1)
            {  pngNormal = 1;  };
        }
    }

else if (agt.indexOf("gecko") != -1)
    {
    browserType = "Gecko";
    pngNormal = 1;
    stretchyControls = 1;
    }


function PNGGIF(strPath, intWidth, intHeight, strAlt, strID)
    {
    if (pngTransform)
        {
        document.write('<div style="height:'+intHeight+'px;width:'+intWidth+'px;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\''+strPath+'.png\', sizingMethod=\'scale\')" id="'+strID+'"></div>');
        }
    else if (pngNormal)
        {
        document.write('<img src="'+strPath+'.png" width="'+intWidth+'" height="'+intHeight+'" alt="'+strAlt+'" id="'+strID+'"/>');
        }
    else
        {
        document.write('<img src="'+strPath+'.gif" width="'+intWidth+'" height="'+intHeight+'" alt="'+strAlt+'" id="'+strID+'" />');
        }
    }

function OpeningBrowserTags()
    {
    if (stretchyControls)
        {
        document.write('<div class=StretchyControls>');
        }

    if (browserType)
        {
        document.write('<div class='+browserType+'>');
        if (browserVer)
            {
            document.write('<div class='+browserVer+'>');
            }
        }
    };

function ClosingBrowserTags()
    {
    if (browserType)
        {
        document.write('</div>');
        if (browserVer)
            {
            document.write('</div>');
            }
        }

    if (stretchyControls)
        {
        document.write('</div>');
        }
    };
