<style type="text/css">div.welcome{margin:0 auto;text-align:center}i.router{display:inline-block;background:url(/luci-static/images/phiwifi.png?_=20191016014108) no-repeat;background-size:contain;width:5rem;height:5rem;margin-left:1rem}div.btn-con-2{margin:.5rem auto}ul.set-con2{text-align:center}span.desc-lbl{text-align:left;vertical-align:middle;font-size:.4rem;color:#575757}a.user-agreement{font-size:.375rem;color:#575757;text-decoration:underline}div.download-app{margin:.4rem auto .2rem;text-align:center}a.download-app{font-size:.4rem;color:#ff9919;text-decoration:underline}p.company{margin-bottom:.25rem;text-align:center;font-size:.4rem;color:#575757}div.switch-lang{height:.64rem;padding:.25rem}#LangList{color:#575757;font-size:.4rem;float:right}p.sel-title{border-bottom:0}</style>
<script type="text/javascript">
	(function () {
		$("#AppURL").attr("href", ROUTER.appURL);

		$("#Start").click(function () {
			stateman.go("setLgPwd");
		});

		$("i.icon-check").click(function () {
			var val = parseInt($(this).attr("data-value"));
			if (0 == val) {
				$(this).attr("data-value", "1").css("color", "#FF7900").removeClass("icon_select_off").addClass("icon_select_on");
			} else {
				$(this).attr("data-value", "0").css("color", "#575757").removeClass("icon_select_on").addClass("icon_select_off");
			}

			var btn = $(this).attr("data-toggle-btn");
			if (btn) {
				if (1 == val) {
					$("#" + btn).attr("disabled", "disabled").addClass("disabled");
				} else {
					$("#" + btn).removeAttr("disabled").removeClass("disabled");
				}
			}
		}).each(function () {
			var val = $(this).attr("data-value") || 0;
			if (1 == val) {
				$(this).attr("data-value", "1").css("color", "#FF7900").removeClass("icon_select_off").addClass("icon_select_on");
			} else {
				$(this).attr("data-value", "0").css("color", "#575757").removeClass("icon_select_on").addClass("icon_select_off");
			}

			var btn = $(this).attr("data-toggle-btn");
			if (btn) {
				if (0 == val) {
					$("#" + btn).attr("disabled", "disabled").addClass("disabled");
				} else {
					$("#" + btn).removeAttr("disabled").removeClass("disabled");
				}
			}
		});

		if (ROUTER.languageList.length > 1) {
			$("#LangList").show();
		} else {
			$("#LangList").hide();
		}

		var curLang = ROUTER.lang;
		var langListUsed = LANGLIST.getLangList();

		initSelect("LangList", langListUsed, curLang, function (val, init) {
			for (var i = 0; i < langListUsed.length; i++) {
				if (langListUsed[i]["value"] == val) {
					$("#Language").text(langListUsed[i]["name"]);
					break;
				}
			}

			if (!init) {
				var data = {};
				data.lang = val;

				apiSetWithUrl("/welcome/config", data, function (ret) {
					var code = ret[ERR_CODE];
					if (E_NONE == code) {
						window.location.reload();
					} else {
						$.setTimeout(function () {
							errHandle(code);
						}, 800);
					}
				});
			}
		});

		function errHandle(code) {
			switch (code) {
				case E_NONE:
					return false;
				default:
					showNote(errStr.unknownErr + code);
					break;
			}

			return true;
		}
	})();
</script>
<%
	local para = {welcome = {config = {}}}
	local result = tpl_get_data(para)
	local agreement = result[K_MODULE].welcome.config.agreement
-%>
<div class="head-con">
	<h1 class="head-title">{%label.phicommRouter%}</h1>
</div>
<div class="set-con below-head">
	<div class="switch-lang">
		<span id="LangList" class="select" data-value="0">
			<span id="Language" class="select-value"></span>
		</span>
	</div>
	<div class="welcome">
		<i class="router"></i>
	</div>
	<ul class="set-con set-con2">
		<i class="tip-l icon-check" data-value='<%=agreement%>' data-toggle-btn="Start"></i>
		<span class="desc-lbl">
			{%label.readAndagree%}&nbsp;<a href="#/userAgreement" class="user-agreement">{%label.theUserAgreement%}</a>
		</span>
	</ul>
	<div class="btn-con btn-con-2">
		<input id="Start" class="btn" type="button" value="{%btn.start%}" />
	</div>
	<!--
	<div class="download-app invisible">
		<a href="" id="AppURL" target="_blank" class="download-app">
			<span>{%label.downloadApp%}</span>
		</a>
	</div>
	<p class="company">{%label.phicommTechnologyCoLtd%}</p>
-->
</div>