﻿

var $jq = jQuery.noConflict();

document.observe(
    'dom:loaded',
    function() { Window_Load(); }
    );



function Window_Load()
{
    var opacity = 90;
    /*Breaks mouse click event in Safari.*/
    //if (BrowserDetect.browser != "Safari")
    //{

    //AlspaCore.SetOpacity($$("top_right").getElementsByTagName("ul")[0], opacity);
    //AlspaCore.SetOpacity($$("bottom_left_round_edge").getElementsByTagName("div")[0], opacity);
    //AlspaCore.SetOpacity($$("top_right_round_edge").getElementsByTagName("div")[0], opacity);
    //AlspaCore.SetOpacity($$("content"), opacity);
    //}

    //AlspaCore.SetOpacity($$("top_menu"), opacity);

    //Make the left menu container transparent
    //AlspaCore.SetOpacity($$("content_container"), (opacity - 10))
    //AlspaCore.SetOpacity($$("left_menu_container"), (opacity - 10));

    //Make the submenus container transparent
    //var submenus = $jq(".submenu");   
    //for (var i=0; i<submenus.length; i++)
    //   AlspaCore.SetOpacity(submenus[i], opacity);

    //Fix PNG Transparency in IE6 - Breaks links. They become unclickable.
    if (BrowserDetect.browser == "Explorer" && BrowserDetect.version < 7)
        IEPNGFix();
}

function ToggleDisplay(sender, element)
{
    var display = $$(element).style.display;
    var c = AlspaCore.GetCoords($$('parent1'));
    $$(element).style.top = c.y + 'px';
    $$(element).style.left = (c.x + 150) + 'px';

    $$(element).style.display = (display == 'block') ? 'none' : 'block';
}

function IEPNGFix() // correctly handle PNG transparency in Win IE 5.5 & 6.
{
    var arVersion = navigator.appVersion.split("MSIE");
    var version = parseFloat(arVersion[1]);

    if ((version >= 5.5) && (document.body.filters))
    {
        for (var i = 0; i < document.images.length; i++)
        {
            var img = document.images[i];
            var imgName = img.src.toLowerCase();
                        
            if (imgName.substring(imgName.length - 3, imgName.length) == "png")
            {
                if (imgName.indexOf('scroll_arrow_up.png') == -1 && imgName.indexOf('scroll_arrow_down.png') == -1)
                {
                    var imgID = (img.id) ? "id='" + img.id + "' " : "";
                    var imgClass = (img.className) ? "class='" + img.className + "' " : "";
                    var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' ";
                    var imgStyle = "display:inline-block;" + img.style.cssText;
                    if (img.align == "left") imgStyle = "float:left;" + imgStyle;
                    if (img.align == "right") imgStyle = "float:right;" + imgStyle;
                    if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle;
                    var strNewHTML = "<span " + imgID + imgClass + imgTitle
                    + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
                    + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
                    + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>"
                    img.outerHTML = strNewHTML;
                    i = i - 1;
                }
            }
        }
    }
}
