﻿$(document).ready(function() {
    if (typeof Sys !== "undefined") {
        var prm = Sys.WebForms.PageRequestManager.getInstance();
        prm.add_pageLoaded(InovexDropDownList_PageLoadedHandler);
    }
});

function InovexDropDownList_PageLoadedHandler(sender, args) {
    LoadInovexDropDownListEvents();
}

function LoadInovexDropDownListEvents() {
    var inovexDropDownList = $("select.dropdownlist[id$=DropDownListWithReadOnly]");
    inovexDropDownList.each(function(i) {
        var htmlContent = $(this).siblings(".hint").html();

        if (jQuery.trim(htmlContent) != "") {
            $(this).unbind("focus").bind("focus", { htmlContent: htmlContent }, InovexUserControlHintFocused)
            .unbind("blur").bind("blur", {}, InovexUserControlHintLostFocus);
        }
    });
}

// Fixes the following error:
// Microsoft JScript runtime error: Sys.ScriptLoadFailedException: The script '...' failed to load. Check for: Inaccessible path.
if (typeof Sys !== "undefined") { Sys.Application.notifyScriptLoaded(); }
