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(e){var c=$("search_results");if(!$F(c).size()){alert(IMP.text.contacts_select);return false}else{var g=$("selected_addresses"),a=$A(g).length,b;c.childElements().each(function(d){if(d.value&&d.selected){if(!$A(g).any(function(f){return sameOption(e,d,f)})){b=e+": "+d.value;g[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,g,b;g=a.indexOf(":");d=a.substring(0,g);a=a.substring(g+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(f){return f});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()}})};