<!DOCTYPE html>
<!--// $Id$ //-->
<html><head>
<meta name="GENERATOR" content="LMS {$layout.lmsv}">
{include file="language.html"}
<title>LMS – {if $layout.pagetitle != ""}{$layout.pagetitle}{/if}</title>
{include file="jquery.html" language=Localisation::getCurrentHtmlLanguage() lms_language=Localisation::getCurrentUiLanguage()}
<link href="css/style.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="js/common.js"></script>
{if $js}<script type="text/javascript">
{$js}
</script>{/if}
</head>
{if ! $part}
<script>
	autoiframe_correct_size();
</script>
<frameset name="all" frameborder="0" framespacing="0" ROWS="65,*,27">
	<frame scrolling="no" frameborder="0" marginheight="0" marginwidth="0" name="cal" noresize src="?m=chooseip&p=top&netid={$netid}{if $privnetid}&privnetid={$privnetid}{/if}{if $device}&device={$device}{/if}">
	<frame scrolling="always" frameborder="0" marginheight="0" marginwidth="0" name="m" noresize src="?m=chooseip&p=main&netid={$netid}{if $ip}&ip={$ip}{/if}{if $privnetid}&privnetid={$privnetid}{/if}{if $device}&device={$device}{/if}">
	<frame scrolling="no" frameborder="0" marginheight="0" marginwidth="0" name="down" noresize src="?m=chooseip&p=down&netid={$netid}{if $privnetid}&privnetid={$privnetid}{/if}{if $device}&device={$device}{/if}">
</frameset>
{/if}
{if $part == "main"}
<body class="lms-ui-popup">
	<script type="text/javascript">
	<!--
	function send_address_settings(ipaddr) {
		sendvalue(targetfield1, ipaddr);
		if (targetfield2 != null)
			$(targetfield2).val({$netid});
	}
	//-->
	</script>
	<table width="100%" cellpadding="1">
	{section name=iplist loop=$network.nodes.address}
	{if $smarty.section.iplist.index is even}<TR>{/if}
		<TD width="50%" align="center" class="highlight" {if $network.nodes.name[iplist] == ""} onClick="send_address_settings('{$network.nodes.address[iplist]}');"{/if}>
			{if $network.nodes.name[iplist] != ""}
				{if $device && $network.nodes.name[iplist] == "<b>GATEWAY</b>"}
					<A href="javascript: void(0);" onClick="send_address_settings('{$network.nodes.address[iplist]}');">{$network.nodes.name[iplist]}</A>
				{else}
					<span class="blend">{$network.nodes.name[iplist]}</span>
				{/if}
			{else}
			<A href="javascript: void(0);" onClick="send_address_settings('{$network.nodes.address[iplist]}');">{$network.nodes.address[iplist]}</A>
			{/if}
		</TD>
	{if $smarty.section.iplist.index is not even}</TR>{/if}
	{sectionelse}
	</table>
	<TABLE width="100%" height="100%">
	<TR title="{trans("Click to close window")}" onclick="parent.window.close();">
		<TD width="100%" align="center">
			<P><B>{trans("You don't have any IP network.")}<BR><BR>{t}To add a new network see "IP Networks" menu.{/t}</B></P>
		</TD>
	</TR>
	{/section}
	</table>
</body>
{/if}
{if $part == "top"}
<body class="lms-ui-popup">
<table cellpadding="5" width="100%">
	<tr>
		<td class="fall dark" align="center">
			<B>{trans("Select IP address:")}</B>
		</td>
	</tr>
	<form target="m" name="selectnet" method="post" action="?m=chooseip&p=main&netid={$netid}{if $privnetid}&privnetid={$privnetid}{/if}{if $device}&device={$device}{/if}">
	<INPUT type="submit" class="hiddenbtn">
	<tr>
		<td class="fall light" align="center">
			<SELECT SIZE="1" onchange="parent.location.href='?m=chooseip{if $privnetid}&privnetid={$privnetid}{/if}{if $device}&device={$device}{/if}&netid='+document.selectnet.elements['netid'].value" NAME="netid">
				{foreach $networks as $net}
				<OPTION VALUE="{$net.id}"{if $net.id == $netid} selected{/if}{if $net.disabled == 1} class="lms-ui-alert"{/if}>{$net.name|truncate:20:"":true}: {$net.address}/{$net.prefix}</OPTION>
				{foreachelse}
				<OPTION VALUE="0">{trans("You don't have any IP network.")}</OPTION>
				{/foreach}
			</SELECT>
		</TD>
	</tr>
	</form>
