//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,fangshi) 
{  
	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='';
	
	if(fangshi=="shubiaogs")
	{
	 	//鼠标跟谁
		var shubiaox=event.clientX+ document.documentElement.scrollLeft  - document.body.clientLeft;
		var shubiaoy=event.clientY+ document.documentElement.scrollTop - document.body.clientTop;
		 
		document.getElementById("shubiaogyts").style.width='0px';
		document.getElementById("shubiaogyts").style.height='0px';
		document.getElementById("shubiaogyts").style.left= shubiaox +'px';
		document.getElementById("shubiaogyts").style.top= shubiaoy +'px';
		document.getElementById("xgzdz_c").style.display=''; 
		document.getElementById("xgzdz_c").style.left=shubiaox +'px';
		document.getElementById("xgzdz_c").style.top=shubiaoy +'px';
		document.getElementById("ksbc").style.display='none'; 
		document.getElementById("shubiaogyts").style.border='#F00 solid 0px'; 		
	}
	if(fangshi=="biankuangts")
	{
	 	//边框提示
		document.getElementById("ksbc").style.display=''; 
		document.getElementById("shubiaogyts").style.width=k+'px';
		document.getElementById("shubiaogyts").style.height=g +'px';  
		document.getElementById("shubiaogyts").style.left=x +'px';
		document.getElementById("shubiaogyts").style.top=y+'px'; 
		document.getElementById("shubiaogyts").style.border='#F00 solid 1px'; 
		document.getElementById("xgzdz_c").style.display=''; 
		document.getElementById("xgzdz_c").style.left=x+'px';
		if(y<30)
		{
			document.getElementById("xgzdz_c").style.top=y +g+'px';
		}
		else
		{
			document.getElementById("xgzdz_c").style.top=y -25+'px';
		}
	} 
	if(fangshi=="qishiwz")
	{
	 	//起始位置
		document.getElementById("shubiaogyts").style.width='0px';
		document.getElementById("shubiaogyts").style.height='0px';
		document.getElementById("shubiaogyts").style.left=x +'px';
		document.getElementById("shubiaogyts").style.top=y+'px'; 
		document.getElementById("xgzdz_c").style.display=''; 
		document.getElementById("xgzdz_c").style.left=x +'px';
		document.getElementById("xgzdz_c").style.top=y+'px'; 
		document.getElementById("ksbc").style.display='none'; 
		document.getElementById("shubiaogyts").style.border='#F00 solid 0px';
	} 
	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;
}  

