<!--//
function newsopen(theurl)
{
	var lw = window.screen.width;
	var lh = window.screen.height;
	leftX =  (lw - 520) / 2
	topY = (lh - 430) / 2 - 30
	
	window.open(theurl,'news','scrollbars=yes,left='+ leftX + ',top='+ topY + ',width=523,height=400')
	return false;
}
function winopen(theurl,winName,_iLeftX,_iTopY,_iWidth,_iHeight,_iDirection)
{
	if(_iDirection == 0)
	{
		var lw = window.screen.width;
		var lh = window.screen.height;
		leftX =  (lw - _iWidth) / 2
		topY = (lh - _iHeight) / 2 - 30
	}
	else
	{
		leftX = _iLeftX;
		topY = _iTopY;
	}
	window.open(theurl,winName,'scrollbars=yes,left='+ leftX + ',top='+ topY + ',width='+ _iWidth +',height='+ _iHeight +'')
	return false;
}
//函数名：fucCheckNUM
//功能介绍：检查是否为数字
//参数说明：要检查的数字
//返回值：1为是数字，0为不是数字
function fucCheckNUM(NUM)
{
	var i,j,strTemp;
	strTemp= "0123456789 ";
	if ( NUM.length == 0) return 0;
	for (i=0;i<NUM.length;i++)
	{
		j = strTemp.indexOf(NUM.charAt(i));
		if (j==-1)
		{
			//说明有字符不是数字
			return 0;
		}
	}
	//说明是数字
	return 1;
}

//函数名：fucCheckNull
//功能介绍：检查是否为空
//参数说明：要检查的字符串
//返回值：0为是空，1为不是空
function fucCheckNull(STR)
{
	var i,j,strTemp;
	strTemp= "0123456789 ";
	if ( STR.length <= 0) return 0;
	//说明不为空
	return 1;
}

//函数名：fucCheckLength
//功能介绍：检查字符串的长度
//参数说明：要检查的字符串
//返回值：长度值
function fucCheckLength(strTemp)
{
	var i,sum;
	sum=0;
	for(i=0;i<strTemp.length;i++)	{
		if ((strTemp.charCodeAt(i)>=0) && (strTemp.charCodeAt(i)<=255))
			sum=sum+1;
		else
			sum=sum+2;
	}
	return sum;
}

//函数名：chkemail
//功能介绍：检查是否为Email Address
//参数说明：要检查的字符串
//返回值：0：不是  1：是
function chkemail(theEmail)
{
	re = /\b(^(\S+@).+((\.com)|(\.net)|(\.biz)|(\.info)|(\.edu)|(\.mil)|(\.gov)|(\.org)|(\..{2,2}))$)\b/gi 
	if (theEmail.match(re))
	{
		return 1;
	}
	else
	{
		return 0;
	}
}
//函数名：fucCheckTEL
//功能介绍：检查是否为电话号码
//参数说明：要检查的字符串
//返回值：1为是合法，0为不合法
function fucCheckTEL(TEL){
	var i,j,strTemp;
	strTemp=" 0123456789-(+)#";
	if (TEL.length == 0) return 0;
	for (i=0;i<TEL.length;i++)
	{
		j=strTemp.indexOf(TEL.charAt(i));
		if (j==-1)
		{
			//说明有字符不合法
			return 0;
		}
	}
	//说明合法
	return 1;
}

//函数名：chkdate    (YYYY-MM-DD)
//功能介绍：检查是否为日期
//参数说明：要检查的字符串
//返回值：0：不是日期  1：是日期
function chkdate(datestr) {
	var lthdatestr
	if (datestr != "")
		lthdatestr= datestr.length ;
	else
		lthdatestr=0;
	var tmpy="";
	var tmpm="";
	var tmpd="";
	//var datestr;
	var status;
	status=0;
	if ( lthdatestr== 0)
		return 0;
	for (i=0;i<lthdatestr;i++)
	{
		if (datestr.charAt(i)== '-') {
			status++;
		}
		if (status>2) {
			return 0;
		}
		if ((status==0) && (datestr.charAt(i)!='-')) {
			tmpy=tmpy+datestr.charAt(i)
		}
		if ((status==1) && (datestr.charAt(i)!='-')) {
			tmpm=tmpm+datestr.charAt(i)
		}
		if ((status==2) && (datestr.charAt(i)!='-')) {
			tmpd=tmpd+datestr.charAt(i)
		}
	}
	year=new String (tmpy);
	month=new String (tmpm);
	day=new String (tmpd)
	if ((tmpy.length!=4) || (tmpm.length>2) || (tmpd.length>2)) {
		return 0;
	}
	if (!((1<=month) && (12>=month) && (31>=day) && (1<=day)) ) {
		return 0;
	}
	if (!((year % 4)==0) && (month==2) && (day==29)) {
		return 0;
	}
	if ((month<=7) && ((month % 2)==0) && (day>=31)) {
		return 0;
	}
	if ((month>=8) && ((month % 2)==1) && (day>=31)) {
		return 0;
	}
	if ((month==2) && (day==30))
	{
		return 0;
	}
	return 1;
}

//-->