</table>
</body>
{/if}
{if $part == "down"}
<body class="lms-ui-popup">
<table cellpadding="5" width="100%">
	<tr>
		<td class="fall light" align="center">
			<B>
			{if $network.page > 1}<A HREF="javascript:void(0);" onclick="parent.location.href='?m=chooseip&netid={$netid}{if $privnetid}&privnetid={$privnetid}{/if}{if $device}&device={$device}{/if}&page=1'; return false;">&#9668;</A>{elseif $network.pages > 1}<span CLASS="blend">&#9668;</span>{/if}

			{if $network.page - 50 >= 1}<A HREF="javascript:void(0);" onclick="parent.location.href='?m=chooseip&netid={$netid}{if $privnetid}&privnetid={$privnetid}{/if}{if $device}&device={$device}{/if}&page={math equation="x - 50" x=$network.page}'; return false;">&laquo;&laquo;&laquo;</A>{elseif $network.pages > 50}<span CLASS="blend">&laquo;&laquo;&laquo;</span>{/if}

			{if $network.page - 10 >= 1}<A HREF="javascript:void(0);" onclick="parent.location.href='?m=chooseip&netid={$netid}{if $privnetid}&privnetid={$privnetid}{/if}{if $device}&device={$device}{/if}&page={math equation="x - 10" x=$network.page}'; return false;">&laquo;&laquo;</A>{elseif $network.pages > 10}<span CLASS="blend">&laquo;&laquo;</span>{/if}

			{if $network.page > 1}<A HREF="javascript:void(0);" onclick="parent.location.href='?m=chooseip&netid={$netid}{if $privnetid}&privnetid={$privnetid}{/if}{if $device}&device={$device}{/if}&page={math equation="x - 1" x=$network.page}'; return false;">&laquo;</A>{else}<span CLASS="blend">&laquo;</span>{/if}

			{t a=$network.page b=$network.pages}Page $a of $b{/t}

			{if $network.page < $network.pages}<A HREF="javascript:void(0);" onclick="parent.location.href='?m=chooseip&netid={$netid}{if $privnetid}&privnetid={$privnetid}{/if}{if $device}&device={$device}{/if}&page={math equation="x + 1" x=$network.page}'; return false;">&raquo;</A>{else}<span CLASS="blend">&raquo;<span>{/if}</B>

			{if $network.page + 10 <= $network.pages}<A HREF="javascript:void(0);" onclick="parent.location.href='?m=chooseip&netid={$netid}{if $privnetid}&privnetid={$privnetid}{/if}{if $device}&device={$device}{/if}&page={math equation="x + 10" x=$network.page}'; return false;">&raquo;&raquo;</A>{elseif $network.pages > 10}<span CLASS="blend">&raquo;&raquo;<span>{/if}</B>

			{if $network.page + 50 <= $network.pages}<A HREF="javascript:void(0);" onclick="parent.location.href='?m=chooseip&netid={$netid}{if $privnetid}&privnetid={$privnetid}{/if}{if $device}&device={$device}{/if}&page={math equation="x + 50" x=$network.page}'; return false;">&raquo;&raquo;&raquo;</A>{elseif $network.pages > 50}<span CLASS="blend">&raquo;&raquo;&raquo;<span>{/if}</B>

			{if $network.page < $network.pages}<A HREF="javascript:void(0);" onclick="parent.location.href='?m=chooseip&netid={$netid}{if $privnetid}&privnetid={$privnetid}{/if}{if $device}&device={$device}{/if}&page={$network.pages}'; return false;">&#9658;</A>{elseif $network.pages > 1}<span CLASS="blend">&#9658;<span>{/if}
			</B>
		</td>
	</tr>
</table>
</body>
{/if}
</html>
