
//打开自定义窗口

function OpenWindow(url, w, h)
{
	window.open(url, "blank", "width=" + w + ", height=" + h + ", toolbar=no, status=no, menubar=no, scrollbars=no, resizable=no");
}

//全选

function CheckAll(ca, rd)
{
    var AllElement = document.getElementsByTagName("input");
    for(i = 0; i < AllElement.length; i++)
    {
        if(AllElement[i].id == rd && AllElement[i].type == "checkbox")
        {
            AllElement[i].checked = ca.checked;
        }
    }
}

//判断是否为空

function Trim(s)
{
	var m = s.match(/^\s*(\S+(\s+\S+)*)\s*$/);
	return (m == null) ? "" : m[1];
}

//生成随机数

function GetRandom(r)
{
	return parseInt(Math.random() * r);
}

//从GMT时间的1970年1月1日0时0分0秒到现在的毫秒数

function getTimer()
{
    var dt = new Date();
    return dt.getTime();
}

//获取对象页面坐标

function getoffset(e)
{
    var t = e.offsetTop;
    var l = e.offsetLeft;
    while(e = e.offsetParent)
    {
        t += e.offsetTop;
        l += e.offsetLeft;
    }
    var re = new Array(1);
    re[0] = t;
    re[1] = l;
    return re;
}
