<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<script type="text/javascript">
<!--
||ifdef||netscape_version||
	||define||amp||&||
||else||
	||define||amp||&amp;||
||endif||

function do_copy(sel)
{
	var i;
	for (i=0; i<sel.options.length; i++)
	if (sel.options[i].selected==true)
		document.pickform.abook_edit.value
			= sel.options[i].text;

	document.pickform.cmd.value = "edit_abook";
	document.pickform.submit();
}


function externwindow(){
        msgWindow = open('||action||?cmd=ext_addr||amp||utoken=||putoken||||amp||||amp||','EXTERNADDR','width=550,height=450,toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=yes,scrollbars=yes','POPUP');
        if (msgWindow.opener == null) msgWindow.opener = self;
        if (msgWindow.opener.pickform == null) msgWindow.opener.pickform = document.pickform;
}

function newwindow()
{
	msgWindow = open('||action||?cmd=msg_new||amp||page=group.tpl||amp||utoken=||putoken||||amp||||amp||','creategroup','width=550,height=250,toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no,scrollbars=yes','POPUP');
	if (msgWindow.opener == null){
		msgWindow.opener = self;
	}
	if (msgWindow.opener.pickform == null){
        msgWindow.opener.pickform = document.pickform;
	}
	msgWindow.focus();
}

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

function setTitle(){
	||ifequal||top||_top||
		window.top.document.title = "||cust_display_name|| - ||current_user|| - Address Book";
	||endif||
}

function openWindow(){
	window.open("||nwimg||/blank.htm","addrbook",'left=20,top=20,width=350,height=350,toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=yes,scrollbars=no');
	return "addrbook";
}

function addAddr(query){
	window.open(query + document.pickform.abook_edit.value,"addrbook",'left=20,top=20,width=350,height=350,toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=yes,scrollbars=yes');
}

function importNew(){
	window.open("||action||?cmd=import_new||amp||utoken=||utoken||", "Import", 'left=20,top=20,width=350,height=350,toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=yes,scrollbars=yes');
}
// -->
</script>

||just_include||pickfcss.tpl||

<title>Edit Pick List</title>
</head>

<body background="||cust_panel_background||" bgcolor="||cust_panel_bgcolor||" onload="setTitle();">


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


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


<form name="pickform" method="post" action="||action||">
	<input type="hidden" name="remove_setting" value="_autoadd3" />
	<input type="hidden" name="utoken" value="||utoken||" />
	<input type="hidden" name="cmd" value="" />

	<center>
	<table>
		<tr>
			<td align="center"><h2><b>Pick List</b></h2></td>
			<td align="center"><h2><b>Distribution List</b></h2></td>
			<td>&nbsp;</td>
		</tr>
		<tr>
			<td align="center"><textarea name="picklist" rows="8" cols="||ifinstr||netscape_version||4.||25||else||40||endif||">||picklist||</textarea></td>
			<td align="center"><textarea name="dist_list" rows="8" cols="||ifinstr||netscape_version||4.||25||else||40||endif||">||dist_list||</textarea></td>
			<td align="center">
				||ifdef||external_book||
					This is the external address book which is maintained by the Site Admin.
					It stores users information, and allows you to search for details.
				||endif||
			</td>
		</tr>
		<tr>
			<td align="center">
				<input type="checkbox" name="autoadd" value="on" ||ifnempty||autoadd||checked="checked"||endif|| />Add all addresses automatically<br />
				<input type="checkbox" name="autoadd2" value="on" ||ifnempty||autoadd2||checked="checked"||endif|| />Add addresses you Email<br />
				<input type="checkbox" name="_autoadd3" value="on" ||ifnempty||_autoadd3||checked="checked"||endif|| />Add addresses add to your Address Book
			</td>
			<td align="center">
				<input type="submit" value="Save" name="pick_save" />
				<input type="button" value="Add Group" onclick="newwindow();" />
			</td>
			<td align="center">
				||ifdef||external_book||
					<input type="button" value="External Address Book" name="External Address Book" onclick="externwindow();" />
				||endif||
			</td>
		</tr>
	</table>
	</center>

	<center><h2>Address Books</h2></center>

	<center>
	<table border="0" cellspacing="0" cellpadding="0" width="100%">
	<tr>
		<td valign="top" width="30%">
			<table cellspacing="0" cellpadding="0">
				<tr><td><b>Edit Address Book</b></td></tr>
				<tr>
					<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>
					<td>
						<input type="submit" value="Create Book" name="edit_abook" />
						<input type="button" value="Delete Book" onclick="prompt_user()" /><br />
						<input type="button" onclick="importNew();" value="Import Book" />
					</td>
				</tr>
				<tr><td><hr /></td></tr>
				<tr><td><b>Use Public address book(s) from</b></td></tr>
				<tr><td nowrap="nowrap"><input type="text" size="25" name="gaddr_books" value="||gaddr_books||" /> <input type="submit" value="Save" name="pick_save" /></td></tr>
				<tr><td>You only need to enter the User Name. eg. Lynden, Ralph</td></tr>
				<tr><td><p><b>Note:</b> Public Address Books are Named 'pub_xxxx'.</p></td></tr>
			</table>
		</td>
		<td valign="top" width="70%">
			<table width="100%">
			<tr>
				<td align="center"><input type="button" value="Add Addresses" onclick="addAddr('||action||?cmd=pick_edit||amp||process=create_addr||amp||utoken=||utoken||||amp||abook_edit=');" /></td>
			</tr>
			<tr><td><table bgcolor="#FFFFFF" width="100%" border="2" cellspacing="0" cellpadding="0">
				<tr>
				||ifequal||sort_abk_on||name||
					<th nowrap="nowrap">Nickname</th>
				||else||
					<th nowrap="nowrap"><a href="||action||?sort_abk_on=name&amp;abook_edit=||abook_edit||&amp;cmd=pick_edit&amp;utoken=||utoken||">Nickname</a></th>
				||endif||

				||ifequal||sort_abk_on||abk_email||
					<th nowrap="nowrap">Email Address</th>
				||else||
					<th nowrap="nowrap"><a href="||action||?sort_abk_on=abk_email&amp;abook_edit=||abook_edit||&amp;cmd=pick_edit&amp;utoken=||utoken||">Email Address</a></th>
				||endif||
				||ifequal||sort_abk_on||abk_full_name||
					<th nowrap="nowrap">Full Name</th>
				||else||
					<th nowrap="nowrap"><a href="||action||?sort_abk_on=abk_full_name&amp;abook_edit=||abook_edit||&amp;cmd=pick_edit&amp;utoken=||utoken||">Full Name</a></th>
				||endif||
					<th nowrap="nowrap">Phone</th>
					<th nowrap="nowrap">Mobile</th>
					<th nowrap="nowrap">Fax</th>
				</tr>
				||begin_address||
					<tr>
						<td><a onclick="this.target = openWindow();" target="_blank" href="||action||?cmd=create_addr&amp;nick_name=||href_text||name||&amp;abook_edit=||abook_edit||&amp;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></tr>
			</table>
		</td>
		</tr>
	</table>
	</center>

</form>

</body>
</html>
