function openwin(w,h,url)
		{
		var l=(window.screen.width/2)-w/2;
		var t=(window.screen.height/2)-h/2;
		window.open(url,'','width='+w+',height='+h+',top='+t+',left='+l+',menubar=no,toobar=no,scrollbars=yes,resizable=no,status=no,loation=no');
		}
function userlogincheck()	
       { 
	     var frm=document.form1;
		   if(frm.HX_UserName.value==""){
			   alert('用户名不能为空!');
			   frm.HX_UserName.focus();
			   return false;
			   }
		  if(frm.HX_PassWord.value==""){
			   alert('密码不能为空!');
			   frm.HX_PassWord.focus();
			   return false;
			   }
		  if(frm.HX_ValidateCode.value==""){
			   alert('验证码不能为空!');
			   frm.HX_ValidateCode.focus();
			   return false;
			   }
		   return true;
		   
		   }
	   function Carcheck(form)
          {
         if(form.CarName.value=="")
            {
           alert("请输入车辆名!");
	       form.CarName.focus();
           return false;
            }
        if (form.CarDescribe.value=="")
        { 
         alert("请输入简要描述!");
         form.CarDescribe.focus();
         return false;
          }
         return true;
         }	

      function Meetingcheck(form)
       {
         if(form.MeetingName.value=="")
          {
           alert("请输入会议室名称!");
	       form.MeetingName.focus();
           return false;
               }
         if (form.MeetingDescribe.value=="")
          { 
          alert("请输入简要描述!");
          form.MeetingDescribe.focus();
          return false;
          }
        return true;
     }   
    function offieccheck()
     {
      var frm=document.form1;	
      if(frm.WS_OfficeName.value==""){
			   alert('名称不能为空!');
			   frm.WS_OfficeName.focus();
			   return false;
			   }
      if(frm.WS_OfficeManageName.value==""){
			   alert('请选择保管员!');
			   frm.WS_OfficeManageName.focus();
			   return false;
			   }			   
	return true;		   
	}
	
	 function propertycheck(form)
     {
		 if(form.pnumber.value==""){
			   alert('资产编号不能为空!');
			   form.pnumber.focus();
			   return false;
			   }
		 if(form.pname.value==""){
			   alert('资产名称不能为空!');
			   form.pname.focus();
			   return false;
			   }
	return true;		   
	}	
function CarReturncheck(form)
{if(form.carman.value=="")
     {
      alert("请输入司机名字!")
	  form.carman.focus();
      return false
     }
return true
}
function CustomCheck(form)
{if(form.InfoName.value=="")
     {
      alert("客户名称不能为空!")
	  form.InfoName.focus();
      return false
     }
return true
}
function CustomActCheck(form)
{if(form.ContactName.value=="")
     {
      alert("姓名不能为空!")
	  form.ContactName.focus();
      return false
     }
return true
}
function SaleShopCheck(form)
{if(form.SaleShopName.value=="")
     {
      alert("供应商名称不能为空!")
	  form.SaleShopName.focus();
      return false
     }
return true
}
function ProductCheck(form)
{if(form.ProductName.value=="")
     {
      alert("产品不能为空!")
	  form.ProductName.focus();
      return false
     }
return true
}
function chkall(e)
{
	if(form1.MAID)
	{
		form1.MAID.checked=e.checked;
		for(i=0;i<form1.MAID.length;i++)
		if(form1.MAID[i].disabled!=true) form1.MAID[i].checked=e.checked;
	}
}
function PersonalPDA(form)
{if(form.Pname.value=="")
     {
      alert("请输入姓名!")
	  form.Pname.focus();
      return false
     }
return true
}
function checkmm(from)
{
if (from.WS_ManName.value=="")
{ alert("不能没有发布人员!");
from.WS_ManName.focus();
  return false;
}
if (from.pathname.value=="")
{ alert("流程名称不能为空!");
  from.pathname.focus();
  return false;
}
if (from.statenumber.value=="")
{ alert("请选择公文类别!");
  from.statenumber.focus();
  return false;
}
return true
}
function SchEduleCheck(form)
{
if(form.title.value=="")
     {
      alert("请输入日程主题!");
	  form.title.focus();
      return false;
     }
if(form.memo.value=="")
     {
      alert("请输入日程内容!");
	  form.memo.focus();
      return false;
     }	 
return true
}
function WorkTypecheck(form)
{if(form.TypeName.value=="")
     {
      alert("请输入类别名称!")
	  form.TypeName.focus();
      return false
     }
return true
}
function aa()
{
	if(form1.WS_MailToName.value=="")
	{
		alert("请选择收件人!");
		form1.WS_MailToName.focus();
		return false;
	}
	if(form1.subject.value=="")
	{
		alert("标题不能为空");
		form1.subject.focus();
		return false;
	}
form1.Content.value = frames.message.document.body.innerHTML;
form1.submit();
}
function bb()
{
if(form1.subject.value=="")
  {
     alert("标题不能为空");
	 form1.subject.focus();
     return false;
  }
form1.Content.value = frames.message.document.body.innerHTML; 
form1.pagename.value="dosave";
form1.submit();
}
function IsDigit()
{
  return ((event.keyCode >= 48) && (event.keyCode <= 57));
}

