﻿
//<!--

function doPage(query, collection, page, resperpage) {
    MNTSearch.searchSubmit(query, collection, page, resperpage, SucceededCallback);
}

function searchClick() {
    var collection = document.getElementById("ctl00_BodyContent_searchCollection");
    var colselIndex = collection.selectedIndex;

    var resultsPerPage = document.getElementById("ctl00_BodyContent_resultsPerPage");
    var rspselIndex = resultsPerPage.selectedIndex;

    MNTSearch.searchSubmit(document.getElementById("ctl00_BodyContent_searchQuery").value,
                                            collection.options[colselIndex].value,
                                            "1",
                                            resultsPerPage.options[rspselIndex].value,
                                            SucceededCallback);
}

// This is the callback function invoked if the Web service
// succeeded.
// It accepts the result object as a parameter.
function SucceededCallback(result, eventArgs) {
    // Page element to display feedback.
    document.getElementById("SearchResult").innerHTML = result;
}


// This is the callback function invoked if the Web service
// failed.
// It accepts the error object as a parameter.
function FailedCallback(error) {
    // Display the error.
    document.getElementById("SearchResult").innerHTML =
    "Service Error: " + error.get_message();
}


//-->
