﻿function PageInit() {
    $(".jmenuitem img").hover(
        function() {
            if (this.src.search("_Over") < 0)
                this.src = this.src.replace(".gif", "_Over.gif");
        },
        function() {
            this.src = this.src.replace("_Over", "");
        }
    );
    $(".jquestionselect").change(function() {
        document.location = "#question_" + $(".jquestionselect option:selected").val();
        $(".jquestionselect").val(null);
    });
    // order controls
    $(".container").buildContainers().hide();
    // 36 hour cialias
    $(".jpopuporder").click(function() {
        $(".container").hide();
        $(this).parent().find("input[type=radio]:checked").each(function() {
            $(".container." + $(this).val()).show();
        });
        return false;
    });
    // daily cialis
    $(".jpopuporderdaily").click(function() {
        $(".container").hide();
        $(".container.dailyprofessional").show();
        return false;
    });
}
function EndRequestHandler() {
    // reload event handlers on newly refreshed page
    PageInit();
}

$(document).ready(function() {
    PageInit();
    // ensure events are rebound on ajax refreshes
    Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
});