

<div class="upObj detailCon detailConMorePad">
	<ul class="line">
		<li class="line lineG">
			<label class="des desD">{%label.upCurrHard%}</label>
			<label class="des desG" id="devName">---</label>
		</li>
		<li class="line lineG">
			<label class="des desD">{%label.upCurrSoftVer%}</label>
			<label class="des desG" id="curVer">v1.0</label>
		</li>
		<li id="ispVer" class="line lineG">
			<label class="des desD">{%label.ispVersion%}</label>
			<label class="des desG">v1.0</label>
		</li>
		<li class="line lineG">
			<label class="des desD">{%label.onlineUpgrade%}</label>
			<input type="button" id="onlineUpgradeCheck" value="{%label.fwCheckUpdate%}" class="subBtnB btnA" />
			<img class="loading disNone"  id="chkPic" src="../web-static/images/loading.gif" />
			<label class="des desH disNone" id="chkTip">{%label.fwCheckUpdating%}</label>
			<label class="des desH disNone" id="hsNewFw">{%label.hsUpgradeFw%}</label>
			<label class="des desH disNone" id="noNewFw">{%label.notFindNewFw%}</label>
		</li>
		<li class="line lineG">
			<label class="des desD">{%label.chooseFw%}</label>
			<form enctype="multipart/form-data" id="upFileForm" method="post" target="uploadIf">
				<div class="fileDiv">
					<iframe id="uploadIf" name="uploadIf"></iframe>
					<input type="text" id="textfield" class="text textB7" readonly="true" />
					<input type="button" value="{%btn.browse%}" class="subBtnB btnA brower" />
					<input type="file" class="file" name="filename" id="fileName" />
				</div>
			</form>
			<input type="button" id="sysUpgrade" class="subBtnB btnA" value="{%btn.fwUpgrade%}" />
		</li>
		<li  class="line lineG">
			<label class="des desD"> </label>
			<label class="des desF">{%label.upgradeDescTipPart1%}<a id="download_sw" href = "javascript:;">{%label.downloadCenter%}</a>{%label.upgradeDescTipPart2%}</label>
		</li>
	</ul>