function mscroll(n,id){
temp=n;
did=id;
if (temp==0) return;
switch(did){
case 1: div1.scrollTop=div1.scrollTop+temp;break;
case 2: div2.scrollTop=div2.scrollTop+temp;break;
case 3: div3.scrollTop=div3.scrollTop+temp;break;
}
setTimeout("mscroll(temp,did)",80);
}

function workflowTocheck(form)
{

if(form.WS_WorkFlowToName.value=="")
     {
      alert("请选择收文人!");
	  form.WS_WorkFlowToName.focus();
      return false;
     }
if(form.Numbers.value=="")
     {
      alert("请输入来文单位!");
	  form.Numbers.focus();
      return false;
     }
if(form.Title.value=="")
     {
      alert("请输入来文标题!");
	  form.Title.focus();
      return false;
     }
if(form.ComeDate.value=="")
     {
      alert("请输入来文日期!");
	  form.ComeDate.focus();
      return false;
     }
	
if(form.Content.value=="")
     {
      alert("请输入具体公文内容!");
	  form.Content.focus();
      return false;
     }
return true
}
function checkadd(){
			if(document.frmAdd.FolderName.value==""){
				alert("请输入文件夹名称！");
				document.frmAdd.FolderName.focus();
				return false;
			}
		}
		function DoFolder(action){
			if(document.frmEdit.FolderId.value==""){
				alert("请选择要修改的文件夹！");
			}else{
				document.frmEdit.action.value=action;
				if(document.frmEdit.FolderName.value==""){
					alert("请输入文件夹名称！");
					document.frmEdit.FolderName.focus();
				}else{
					if(action=="delete"){
						if(confirm("确定要删除该文件夹吗？\n\n注意：删除该文件夹将删除该文件下的所有文件！")){
							document.frmEdit.submit();
						}
					}else{
						document.frmEdit.submit();
					}
				}
			}
		}
menu_flag=0;
var STATUS_BAR_MENU;

function show_WEBSMS()
{
   if(menu_flag==0)
       STATUS_BAR_MENU=window.open("HX_WEBSMS/list.asp","STATUS_BAR_MENU","height=360,width=90,status=0,toolbar=no,menubar=no,location=no,scrollbars=no,top=200,left=150,resizable=no");

   STATUS_BAR_MENU.focus();
}
function CloseOpen(evt) {
   if(evt.clientX<=0 && evt.clientY<0) {
	location.href='HX_login.asp?action=loginout';
        if(!confirm('您已经安全的退出了系统，现在可以关闭浏览器！\n是关闭浏览器（取消）还是重新登录（确定）？')){
         window.open('index.asp');
           return false;}
         else{
          window.close();
            return true;
          }
	}
}

   var MENU_ID_ARRAY = new Array();
    MENU_ID_ARRAY[0]="01";
    MENU_ID_ARRAY[1]="02";
    MENU_ID_ARRAY[2]="03";
    MENU_ID_ARRAY[3]="04";
    MENU_ID_ARRAY[4]="02";
    MENU_ID_ARRAY[5]="06";
    MENU_ID_ARRAY[6]="07";
	MENU_ID_ARRAY[7]="08";
	MENU_ID_ARRAY[8]="09";
	MENU_ID_ARRAY[9]="10";
	MENU_ID_ARRAY[6]="11";	
function check_all(menu_all,MENU_ID)
{
 for (i=0;i<document.all(MENU_ID).length;i++)
 {
   if(menu_all.checked)
      document.all(MENU_ID).item(i).checked=true;
   else
      document.all(MENU_ID).item(i).checked=false;
 }
}
 
