﻿$(function() {
    Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
    function EndRequestHandler(sender, args) {

        //Checks all the selects in the page and changes them as a div if they are not changed.
        $('select').each(function(i) {
        if ($(this).next('.newListSelected').length == 0 && $(this).next('.newListDisabled').length == 0) {
                $(this).sSelect();
                $(this).css('display', 'none');
            }
        });
        executeReady();

        $('.blueLinkLong').unbind('click');
        $('.blueLinkLong').click(function() { $(this).toggleClass('blueLinkLongCollapse'); });
        $('.blueLinkLong').click(function() { $('.productFinder').slideToggle(); });
        if (formSubmitted == true) {

            $(this).find("div[id$=" + successControlId + "]").css('display', 'block');
            $(divId + " .RequestSent").css('display', 'block');
            $(divId + " .contactPage").css('display', 'none');
            formSubmitted = false;
        }
    }
}
);