function check_port(port)
{
	var pattern = /^\d+$/;
	var PResult;
	PResult=pattern.test(port);
	if ( (PResult==false) || ( PResult==true && (port<1 || port>65535) ) ) return false;
	else return true;
}

function check_name(name)
{
	var pattern = /(\\|\/|;|:|\||<|>|\*|\?|\"|\')/;
	if (pattern.test(name)==true || name.length==0) return false;
	return true;
}

function check_noDQuo(name)
{
	if(name.indexOf("\"")!=-1) return false;
	return true;
}

function check_DNorIP(int)
{
	var pattern = /^-/;
	if (pattern.test(int)==true) return false;
	else return true;
}
function check_email(email)
{
	//var pattern = /\w{1,}@[[a-zA-Z0-9]{1,}.]{1,}[a-zA-Z0-9]{1,}/;
	var pattern = /^.+@.+\..{2,3}$/;
	if (pattern.test(name)==true) return false;
	return true;
}
function check_number(num)
{
	var pattern = /^\d+$/;
	if (pattern.test(num)==false) return false;
	else return true;
}
function checkInputLen(eve, str, len)
{
	var ori=unescape(str);
	
	if(str.length>len)
	{
		alert(err_StringTooLong);
		var element=getEventTarget(eve);
		if(unescape(str).length==str.length) element.value=unescape(str.substring(0,len));
		while(str.length>len)
		{
			var arr=ori.substring(ori.length-1).match(/[^\x00-\xff]/ig);
			if(arr!=null) str=str.substring(0,str.length-6);
			else str=str.substring(0,str.length-1);
			ori=unescape(str);
		}
		element.value=unescape(ori);
	}
}