function calenderout(){                            
calendar = new Date(); 
month = calendar.getMonth();                                 
date = calendar.getDate();                                 
year = calendar.getYear();
hours= calendar.getHours();
if (year< 100)  year = 2000 + year;
 document.write(" <font color=red><b>今天是："+year+"年"+(month+1)+"月"+date+"日");                             
//提前十天提醒节日                                 
document.write("<br>"); 
//以下为元旦提醒 
if ((month == 11) && (date == 22))  document.write("距元旦还有十天！");
if ((month == 11) && (date == 23))  document.write("距元旦还有九天！");
if ((month == 11) && (date == 24))  document.write("距元旦还有八天！");
if ((month == 11) && (date == 25))  document.write("距元旦还有七天！");
if ((month == 11) && (date == 26))  document.write("距元旦还有六天！");
if ((month == 11) && (date == 27))  document.write("距元旦还有五天！");
if ((month == 11) && (date == 28))  document.write("距元旦还有四天！");
if ((month == 11) && (date == 29))  document.write("距元旦还有三天！");
if ((month == 11) && (date == 30))  document.write("距元旦还有二天！");
if ((month == 11) && (date == 31))  document.write("距元旦还有一天！");               
if ((month == 0) && (date == 1))  document.write("元旦快乐！");
//情人节提醒 
if ((month == 1) && (date == 4)) document.write("距情人节还有十天！");
if ((month == 1) && (date == 5)) document.write("距情人节还有九天！");
if ((month == 1) && (date == 6)) document.write("距情人节还有八天！");
if ((month == 1) && (date == 7)) document.write("距情人节还有七天！");
if ((month == 1) && (date == 8)) document.write("距情人节还有六天！");
if ((month == 1) && (date == 9)) document.write("距情人节还有五天！");
if ((month == 1) && (date == 10)) document.write("距情人节还有四天！");
if ((month == 1) && (date == 11)) document.write("距情人节还有三天！");
if ((month == 1) && (date == 12)) document.write("距情人节还有二天！");
if ((month == 1) && (date == 13)) document.write("距情人节还有一天！");                    
if ((month == 1) && (date == 14)) document.write("情人节快乐！");
//妇女节提醒，还要考虑是不是闰年的问题 
if ((((year%4)==0)&&((year%100)!=0))||((year%400)==0))
{
if ((month == 1) && (date == 26)) document.write("距劳动妇女节还有十天！");
if ((month == 1) && (date == 27)) document.write("距劳动妇女节还有九天！");
if ((month == 1) && (date == 28)) document.write("距劳动妇女节还有八天！");
if ((month == 1) && (date == 29)) document.write("距劳动妇女节还有七天！");
}
else
{
if ((month == 1) && (date == 25)) document.write("距劳动妇女节还有十天！");
if ((month == 1) && (date == 26)) document.write("距劳动妇女节还有九天！");
if ((month == 1) && (date == 27)) document.write("距劳动妇女节还有八天！");
if ((month == 1) && (date == 28)) document.write("距劳动妇女节还有七天！");
}


if ((month == 2) && (date == 1)) document.write("距劳动妇女节还有六天！");
if ((month == 2) && (date == 2)) document.write("距劳动妇女节还有五天！");
if ((month == 2) && (date == 3)) document.write("距劳动妇女节还有四天！");
if ((month == 2) && (date == 4)) document.write("距劳动妇女节还有三天！");
if ((month == 2) && (date == 6)) document.write("距劳动妇女节还有二天！");
if ((month == 2) && (date == 7)) document.write("距劳动妇女节还有一天！");         
if ((month == 2) && (date == 8)) document.write("今天是国际劳动妇女节！");
//劳动节提醒

if ((month == 3) && (date == 21)) document.write("距劳动节还有十天！");
if ((month == 3) && (date == 22)) document.write("距劳动节还有九天！");
if ((month == 3) && (date == 23)) document.write("距劳动节还有八天！");
if ((month == 3) && (date == 24)) document.write("距劳动节还有七天！");
if ((month == 3) && (date == 25)) document.write("距劳动节还有六天！");
if ((month == 3) && (date == 26)) document.write("距劳动节还有五天！");
if ((month == 3) && (date == 27)) document.write("距劳动节还有四天！");
if ((month == 3) && (date == 28)) document.write("距劳动节还有三天！");
if ((month == 3) && (date == 29)) document.write("距劳动节还有二天！");
if ((month == 3) && (date == 30)) document.write("距劳动节还有一天！");
if ((month == 4) && (date == 1)) document.write("今天是国际劳动节！");
//儿童节提醒

if ((month == 4) && (date == 22)) document.write("距儿童节还有十天！");
if ((month == 4) && (date == 23)) document.write("距儿童节还有九天！");
if ((month == 4) && (date == 24)) document.write("距儿童节还有八天！");
if ((month == 4) && (date == 25)) document.write("距儿童节还有七天！");
if ((month == 4) && (date == 26)) document.write("距儿童节还有六天！");
if ((month == 4) && (date == 27)) document.write("距儿童节还有五天！");
if ((month == 4) && (date == 28)) document.write("距儿童节还有四天！");
if ((month == 4) && (date == 29)) document.write("距儿童节还有三天！");
if ((month == 4) && (date == 30)) document.write("距儿童节还有二天！");
if ((month == 4) && (date == 31)) document.write("距儿童节还有一天！");
if ((month == 5) && (date == 1)) document.write("今天是国际儿童节！");
//教师节提醒
if ((month == 7) && (date == 31)) document.write("距教师节还有十天！");
if ((month == 8) && (date == 1)) document.write("距教师节还有九天！");
if ((month == 8) && (date == 2)) document.write("距教师节还有八天！");
if ((month == 8) && (date == 3)) document.write("距教师节还有七天！");
if ((month == 8) && (date == 4)) document.write("距教师节还有六天！");
if ((month == 8) && (date == 5)) document.write("距教师节还有五天！");
if ((month == 8) && (date == 6)) document.write("距教师节还有四天！");
if ((month == 8) && (date == 7)) document.write("距教师节还有三天！");
if ((month == 8) && (date == 8)) document.write("距教师节还有二天！");
if ((month == 8) && (date == 9)) document.write("距教师节还有一天！");
if ((month == 8) && (date == 10)) document.write("今天是教师节！");
//国庆节提醒 
if ((month == 8) && (date == 21)) document.write("距国庆节还有十天！");
if ((month == 8) && (date == 22)) document.write("距国庆节还有九天！");
if ((month == 8) && (date == 23)) document.write("距国庆节还有八天！");
if ((month == 8) && (date == 24)) document.write("距国庆节还有七天！");
if ((month == 8) && (date == 25)) document.write("距国庆节还有六天！");
if ((month == 8) && (date == 26)) document.write("距国庆节还有五天！");
if ((month == 8) && (date == 27)) document.write("距国庆节还有四天！");
if ((month == 8) && (date == 28)) document.write("距国庆节还有三天！");
if ((month == 8) && (date == 29)) document.write("距国庆节还有二天！");
if ((month == 8) && (date == 30)) document.write("距国庆节还有一天！");           
if ((month == 9) && (date == 1)) document.write("今天是国庆节！");
//圣诞提醒  
if ((month == 11) && (date == 15)) document.write("距圣诞还有十天！");
if ((month == 11) && (date == 16)) document.write("距圣诞还有九天！");
if ((month == 11) && (date == 17)) document.write("距圣诞还有八天！");
if ((month == 11) && (date == 18)) document.write("距圣诞还有七天！");
if ((month == 11) && (date == 19)) document.write("距圣诞还有六天！");
if ((month == 11) && (date == 20)) document.write("距圣诞还有五天！");
if ((month == 11) && (date == 21)) document.write("距圣诞还有四天！");
if ((month == 11) && (date == 22)) document.write("距圣诞还有三天！");
if ((month == 11) && (date == 23)) document.write("距圣诞还有二天！");
if ((month == 11) && (date == 24)) document.write("距圣诞还有一天！");
if ((month == 11) && (date == 25)) document.write("圣诞快乐！");
document.write("</b></font>");  }  

