<html>
||include||meta.tpl||
<head>
<link rel="stylesheet" type="text/css" href="||nwimg||||tpl_color||/surge.css" />
<script type="text/javascript">
<!--
function do_copy(sel){
	var i, form=document.pickform;
	for (i=0; i<sel.options.length; i++){
		if (sel.options[i].selected==true){
			if (sel.options[i].value == "Groups")
				form.page.value = "pick_dist";
			else if (sel.options[i].value == "Recent Addresses")
				form.page.value = "pick_recent";
			else
				form.abook_edit.value = sel.options[i].value;
			break;
		}
	}
	form.submit();
}
function create(){
	var form=document.pickform;
	form.page.value = "pick";
	form.abook_edit.value = form.abook_new.value;
	form.abook_list.value = form.abook_new.value;
	form.submit();
}
// -->
</script>
<script type="text/javascript" src="||common_files||/util.js"></script>
<script type="text/javascript" src="||nwimg||/layout.js"></script>
<title>||cust_title|| - ||lang_str||Addresses||</title>
</head>
<body class="body" onload="doresize();" onresize="doresize()">

||include||_layout_start.tpl||

||ifdef||error||
	||include||_errorinline.tpl||
||endif||
||ifdef||msg||
	||include||_msginline.tpl||
||endif||

<center>
<form name="pickform" method="post" action="||action||">
<input type="hidden" name="utoken" value="||utoken||" />
<input type="hidden" name="force_connection" value="true" />
<input type="hidden" name="cmd" value="pick_edit" />
<input type="hidden" name="abook_edit" value="||abook_edit||" />
<input type="hidden" name="abook_list" value="" />
<input type="hidden" name="page" value="pick" />



<table width="95%"><tr>
<td nowrap class="LF c">||lang_str||Address Book||</td>
<td></td>
<td nowrap class="LF c">||lang_str||New Address Book||</td>
</tr>
<tr>
<td><select size="1" name="addr_books" onchange="do_copy(this)">
		||begin_book||
			<option value="||addr_book||" ||selected||>||trans_addr_book||</option>
		||end_book||
		<option value="Recent Addresses" selected="selected">||lang_str||Recent Addresses||</option>
		<option value="Groups">||lang_str||Groups||</option>
	</select></td>
<td nowrap class="LF">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td><INPUT TYPE="Text"  name="abook_new" SIZE="26"></td>
<td><INPUT TYPE="button" class="btn" VALUE="||lang_str||Create||" onclick="javascript:create()"></td>
<td width="100%"> </td>
<td class="c"><INPUT TYPE="button" class="btn" VALUE="||lang_str||Import an Address Book||" onclick="javascript:G2('import_new&force_connection=true')"></td>
</tr></table>
<table class="LT" border="0" cellspacing="0" width="95%">
<TR class="bg1">
	<th width="100%" nowrap>||lang_str||Email Address||</th>
	<th></th><th></th>
</tr>
||define||color||1||
||begin_picklist||
	<tr nowrap class="L||color||">
		||ifequal||color||1|| ||define||color||0|| ||else|| ||define||color||1|| ||endif||
		<td nowrap><a href="javascript:G2('msg_new&get_attach_id=true&h_from=||href_text||(||pick_full||)||')">||html_text||pick_full||</a></td>
		<td><a href="javascript:G2('msg_new&get_attach_id=true&h_from=||href_text||(||pick_full||)||')">||lang_str||email||</a></td>
		<td> <a href="javascript:G3(||num||)">||lang_str||delete||</a></td>
	</tr>
||end_picklist||

</table>
</form>

<form name="save_picklist_form">
	<input type="hidden" name="cmd" value="pick_save" />
	<input type="hidden" name="utoken" value="||utoken||" />
	<input type="hidden" name="page" value="pick_recent" />
	<textarea name="picklist" id="picklist" style="display:none">||picklist||</textarea>
</form>

<script type="text/javascript">
	function G3(i){
		var f=document.save_picklist_form;
		var t=document.getElementById('picklist');
		var txt=t.value;
		var a=txt.split('\n');
		a.splice(i-1,1);
		t.value=a.join('\n');
		f.submit();
	}
</script>


</center>
</body>
</html>

