﻿//
//----------------------------------------------------------------------
//
//                          钱文田   2006-11-28
//
//                      各系统之间的对话框函数集合
//
//----------------------------------------------------------------------
//

//
// 用户注册
//
function upRegWin()
{
    var win_left, win_top;
    win_left = (screen.width-700) / 2;
    win_top = (screen.height - 460) / 2;
    var ret = window.open('../register/CompReg.aspx','','width=700,height=460,menu=no,status=no,resizable=no,scrollbars=no,left=' + win_left + ',top=' + win_top);
    if (!ret)
    {
        showMessage("error", "请设置您的浏览器让其允许本网站使用弹出窗口!");
    }
    
}

//
// 找回密码
//
function upPassWin()
{
    var win_left, win_top;
    win_left = (screen.width - 691) / 2;
    win_top = (screen.height - 432) / 2;
    var ret = window.open('../register/forgetpass.aspx', '', 'width=691,height=432,menu=no,status=no,resizable=no,scrollbars=no,left=' + win_left + ',top=' + win_top);
    if (!ret)
    {
        showMessage("error", "请设置您的浏览器让其允许本网站使用弹出窗口!");
    }
}

//
// 企业代码
//
function upCompcode(){
    var win_left, win_top;
    win_top =(screen.height - 518) / 2;
    win_left = (screen.width - 750) / 2;
    var ret = window.open('../register/zhengshu.html ','','width=750,height=518,menu=no,status=no,resizable=no,scrollbars=no,left=' + win_left + ',top=' + win_top);
    if (!ret)
    {
        showMessage("error", "请设置您的浏览器让其允许本网站使用弹出窗口!");
    }
}

//
// 企业验证卡
//
function upCompCard(){
    var win_left, win_top;
    win_top =(screen.height - 260) / 2;
    win_left = (screen.width - 410) / 2;
    var ret = window.open('../register/compcard.html ','','width=410,height=260,menu=no,status=no,resizable=no,scrollbars=no,left=' + win_left + ',top=' + win_top);
    if (!ret)
    {
        showMessage("error", "请设置您的浏览器让其允许本网站使用弹出窗口!");
    }
}

//
// 申请证书
//
function upPKIRequest(host, type ,usertype)
{
    var win_left, win_top, url;
    
    win_top = (screen.height - 500) / 2;
    win_left = (screen.width - 750) / 2;
    
    if (type == "file")
        url = host + "register/FileCertRegStep1.aspx?type=" + usertype;
    else if(type == "key")
        url = host + "register/KeyCertRegStep1.aspx?type=" + usertype;
        
    var ret = window.open(url, '','width=750,height=500,menu=no,status=no,resizable=no,scrollbars=no,left=' + win_left + ',top=' + win_top);
    if (!ret)
    {
        showMessage("error", "请设置您的浏览器让其允许本网站使用弹出窗口!");
    }
}

//
// 重置PKI密码
//
function upPKIPassWin(host, usertype)
{
    var win_left, win_top;
    win_left = (screen.width - 691) / 2;
    win_top = (screen.height - 432) / 2;
    var ret = window.open(host + 'register/IniKeyStep1.aspx?type=' + usertype, '', 'width=691,height=432,menu=no,status=no,resizable=no,scrollbars=no,left=' + win_left + ',top=' + win_top);
    if (!ret)
    {
        showMessage("error", "请设置您的浏览器让其允许本网站使用弹出窗口!");
    }
}

//
// 证书作废
//
function upPKICancle(host)
{
    var win_left, win_top, url;
    
    win_top = (screen.height - 500) / 2;
    win_left = (screen.width - 750) / 2;
    
    url = host + "register/PKICancle.aspx";
     
    var ret = window.open(url,'','width=750,height=500,menu=no,status=no,resizable=no,scrollbars=no,left=' + win_left + ',top=' + win_top);
    if (!ret)
    {
        showMessage("error", "请设置您的浏览器让其允许本网站使用弹出窗口!");
    }
}

//
// 文件证书
//
function upPKIFile(host)
{
    var win_left, win_top, url;
    win_top = (screen.height - 330) / 2;
    win_left = (screen.width - 508) / 2;
    
    url = host + "register/FBIntro.aspx";
    
    var ret = window.open(url,'','width=508,height=330,menu=no,status=no,resizable=no,scrollbars=no,left=' + win_left + ',top=' + win_top);
    if (!ret)
    {
        showMessage("error", "请设置您的浏览器让其允许本网站使用弹出窗口!");
    }
}

//
// 移动证书
//
function upPKIMobile(host)
{
    var win_left, win_top, url;
    
    win_top =(screen.height - 330) / 2;
    win_left = (screen.width - 508) / 2;
    
    url = host + "/register/MBIntro.aspx";
    
    var ret = window.open(url,'','width=508,height=330,menu=no,status=no,resizable=no,scrollbars=no,left=' + win_left + ',top=' + win_top);
    if (!ret)
    {
        showMessage("error", "请设置您的浏览器让其允许本网站使用弹出窗口!");
    }
}
//
//组件安装
//
function upPKISetUp(host)
{
    var win_left, win_top;
    win_top =(screen.height - 330) / 2;
    win_left = (screen.width - 508) / 2;
    var ret = window.open(host + 'help/pkisetup.htm','','width=508,height=330,menu=no,status=no,resizable=no,scrollbars=no,left=' + win_left + ',top=' + win_top);
    if (!ret)
    {
        showMessage("error", "请设置您的浏览器让其允许本网站使用弹出窗口!");
    }
}

