<html>
<head>
<title>15_FileBackupDone.v1.06</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="css.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
#Layer1 {	position:absolute;
	left:532px;
	top:6px;
	width:21px;
	height:23px;
	z-index:10;
}
-->
</style>
</head>
<script language="javascript" src="js/comm.js" type="text/javascript"></script>
<script language="javascript">
// import js document
	_import("control");
	_import("product");_import("function");
	//_import("main_only");
	
	
	_import("webmenuevent");
</script>
<script language="javascript" src="aol.js"></script>
<script language="javascript" src="errorcode.js"></script>
<script>
var XMLRA=new xmlResourceAgent("EFB_xmlStrings.xml",langType);
</script>
<script language="javascript">
if(FarstoneProductFlag_md=="DCPER")
{
	document.write('<OBJECT tabindex="-1" id="fileBackupCom" style="WIDTH: 0px; HEIGHT: 0px" 		classid="clsid:E8F2A56C-BD3A-4369-AC28-2A6992A4FCBB" VIEWASTEXT></OBJECT>');
}
else if(FarstoneProductFlag_md=="DCPRO" || FarstoneProductFlag_md=="DCSER")
{
	document.write('<OBJECT tabindex="-1" id="fileBackupCom" style="WIDTH: 0px; HEIGHT: 0px" 		classid="clsid:E8F2A56C-BD3A-4369-AC28-2A6992A4FC84" VIEWASTEXT></OBJECT>');
}
</script>

<OBJECT tabindex="-1" ID="RitForAsp1"
 CLASSID="CLSID:077257D1-BA60-4D34-8EA2-7737C3134F58" style="width:0px; height:0px;">
</OBJECT>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onkeydown="return testKey(event.keyCode)" style="overflow:hidden;">
<!-- ImageReady Slices (15_FileBackupDone.v1.06.jpg) -->
<table width="554" height="571" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td valign="top"  ><table width="554" height="48" border="0" cellpadding="0" cellspacing="0" >
      <tr>
        <td width="513">&nbsp;</td>
        <td width="41" valign="top"><table width="41" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td height="5"><img src="" width="1" height="1" alt="" /></td>
          </tr>
          <tr>
            <td style="padding-left:18PX;"><table width="17" height="18" border="0" cellpadding="0" cellspacing="0">
              <tr>
                <td width="17" class="tinnytext"  >&nbsp;</td>
              </tr>
            </table></td>
          </tr>
        </table></td>
      </tr>
    </table>
        <table width="535" height="507" border="0" align="center" cellpadding="0" cellspacing="0">
          <tr>
            <td align="center" valign="top"><table width="530" height="500" border="0" cellpadding="0" cellspacing="0">
                <tr>
                  <td valign="top"><table width="528" border="0" cellspacing="0" cellpadding="0">
                      <tr>
                        <td width="528" class="arial22blue" style="padding-top:10px; padding-left:8px;"><span id="EFB_AFF_Title"></span> <span id="filebackupname"></span> </td>
                      </tr>
                      <tr>
                        <td class="arial22blue" style="padding-left:8px;"><table width="97%" border="0" cellspacing="0" cellpadding="0" style="border-top:1px solid #858E9E">
                            <tr>
                              <td>&nbsp;</td>
                            </tr>
                        </table></td>
                      </tr>
                      <tr>
                        <td class="arial22blue" style="padding-left:18px; height: 13px;"><strong class="Arial12blackbold" id="EFB_AFF_Waiting"></strong></td>
                      </tr>
                      <tr>
                        <td class="arial22blue" style="padding-left:8px;"><table width="504" border="0" cellspacing="0" cellpadding="0">
                          <tr>
                            <td width="252"><table width="430" border="0" cellspacing="0" cellpadding="0" style="margin-left:10px;">
                                <tr>
                                  <td width="2" valign="top" class="arial11black"><img src="images/progressleft.jpg" width="2" height="15" /></td>
                                  <td width="425" valign="top" background="images/progresswaiting.jpg" class="arial11black" style="background-position:top; background-repeat:repeat-x;"><img src="images/progressfinished.jpg" name="progressBlue" width="1" height="15" id="progressBlue" /></td>
                                  <td width="2" valign="top" class="arial11black"><img id="progress_left" src="images/progressright.jpg" width="2" height="15" /></td>
                                </tr>
                            </table></td>
                            <td width="252" align="center" id="cancelTd">
							<button id="Btn_Cancel" cstyle="rit" onClick="Cancelp();" >&nbsp;</button>
							</td>
                          </tr>
                        </table></td>
                      </tr>
                      <tr>
                        <td class="Arial12black" style="padding-left:18px;" id="progressinfo"></td>
                      </tr>

                  </table></td>
                </tr>
            </table></td>
          </tr>
      </table></td>
  </tr>
</table>

<!-- End ImageReady Slices -->
<script language=vbscript>
sub fileBackupCom_BackupInfo(id, msg)  
    call EFBEventFunction(id,msg)
end sub
</script>


<script language="javascript">

