// 自动最大化网页，以获得最佳浏览效果
if ( screen.availWidth > 1000 && document.documentElement.offsetWidth < 1010 )	{
	self.moveTo(-4,-4);
	self.resizeTo(screen.availWidth+7,screen.availHeight+8);
	document.body.style.cssText="overflow-x:hidden;";
}else if ( screen.availWidth < 1000 && document.documentElement.offsetWidth < 750 )	{
	self.moveTo(-3,-3);
	self.resizeTo(screen.availWidth+5,screen.availHeight+6);
}

// 容错代码
function killErrors() {
return true;
}
window.onerror = killErrors;
//去左右两边空格
String.prototype.trim=function()
{
  return this.replace(/^\s+|\s+$/g,"")
} 
function check_radio(i)
{
  var obj=document.getElementById("tm2");
  if(obj)
  {
    if( parseInt(i)==1)
    {
      obj.disabled=true;
      obj.value="";
    }
    else
    {
      obj.disabled=false;
      obj.value="yyyy-mm-dd";
    }
  }
}
 
//获取radioValue
function GetRadioValue(RadioName){   
    var obj;       
    obj=document.getElementsByName(RadioName);   
    if(obj!=null){   
        var i;   
        for(i=0;i<obj.length;i++){   
            if(obj[i].checked){   
                return obj[i].value;               
            }   
        }   
    }   
    return null;   
}  
//关键字搜索变色
function HighlightText(obj,keywordarray)
{
  if(keywordarray!=""&&keywordarray.length>0)
  {
    for(var i=0;i<keywordarray.length;i++)
    {
      var reg = new RegExp(keywordarray.substr(i,1)+"(?=[^<>]*<)","ig");
      var data=document.getElementById(obj).innerHTML;
      document.getElementById(obj).innerHTML=data.replace(reg,'<span style="color:#ff0000">'+keywordarray.substr(i,1)+'</span>');
    }
  }
}
function getCookieVal(offset){ 
	var endstr = document.cookie.indexOf (";", offset); 
	if (endstr == -1) endstr = document.cookie.length; 
		return unescape(document.cookie.substring(offset, endstr)); 
} 
//js获取cookie
 
function getck(name){
	var arg = name + "="; 
	var alen = arg.length; 
	var clen = document.cookie.length; 
	var i = 0; 
	while (i < clen) { 
		var j = i + alen; 
		if (document.cookie.substring(i, j) == arg) return getCookieVal (j); 
		i = document.cookie.indexOf(" ", i) + 1; 
		if (i == 0) break; 
	} 
	return ""; 
} 
 
//获取url参数
function geturlvalue(name)
{
 var str=window.location.search;
 if (str.indexOf(name)!=-1)
 {
  var pos_start=str.indexOf(name)+name.length+1;
  var pos_end=str.indexOf("&",pos_start);
  if (pos_end==-1)
  {
   return str.substring(pos_start);
  }
  else
  {
   return str.substring(pos_start,pos_end)
  }
 }
 else
 {
  return "";
 }
}
 