function findString(s){
	//判断字符串是否合法
	 if(s==""||typeof(s)!="string"){
	   return false;	
	 }
	 return true;
}

function dealSpace(s){
	//去除空格
	return s.replace(/\s/ig,"");
}

function dealHtmlTag(s){
	//去除html标签
  return	s.replace(/<(.|\n)+>/ig,"");
}

function scoreCheck(score){//检查dkp分数是否合法
  var patrn=/^-{0,1}\d*\.?\d*$/ig;
  if(score.match(patrn)==null){
     return false;
  }
  return true;
}

function trim(s){
  //去除字符串头尾空格	
  s=s.replace(/^\s*/ig,"");
  s=s.replace(/\s*$/ig,"");
  return s;
}

function getGuildidByUrl(){
//根据document.location.href的地址,获得guildid
  var url=document.location.href;
  var re;
  var arr;
  if(url.indexOf(".jsp?")!=-1){
    re=/.*?\.jsp\?.*?guildid=([^&]+)/ig;
    arr=re.exec(url);	
  }else{
    re=/http:\/\/.*?\/(.*?)\/.*/ig;
	  arr=re.exec(url);
	}
	if(arr!=null){
    return arr[1];
  }
}

function canSubmit(){//防止多次提交
var buttondiva = $(".button a")[0];
 if($( buttondiva ).attr("disabled")){
   return false;
 }else{
   $( buttondiva ).attr("disabled","true");
   $( buttondiva ).removeAttr("onclick");
   $( buttondiva ).removeAttr("href");
 }
 return true;
}


function copytxt(){
var text;
if(navigator.userAgent.indexOf("MSIE")>0) {
	var r=document.selection.createRange();
	text=r.htmlText;
	if(r.text.length>10){
		document.selection.empty();
	}
   }
   if(isFirefox=navigator.userAgent.indexOf("Firefox")>0){
    text=window.getSelection().toString();
    if(text.length>10){
		window.getSelection().removeAllRanges(); 
	}
   }
}