var BordersArray = new Array(); BordersArray[0] = new setBorderAttributes(0); function setBorderAttributes(ID) { this.border_id = "border_id_"+ID; this.sequence = ID; } function alternate_border(ID) { if (! Element('border_id_'+ID)) return false; // Not possible to alternate show_hide_span_paging(ID); Element("footer_menu").style.display = (ID != "0" ? 'none' : ''); var len = BordersArray.length; for (var i=0; i < len; i++) { m = document.getElementById(BordersArray[i].border_id); if ((m)&&(m.className == 'menu-sel')) { m.className = 'menu'; c = document.getElementById("content_id_"+BordersArray[i].sequence); c.style.display = 'none'; if(Element("font_border_id_"+BordersArray[i].sequence)) Element("font_border_id_"+BordersArray[i].sequence).className = 'font-menu'; var body = Element('body_'+BordersArray[i].sequence); if (body) { try { if (Element('viewsource_rt_checkbox').checked) { connector.loadScript("rich_text_editor"); RichTextEditor.viewsource(false); } } catch(e) { //alert(e.message) } } } } m = Element("border_id_"+ID); if (m) m.className = 'menu-sel'; if(Element("font_border_id_" + ID)) Element("font_border_id_" + ID).className = 'font-menu-sel'; var c = Element("content_id_"+ID) if (c) c.style.display = ''; body = document.getElementById('body_'+ ID); if (body){ try{ if(ID){ connector.loadScript("rich_text_editor"); RichTextEditor.loadEditor(ID); } body.contentWindow.document.designMode="on"; } catch(e){ //alert(e.message); } } // hide the DropDrowContact, if necessary window_DropDownContacts = Element('tipDiv'); if ((window_DropDownContacts)&&(window_DropDownContacts.style.visibility != 'hidden')){ window_DropDownContacts.style.visibility = 'hidden'; } if (typeof(ID) == 'number') { current_folder = openTab.imapBox[ID]; openTab.type[ID] = 0; numBox=ID; } currentTab=ID; return ID; } function create_border(borderTitle, id_value) { var resize = false; var offWidth = Element('border_blank').offsetWidth ? Element('border_blank').offsetWidth : Element('border_blank').clientWidth; if (offWidth < 200) { resize = resize_borders(); if (!resize){ alert(get_lang('Reached maximum tab limit')); return false; } } Element("footer_menu").style.display = 'none'; if (! id_value) // Is new message? var ID = parseInt(BordersArray[(BordersArray.length-1)].sequence) + 1; else{ if (Element("border_id_"+id_value)){ // It's opened already! alternate_border(id_value); return false; } if (typeof(id_value) == 'string') for (var bord = 1; bord <= 10; bord++) if (openTab.imapUid[bord] == id_value.substr(0,id_value.length-2)){ alternate_border(bord); // It's opened already! (in a new message) return false; } var ID = id_value; if (Element("border_id_"+id_value+"_r")) // Edit message? if yes treat like new in dragdrop case var id_value = null; } td = document.createElement("TD"); td.id="border_id_" + ID; if(resize) { td.setAttribute("width", parseInt(resize)+"px"); td.style.width = parseInt(resize)+"px"; } else td.setAttribute("width", "200px"); td.className = "menu"; td.setAttribute("align", "right"); td.onclick = function(){alternate_border(ID);}; td.setAttribute("noWrap","true"); var subject = borderTitle; borderTitle = borderTitle ? borderTitle : id_value ? get_lang("No Subject") : " " ; td.value = borderTitle; if (borderTitle.length > 21){ borderTitle = borderTitle.substring(0,21) + "..."; } if (resize) borderTitle = borderTitle.substring(0, resize*0.08); td.innerHTML = "
" + borderTitle + "
"; bb = document.getElementById("border_blank"); parent_bb = bb.parentNode; //Pego o tbody parent_bb.insertBefore(td, bb); if((typeof(id_value) == 'string') && id_value.match(/_r$/)) _dragArea.makeDragged(td, id_value,td.value); BordersArray[BordersArray.length] = new setBorderAttributes(ID); var div = document.createElement("DIV"); div.id = "content_id_" + ID; div.className = "conteudo"; div.style.display=''; var bar = document.getElementById("toolbar"); var offset = 0; if(bar.style.visibility != 'hidden') offset = bar.offsetHeight ? bar.offsetHeight : bar.clientHeight; div.style.height = document.body.clientHeight - offset - (is_ie ? 76 : 86); div.style.overflow = "hidden"; if(!is_ie) { var menuHidden = Element("folderscol").style.display == 'none' ? true : false; var defaultWidth = document.body.clientWidth - 27; if(!menuHidden) defaultWidth -= Element("folderscol").offsetWidth; div.style.width = defaultWidth; // div.style.width ="99.3%"; } document.getElementById("exmail_main_body").appendChild(div); alternate_border(ID); return ID; } function resize_borders() { var children; var numBorders = 0; var widthTD = 0; var newWidthTD = 0; children = Element('border_tr').childNodes; for (var i=0; i 8) return false; newWidthTD = ((numBorders*widthTD)+(Element("border_blank").clientWidth-20))/(numBorders+1); for (var i=0; i