// JavaScript Document
window.onerror=function(){return true;} 
//邮箱检验
function Isyx(yx){
	var reyx= /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-])+/;
	return(reyx.test(yx));
	}
 function selectAll() { 
	var objs = document.getElementsByName('chk_id'); 
	var i; 
	for(i = 0; i < objs.length; i++) { 
		if(objs[i].type == "checkbox") 
			{ 
				objs[i].checked = true; 
			} 
		} 
	} 
 function unselect(){ 
	var objs = document.getElementsByName('chk_id'); 
	var i; 
	for(i=0;i<objs.length;i++) { 
		if(objs[i].type=='checkbox') { 
				if(objs[i].checked == true) 
			{ 
				objs[i].checked =false; 
			} else { 
				objs[i].checked =true; 
				} 
			} 
		} 
	} 
 function idArray(){ 
	var objs = window.document.getElementsByName('chk_id'); 
	var i; 
	var idArray = new Array(); 
	var j = 0; 
	for(i=0;i<objs.length;i++) { 
		if(objs[i].type=='checkbox') 
		{ 
			if(objs[i].checked == true) 
		{ 
			idArray[j] = objs[i].value; 
			j = j + 1; 
			} 
		} 
	} 
	return idArray; 
 } 
 function getLen( str) {
	var totallength=0;
	for (var i=0;i<str.length;i++){
		var intCode=str.charCodeAt(i);
		if (intCode>=0&&intCode<=128) {
			totallength=totallength+1;//非中文单个字符长度加1
		}else {
		totallength=totallength+2;//中文字符长度则加2
		}
	}
	return totallength;
}