//
// 满屏弹出指定URL窗口
//
function OpenWin(newWinUrl)
{
    var width = screen.availWidth - 10;
    var height = screen.availHeight - 30;
    var ret = window.open(newWinUrl, "", "fullscreen=0,toolbar=0,location=0,directories=0,status=yes,menubar=0,scrollbars=yes,resizable=1,top=0,left=0,width=" + width + ",height=" + height + "");
    if (!ret)
    {
        showMessage("error", "请设置您的浏览器让其允许本网站使用弹出窗口!");
    }
}

//
// 显示部门联系信息
//
function upDeptpInfo(deptcode)
{
    var win_left, win_top;
    win_top =(screen.height - 250) / 2;
    win_left = (screen.width - 258) / 2;
    var ret = window.open('../comp/DeptContactInfo.aspx?deptcode=' + deptcode,'','width=418,height=350,menu=no,status=no,resizable=no,scrollbars=no,left=' + win_left + ',top=' + win_top);
    if (!ret)
    {
        showMessage("error", "请设置您的浏览器让其允许本网站使用弹出窗口!");
    }
}

//////////////////////////////////////////////                            
//                                          //
//        审核版中用到的弹出窗口            //
//                                          //
//////////////////////////////////////////////


//
// 显示企业联系信息
//
function upCompInfo(compcode)
{
    var win_left, win_top;
    win_top =(screen.height - 250) / 2;
    win_left = (screen.width - 258) / 2;
    var ret = window.open('../dept/CompContactInfo.aspx?compcode=' + compcode,'','width=418,height=350,menu=no,status=no,resizable=no,scrollbars=yes,left=' + win_left + ',top=' + win_top);
    if (!ret)
    {
        showMessage("error", "请设置您的浏览器让其允许本网站使用弹出窗口!");
    }
}

//
// 查看审核历史记录
//
function upAuditHistory(compcode)
{
    var ret = window.open('../dept/audit_record.aspx?compcode=' + compcode);
    if (!ret)
    {
        showMessage("error", "请设置您的浏览器让其允许本网站使用弹出窗口!");
    }
}

//
// 查看复核验证码
//
function upAuditYzm()
{
    var win_left, win_top;
    win_top =(screen.height - 200) / 2;
    win_left = (screen.width - 300) / 2;
    var ret = window.open('../dept/check_yzm.htm','','width=300,height=200,menu=no,status=no,resizable=no,scrollbars=no,left=' + win_left + ',top=' + win_top);
    if (!ret)
    {
        showMessage("error", "请设置您的浏览器让其允许本网站使用弹出窗口!");
    }
}

//
// 查看复核条形码
//
function upAuditTxm()
{
    var win_left, win_top;
    win_top =(screen.height - 240) / 2;
    win_left = (screen.width - 300) / 2;
    var ret = window.open('../dept/check_txm.htm','','width=300,height=200,menu=no,status=no,resizable=no,scrollbars=no,left=' + win_left + ',top=' + win_top);
    if (!ret)
    {
        showMessage("error", "请设置您的浏览器让其允许本网站使用弹出窗口!");
    }
}
//
// 根据名称查找企业
//
function upSearchComp(obj1,obj2,gsname,gscode)
{
    var win_left, win_top;
    win_left = (screen.width-800) / 2;
    win_top = (screen.height - 460) / 2;
    var k = window.showModalDialog("../dept/bjcheckdata_searchcomp.aspx?code="+gscode,gsname,"width=800,height=460,menu=no,status=no,resizable=no,scrollbars=no,left=" + win_left + ",top=" + win_top);
	
	if(k != undefined )
	{
		obj1.value=k[0]
		obj2.innerHTML=k[1]
	}
}

/*会计师事务所占位 start in 2007.1.10 */
//
// 选择会计师事务所URL窗口
//
function upCpaListWin(obj1, obj2, Region)
{
    var win_left, win_top;
    win_left = (screen.width-800) / 2;
    win_top = (screen.height - 460) / 2;
    var k = window.showModalDialog("../comp/SelectCpa.aspx?Region="+Region,window,"width=800,height=460,menu=no,status=no,resizable=no,scrollbars=no,left=" + win_left + ",top=" + win_top);
	
	if(k != undefined )
	{
		window.document.getElementById(obj1).value=k[0]
		window.document.getElementById(obj2).value=k[1]
	}
    
}
//
// 会计师事务所用户注册
//
function upCpaNormalRegWin()
{
    var win_left, win_top;
    win_left = (screen.width-700) / 2;
    win_top = (screen.height - 500) / 2;
    var ret = window.open('../register/NormalReg1.aspx ','','width=700,height=500,menu=no,status=no,resizable=no,scrollbars=no,left=' + win_left + ',top=' + win_top);
    if (!ret)
    {
        showMessage("error", "请设置您的浏览器让其允许本网站使用弹出窗口!");
    }
    
}
//
// 企业详细信息页
//
function upCompInfoWin(_compcode)
{
    var win_left, win_top;
    win_left = (screen.width-399) / 2;
    win_top = (screen.height - 292) / 2;
    var ret = window.open('../cpa/CompDetail.aspx?compcode='+_compcode,'','width=399,height=310,menu=no,status=no,resizable=no,scrollbars=no,left=' + win_left + ',top=' + win_top);
    if (!ret)
    {
        showMessage("error", "请设置您的浏览器让其允许本网站使用弹出窗口!");
    }
}
//
// 企业日志信息页
//
function upLogInfoWin(_id)
{
    var win_left, win_top;
    win_left = (screen.width - 399) / 2;
    win_top = (screen.height - 292) / 2;
    var ret = window.open('../cpa/compLogInfo.aspx?id='+_id,'','width=399,height=292,menu=no,status=no,resizable=no,scrollbars=no,left=' + win_left + ',top=' + win_top);
    if (!ret)
    {
        showMessage("error", "请设置您的浏览器让其允许本网站使用弹出窗口!");
    }
}


/*会计师事务所占位 end  in 2007.1.10 */
