//**   custom jquery function to fade in/out toggle
jQuery.fn.fadeToggle = function(speed, easing, callback) {
    return this.animate({ opacity: 'toggle' }, speed, easing, callback);
};


//** show / hide the product catalog flyout nav

var flyOutTime = -1;
var flyOut2 = -1;

function HideContentLogin(d) {
    if (flyOut2 == -1) {
        flyOut2 = window.setTimeout('$("#' + d + '").hide()', 1000);
    }
    //$("#" + d).hide();
}


function ShowContentLogin(d) {
    if (flyOut2 > -1) {
        window.clearTimeout(flyOut2);
        flyOut2 = -1;
    }

    $("#" + d).show();
}

function HideContent(d, notify) {
    if (flyOutTime == -1) {
        flyOutTime = window.setTimeout('$("#' + d + '").hide(); if (typeof (onHideContent) == "function") onHideContent();', 500);
    }
    //$("#" + d).hide();
    
}

function ShowContent(d, menu, notify) {
    if (flyOutTime > -1) {
        window.clearTimeout(flyOutTime);
        flyOutTime = -1;
    }

    $("#" + menu).show();
    var left = $("#" + d).offset().left + "px";
    var top = $("#" + d).offset().top + $("#" + d).outerHeight(true) + "px";
    $("#" + menu).css({ position: 'absolute', zIndex: 5000, left: left, top: top });

    if (notify && typeof (onShowContent) == 'function') onShowContent();
}

function ReverseContentDisplay(d) {
    if (d.length < 1) { return; }
    if (document.getElementById(d).style.display == "none") { document.getElementById(d).style.display = "block"; }
    else { document.getElementById(d).style.display = "none"; }
}

function saveChoice(obj) {
    var checkBox = document.getElementById("rememberMe");
    var checkBox2 = document.getElementById("rememberMe2");
    if (checkBox.checked || checkBox2.checked)
    {
     var options = { path: '/', expires: 360 };
     jQuery.cookie("saveChoice", obj.href, options);
    }
    else {
     jQuery.cookie("saveChoice", null, options);
    }
    return true;
}

function saveChoice2(obj) {
    var checkBox = document.getElementById("rememberMe");
    var checkBox2 = document.getElementById("rememberMe2");
    if (checkBox.checked || checkBox2.checked)
    {
     var options = { path: '/', expires: 360 };
     jQuery.cookie("saveChoice", obj.href, options);
    }
    else {
     jQuery.cookie("saveChoice", null, options);
    }
    return true;
}