﻿// JScript 文件



function getObjectById(objID)
{
	if (typeof (objID) != "string" || objID == "" )return null;
	if (document.all) return document.all(objID);
	if (document.getElementById) return document.getElementById(objID);
	try {return eval(objID)}catch(e) {alert("This script does not work in your browser!");return null;}
}

function lftrim(obj)
{
	var str = obj.value;
	str = DBC2SBC(str);
	return str.replace(/(^\s*)|(\s*$)/g, "");
}

function DBC2SBC(str)
{
	var result = '';
	for (i=0 ; i<str.length; i++)
	{
		code = str.charCodeAt(i);
		if (code >= 65281 && code <= 65373)
		{
			result += String.fromCharCode(str.charCodeAt(i) - 65248);
		}else if (code == 12288)
		{
			result += String.fromCharCode(str.charCodeAt(i) - 12288 + 32);
		}else
		{
			result += str.charAt(i);
		}
	}
	return result;
}
function openSamleWindow(url,width,height)
{
    window.open (url, '', 'fullscreen=no,toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=no,width=' + width + ',height=' + height + ',top=100,left=200');
}
function displayLoading()
{
    var div = document.getElementById('loading');
    div.style.display = 'block';
}

function doUpdate(btn,group)
{
    if (Page_ClientValidate(group))
    {
        btn.style.visibility = 'hidden';
        displayLoading();
    }
}