</div>
<script type="text/javascript">function init(){function t(a){showProgBar(a,statusStr.rebootingForUpgrade,function(){lanDetecting(function(){window.location.reload()})},!0,statusStr.rebootingForUpgradeTip)}function z(a){var b="";switch(parseInt(a)){case ENONE:return!0;case EINVSENDREQMSGFAILED:b=errStr.invSendReqMsgFailed;break;case ESYSBUSY:case EINVLASTOPTIONISNOTFINISHED:b=errStr.invLastOptionIsNotFinished;break;case ESYSTEM:b=errStr.invRequestFail;break;case ENOMEMORY:b=errStr.invMemoryOut;break;case EINVGETDATAFAILED:b=errStr.invGetDataFailed;
break;case EINVPARAMETER:b=errStr.invParameter;break;case EINVREQUESTTIMEOUT:b=errStr.invRequestTimeout;break;case EINVDEVICEIDNOTEXIST:case EINVERRORDEVICEIDFORMATERROR:case EINVILLEGALDEVICE:b=label.cloudDeviceInfoExpt;break;default:a=cloudErrHandle(a),b=!1==a.result?a.tip:errStr.invRequestFail}k.style.display="none";m.style.display="none";showAlert(b);return!1}function A(){var a=u.value;return""==a?(showAlert(label.upWarn),!1):-1==a.search(/\.bin$/)?(showAlert(errStr.fileFmttErr),!1):!0}function v(){q=
!0;id("uploadIf").onload=null;closeLoading();closeProgBar();clearTimeout(n);showAlert(errStr.upGradeFail);closeToast();id("uploadIf").contentWindow.location.reload();t(REBOOT_SECONDS)}function B(a,b){var e=b.wait_time,f=0;closeToast();if(!0!=q)if(clearTimeout(n),n=null,closeLoading(),ENONE==a)f=e?1E3*parseInt(e):SYSUPGRADE_SECONDS,showProgBar(f,label.upgrading,function(){lanDetecting(function(){window.location.reload()})},!0,void 0,statusStr.upgradeOk,statusStr.upgradeTip);else{a:{switch(a){case ENONE:f=
!0;break a;case EFWEXCEPTION:case EFWNOTSUPPORTED:case EFILETOOBIG:c=errStr.fwFmtErr;break;case EFWNOTINFLANDBL:case EFWNEWEST:c=errStr.fwNotSupported;break;case IPCUMGUESTNAUTH:c=errStr.invPermissionDenied;break;case EINVMEMORYOUT:case EINVDOWNLOADFWFAILED:case EINVSENDREQMSGFAILED:case EINVREQUESTTIMEOUT:case EINVCONNECTTINGCLOUDSERVER:case EINVLASTOPTIONISNOTFINISHED:case ESYSBUSY:c=errStr.fwDownLoadFailed;break;case EFWUNKNOWNBLOCKTYPE:c=errStr.fwUnknownBlockType;break;case EFWISPDATA:c=errStr.fwISPDataErr;
break;default:c=errStr.fwUpgradeFailed}f=!1}f||(e?(f=1E3*parseInt(e),t(f)):showAlert(c))}}function C(){showCover(function(){var a=id("newFwObj");null==a&&(a=document.createElement("div"),a.id="newFwObj",a.innerHTML='<div class="updateShowDiv" id="updateShowDiv"><p class="newVer">'+label.findNewFw+'<span id="newVer"></span></p><div class="updateInfo"><p>'+label.upgradeLog+'<span id="updateTime"></span></p><p class="updateNote" id="updateNote"></p><p class="slideDown" id="slideDown">...<span>'+label.slideDown+
'</span></p></div><div class="btnFun"><input type="button" id="cancelUpgrade" class="subBtn btnA" value="{%btn.cancel%}" /><input type="button" id="onlineUpgrade" class="subBtnB btnA" value="{%btn.fwStartUpgrade%}" /></div></div>',document.body.appendChild(a));h=id("updateNote");p=id("slideDown");a.style.visibility="visible";a.style.top="210px";id("cancelUpgrade").onclick=function(){hideCover(function(){a.style.top="-9999px";a.style.visibility="hidden"})};id("onlineUpgrade").onclick=function(){hideCover(function(){a.style.top=
"-9999px";a.style.visibility="hidden"});D()}})}function E(a,b,e){var f=0;!0==e?!0==a&&(w.style.display="inline-block"):!1==a?r.style.display="inline-block":(C(),upgradeInfo=b[uciCloudConfig.fileName][uciCloudConfig.secName.upgradeInfo],id("newVer").innerHTML=upgradeInfo[uciCloudConfig.optName.version].split(" ")[0],h.innerHTML=upgradeInfo[uciCloudConfig.optName.releaseLog].replace(/\\n/gi,"<br/>"),id("updateTime").innerHTML=upgradeInfo[uciCloudConfig.optName.releaseDate],h.style.height="auto",f=parseInt(getNodeDefaultView(h,
"height")),80<f?(h.style.height="72px",p.style.display="block",p.onclick=function(){this.style.display="none";$("#updateNote").animate({height:f+"px"})}):p.style.display="none")}function x(a){var b={},e=0;b[uciDeviceInfo.fileName]={};b[uciDeviceInfo.fileName][KEY_NAME]=[uciDeviceInfo.secName.basicInfo,uciDeviceInfo.secName.info];b[uciCloudConfig.fileName]={};b[uciCloudConfig.fileName][KEY_NAME]=[uciCloudConfig.secName.newFirmware,uciCloudConfig.secName.upgradeInfo];$.query(b,function(b){var c,d,l;
if(ENONE==b[ERR_CODE])if(l=b[uciDeviceInfo.fileName][uciDeviceInfo.secName.basicInfo],c=b[uciDeviceInfo.fileName][uciDeviceInfo.secName.info],d=b[uciCloudConfig.fileName][uciCloudConfig.secName.newFirmware],e=d[uciCloudConfig.optName.fwNewNotify],e=checkNum(e)&&parseInt(e)||uciCloudConfig.optValue.fwNewFalse,id("devName").innerHTML=l[uciDeviceInfo.optName.devName],id("curVer").innerHTML=l[uciDeviceInfo.optName.swVer],E(e==uciCloudConfig.optValue.fwNewTrue,b,a),null!=c[uciDeviceInfo.optName.ispVer]){var g=
new Date(1E3*parseInt(c[uciDeviceInfo.optName.ispVer]));c=g.getFullYear()%100;d=g.getMonth()+1;l=g.getDate();var h=g.getHours(),k=g.getMinutes(),g=g.getSeconds();c=(10>c?"0":"")+c+(10>d?"0":"")+d+(10>l?"0":"")+l+(10>h?"0":"")+h+(10>k?"0":"")+k+(10>g?"0":"")+g;$("#ispVer label.desG").html(c);$("#ispVer").show()}else $("#ispVer").hide();IPCUMGUESTNAUTH==b[ERR_CODE]?showAlert(errStr.invPermissionDenied):!0==a&&showDetailCon()})}function D(){d=!1;showLoading(statusStr.fwCheckUpInfoTip,function(){d=!0},
void 0,!1);onlineUpgrade(function(){!1==d&&(closeLoading(),showAlert(gOnlineUpgradeNote),gOnlineUpgradeNote="")},function(){!1==d&&closeLoading()},UPGRADE_FW)}function y(){d=!1;k.style.display="inline-block";m.style.display="inline-block";w.style.display="none";r.style.display="none";onlineUpgradeCheck(z,function(a){!1==d&&(parseInt(a)==EINVNOTFOUNTNEWFW?r.style.display="inline-block":showConfirmIpc(errStr.updateNetworkExpt,function(a){!1==a&&(closeConfirm(),y())},btn.cloudRetry),k.style.display=
"none",m.style.display="none")},function(){!1==d&&(x(!1),k.style.display="none",m.style.display="none")},UPGRADE_FW)}var d=!1,n=null,s=document.forms[0],u=id("fileName"),F=id("sysUpgrade"),G=id("onlineUpgradeCheck"),H=id("download_sw");id("newSoftVer");$("#newSoftInfo");$("input.fileBrowse");var k=id("chkPic"),m=id("chkTip"),w=id("hsNewFw"),r=id("noNewFw"),h=null,p=null,q=!1,c;G.onclick=y;H.onclick=function(){window.open(label.downloadSwLink)};(function(){u.onchange=function(){var a=this.value,a=
a.substring(a.lastIndexOf("\\")+1);id("textfield").value=a};F.onclick=function(){if(GROUP_GUEST==$.group)showAlert(errStr.invPermissionDenied);else if(!0==A()){var a={};$("#uploadIf").one("load",function(){iFrmOnload("uploadIf",B)});a[uciSystem.fileName]={};a[uciSystem.fileName][uciSystem.actionName.firmUpgrade]={type:"0"};showToast("fwUpload");n=$.setTimeout(v,12E4);$.action(a,function(a){ENONE==a[ERR_CODE]?(s.action=$.orgURL(a.url),s.submit(),s.reset(),q=!1):v()})}}})();x(!0)}init();
</script><style type="text/css">div.upObj{position:relative;*zoom:1}#uploadIf{top:-9999px;position:absolute;visibility:hidden}div.fileDiv{height:30px;overflow:hidden;position:relative;vertical-align:middle}input.file{font-size:110px;top:-5px;right:-5px;opacity:0;filter:alpha(opacity:0);cursor:pointer;position:absolute;vertical-align:top;z-index:1}#sysUpgrade{margin-left:10px!important;*margin-top:3px;*padding:2px 16px}#upFileForm{display:inline-block;vertical-align:middle;width:430px;*width:443px;_width:430px;*display:inline;*zoom:1}input.brower{margin-left:20px;width:88px}ul.line label.desF{line-height:32px;color:#333;margin-right:0;width:612px}img.loading{display:inline-block;width:20px;height:20px;margin-left:12px;vertical-align:middle}div.updateShowDiv{padding:0 24px 28px 24px;background-color:#fff;box-shadow:0 0 8px rgba(0,0,0,0.2);border-radius:2px;width:432px;margin:0 auto}p.newVer{font-size:16px;color:#7a8599;text-align:center;width:432px;height:39px;line-height:39px;border-bottom:1px solid #e1e4e6;margin-bottom:48px}p.updateNote{overflow:hidden}div.updateInfo{color:#333;font-size:14px;text-align:center;margin-bottom:48px}p.slideDown{display:inline-block;_display:inline;*zoom:1}p.slideDown span{color:#333;pointer:cursor}div.updateInfo p{line-height:24px}div.btnFun{text-align:center}#updateShowDiv input.subBtnB{margin-left:8px}#newFwObj{top:0;position:absolute;margin:auto;width:100%;z-index:1020;visibility:hidden;*zoom:1}ul.line li.line .disNone{display:none}</style>