<!--
function do_copy(sel){
	var i;
	for (i=0; i<sel.options.length; i++){
		if (sel.options[i].selected==true){
			if (sel.options[i].value == "Groups")
				document.pickform.page.value = "pick_dist";
			else if (sel.options[i].value == "Recent Addresses")
				document.pickform.page.value = "pick_recent";
			else
				document.pickform.abook_edit.value = sel.options[i].value;
			break;
		}
	}
	document.pickform.submit();
}
function create(){
	document.pickform.abook_edit.value = document.pickform.abook_new.value;
	document.pickform.abook_list.value = document.pickform.abook_new.value;
	document.pickform.submit();
}

function edit_group(name,value){
	document.editgrp.group_name.value = name;
	document.editgrp.stored_dist.value = value;
	document.editgrp.changing_address.value = "true";
	document.editgrp.submit();
}
function addSel(){
	var form = document.pickform;
	var from = form.abksel.options;
	var j, newentry;
	for(j=0; j<from.length; j++){
		if(from[j].selected){
			newentry = from[j].text;
			if (form.group_list.value.indexOf(newentry) == -1)  //only add the new entry if it's not already there
				form.group_list.value = form.group_list.value + newentry + ",\n";
		}
	}
}

function saveDist(){
	var form = document.pickform;
	if (form.new_group_name){
		if (!form.new_group_name.value.length){
			alert(x_savedist);
			return;
		}
		form.group_name.value = form.new_group_name.value;
	}
	var tmp=form.group_list.value;
	tmp.replace("@","!40")
	if (tmp.length>1020){
		alert(x_toobig);
		return;
	}
	
	form.cmd.value = "add_dist";
	form.page.value = "pick_dist";
	form.changing_address.value = "";
	form.submit();
}

function del_group(str){
	document.editgrp.group_name.value = str;
	document.editgrp.cmd.value = "del_dist";
	document.editgrp.submit();
}
function do_copy2(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].value;
		}
	}
	document.pickform.page.value = "pick_dist";
	if (document.pickform.new_group_name)
		document.pickform.group_name.value = document.pickform.new_group_name.value;
	document.pickform.submit();
}
//-->