function changeLinkState(el,state){
el.innerHTML = get_lang(state);
switch (state){
case 'important':
{
el.onclick = function(){changeLinkState(el,'normal');set_messages_flag('unflagged',currentTab.substr(0,currentTab.indexOf("_r"))); write_msg(get_lang('Message marked as ')+get_lang("Normal"))};
break;
}
case 'normal':
{
el.onclick = function(){ changeLinkState(el,'important');set_messages_flag('flagged',currentTab.substr(0,currentTab.indexOf("_r")));write_msg(get_lang('Message marked as ')+get_lang("Important"))};
break;
}
case 'unseen':
{
el.onclick = function(){ changeLinkState(el,'seen');set_messages_flag('unseen',currentTab.substr(0,currentTab.indexOf("_r")));write_msg(get_lang('Message marked as ')+get_lang("unseen"))};
break;
}
case 'seen':
{
el.onclick = function(){ changeLinkState(el,'unseen');set_messages_flag('seen',currentTab.substr(0,currentTab.indexOf("_r")));write_msg(get_lang('Message marked as ')+get_lang("seen"))};
break;
}
default:
{
break;
}
}
}
function constructMenuNewMessage(ID,tbody_message,table_message,content)
{
table_message.width = "100%";
var tr0 = document.createElement("TR");
tr0.className = "tr_message_header";
var td0 = document.createElement("TD");
td0.colSpan = '3';
var table_menu_new_message = document.createElement("TABLE");
table_menu_new_message.width = "100%";
table_menu_new_message.border = '0';
table_menu_new_message.className = 'table_message';
var tbody_menu_new_message = document.createElement("TBODY");
var tr_menu_new_message = document.createElement("TR");
var td_menu_new_message = document.createElement("TD");
td_menu_new_message.setAttribute("noWrap","true");
if ((preferences.save_in_folder == '-1') || (preferences.save_in_folder == '')){
//var option_send = ''+get_lang("Send")+' | ';
var option_send = '' + ' | ';
if(!expresso_offline)
var option_send_and_file= ''+get_lang("Send and file")+' | ';
else
var option_send_and_file='';
}
else{
//var option_send = ''+get_lang("Send")+' | ';
var option_send = '' + ' | ';
var option_send_and_file='';
wfolders.alert = true;
}
// var option_save_as = ''+get_lang("Save as")+' | ';
if (!expresso_offline) {
var option_save = ''+get_lang("Save")+' | ';
var option_search = ''+get_lang("Search")+'';
}
else {
var option_save = '';
var option_search = '';
}
td_menu_new_message.innerHTML = option_send + option_send_and_file + option_save + option_search;
tr_menu_new_message.appendChild(td_menu_new_message);
tbody_menu_new_message.appendChild(tr_menu_new_message);
table_menu_new_message.appendChild(tbody_menu_new_message);
content.appendChild(table_menu_new_message);
tr0.appendChild(td0);
tbody_message.appendChild(tr0);
////////////////////////////////////////////////////////////////////////////////////////////////////////
}
function constructFromField(tbody_message,ID)
{
var tr1_1 = document.createElement("TR");
tr1_1.style.display = 'none';
var td1_1 = document.createElement("TD");
td1_1.innerHTML = get_lang("From")+":";
td1_1.setAttribute("noWrap","true");
td1_1.style.width = "1%";
var td_from = document.createElement("TD");
td_from.setAttribute("noWrap","true");
td_from.style.width = "100%";
var sel_from = document.createElement('SELECT');
sel_from.id = "from_"+ID;
sel_from.name = "input_from";
sel_from.style.width = "70%";
sel_from.setAttribute("wrap","soft");
td_from.appendChild(sel_from);
tr1_1.appendChild(td1_1);
tr1_1.appendChild(td_from);
tbody_message.appendChild(tr1_1);
if(!expresso_offline)
draw_from_field(sel_from,tr1_1);
var tr1 = document.createElement("TR");
var td1 = document.createElement("TD");
td1.innerHTML = get_lang("To")+":";
td1.setAttribute("noWrap","true");
td1.style.width = "1%";
var td_to = document.createElement("TD");
td_to.setAttribute("noWrap","true");
td_to.style.width = "100%";
var input_to = document.createElement('TEXTAREA');
input_to.id = "to_"+ID;
input_to.name = "input_to";
input_to.setAttribute("tabIndex","1");
input_to.style.width = "100%";
input_to.setAttribute("wrap","soft");
input_to.onfocus = function(){clearTimeout(parseInt(setTimeOutLayer)); search_contacts('onfocus', this.id);};
input_to.onblur = function(){setTimeOutLayer=setTimeout('search_contacts("lostfocus","'+this.id+'")',100);};
if (!is_ie)
{
input_to.rows = 2;
input_to.onkeypress = function (e)
{
if ((e.keyCode) == 120) //F9
{
emQuickSearch(input_to.value, 'to', ID);
}
else
{
if (((e.keyCode == 13) || ((e.keyCode == 38)||(e.keyCode == 40))) && (document.getElementById('tipDiv').style.visibility!='hidden'))
{
e.preventDefault();
search_contacts(e.keyCode,this.id);
}
}
};
input_to.onkeyup = function (e)
{
if ((e.keyCode != 13) && (e.keyCode != 38) && (e.keyCode != 40))
{
search_contacts(e.keyCode,this.id);
}
};
}
else
{
input_to.rows = 3;
input_to.onkeyup = function (e)
{
if ((window.event.keyCode) == 120) //F9
{
emQuickSearch(input_to.value, 'to', ID);
}
else
{
search_contacts(window.event.keyCode,this.id);
}
};
}
td_to.appendChild(input_to);
var forwarded_local_message = document.createElement("INPUT"); //Hidden para indicar se é um forward de uma mensagem local
forwarded_local_message.id = "is_local_forward"+ID;
forwarded_local_message.name = "is_local_forward";
forwarded_local_message.type = "HIDDEN";
forwarded_local_message.value = "0";
td_to.appendChild(forwarded_local_message);
////////////////////////////////////////////////////////////////////////////////////////////////////////
if (!expresso_offline) {
var img_search = document.createElement("IMG");
img_search.src = URL_SERVER + 'expressoMail1_2/templates/'+template+'/images/search.gif';
img_search.title = get_lang('Search') + " | " + get_lang('Use F9 Key as shortcut.');
img_search.onclick = function () {emQuickSearch(document.getElementById('to_'+ID).value, 'to', ID);};
}
else {
var img_search = document.createElement("SPAN");
}
var span_search = document.createElement("SPAN");
span_search.innerHTML = get_lang('Search');
var td1_img_search = document.createElement("TD");
td1_img_search.setAttribute("noWrap","true");
var td1_span_search = document.createElement("TD");
td1_span_search.setAttribute("noWrap","true");
td1_img_search.appendChild(img_search);
td1_span_search.appendChild(span_search);
tr1.appendChild(td1);
tr1.appendChild(td_to);
tr1.appendChild(td1_img_search);
tbody_message.appendChild(tr1);
}
function draw_new_message(border_ID)
{
expresso.connector.loadScript("jscode/rich_text_editor");
expresso.connector.loadScript("jscode/color_palette");
if(typeof(RichTextEditor) == 'undefined' || typeof(ColorPalette) == 'undefined')
return false;
Tooltip.init();
var ID = create_border("",border_ID);
if (ID === false){
return false;
}
expresso.connector.hold_session = true;
var footer_menu = Element("footer_menu");
if (footer_menu) {
footer_menu.style.display = 'none';
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////
var form = document.createElement("FORM");
form.name = "form_message_"+ID;
form.method = "POST";
form.onsubmit = function(){return false;};
if(!is_ie)
form.enctype="multipart/form-data";
else
form.encoding="multipart/form-data";
var content = Element('content_id_' + ID);
var table_message = document.createElement("TABLE");
var tbody_message = document.createElement("TBODY");
constructMenuNewMessage(ID,tbody_message,table_message,content);
constructFromField(tbody_message,ID);
//////////////////////////////////////////////////////////////////////////////////////////////////////
var tr2 = document.createElement("TR");
tr2.id = "tr_cc_"+ID;
tr2.style.display = 'none';
var td2 = document.createElement("TD");
td2.innerHTML = "Cc:";
td2.setAttribute("noWrap","true");
td2.style.width = "1%";
var td_cc = document.createElement("TD");
td_cc.setAttribute("noWrap","true");
td_cc.style.width = "100%";
var input_cc = document.createElement('TEXTAREA');
input_cc.id = "cc_"+ID;
input_cc.name = "input_cc";
input_cc.setAttribute("tabIndex","1");
input_cc.style.width = "100%";
input_cc.onfocus = function(){clearTimeout(parseInt(setTimeOutLayer)); search_contacts('onfocus',this.id);};
input_cc.onblur = function(){setTimeOutLayer=setTimeout('search_contacts("lostfocus","'+this.id+'")',100);};
if (!is_ie)
{
input_cc.rows = 2;
input_cc.onkeypress = function (e)
{
if ((e.keyCode) == 120) //F9
{
emQuickSearch(input_cc.value, 'cc', ID);
}
else
{
if (((e.keyCode == 13) || ((e.keyCode == 38)||(e.keyCode == 40))) && (document.getElementById('tipDiv').style.visibility!='hidden'))
{
e.preventDefault();
search_contacts(e.keyCode,this.id);
}
}
};
input_cc.onkeyup = function (e)
{
if ((e.keyCode != 13) && (e.keyCode != 38) && (e.keyCode != 40))
{
search_contacts(e.keyCode,this.id);
}
};
}
else if (is_ie)
{
input_cc.rows = 3;
input_cc.onkeyup = function (e)
{
if ((window.event.keyCode) == 120) //F9
{
emQuickSearch(input_cc.value, 'cc', ID);
}
else
{
search_contacts(window.event.keyCode,this.id);
}
};
}
td_cc.appendChild(input_cc);
var img_search = document.createElement("IMG");
img_search.src = URL_SERVER + 'expressoMail1_2/templates/'+template+'/images/search.gif';
img_search.onclick = function () {emQuickSearch(document.getElementById('cc_'+ID).value, 'cc', ID)};
img_search.title = get_lang('Search') + " | " + get_lang('Use F9 Key as shortcut.');
var span_search = document.createElement("SPAN");
span_search.innerHTML = get_lang('Search');
var td2_img_search = document.createElement("TD");
td2_img_search.setAttribute("noWrap","true");
var td2_span_search = document.createElement("TD");
td2_span_search.setAttribute("noWrap","true");
td2_img_search.appendChild(img_search);
td2_span_search.appendChild(span_search);
tr2.appendChild(td2);
tr2.appendChild(td_cc);
tr2.appendChild(td2_img_search);
tbody_message.appendChild(tr2);
//////////////////////////////////////////////////////////////////////////////////////////////////////
var tr3 = document.createElement("TR");
tr3.id = "tr_cco_"+ID;
tr3.style.display = 'none';
var td3 = document.createElement("TD");
td3.setAttribute("noWrap","true");
td3.innerHTML = get_lang("CCo")+":";
td3.style.width = "1%";
var td_cco = document.createElement("TD");
td_cco.setAttribute("noWrap","true");
td_cco.style.width = "100%";
var input_cco = document.createElement('TEXTAREA');
input_cco.id = "cco_"+ID;
input_cco.name = "input_cco";
input_cco.setAttribute("tabIndex","1");
input_cco.style.width = "100%";
input_cco.onfocus = function(){clearTimeout(parseInt(setTimeOutLayer)); search_contacts('onfocus',this.id);};
input_cco.onblur = function(){setTimeOutLayer=setTimeout('search_contacts("lostfocus","'+this.id+'")',100);};
if (!is_ie)
{
input_cco.rows = 2;
input_cco.onkeypress = function (e)
{
if ((e.keyCode) == 120) //F9
{
emQuickSearch(input_cco.value, 'cco', ID);
}
else
{
if (((e.keyCode == 13) || ((e.keyCode == 38)||(e.keyCode == 40))) && (document.getElementById('tipDiv').style.visibility!='hidden'))
{
e.preventDefault();
search_contacts(e.keyCode,this.id);
}
}
};
input_cco.onkeyup = function (e)
{
if ((e.keyCode != 13) && (e.keyCode != 38) && (e.keyCode != 40))
{
search_contacts(e.keyCode,this.id);
}
};
}
else if (is_ie)
{
input_cco.rows = 3;
input_cco.onkeyup = function (e)
{
if ((window.event.keyCode) == 120) //F9
{
emQuickSearch(input_cco.value, 'cco', ID);
}
else
{
search_contacts(window.event.keyCode,this.id);
}
};
}
td_cco.appendChild(input_cco);
var img_search = document.createElement("IMG");
img_search.src = URL_SERVER + 'expressoMail1_2/templates/'+template+'/images/search.gif';
img_search.title = get_lang('Search') + " | " + get_lang('Use F9 Key as shortcut.');
img_search.onclick = function () {emQuickSearch(document.getElementById('cco_'+ID).value, 'cco', ID);};
var span_search = document.createElement("SPAN");
span_search.innerHTML = get_lang('Search');
var td3_img_search = document.createElement("TD");
td3_img_search.setAttribute("noWrap","true");
var td3_span_search = document.createElement("TD");
td3_span_search.setAttribute("noWrap","true");
td3_img_search.appendChild(img_search);
td3_span_search.appendChild(span_search);
tr3.appendChild(td3);
tr3.appendChild(td_cco);
tr3.appendChild(td3_img_search);
tbody_message.appendChild(tr3);
//////////////////////////////////////////////////////////////////////////////////////////////////////
var tr_link = document.createElement("TR");
tr_link.id = "tr_link_"+ID;
var td1_link = document.createElement("TD");
var td2_link = document.createElement("TD");
td1_link.innerHTML = " ";
var a_cc_link = document.createElement('A');
a_cc_link.innerHTML = get_lang('Add CC');
a_cc_link.id = "a_cc_link_"+ID;
a_cc_link.setAttribute("href","javascript:void(0)");
a_cc_link.setAttribute("tabIndex","-1");
a_cc_link.onclick = function () {
this.style.display='none';
document.getElementById('tr_cc_'+ID).style.display='';document.getElementById('space_link_'+ID).style.display='none';
input_cc.focus();
return false;
};
td2_link.appendChild(a_cc_link);
var space = document.createElement("span");
space.id ="space_link_"+ID;
space.innerHTML=" | ";
td2_link.appendChild(space);
var a_cco_link = document.createElement('A');
a_cco_link.innerHTML = get_lang('Add BCC');
a_cco_link.id = "a_cco_link_"+ID;
a_cco_link.setAttribute("href","javascript:void(0)");
a_cco_link.setAttribute("tabIndex","-1");
a_cco_link.onclick = function () {
this.style.display='none';
document.getElementById('tr_cco_'+ID).style.display='';
document.getElementById('space_link_'+ID).style.display='none';
input_cco.focus();
return false;
};
td2_link.appendChild(a_cco_link);
tr_link.appendChild(td1_link);
tr_link.appendChild(td2_link);
tbody_message.appendChild(tr_link);
//////////////////////////////////////////////////////////////////////////////////////////////////////
var tr4 = document.createElement("TR");
var td4 = document.createElement("TD");
//td4.setAttribute("noWrap","true");
td4.innerHTML = get_lang("Subject")+":";
var td_subject = document.createElement("TD");
var input_subject = document.createElement('input');
input_subject.id = "subject_"+ID;
input_subject.name = "input_subject";
input_subject.setAttribute("tabIndex","1");
input_subject.style.width = "90%";
input_subject.setAttribute("autocomplete","off");
td_subject.appendChild(input_subject);
tr4.appendChild(td4);
tr4.appendChild(td_subject);
tbody_message.appendChild(tr4);
//////////////////////////////////////////////////////////////////////////////////////////////////////
var tr5 = document.createElement("TR");
var td5 = document.createElement("TD");
td5.innerHTML = " ";
var td_return_receipt = document.createElement("TD");
td_return_receipt.setAttribute("noWrap","true");
td_return_receipt.innerHTML = get_lang("Return receipt")+":";
if (is_ie)
{
var input_return_receipt = document.createElement('input name=input_return_receipt');
}
else
{
var input_return_receipt = document.createElement('input');
input_return_receipt.name = "input_return_receipt";
}
input_return_receipt.type = "checkbox";
input_return_receipt.className = "checkbox";
input_return_receipt.id = "return_receipt_"+ID;
input_return_receipt.setAttribute("tabIndex","-1");
td_return_receipt.appendChild(input_return_receipt);
// Workaround para resolver problema ao enviar e-mails
if((preferences.use_assinar_criptografar != '0'))
{
if(parseInt(preferences.use_signature_digital_cripto)==1)
{
td_return_receipt.innerHTML += " " + get_lang("Digitally sign message?")+"";
if (is_ie)
{
var input_return_digital = document.createElement('input name=input_return_digital');
}
else
{
var input_return_digital = document.createElement('input');
input_return_digital.name = "input_return_digital";
}
input_return_digital.type = "checkbox";
input_return_digital.className = "checkbox";
input_return_digital.id = "return_digital_"+ID;
input_return_digital.setAttribute("tabIndex","-1");
if(parseInt(preferences.use_signature_digital)==1)
{
input_return_digital.defaultChecked=true;
}
td_return_receipt.appendChild(input_return_digital);
td_return_receipt.innerHTML += " " + get_lang("Digitally crypt message?")+"";
if (is_ie)
{
var input_return_cripto = document.createElement('input name=input_return_cripto');
}
else
{
var input_return_cripto = document.createElement('input');
input_return_cripto.name = "input_return_cripto";
}
input_return_cripto.type = "checkbox";
input_return_cripto.className = "checkbox";
input_return_cripto.id = "return_cripto_"+ID;
input_return_cripto.setAttribute("tabIndex","-1");
input_return_cripto.defaultChecked=false;
if(parseInt(preferences.use_signature_cripto)==1)
{
input_return_cripto.defaultChecked=true;
}
td_return_receipt.appendChild(input_return_cripto);
}
}
td_return_receipt.innerHTML += "";
tr5.appendChild(td5);
tr5.appendChild(td_return_receipt);
tbody_message.appendChild(tr5);
if (parseInt(preferences.use_important_flag))
{
var trn = document.createElement("TR");
var tdn = document.createElement("TD");
tdn.innerHTML = " ";
var td_important_msg = document.createElement("TD");
td_important_msg.setAttribute("noWrap","true");
td_important_msg.innerHTML = get_lang("Important message")+":";
var input_important_message = document.createElement('input');
input_important_message.type = "checkbox";
input_important_message.className = "checkbox";
input_important_message.id = "important_message_"+ID;
input_important_message.name = "input_important_message";
input_important_message.setAttribute("tabIndex","-1");
td_important_msg.appendChild(input_important_message);
trn.appendChild(tdn);
trn.appendChild(td_important_msg);
tbody_message.appendChild(trn);
}
var add_files = document.createElement("A");
add_files.setAttribute("href", "javascript:void(0)");
add_files.onclick = function () { addFile(ID); return false;};
add_files.innerHTML = get_lang("Attachments: add+");
add_files.setAttribute("tabIndex","-1");
var divfiles = document.createElement("DIV");
divfiles.id = "divFiles_"+ID;
var tr5 = document.createElement("TR");
var td5_link = document.createElement("TD");
var td5_input = document.createElement("TD");
td5_input.innerHTML = " ";
td5_link.setAttribute("valign","top");
td5_link.setAttribute("colSpan","2");
td5_link.appendChild(add_files);
tr5.appendChild(td5_input);
tr5.appendChild(td5_link);
tbody_message.appendChild(tr5);
var tr6 = document.createElement("TR");
var td6_link = document.createElement("TD");
var td6_input = document.createElement("TD");
tr6.appendChild(td6_link);
td6_input.appendChild(divfiles);
tr6.appendChild(td6_input);
tbody_message.appendChild(tr6);
//////////////////////////////////////////////////////////////////////////////////////////////////////
var tr5 = document.createElement("TR");
var td5 = document.createElement("TD");
td5.innerHTML = " ";
var td_body = document.createElement("TD");
td_body.setAttribute("colSpan","2");
var div_body_position = document.createElement("DIV");
div_body_position.id = "body_position_" + ID;
td_body.appendChild(div_body_position);
tr5.appendChild(td5);
tr5.appendChild(td_body);
tbody_message.appendChild(tr5);
var _div = document.createElement("DIV");
_div.id = "div_message_scroll_"+ID;
_div.style.overflow = "auto";
_div.style.width = "100%";
// Hide the contac tips and re-position the pallete color.
_div.onscroll = function() {
var intElemScrollTop = Element("div_message_scroll_"+ID).scrollTop;
if (!is_ie)
ColorPalette.repos(intElemScrollTop);
Tooltip.scrollChanged();
};
//////////////////////////////////////////////////////////////////////////////////////////////////////
_div.appendChild(form);
content.appendChild(_div);
table_message.appendChild(tbody_message);
form.appendChild(table_message);
if ( RichTextEditor == null )
RichTextEditor = new cRichTextEditor( );
RichTextEditor.loadEditor(ID);
resizeWindow();
//////////////////////////////////////////////////////////////////////////////////////////////////////
return ID;
}
// Verify if any user is sharing his name/email address
// for use in the new messages's "From " field.
function draw_from_field(sel_from,tr1_1){
var el_shared_users = Element("el_shared_users");
// The element was loaded and populated...so return.
if(el_shared_users){
// Nothing to work...so return.
if(el_shared_users.options.length == 0)
return;
tr1_1.style.display = '';
for (var x = 0; x < el_shared_users.options.length; x++) {
var _option = document.createElement("OPTION");
_option.text = el_shared_users.options[x].text;
_option.value = el_shared_users.options[x].value;
sel_from.options[sel_from.options.length] = _option;
}
return;
}
// Get the shared folders.....
var sharedFolders = new Array();
for(var i = 0; i < folders.length; i++) {
var x = folders[i].folder_id;
if (folders[i].folder_parent == 'user'){
sharedFolders[sharedFolders.length] = x;
}
}
var matchUser = '#';
var sharedUsers = new Array();
// Filter the shared folders (only root folders) .....
for(var i = 0; i < sharedFolders.length; i++) {
if(!sharedFolders[i].match(matchUser)) {
matchUser = sharedFolders[i];
sharedUsers[sharedUsers.length] = matchUser.substring(("user"+cyrus_delimiter).length,matchUser.length);
}
}
// Handler function for cExecute
var h_user = function(data) {
if(data.length > 0) {
tr1_1.style.display = '';
var _option = document.createElement("OPTION");
_option.text = '"'+data.myname+'" <'+Element("user_email").value+'>';
_option.value = data.myname+";"+Element("user_email").value;
sel_from.options[sel_from.options.length] = _option;
var options = '';
for (var x = 0; x < data.length; x++) {
var _option = document.createElement("OPTION");
_option.text = '"'+data[x].cn[0] + '" <'+data[x].mail[0]+'>';
_option.value = data[x].cn[0] + ';'+data[x].mail[0]+';'+data[x].save_shared[0]+';'+data[x].uid[0];
sel_from.options[sel_from.options.length] = _option;
}
}
var shared_users_from = Element("el_shared_users");
if(!shared_users_from) {
shared_users_from = sel_from.cloneNode(true);
shared_users_from.id = "el_shared_users";
shared_users_from.style.display = 'none';
document.body.appendChild(shared_users_from);
}
};
// First time, so execute.....
cExecute ("expressoMail1_2.ldap_functions.getSharedUsersFrom&uids="+sharedUsers.join(';'), h_user);
}
function changeBgColorToON(all_messages, begin, end){
for (begin; begin<=end; begin++)
{
add_className(all_messages[begin], 'selected_msg');
Element("check_box_message_" + all_messages[begin].id).checked = true;
}
}
function updateBoxBgColor(box){
// Set first TR Class
var _className = 'tr_msg_read2';
for(var i = 0; i < box.length;i++){
if(exist_className(box[i],_className))
remove_className(box[i], _className);
_className = (_className == 'tr_msg_read2' ? 'tr_msg_read' : 'tr_msg_read2');
if(!exist_className(box[i],_className))
add_className( box[i], _className);
}
}
function changeBgColor(event, msg_number){
actual_tr = Element(msg_number);
if (event.shiftKey)
{
last_tr = Element(last_message_selected);
if(!last_tr)
last_tr = actual_tr;
all_messages = actual_tr.parentNode.childNodes;
for (var i=0; i < all_messages.length; i++)
{
if (actual_tr.id == all_messages[i].id)
first_order = i;
if (last_tr.id == all_messages[i].id)
last_order = i;
}
if (parseInt(first_order) > parseInt(last_order))
changeBgColorToON(all_messages, last_order, first_order);
else
changeBgColorToON(all_messages, first_order, last_order);
}
else{
//if ( exist_className(actual_tr, 'selected_msg') )
if ( Element('check_box_message_' + msg_number).checked )
add_className(actual_tr, 'selected_msg');
else
remove_className(actual_tr, 'selected_msg');
}
last_message_selected = msg_number;
}
function deny_email(email){
expresso.connector.loadScript("jscode/filter");
expresso.connector.loadScript("jscode/filters");
var dn_em = document.createElement("SPAN");
dn_em.id = "tt_d";
dn_em.onclick = function(){filter_rules.new_rule(url_encode(email));};
dn_em.setAttribute("title",get_lang("Block Sender"));
dn_em.style.cursor = "pointer";
dn_em.innerHTML = "";
return dn_em;
}
function show_div_address_full(id, type) {
var div_address_full = Element("div_"+type+"address_full_"+id);
if(!div_address_full) {
div_address_full = document.createElement("SPAN");
div_address_full.id = "div_"+type+"address_full_"+id;
div_address_full.style.display="none";
var _address = eval(type+"address_array['"+id+"']");
var isOverLimit = (_address.length > 100);
if(isOverLimit) {
alert("Esse campo possui muitos endereços ("+_address.length+" destinatários).\r\n"+
"Para evitar o travamento do navegador, o botão 'Adicionar Contato' foi desabilitado!");
}
for(var idx = 1 ; idx < _address.length;idx++) {
div_address_full.innerHTML += isOverLimit ? '
'+_address[idx] : ','+this.draw_plugin_cc(_address[idx]);
}
div_address_full.innerHTML += " ("+get_lang('less')+")";
Element(type+"_"+id).appendChild(div_address_full);
}
Element('div_'+type+'address_'+id).style.display='none';
div_address_full.style.display='';
}