AjaxAdvancedSearch_class = function() {
    this.connection = new Ext.data.Connection({
        url: "/Library/ajaxpro/AjaxAdvancedSearch,App_Code.nb3thwog.ashx",
        listeners: {
            requestcomplete: function(connection, response, options) {
                var onsuccess = options.onsuccess;
                if (typeof onsuccess == "function") {
                    onsuccess(Ext.decode(response.responseText));
                }
            },
            requestexception: function(connection, response, options, e) {
                var onerror = options.onerror;
                var r = response.responseText;
                if (r.indexOf('{"Message":') == 0 && typeof onerror == "function") {
                    onerror(Ext.decode(r));
                } else {
                    onerror({"Message":"Failed."});
                }
            }
        }
    });
};

AjaxAdvancedSearch_class.prototype = {
    AjaxInitialAdvanced: function(onsuccess, onerror) {
        return this.connection.request({
            ajaxProMethod: "AjaxInitialAdvanced",
            ajaxProToken: (typeof AjaxPro !== "undefined" && AjaxPro.token !== null) ? AjaxPro.token : "",
            params: {},
            onsuccess: onsuccess,
            onerror: onerror
        });
    },
    AjaxNormalizeString: function(strValue, onsuccess, onerror) {
        return this.connection.request({
            ajaxProMethod: "AjaxNormalizeString",
            ajaxProToken: (typeof AjaxPro !== "undefined" && AjaxPro.token !== null) ? AjaxPro.token : "",
            params: {"strValue": strValue},
            onsuccess: onsuccess,
            onerror: onerror
        });
    },
    AjaxSearch: function(sValue1, sValue2, sValue3, strParam1, strParam2, strParam3, strMatch1, strMatch2, strMatch3, iOpt1, iOpt2, strLanguage, strMedium, strAudience, strCollectionType, strPublishedFrom, strPublishedTo, strLibraryID, strSortBy, onsuccess, onerror) {
        return this.connection.request({
            ajaxProMethod: "AjaxSearch",
            ajaxProToken: (typeof AjaxPro !== "undefined" && AjaxPro.token !== null) ? AjaxPro.token : "",
            params: {"sValue1": sValue1, "sValue2": sValue2, "sValue3": sValue3, "strParam1": strParam1, "strParam2": strParam2, "strParam3": strParam3, "strMatch1": strMatch1, "strMatch2": strMatch2, "strMatch3": strMatch3, "iOpt1": iOpt1, "iOpt2": iOpt2, "strLanguage": strLanguage, "strMedium": strMedium, "strAudience": strAudience, "strCollectionType": strCollectionType, "strPublishedFrom": strPublishedFrom, "strPublishedTo": strPublishedTo, "strLibraryID": strLibraryID, "strSortBy": strSortBy},
            onsuccess: onsuccess,
            onerror: onerror
        });
    },
    AjaxNewSearch: function(strTitle, strKeyword, strAuthor, strSubject, strSeriesTitle, strCallNoFrom, strCallNoTo, strISBN, strLexileFrom, strLexileTo, strARLevelFrom, strARLevelTo, strPublisher, strPublicationYearFrom, strPublicationYearTo, strSortBy, strLibraryID, strLanguageSelected, onsuccess, onerror) {
        return this.connection.request({
            ajaxProMethod: "AjaxNewSearch",
            ajaxProToken: (typeof AjaxPro !== "undefined" && AjaxPro.token !== null) ? AjaxPro.token : "",
            params: {"strTitle": strTitle, "strKeyword": strKeyword, "strAuthor": strAuthor, "strSubject": strSubject, "strSeriesTitle": strSeriesTitle, "strCallNoFrom": strCallNoFrom, "strCallNoTo": strCallNoTo, "strISBN": strISBN, "strLexileFrom": strLexileFrom, "strLexileTo": strLexileTo, "strARLevelFrom": strARLevelFrom, "strARLevelTo": strARLevelTo, "strPublisher": strPublisher, "strPublicationYearFrom": strPublicationYearFrom, "strPublicationYearTo": strPublicationYearTo, "strSortBy": strSortBy, "strLibraryID": strLibraryID, "strLanguageSelected": strLanguageSelected},
            onsuccess: onsuccess,
            onerror: onerror
        });
    },
    AjaxHideCollectionTypeAndGetDatas: function(ConfigLibraryID, GetDataLibraryID, isNewAdvanced, onsuccess, onerror) {
        return this.connection.request({
            ajaxProMethod: "AjaxHideCollectionTypeAndGetDatas",
            ajaxProToken: (typeof AjaxPro !== "undefined" && AjaxPro.token !== null) ? AjaxPro.token : "",
            params: {"ConfigLibraryID": ConfigLibraryID, "GetDataLibraryID": GetDataLibraryID, "isNewAdvanced": isNewAdvanced},
            onsuccess: onsuccess,
            onerror: onerror
        });
    }
};

var AjaxAdvancedSearch = new AjaxAdvancedSearch_class();


