//$(function()
//{
//	GetTodayData()
//	setInterval(GetTodayData,30000)
	
//    //Getapied()//查询API额度

//    GetapiedCookie();//查询API额度
//})


//function GetTodayData()
//{
//	$.post("ajax/easytongji.ashx",function(data)
//	{
//		$("#todaydatabox").html(data);
//	})
//}
function GetapiedCookie() {

    $("#system_ag").find("span").text(getCookie("system_ag") == null ? "刷新" : getCookie("system_ag"));
    $("#system_bbin").find("span").text(getCookie("system_bbin") == null ? "刷新" : getCookie("system_bbin"));
    $("#system_og").find("span").text(getCookie("system_og") == null ? "刷新" : getCookie("system_og"));
    $("#system_ab").find("span").text(getCookie("system_ab") == null ? "刷新" : getCookie("system_ab"));
    $("#system_eb").find("span").text(getCookie("system_eb") == null ? "刷新" : getCookie("system_eb"));
    $("#system_mg").find("span").text(getCookie("system_mg") == null ? "刷新" : getCookie("system_mg"));
    $("#system_pt").find("span").text(getCookie("system_pt") == null ? "刷新" : getCookie("system_pt"));
    $("#system_im").find("span").text(getCookie("system_im") == null ? "刷新" : getCookie("system_im"));
    $("#system_qp").find("span").text(getCookie("system_qp") == null ? "刷新" : getCookie("system_qp"));

}
//读取cookies
function Getapied(a)
{	
    var obj = $(a);
	obj.find("span").text("…")
	$.post("ajax/apied.ashx", { t: obj.data("id") }, function (data)
	{
	    obj.find("span").text(data);
	    setCookie($(a).attr("id"), data);
	})
}
function GetapiedAll(a) {
    for (var i = 1; i < $("#edtable").find("span").length; i++) {
        $("#edtable").find("span").eq(i).click();
    }
}
//读cookies
function getCookie(name) {
    var arr, reg = new RegExp("(^| )" + name + "=([^;]*)(;|$)");
    if (arr = document.cookie.match(reg))
        return unescape(arr[2]);
    else
        return null;
}
//写cookies
function setCookie(name, value) {
    var Days = 30;
    var exp = new Date();
    exp.setTime(exp.getTime() + Days * 24 * 60 * 60 * 1000);
    document.cookie = name + "=" + escape(value) + ";expires=" + exp.toGMTString();
}
function setAutoTime(type,ids,ide)
{
    $.post("ajax/getTime.ashx", { type: type }, function (data) {
        $("#" + ids).val(data.split(",")[1]);
        $("#" + ide).val(data.split(",")[0]);
        $("[type=submit]").click();
    })
}