/*****************************************************************************
函数名称：OpenContent
处理机能：打开附件或内容窗口
参数	：id  对象id
日期	：2006
作者    ：王勇明
修改人-------修改日--------概要--------------------------
******************************************************************************/
function OpenContent(url)
{
	ContentWindow=window.open(url,"_blank","width=620,height=500,directories=no,status=yes,scrollbars=yes,resizable=yes,menubar=no,top=0,left=100")
}
/*****************************************************************************
函数名称：OpenDocNewShow
处理机能：打开公文签批栏
参数	：id  对象id
日期	：2004
作者    ：伍华峰
修改人-------修改日--------概要--------------------------
******************************************************************************/
function OpenDocNewShow(url)
{
		ContentWindow=window.open(url,"_blank","width=680,height=500,directories=no,status=yes,scrollbars=yes,resizable=yes,menubar=yes,top=0,left=100")
}
/*****************************************************************************
函数名称：OpenNew
处理机能：控制页面中HTML对象的显示和隐藏
参数	：id  对象id
日期	：2003/03/04
作者    ：尹凯

修改人-------修改日--------概要--------------------------
******************************************************************************/
function OpenNew(url)
{
		ContentWindow=window.open(url,"_blank","width=400,height=300,directories=no,status=yes,scrollbars=yes,resizable=yes,menubar=no,top=180,left=250")		
}

/*****************************************************************************
函数名称：OpenNewNoResize
函数功能：打开一个新的窗口

参数	：url 新窗口的链接地址
日期	：2004-1-07
作者    ：赵国涛
修改人  ：

修改日  ：

******************************************************************************/
function OpenNewNoResize(url)
{
		ContentWindow=window.open(url,"_blank","width=625,height=455,directories=no,status=yes,scrollbars=yes,resizable=no,menubar=no,top=10,left=100")
}


/*****************************************************************************
函数名称：OpenNewWin
函数功能：打开一个新的窗口

参数	：url 新窗口的链接地址
日期	：2003-11-07
作者    ：金晶

修改人  ：

修改日  ：

******************************************************************************/
function OpenNewWin(url)
{
		ContentWindow=window.open(url,"_blank","width=600,height=450,directories=no,status=yes,scrollbars=yes,resizable=yes,menubar=no,toolbar=no,location=no,top=40,left=40")
}


/*****************************************************************************
函数名称：TraceWin
处理机能：控制页面中HTML对象的显示和隐藏
参数	：id  对象id
日期	：2003/11/14
作者    ：郭景瞻
修改人-------修改日--------概要--------------------------
******************************************************************************/
function TraceWin(url)
{
		ContentWindow=window.open(url,"_blank","width=620,height=410,directories=no,status=yes,scrollbars=yes,resizable=no,menubar=no,top=20,left=100")
}

/*****************************************************************************
函数名称：OpenNewLen
处理机能：弹出新窗口
参数	：周敏

日期	：2003/11/04
作者    ：

修改人  ：

修改日  ：

******************************************************************************/
function OpenNewLen(url,wLen,hLen)
{
		var leftLen = screen.width/2-wLen/2;
		var topLen = screen.height/2-hLen/2-30;
		ContentWindow=window.open(url,"_blank","width="+wLen+",height="+hLen+",directories=no,status=yes,scrollbars=yes,resizable=yes,menubar=no,top="+topLen+",left="+leftLen)
}

/*****************************************************************************
函数名称：OpenSubWin
函数功能：打开一个新的模态窗口

参数 ：newURL 新窗口的链接地址
日期 ：2003-11-07
作者    ：金晶

修改人  ：

修改日  ：

******************************************************************************/
function OpenSubWin(newURL)
{
   try
   {
        //初始化变量，用于接收页面反回值。

        var recdata=false;
        //模式窗口打开指定的窗口链接

        recdata=showModalDialog(newURL,"DescWindow","dialogWidth:645px;dialogHeight:325px;center:1;scroll:1;help:0;status:0");

        //判断对应的值返回

        if(recdata==true)
        {
             //关闭当前窗口
              //parent.mainFrame.
              window.opener.location.reload(); //刷新父窗口

              window.close();
        }
        else
        {
            //刷新当前窗口
            window.location.reload();
        }

   }

    catch(err)

    {}

}