function Notfiycheck()
{
	if(form1.NotifyTitle.value=="")
	{
		alert("公告标题不能为空!");
		form1.NotifyTitle.focus();
		return false;
	}
	if(frames.message.document.body.innerHTML=="")
	{
		alert("公告内容不能为空!");
		return false;
	}
form1.Content.value = frames.message.document.body.innerHTML;
//form1.submit();
}
function openlogin(url){
HeightValue=screen.height;
WidthValue=screen.width;
window.location.href=url;
window.moveTo(0,0);
window.resizeTo(WidthValue+6,HeightValue-23);
}
function setstyle(id){
var id;
if(id.className=='but'){
id.className='tddown';
switch(id){
case a1: say.saytext.style.fontWeight='bold';say.fontb.value='bold';break;
case a2: say.saytext.style.fontStyle='italic';say.fonti.value='italic';break;
case a3: say.saytext.style.textDecoration='underline';say.fontu.value='underline';break;
}}else{
id.className='but';
switch(id){
case a1: say.saytext.style.fontWeight='';say.fontb.value='';break;
case a2: say.saytext.style.fontStyle='';say.fonti.value='';break;
case a3: say.saytext.style.textDecoration='';say.fontu.value='';break;
}
}
}
function mover(id){
var id;
if(id.className=='')
id.className='but';
}
function mout(id){
var id;
if(id.className=='but')
id.className='';
}
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=='Netscape')&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf('?'))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}
function selectimg(image){
var image
document.say.saytext.value=document.say.saytext.value+image;
MM_showHideLayers('facelay','','hide');
}
function checkform()
{
 if(document.say.saytext.value==''){
alert('不能发送空信息');
 return false ;
 }else{
 minctrl.Click();
 this.document.say.submit();
 }
}
function center(){
if(event.ctrlKey && window.event.keyCode==13){checkform();}
if (window.say.saytext.value.length > 210) 
window.say.saytext.value = window.say.saytext.value.substring(0,210);
}
function show(id){
window.open('userinfo.asp?id='+id,'资料查看','width=364,height=228,top=200,left=300');
}
function showhis(){
if(document.say.histext.value=='聊天记录(H)'){
resizeTo(404,358);
document.say.histext.value='关闭记录(H)';
document.say.saytext.focus();
}else{
resizeTo(404,238);
document.say.histext.value='聊天记录(H)';
document.say.saytext.focus();
}
}
	function checkfrm_upload(){
		if(document.frm_upload.doc.value==""){
			alert("请选择要上传的附件！");
			return false;
		}
	}
