function passAddresses(){var A="";$("selected_addresses").childElements().each(function(B){if(!B.value){return}A+=B.value+"|"});$("sa").setValue(A)}function sameOption(E,D,A){var C=E+": "+D.value,B=A.value;return Try.these(function(){return(C==B)||(decodeURIComponent(C)==decodeURIComponent(B))},function(){return(C==B)})}function addAddress(D){var C=$("search_results");if(!$F(C).size()){alert(IMP.text.contacts_select);return false}else{var E=$("selected_addresses"),A=$A(E).length,B;C.childElements().each(function(F){if(F.value&&F.selected){if(!$A(E).any(function(G){return sameOption(D,F,G)})){B=D+": "+F.value;E[A++]=new Option(B,B)}}})}return true}function updateMessage(){if(parent.opener.closed){alert(IMP.text.contacts_closed);this.close();return}if(!parent.opener.document[formname]){alert(IMP.text.contacts_called);this.close();return}$("selected_addresses").childElements().each(function(C){var A=C.value,D,E=null,F,B;F=A.indexOf(":");D=A.substring(0,F);A=A.substring(F+2,A.length);if(D=="to"){E=parent.opener.document[formname].to}else{if(!to_only&&D=="cc"){E=parent.opener.document[formname].cc}else{if(!to_only&&D=="bcc"){E=parent.opener.document[formname].bcc}else{return}}}if(E.value.length){B=E.value.replace(/, +/g,",").split(",").findAll(function(G){return G});E.value=B.join(", ");if(E.value.lastIndexOf(";")!=E.value.length-1){E.value+=","}E.value+=" "+A}else{E.value=A}if(A.lastIndexOf(";")!=A.length-1){E.value+=", "}});this.close()}function removeAddress(){$("selected_addresses").childElements().each(function(A){if(A.selected){A.remove()}})};