/*****************************************************************************
函数名称：OpenSealWin
函数功能：打开一个新的模态窗口（用于书生控件页面的打开）

参数 ：newURL 新窗口的链接地址
日期 ：2004-03-15
作者    ：郭景瞻
修改人  ：

修改日  ：

******************************************************************************/
function OpenSealWin(newURL)
{
   try
   {
        //初始化变量，用于接收页面反回值。

        var recdata=false;
        var width=0.8*screen.width;
        var height=0.8*screen.height;

        //模式窗口打开指定的窗口链接

        recdata=showModalDialog(newURL,"DescWindow","resizable:yes;dialogWidth:"+width+";dialogHeight:"+height+";center:1;scroll:1;help:0;status:0");

        //判断对应的值返回

        if(recdata==true)
        {
             //关闭当前窗口
              window.opener.location.reload(); //刷新父窗口

              window.close();
        }
        else
        {
            //刷新当前窗口
            window.location.reload();
        }

   }

    catch(err)

    {}

}

/*****************************************************************************
函数名称：OpenSubMeetingWin
函数功能：打开一个新的模态窗口

参数 ：newURL 新窗口的链接地址
日期 ：2003-11-07
作者    ：金晶

修改人  ：

修改日  ：

******************************************************************************/
function OpenSubMeetingWin(newURL,wLen,hLen)
{
   try
   {
        //初始化变量，用于接收页面反回值。

        var recdata=false;
        //模式窗口打开指定的窗口链接

        recdata=showModalDialog(newURL,"DescWindow","dialogWidth:"+wLen+"px;dialogHeight:"+hLen+"px;center:1;scroll:1;help:0;status:0");

        //判断对应的值返回

        if(recdata==true)
        {
             //关闭当前窗口
              //parent.mainFrame.
              window.opener.location.reload(); //刷新父窗口

              window.close();
        }
        else
        {
            //刷新当前窗口
            window.location.reload();
        }

   }

    catch(err)

    {}

}

/*****************************************************************************
函数名称：OpenSign
函数功能：督办系统打开一个新的模态窗口

参数 ：newURL 新窗口的链接地址
日期 ：2003-12-03
作者    ：周敏

修改人  ：

修改日  ：

******************************************************************************/
function OpenSign(newURL,wLen,hLen)
{
   try
   {
        //初始化变量，用于接收页面反回值。

        var recdata=false;
        //模式窗口打开指定的窗口链接

        recdata=showModalDialog(newURL,"DescWindow","dialogWidth="+wLen+"px;dialogHeight="+hLen+"px;center=1;scroll=1;help=0;status=0");

        //判断对应的值返回

        if(recdata==true)
        {
             //关闭当前窗口
              //parent.mainFrame.
              opener.location.reload(); //刷新父窗口

              window.close();
        } 
   }

    catch(err)

    {}

}

/*****************************************************************************
函数名称：OpenSign
函数功能：公文流转系统打开一个没有返回值的新的模态窗口

参数 ：newURL 新窗口的链接地址
日期 ：2003-12-28
作者    ：金晶

修改人  ：

修改日  ：

******************************************************************************/
function OpenDocRead(newURL,wLen,hLen)
{
   try
   {
        //初始化变量，用于接收页面反回值。

        var recdata=false;
        //模式窗口打开指定的窗口链接

        recdata=showModalDialog(newURL,"DescWindow","dialogWidth:700px;dialogHeight:450px;center=1;scroll=1;help=0;status=0");
       
   }

    catch(err)

    {}

}

