function addWindowListItem(wid,title){var li=document.createElement("li"),a=(li.className="windowlist-li",li.id="windowlistitem"+wid,document.createElement("a"));function hideWindowList(){document.getElementById("open_windows_list").className=""}a.id="windowlistitemlink"+wid,a.onmouseover=function(e){e.ctrlKey&&client._window_set_focus(client.id_to_window[wid])},a.onclick=function(e){$(e.target).hasClass("menu-content-right")||(client.id_to_window[wid].minimized?client.id_to_window[wid].toggle_minimized():client._window_set_focus(client.id_to_window[wid]),this.parentElement.parentElement.className="-hide")};var divLeft=document.createElement("div"),img=(divLeft.id="windowlistdivleft"+wid,divLeft.className="menu-divleft",new Image),img=(img.id="windowlistitemicon"+wid,img.src="favicon.png",img.className="menu-content-left",divLeft.appendChild(img),document.createElement("div")),title=(img.appendChild(document.createTextNode(title)),img.id="windowlistitemtitle"+wid,img.className="menu-content-left",divLeft.appendChild(img),document.createElement("div")),img=(title.className="menu-divright",new Image),img3=(img.id="windowlistitemclose"+wid,img.src="icons/close.png",img.title="Close",img.className="menu-content-right",img.onclick=function(e){client._window_closed(client.id_to_window[wid]),e.stopPropagation(),hideWindowList()},new Image),img4=(img3.id="windowlistitemmax"+wid,img3.src="icons/maximize.png",img3.title="Maximize",img3.onclick=function(e){client.id_to_window[wid].toggle_maximized(),e.stopPropagation(),hideWindowList()},img3.className="menu-content-right",new Image);img4.id="windowlistitemmin"+wid,img4.src="icons/minimize.png",img4.title="Minimize",img4.onclick=function(e){client.id_to_window[wid].toggle_minimized(),e.stopPropagation(),hideWindowList()},img4.className="menu-content-right",title.appendChild(img),title.appendChild(img3),title.appendChild(img4),a.appendChild(divLeft),a.appendChild(title),li.appendChild(a),document.getElementById("open_windows_list").appendChild(li)}function removeWindowListItem(itemId){itemId=document.getElementById("windowlistitem"+itemId);itemId&&itemId.parentNode&&itemId.parentNode.removeChild(itemId)}$(function(){var float_menu=$("#float_menu");float_menu.draggable({cancel:".noDrag",containment:"window",scroll:!1}),float_menu.on("dragstart",function(ev,ui){client.mouse_grabbed=!0}),float_menu.on("dragstop",function(ev,ui){client.mouse_grabbed=!1,client.toolbar_position="custom",client.reconfigure_all_trays()})});