ToolMgr = function () {

}
ToolMgr.isMobel = function(){
    var userAgentInfo = navigator.userAgent;
    var Agents = ["Android", "iPhone",
        "SymbianOS", "Windows Phone",
        "iPad", "iPod"];
    for (var v = 0; v < Agents.length; v++) {
        if (userAgentInfo.indexOf(Agents[v]) > 0) {
            return true;
        }
    }
    return false;
}
ToolMgr.isMac = function (){
    return /macintosh|mac os x/i.test(navigator.userAgent);
}
ToolMgr.isAndroid = function (){
    var u = navigator.userAgent;
    var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1; //android终端
    return isAndroid;
}
//角度-》弧度
ToolMgr.Angle2Radian = function (angle) {
    return angle * Math.PI / 180;
}
//弧度-》角度
ToolMgr.Radian2Angle = function (radian) {
    return radian * 180 / Math.PI;
}
ToolMgr.getParams = function(searchUrl) {
    var url = searchUrl; //获取url中"?"符后的字串
    var theRequest = new Object();
    if (url.indexOf("?") != -1) {
        var str = url.substr(1);
        strs = str.split("&");
        for (var i = 0; i < strs.length; i++) {
            theRequest[strs[i].split("=")[0]] = decodeURIComponent(strs[i].split("=")[1]);
        }
    }
    return theRequest;
};
