<%
protocol="http://"

%>

<script type="text/javascript">//<![CDATA[
var URL = ""
var URLSAFE = ""
function Luckyconfig() {
		XHR.get('<%=url([[admin]], [[services]], [[lucky_config]])%>', null,
			function (x, d) {
				if (d) {
					URL = "http://" + window.location.hostname + ":" + d.BaseConfigure.AdminWebListenPort;
					URLSAFE = "http://" + window.location.hostname + ":" + d.BaseConfigure.AdminWebListenPort;
					if (d.BaseConfigure.SafeURL != undefined) {
						URL += d.BaseConfigure.SafeURL;
					}
				}
			}
		);
}		

	    XHR.poll(3, '<%=url([[admin]], [[services]], [[lucky_status]])%>', null,
		function(x, d) {
			var tb = document.getElementById('lucky_status');
			if (d && tb)
			{
				if (d.status)
				{
					Luckyconfig()
					tb.innerHTML = '<em><b style=\"color:green\"><%:The Lucky service is running.%></b></em>';
					tb.innerHTML +='<em> <br/><br/><%:Click the new page to open Lucky%> </em>';
					tb.innerHTML += "<input class=\"cbi-button cbi-button-reload \" type=\"button\" value=\" "+ URL + "\" onclick=\"window.open('"+URL+"')\"/>";
				}
				else
				{
					tb.innerHTML = '<em style=\"color:red\"><%:The Lucky service is not running.%></em><br/>';
				}
			}
		}
	);

//]]></script>
<style>.mar-10 {margin-left: 50px; margin-right: 10px;}</style>
<fieldset class="cbi-section">
	<legend><%:Lucky Status%></legend>
	<p id="lucky_status">
		<em><%:Collecting data...%></em>
	</p>
</fieldset>
