﻿var searchAgent = {
    key: "",
    action: "SEARCHKEY",
    actionType: "",
    url: "",
    channelId: "",
    flag: false,
    Search: function (key) {
        $.get(this.url, { action: this.action, k: key, t: this.actionType, c: this.channelId },
        function (data, textStatus) {
            var back = $.parseJSON(data);

            if (back.BackCode == 1) {
                window.location = back.ResultUrl;

            }
            else {
                alert(back.Error);
            }
        });
    },

    init: function (channelId, actionType) {
        this.actionType = actionType;
        this.channelId = channelId;
        this.url = "http://" + window.location.host + "/cms_service/AsynService.aspx";
    }
}









