This is an optional alternative to pickf.tpl
It has an editable pick list with delete & add to address book buttons
Remove these top three lines before using


||header: modified=false tpl_set=cwm_o1 tpl_version=2.6n||

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<script language="JavaScript">
<!--- hide script from old browsers
function setto(sel) {
  var option;
  var i;
 for (i=1; i<sel.options.length; i++) {
   if (sel.options[i].selected==true) {
       if (document.pickform.abook.value == "")
         document.pickform.abook.value = sel.options[i].value;
       else
         document.pickform.abook.value = sel.options[i].value  + "\n" + document.pickform.abook.value;
   
   }
 }   
}
function do_copy(sel){
 var i;
 document.pickform.cmd.value = "edit_abook";
 for (i=0; i<sel.options.length; i++)
   if (sel.options[i].selected==true)
     document.pickform.abook_edit.value
      = sel.options[i].value;
 document.pickform.submit();
   //document.pickform.edit_abook.click();
}
function del_addr(sel){
	var i;
	for(i=1; i<sel.options.length; i++){
		if(sel.options[i].selected==true){
			for(; i<sel.options.length; i++){
				sel.options[i] = sel.options[i+1];
			}
			update_pick(sel);
			return;
		}
	}
}

function update_pick(sel){
	document.pickform.toedit.value = "";
	for(i=0; i<sel.options.length; i++){
		document.pickform.toedit.value += sel.options[i].value;
		document.pickform.toedit.value += "\n";
	}
}

function newwindow1()
{
        msgWindow = open('||action||?cmd=pick_edit&page=add_addr&utoken=||utoken||','ADDRESSBOOK2','width=550,height=265,toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=yes,scrollbars=no','POPUP');
        if (msgWindow.opener == null) msgWindow.opener = self;
        if (msgWindow.opener.pickform == null) msgWindow.opener.pickform = document.pickform;
}
function newwindow()
{
        msgWindow = open('||action||?cmd=pick_edit&page=pickadd&utoken=||utoken||','ADDRESSBOOK2','width=550,height=265,toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=yes,scrollbars=no','POPUP');
        if (msgWindow.opener == null) msgWindow.opener = self;
        if (msgWindow.opener.pickform == null) msgWindow.opener.pickform = document.pickform;
}

function check_books(){
	if(document.pickform.addr_books[0].selected == true  && document.pickform.abook_edit.value.length == 0){
		alert("You have not selected an address book.\nYou must select, or name, an address book before trying to edit it.");
	}
}


// -->
</script>
<title>Address Books</title>
</head>
<body background="||nwimg||/cwback.jpg" onload="update_pick(document.pickform.topick);">
<form name="pickform" method="POST" action="||b_action||">
<input type=hidden name="utoken" value="||utoken||">
<input type=hidden name="cmd" value="pick_set">
<table><tr><td valign="top">
<h3>Address Books</h3>
<input type=checkbox name="autoadd" value="on" ||autoadd||> Add addresses to pick list automatically<br>
<input type=checkbox name="autoadda" value="on" ||autoadda||> Add addresses to 
<select size="1" name="add_book" onChange="document.pickform.autoadda.checked=true">
<option>||addr_booksa||</option></select>
address book automatically<br>
<td>Pick List<br>
<input type="button" onclick="del_addr(document.pickform.topick)" value="Delete">
<input type="button" onclick="setto(document.pickform.topick)" value="Add To Address Book">
 <select name="topick" size="4">
            <option>||topick||</option>
          </select>
		  <input type="hidden" name="toedit">
		  <script language="javascript">
			update_pick(document.pickform.topick);
			</script>
</td></tr>
<tr><td>To create a new address book just enter its name in the address book field and press save.<br>
To open and existing address book select it in this list. 
<select size="1" name="addr_books" onchange="do_copy(this)">
<option>||addr_books||</option>
</select>
<br>
Each line should contain an address or nickname = email address or list of addresses. Examples:<br>
john@adam.co<br>john = john@adam.co<br>
friends = john@adam,pete@dtree.co<br><br>

<MAP NAME="lmap1"><AREA SHAPE="RECT" COORDS="0, 0, 75, 45" HREF="javascript:newwindow1()"></MAP>
<img border="0" src="||nwimg||/add_addr.gif" alt="Add user picklist" usemap="#lmap1">
<MAP NAME="lmap"><AREA SHAPE="RECT" COORDS="0, 0, 75, 45" HREF="javascript:newwindow()"></MAP>
<img border="0" src="||nwimg||/crategrp.gif" alt="Add group from picklist" usemap="#lmap">
<input type=image border="0" src="||nwimg||/s_save.jpg" name="save" alt="Save changes">
<input type=image border="0" src="||nwimg||/s_rfresh.jpg" name="edit_abook" alt="Reload">
<input type=image border="0" src="||nwimg||/s_rmove.jpg" name="del_abook" alt="Delete Address Book">
<!-- <input type=submit name="edit_abook" value="Reload"><input type="submit" name="del_abook" value="Delete Address Book"> --><br>

Use Public address books: <input type="text" size=35 name="gaddr_books" value="||gaddr_books||">
<br>Use format user@their.domain/public_bookname
<td>Address book <input type="text" size=15 name="abook_edit" value="||abook_edit||"><br>
<textarea name="abook" rows=14 cols=26 onchange="check_books();">||abook||</textarea>


</table>
</form>
</body>
</html>

































































||checksum=1055717||
