<!--
var re_name = /^\w{4,16}$/;
var re_password = /^\w{4,16}$/;
var re_checkcode = /^\d{4}$/;
var re_url = /^http[s]?:\/\/([\w-]+\.)+[\w-]+([\w-./?%&=]*)?|([\w-]+\.)+[\w-]+([\w-./?%&=]*)?$/;
var re_br = /^[\s]+$/;		//回车，换行，制表符
var re_num = /^[\d]?$/;		//数字
var re_en = /^[\w]*$/;		//字母 _
var re_ch = /^[\u4E00-\u9FA5]*$/;		//中文
var re_oicq = /^[1-9]\d{4,8}$/;		//QQ
var re_postalcode	= /^[1-9]\d{5}$/;		//邮编
var re_email = /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/;		//email
var re_mobile = /^((\(\d{3}\))|(\d{3}\-))?13\d{9}$/;		//手机
var re_phone = /^((\(\d{3}\))|(\d{3}\-))?(\(0\d{2,3}\)|0\d{2,3}-)?[1-9]\d{6,7}$/;		//座机号码
var re_qh = /^\d{3,5}$/;				//区号
var re_identitycard = /^\d{15}(\d{2}[A-Za-z0-9])?$/;		//身份证
/*
function isUrl(urlname)
{
	var re = /^([\w-]+\.)+[\w-]+([\w-./?%&=]*)?$/;
//	var re = /^http[s]?:\/\/([\w-]+\.)+[\w-]+([\w-./?%&=]*)?$/;
	if (re.test(urlname))
		return true;
	else
		return false;
}
*/
//返回字符长度，英文1个字符，汉字或全角字符算2个
function strlen(str){
	var len;
	var i;
	len = 0;
	for (i=0;i<str.length;i++){
		if (str.charCodeAt(i)>255) len+=2; else len++;
	}
	return len;
}
function txtlength(id){
	var txt;
	txt = document.getElementById(id);
	alert("已经输入了"+strlen(txt.value)+"个字！");
}
//检查是否为ASIC字符
function isAsc(str){
	var len;
	var i;
	len = 0;
	for (i=0;i<str.length;i++){
		if (str.charCodeAt(i)>255) return true;
	}
	return false;
}
//检查邮箱
function isEmail(theStr)
{
	var atIndex		=	theStr.indexOf("@")	;
	var dotIndex	=	theStr.indexOf(".",atIndex)	;
	var flage		=	true	;
	
	theSub	=	theStr.substring(0,dotIndex+1)	;
	if	((atIndex	<	1)	||	(atIndex	!=	theStr.lastIndexOf("@"))	||	(dotIndex	<	(atIndex	+	2))	||	(theStr.length	<=	theSub.length)) 
		{
			flage	=	false	;
		}
	else
		{
			flage	=	true	;
		}
	return (flage)	;		
}
//--------------------常用-------------------------------
function sethp(obj,url)
{
	obj.style.behavior='url(#default#homepage)';
	obj.setHomePage(url);
}

function addfav(url,info)
{
	window.external.addFavorite(url,info);
}		
function closewin()
{
	window.close();
}
function javatrim(str)
{
	var localstr=new String(str);
  	var pattern=/^\s+|\s+$/g;
	localstr=localstr.replace(pattern,"");
	return(localstr);
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//图片按比例缩放 <img src=".." onload = "DrawImage(this)"> 
var img_flag=false; 
function DrawImage(ImgD){ 
	var image=new Image(); 
	var iwidth = 80;  //定义允许图片宽度 
	var iheight = 80;  //定义允许图片高度 
	image.src=ImgD.src; 
	if(image.width>0 && image.height>0){ 
		img_flag=true; 
		if(image.width/image.height>= iwidth/iheight){ 
			if(image.width>iwidth){   
				ImgD.width=iwidth; 
				ImgD.height=(image.height*iwidth)/image.width; 
			}
			else
			{ 
				ImgD.width=image.width;   
				ImgD.height=image.height; 
			} 
			ImgD.alt=image.width+"×"+image.height; 
		} 
		else
		{ 
			if(image.height>iheight){   
				ImgD.height=iheight; 
				ImgD.width=(image.width*iheight)/image.height;   
			}
			else
			{ 
				ImgD.width=image.width;   
				ImgD.height=image.height; 
			} 
		ImgD.alt=image.width+"×"+image.height; 
		} 
	} 
}  
/*文字大小+-*/
var fsize = 14;			//默认文章文字为14px;
function doZoom(div_id){
	document.getElementById(div_id).style.fontSize=14+'px';
	fsize = 14;
}
function ZoomOut(div_id){
	var s = document.getElementById(div_id).style.fontSize = ++fsize +'px';
}
function ZoomIn(div_id){
	var s = document.getElementById(div_id).style.fontSize = --fsize + 'px';
}
function reload_chkimg(chk_img_id){
	var chk1 = document.getElementById(chk_img_id);
	chk1.src = "/inc/checkcode.asp";
}
function KillError() { return false; }
window.onerror=KillError;
//-->