var canceled=false;
var ipro=0;
var cNum;
function go90()
{

	if (canceled)
	{
		return;
	}
	var obj1
	ipro= fileBackupCom.GetCreateProjectPoint()
	//ipro++;
	if (ipro>=99)
	{
    	document.getElementById("cancelTd").innerHTML='<img src="images/createcancel_disabled.jpg" width="59" height="21" border="0">';
	}
	obj1=document.getElementById("progressBlue");
	obj1.style.width=425*(ipro/100)+"px";
	//document.getElementById("progressinfo").innerHTML=""
	if (ipro<100)
	{
		timeOut1=setTimeout("go90()",300);
	}
	else
	{
		//parent.demaskLeftMenu();
		$("progressinfo").innerHTML="";
		setTimeout("jumpToSelectDst()",500)
		//window.location="FileBackupDestination.htm";
	}
}
var fileSize
var diskLeftSize
function jumpToSelectDst()
{
	fileBackupCom.SetFileVerNumber(js_request("name"),cNum);
	saveMaxVersionNumber();
	fileSize=fileBackupCom.GetTotalFileSize(js_request("name"));
	diskLeftSize=fileBackupCom.GetSpaceSize(js_request("name"));
	if (diskLeftSize!=0 && fileSize-diskLeftSize>0)
	{
		DC3RIT_popMsg('',280,148,'ok',XMLRA.getString("EFB_AFF_NotEnoughSpace"),'alert');
		window.external.OnClose();
		return;
	}
    //fileSize="650";
    setTimeout("goSelectDST()",500);
}
function goSelectDST()
{
            window.external.SetStaticData("later");
			//alert(Request("name"))
    		window.external.Navigate("mainui/createibp/addFileConfirm.htm?name="+Request("name"),264,208);
			var createNowRst=window.external.GetStaticData();
			if (createNowRst=="later")
			{
				window.location="fileselectdonepop.htm?name="+Request("name");
			}
			else
			{
				window.location="filebackupprogresspop.htm?name="+Request("name");
			}
	//window.location="FileBackupDestination.htm?name="+escape(js_request("name"))+"&size="+fileSize;
}

document.body.onload=function()
{
    InitPage();
	if(FarstoneProductFlag_md=="DCPRO" || FarstoneProductFlag_md=="DCSER")
	{
		fileBackupCom.SetProductModule(0);
	}
	else if(FarstoneProductFlag_md=="DCPER")
	{
		fileBackupCom.SetProductModule(1);
	}
	cNum=js_request("cNum")
    var EFBProjectNameToDisplay=js_request("name");
	document.getElementById("filebackupname").title=EFBProjectNameToDisplay;
    EFBProjectNameToDisplay=(getCuttedString(EFBProjectNameToDisplay,18,18));
	document.getElementById("filebackupname").innerHTML=EFBProjectNameToDisplay;
	
	setTimeout("efbEditProject()",1000);
}
function InitPage()
{
$("EFB_AFF_Title").innerHTML=XMLRA.getString("EFB_AFF_Title");
$("EFB_AFF_Waiting").innerHTML=XMLRA.getString("EFB_AFF_Waiting");
$("Btn_Cancel").innerHTML=XMLRA.getString("Button_Cancel");
$("progressinfo").innerHTML=XMLRA.getString("EFB_AFF_Note");

}
function efbEditProject()
{
	fileBackupCom.EditProject(js_request("name"));
	go90();
}

function Cancelp()
{
    document.getElementById("cancelTd").innerHTML='<img src="images/createcancel_disabled.jpg" width="59" height="21" border="0">';
	setTimeout(goPPage(),1000)



}

function goPPage()
{
	return function()
	{
		var stopResult=fileBackupCom.StopEditProject(Request("name"));
    
    	if (stopResult==0)
    	{
	    	//parent.demaskLeftMenu();
	    	canceled=true;
	    	window.external.OnClose();
		}
		else
		{
	    	DC3RIT_popMsg('',280,128,'ok',XMLRA.getString("EFB_AFF_FailedCancel"),'alert');
	    	document.getElementById("cancelTd").innerHTML='<a href="javascript:Cancelp();" ><img src="images/createcancel.jpg" width="59" height="21" border="0"></a>'
		}
	}
}



var isMove=true;
var isClose=false;
function moveWindow()
{
	if (isMove)
	{
		window.external.OnMoveWindow();
	}
}


function testKey(id)
{
    if(id==27)
    {
        closeSubWindow()
        return false;
    }
}

function closeSubWindow()
{
    if (isClose)
    {
        window.external.OnClose();
    }
}


function EFBEventFunction(id, msg) 
{
    
    if (id==4)
    {
		getEfbMsg(msg);
    }
}

function editFailedAction( msg)
{
    return function()
    {
        DC3RIT_popMsg('',280,128,'ok',msg,'alert');
        isClose=true;
        window.external.OnClose();
    }
}

function saveMaxVersionNumber()
{
		var maxVarNum=parseInt(fileBackupCom.GetAllProjectMaxVer())
		if (maxVarNum==0)
		{
			maxVarNum=1;
		}
		flbsettingCom = RitForAsp1.RitReadTactic(3);
		flbsettingCom=flbsettingCom.replace(/\<num\>[\d]*\<\/num\>/,"<num>"+maxVarNum+"</num>")
		try
		{
			var saveTacticResult=RitForAsp1.RitSaveTactic(3,flbsettingCom)
		}
		catch(e)
		{
			//alert("Failed to save file version number!");
			DC3RIT_popMsg('',264,135,'ok',XMLRA.getString("EFB_AFF_FailedSaveVNumber"),'alert');
		}
		if (saveTacticResult!=0)
		{
			//alert("Failed to save file version number!");
			DC3RIT_popMsg('',264,135,'ok',XMLRA.getString("EFB_AFF_FailedSaveVNumber"),'alert');
		}
}
</script>
</body>
</html>