function jg_onchange(){
jgnum=0;
if(document.form1.WS_wage.value==""||isNaN(document.form1.WS_wage.value))
{
alert("只能输入数字");
}
else
{
jgnum=jgnum+parseFloat(document.form1.WS_wage.value);
}
if(document.form1.WS_pay.value=="")document.form1.WS_pay.value=0
if(isNaN(document.form1.WS_pay.value))
{
alert("只能输入数字");
}
else
{
jgnum=jgnum+parseFloat(document.form1.WS_pay.value);
}
if(document.form1.WS_house.value=="")document.form1.WS_house.value=0
if(isNaN(document.form1.WS_house.value))
{
alert("只能输入数字");
}
else
{
jgnum=jgnum+parseFloat(document.form1.WS_house.value);
}
if(document.form1.WS_lunch.value=="")document.form1.WS_lunch.value=0
if(isNaN(document.form1.WS_lunch.value))
{
alert("只能输入数字");
}
else
{
jgnum=jgnum+parseFloat(document.form1.WS_lunch.value);
}
if(document.form1.WS_outpay.value=="")document.form1.WS_outpay.value=0
if(isNaN(document.form1.WS_outpay.value))
{
alert("只能输入数字");
}
else
{
jgnum=jgnum+parseFloat(document.form1.WS_outpay.value);
}
if(document.form1.WS_bonus.value=="")document.form1.WS_bonus.value=0
if(isNaN(document.form1.WS_bonus.value))
{
alert("只能输入数字");
}
else
{
jgnum=jgnum+parseFloat(document.form1.WS_bonus.value);
}
if(document.form1.WS_card.value=="")document.form1.WS_card.value=0
if(isNaN(document.form1.WS_card.value))
{
alert("只能输入数字");
}
else
{
jgnum=jgnum-parseFloat(document.form1.WS_card.value);
}
if(document.form1.WS_ratal.value=="")document.form1.WS_ratal.value=0
if(isNaN(document.form1.WS_ratal.value))
{
alert("只能输入数字");
}
else
{
jgnum=jgnum-parseFloat(document.form1.WS_ratal.value);
}
if(document.form1.WS_safe.value=="")document.form1.WS_safe.value=0
if(isNaN(document.form1.WS_safe.value))
{
alert("只能输入数字");
}
else
{
jgnum=jgnum-parseFloat(document.form1.WS_safe.value);
}
if(document.form1.WS_other.value=="")document.form1.WS_other.value=0
if(isNaN(document.form1.WS_other.value))
{
alert("只能输入数字");
}
else
{
jgnum=jgnum-parseFloat(document.form1.WS_other.value);
document.form1.WS_lastmoney.value=eval("jgnum");
}
}

