function getQueryObj() { //参数为window.location.search
    var search = window.location.search;
    var str = search.slice(1); //去掉首字母
    var obj = new Object(); //创建search对象

    if (str.indexOf('&') == -1) { //判断search值是否是多个
        var newArr = str.split('=');
        obj[newArr[0]] = newArr[1]; //拆分search并给 search对象赋值
    } else {
        var arr = str.split('&');
        for (var i = 0; i < arr.length; i++) {
            var newArr = arr[i].split('=');
            obj[newArr[0]] = newArr[1]
        }
    }
    return obj; //输出search对象
}

function handleResponse(data, callback) {
    if (data._APP_RESULT_OPT_CODE > 100 && typeof callback == "function") {
        callback();
    } else {
        //todo
    }
}

Array.prototype.contains = function (obj) {
    var i = this.length;
    while (i--) {
        if (this[i] === obj) {
            return true;
        }
    }
    return false;
}

//function SendMsg(width, height, title, direction) {
//    if (window.ucbook) {
//        var msg = JSON.stringify({
//            "width": width + "px",
//            "height": height + "px",
//            "title": title,
//            "direction": direction
//        });
//        ucbook.postWebPageMessage(title);
//    }
//}

function SendMsg(title) {
    if (window.ucbook) {
        ucbook.postWebPageMessage(title);
    }
}


function base64Encode(input) {
    var rv;
    rv = encodeURIComponent(input);
    rv = unescape(rv);
    rv = window.btoa(rv);
    return rv;
}