$("document").ready(function(){
/*  $("#submit").click(function(){
  });		*/	 
});

function shifou(){
  var username = document.getElementById('username').value;
  if(username=='') return true;
  if(confirm('确定要清除用户“'+username+'”以及该用户的所有信息？')){
     return true;
  }
  return false;
}

function remind(){
  if(confirm('确定操作吗？')){
     return true;
  }
  return false;
}
function checkall(form, name) {
	for(var i = 0; i < form.elements.length; i++) {
		var e = form.elements[i];
		if(e.name.match(name)) {
			e.checked = form.elements['chkall'].checked;
		}
	}
}
function isChinese(str){
    var reg = /[u00-uFF]/;       
    return !reg.test(str);      
}
function RndNum(n){
  var rnd="";
  for(var i=0;i<n;i++)
    rnd+=Math.floor(Math.random()*10);
  return rnd;
}
function ajaxurl(parmat){
    return '/index.php?mod=tools&act=ajax&'+parmat+'&floor='+Math.floor(Math.random()*1000+1);	
}
function strlen(str){
    var strlength=0;
    for (i=0;i<str.length;i++){
        if (isChinese(str.charAt(i))==true)
           strlength=strlength + 2;
        else
           strlength=strlength + 1;
     }
     return strlength;
}
String.prototype.trim = function(){
	return this.replace(/(^\s*)|(\s*$)/g, "");
}
function isEmail(email){
   var reg = /^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/;
   return reg.test(email);
}
function isNum(str){
	return !isNaN(str);
}
function isIcq(str){
    var reg = /^[1-9]\d{4,9}$/;
    return  reg.test(str);
}
function openwin(url,title,width,height){
	var lj;
	if(url.indexOf('?') != -1){
	   lj = "&";	
	}else{
	   lj = "?";
	}
	TB_show(title,url+lj+'keepThis=true&TB_iframe=true&height='+height+'&width='+width,false);
}
function isPhone(str){
	var reg = /([1-9]{1,3}\-[1-9]{7,8}$)|(1[0-9]{10,10}$)/;
    return  reg.test(str.trim());
}
function getid(id){
  return document.getElementById(id);	
}
function getgm(id){
  return $(id);
}
function checkId(pId){
    var arrVerifyCode = [1,0,"x",9,8,7,6,5,4,3,2];
    var Wi = [7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2];
    var Checker = [1,9,8,7,6,5,4,3,2,1,1];
    if(pId.length != 15 && pId.length != 18)    return false;
    var Ai=pId.length==18 ?  pId.substring(0,17)   :   pId.slice(0,6)+"19"+pId.slice(6,16);
    if (!/^\d+$/.test(Ai))  return false;
    var yyyy=Ai.slice(6,10) ,  mm=Ai.slice(10,12)-1  ,  dd=Ai.slice(12,14);
    var d=new Date(yyyy,mm,dd) ,  now=new Date();
    var year=d.getFullYear() ,  mon=d.getMonth() , day=d.getDate();
    if (year!=yyyy || mon!=mm || day!=dd || d>now || year<1940) return false;
    for(var i=0,ret=0;i<17;i++)  ret+=Ai.charAt(i)*Wi[i];
    Ai+=arrVerifyCode[ret %=11];     
    return pId.length ==18 && pId != Ai ? false : true;        
}