/*****************************************************************************
函数名称：EWordTitleWidth
函数功能：控制英文显示在DataGrid中的换行
参数	：str8Width  800分辨率下的换行宽度

参数	：strOtherWidth  其他分辨率下的换行宽度

日期	：2004-01-12
作者    ：金晶

修改人  ：

修改日  ：

******************************************************************************/
function EWordTitleWidth(str8Width,strOtherWidth)
{
   var strTDStyle="";
   if(screen.width==800)
   {
     strTDStyle="<style type='text/css'>.tdTitle1{word-wrap:break-word;width="+str8Width+";}</style>";
     document.write (strTDStyle);
   }
   else
   {
     strTDStyle="<style type='text/css'>.tdTitle1{word-wrap:break-word;width="+strOtherWidth+";}</style>";
     document.write (strTDStyle);
   }
}

/*****************************************************************************
函数名称：FreshTextWidth
函数功能：控制刷新后文本框显示的宽度
参数	：str8Width  800分辨率下的换行宽度

参数	：strOtherWidth  其他分辨率下的换行宽度

日期	：2004-01-12
作者    ：金晶

修改人  ：

修改日  ：

******************************************************************************/
function FreshTextWidth(str8Width,strOtherWidth)
{
   var strTDStyle="";
   if(screen.width==800)
   {
     strTDStyle="<style type='text/css'>.FreshInput1{ COLOR: #444444;FONT-FAMILY: 宋体;FONT-SIZE: 9pt; HEIGHT: 18px;width="+str8Width+";}</style>";
     document.write (strTDStyle);
   }
   else
   {
     strTDStyle="<style type='text/css'>.FreshInput1{ COLOR: #444444;FONT-FAMILY: 宋体;FONT-SIZE: 9pt; HEIGHT: 18px;width="+strOtherWidth+";}</style>";
     document.write (strTDStyle);
   }
}


/*****************************************************************************
函数名称：OpenMemorablia
处理机能：大事记的打开连接
参数	：id  对象id
日期	：2004/01/13
作者    ：郭景瞻
修改人-------修改日--------概要--------------------------
******************************************************************************/
function OpenMemorablia(url)
{
		ContentWindow=window.open(url,"_blank","width=620,height=500,directories=no,status=yes,scrollbars=yes,resizable=no,menubar=no,top=0,left=100")
}


/*****************************************************************************
函数名称：BySubString
函数功能：根据客户端屏幕大小确定截取字符串数
参数	：strTitle	被截取的字符串

参数	：iLen800	800*600下的截取字符串数
参数	：iLen1024  1024*768下的截取字符串数
日期	：2004-01-29
作者    ：罗慧琴
修改人  ：

修改日  ：

******************************************************************************/
function BySubString(strTitle,iLen800,iLen1024)
{
	var str = strTitle;
	if (screen.width > 800)
	{
		if (strTitle.length > iLen1024)
		{
			str = strTitle.substring(0,iLen1024) + "…";
		}
	}
	else
	{
		if (strTitle.length > iLen800)
		{
			str = strTitle.substring(0,iLen800) + "…";
		}
	}
	document.write(str);
}

/*****************************************************************************
函数名称：GetCert
函数功能：获取用户签名证书信息

日期	：2004-02-12
作者    ：金晶

修改人  ：

修改日  ：

******************************************************************************/
function GetCert()
{
  document.all.item("CertArea").value=document.all.item("EKey").EnumContainer(1);
  document.all.item("CertArea").value="";
  document.all.item("CertArea").value=document.all.item("EKey").GetMyPKey();
}

/*****************************************************************************
函数名称：VerifyElectronSign
函数功能：验证签批意见的签名
参数	：strPlanTextArea	签批的原始意见

参数	：strCipherTextArea	电子签名数据
日期	：2004-02-12
作者    ：金晶

修改人  ：

修改日  ：

******************************************************************************/
function VerifyElectronSign(strPlanTextArea,strCipherTextArea)
{
   try
	{
	  if(strPlanTextArea!="")
	  {
	    RC=document.all.item("EKey").VerifySignString(document.all.item("CertArea").value, strPlanTextArea, strCipherTextArea);
	    document.write(strPlanTextArea);
	    }
	    else
	    {
	       document.write ("");
	    }
	  }
	  catch(err)
	  {
	    document.write ("error")
	  }
	
}