﻿$(document).ready(function()
{
    $("#accordionNav").accordion({ header: ".accItemHeader", autoHeight: false, active: false, alwaysOpen: false });

    if (!$.browser.msie)
    {
        //margin-left: -200px;
        $(".ddSelectButton").css("margin-left", "18px");
        $("#rt_dd_menu").css("margin", "24px 0 0 16px");
        $("#rt_hide_lt").css("margin-left", "-10px");
        $("#rt_hide_rt").css("margin-left", "194px");
        $("#rt_hide_btm").css("margin-left", "0px");
    }
    else
    {
        $("#btm_select_btn").css("margin-left", "-158px");
    }

    $(".ddItem").each(function()
    {
        $(this).mouseover(function() { $(this).css('text-decoration', 'underline'); }); // add 'hover' effect for dropdown items
        $(this).mouseout(function() { $(this).css('text-decoration', 'none'); }) // remove 'hover' effects for dropdown items
        $(this).click
            (
                function() { selectDDItem($(this).attr('id')) } //($(this).attr('id'))
            )
    }); 

    //track.Homepage_LP(); // track page load

    $(".trackable").each(function() { $(this).click(function() { track[$(this).attr("name")](); return true; }) });

    $("#btm_select_btn").click(function() { toggleDropDown('btm_dd_menu') });
    $("#rt_select_btn").click(function() { toggleDropDown('rt_dd_menu') });
    $("#rt_go").click(function() { openDDUrl('rt_go'); }); // click handler for right-side 'go' button
    $("#rt_go").mouseover(function() { $('#rt_dd_menu').css('display', 'none') });

    dapMgr.enableACB("dapDiv", false);
    dapMgr.renderAd("dapDiv", "&PG=CMS1BD&AP=21", 180, 150);

    $(".hideBox").each(function() // handlers for hiding faux drop-downs
    {
        $(this).mouseover(function()
        {
            var id = $(this).attr('id');
            //alert(id);
            $('#' + id.substr(0, id.indexOf('_')) + '_dd_menu').css('display', 'none');
        })
    });
});