﻿// JScript 文件

// 常用方法
function $F(id)
{
    return document.getElementById(id);//用$()方法代替document.getElementById(id)
}
function $C(t)
{
    return document.createElement(t);//用$C()方法代替document.createElement(t)
}
function $N(str)
{
    return str.replace(/(^\s*)|(\s*$)/g, "");//去前后空格
}
//弹出窗口
//url地址，窗口名称，高度，宽度，滚动条，窗口可变大小
 function NewWindow(mypage,myname,w,h,scroll,rst)
 {   
    var win=null;
    LeftPosition=(screen.width)?(screen.width-w)/2:100;   
    TopPosition=(screen.height)?(((screen.height-h)/2)-30):100;   
    settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable='+rst;   
    win=window.open(mypage,myname,settings);  
} 

String.prototype.Trim = function()
{
return this.replace(/(^\s*)|(\s*$)/g, "");
}

String.prototype.LTrim = function()
{
return this.replace(/(^\s*)/g, "");
}

String.prototype.RTrim = function()
{
return this.replace(/(\s*$)/g, "");
}
    function OpenFullWindow(url)
    {
        window.open(url,(new Date()).valueOf(),"top=0,left=0,height="+(window.screen.availHeight-30)+",width="+(window.screen.availWidth-10)+",toolbar=no,menubar=no,resizable=yes,scrollbars=yes,location=no,status=yes");
    }
