﻿// JScript 文件

String.format = function()
{
    if (arguments.length == 0)
        return null;
        
    var str = arguments[0];
    for(var i=1;i<arguments.length;i++)
    {
        var re = new RegExp('\\{' + (i-1) + '\\}','gm');
        str = str.replace(re, arguments[i]);
    }
    return str;
}

function request(key)
{
    var url=window.document.location.href;
    var pos=url.indexOf("?");
    if (pos == -1) 
        return "";
    var allValues=url.substr(pos + 1);

    var tmpValues = allValues.split("&");
    for(var i = 0; i < tmpValues.length; i++)
    {
        var tmpValue = tmpValues[i].split("=");

        if(tmpValue[0].toUpperCase()==key.toUpperCase()) 
            return tmpValue[1];
    }
    return "";
}


function isInteger(value)
{
    var t = /^\d+$/;
    return t.test(value);
}

function CheckMobile(mobile)
{
    var t = /^1[358]\d{9}$/;
    return t.test(mobile);
}
