<script language="JavaScript">
<!---
function do_copy(sel)
{
	var i;
	for (i=0; i<sel.options.length; i++)
		if (sel.options[i].selected==true)
			document.addrbook.abook_edit.value
				= sel.options[i].text;

	document.addrbook.xcmd.value = "create_addr";
	document.addrbook.submit();
}

function prompt_user()
{
	x = confirm('Do you want to delete the entire Address Book?');
	if (x == true) {
		document.addrbook.cmd.value = "del_abook";
		document.addrbook.submit();
	}
}

// -->
</script>

<html>
<head>
<title>Address Book (||abook_edit||)</title>
</head>

||ifdef||background||
<body background="||nwimg||/||background||" onload="focus()">
||else||
<body onload="focus()">
||endif||


||include||nfmenu.tpl||

||ifdef||error||
	<center>
	<table border="1">
		<tr>	<td><img src="||nwimg||/attention.gif">
			<td bgcolor="ffffff">||error||</td>
		</tr>
	</table>
	</center>
||endif||

||ifdef||msg||
	<center>
	<table border="1">
		<tr>	<td bgcolor="ffffff">||msg||</td>
		</tr>
	</table>
	</center>
||endif||

<form name="addrbook" method="POST" action="||b_action||">
	<input type="hidden" name="utoken" value="||utoken||">
	<input type="hidden" name="xcmd" value="">
	<input type="hidden" name="cmd" value="">

	<center><h1><b>Address Book (||abook_edit||)</b></h1></center>
	<table width="100%" cellspacing="0" cellpadding="0">
		<tr valign="top"><td align=center>
		<table width ="100%" border="1" cellspacing="0" cellpadding="0">
		<tr><td><center><table cellspacing="0" cellpadding="0">
			<tr align="center"><td><b>Edit Address Book</b></td></tr>
			<tr align="center"><td><input type="text" size=10 name="abook_edit" value="||abook_edit||">
				<select size="1" name="addr_books" onchange="do_copy(this)">
					<option>||addr_books||</option>
				</select></td></tr>
			<tr align="center">
				<td>
				<img border="0" src="||nwimg||/delete.gif" usemap="#deletebook">
				<map name="deletebook"><area coords="0,0,100,100" href="javascript:prompt_user()"></map>

				<input type="image" border="0" src="||nwimg||/reload.gif" name="create_addr">
				<input type="image" border="0" src="||nwimg||/back.gif" name="edit_abook">
			</table></center></td></tr>

		<tr><td><table>
			<tr>	<td align="right">Nickname:</td>
				<td><input type="text" size="10" name="nick_name" value="||html_text||nick_name||">
				<input type="image" border="0" src="||nwimg||/add_addr.gif" name="add_addr"></td>

			</tr>
			<tr><td></td><td align="right">
				<input type="image" border="0" src="||nwimg||/delete.gif" name="del_addr"></td></td></tr>
			<tr>	<td align="right">Full Name:</td>
				<td><input type="text" size="25" name="abk_full_name" value="||html_text||abk_full_name||"></td>
			</tr>
			<tr>	<td align="right">EMail Address:</td>
				<td><input type="text" size="25" name="abk_email" value="||html_text||abk_email||"></td>
			</tr>
			<tr>	<td valign="top" align="right">Address:</td>
				<td><textarea name="abk_address" rows="4" cols="25">||abk_address||</textarea>
			</tr>

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

		<td valign="top" border="1" width="100%"><table bgcolor="#FFFFFF" width="100%" border="2" cellspacing="0" cellpadding="0">
			<!-- Header -->
				<tr>
					<th nowrap>Nickname</th>
					<th nowrap>Email Address</th>
					<th nowrap>Full Name</th>
					<th nowrap>Phone</th>
					<th nowrap>Mobile</th>
					<th nowrap>Fax</th>
				</tr>
			||begin_address||
				<tr>
					<td><a href="||action||?cmd=create_addr&nick_name=||href_text||name||&abook_edit=||abook_edit||&utoken=||utoken||">||html_text||name||</a></td>
					<td>||html_text||abk_email||</td>
					<td>||html_text||abk_full_name||</td>
					<td>||html_text||abk_phone||</td>
					<td>||html_text||abk_mobile||</td>
					<td>||html_text||abk_fax||</td>
				</tr>
			||end_address||

		</table></td>

	</table></center>
</form>


</body>
</html>
