//js.js JavaScript调用函数,Power by rongsoft
window.onerror =function(){ return true};  
//设置cookie
function shezhick(name,value)
{
  var Days = 30; //此 cookie 将被保存 30 天
  var exp  = new Date();    //new Date("December 31, 9998");
  exp.setTime(exp.getTime() + Days*24*60*60*1000);
  document.cookie = name + "="+ escape(value) +";expires="+ exp.toGMTString();
}
//得到cookie
function dedaock(name)
{
  var arr = document.cookie.match(new RegExp("(^| )"+name+"=([^;]*)(;|$)"));
  if(arr != null) return unescape(arr[2]); return "";
}
//删除cookie
function shanchuck(name)
{ 
   var date = new Date();
   date.setTime(date.getTime() - 10000);
   document.cookie = name + "=a; expires=" + date.toGMTString(); 
} 
//图片等比例
function tupiandbl(tupianid,kuan,gao)
{
  var image=new Image();
  image.src=tupianid.src;   
  if(image.width>0 && image.height>0)
  {
       if(image.width/image.height>= kuan/gao)
	   {
           if(image.width>kuan)
		   {
               tupianid.width=kuan;           
               tupianid.height=(image.height*kuan)/image.width;
           }
		   else
		   {
               tupianid.width=image.width;           
               tupianid.height=image.height;         
           }
       } 
	   else
	   {         
           if(image.height>gao)
		   {           
               tupianid.height=gao;           
               tupianid.width=(image.width*gao)/image.height;
           }
		   else
		   {
               tupianid.width=image.width;
              tupianid.height=image.height; 
           }       
       }   
   } 
} 
//全局参数 
var yunxuqcts=true;
var xiugaizdzmc="";
var xiugaizdzbh="";
var xiugaizdzwz="";
 
//位置固定
setInterval("weizhigd()",500);  
function weizhigd() 
{    
	document.getElementById("qiantaigjt").style.top=document.documentElement.scrollTop; 
}  
//清除提示
setInterval("qingchuts()",5000);  
function qingchuts() 
{ 
	if(yunxuqcts)
	{
		document.getElementById("shubiaogyts").style.display="none";
		document.getElementById("shubiaogyts").innerHTML = ""; 
		document.getElementById("xgzdz_c").style.display="none"; 
		document.getElementById("caozuots_c").innerHTML = "";  
	}
}  
//修改字段值 
function xiugaizdz(obj,biaoming,ziduanmc,biaohao,wangzhi) 
{  
	var   x,y,k,g,oRect;   
  	oRect   =   obj.getBoundingClientRect();   
	x=oRect.left + document.documentElement.scrollLeft ; 
	y=oRect.top + document.documentElement.scrollTop  ;
	k=obj.offsetWidth ;
	g=obj.offsetHeight ;
	document.getElementById("shubiaogyts").style.display='';
	document.getElementById("shubiaogyts").style.border='#F00 solid 1px'; 
	document.getElementById("shubiaogyts").style.left=x ;
	document.getElementById("shubiaogyts").style.top=y ;
	document.getElementById("shubiaogyts").style.width=k ;
	document.getElementById("shubiaogyts").style.height=g ;  
	document.getElementById("xgzdz_c").style.display=''; 
	document.getElementById("xgzdz_c").style.left=x ;
	if(y<30)
	{
		document.getElementById("xgzdz_c").style.top=y +g; 
	}
	else
	{
		document.getElementById("xgzdz_c").style.top=y -25; 
	}
	document.getElementById("xgzdz_ziduanmc").value=ziduanmc;
	document.getElementById("xgzdz_biaoming").value=biaoming; 
	document.getElementById("xgzdz_biaohao").value=biaohao; 
	xiugaizdzmc=ziduanmc;
	xiugaizdzbh=biaohao;  
	xiugaizdzwz=wangzhi;
	yunxuqcts=false;
}  

