//////////////////// //Chat Window Manager functions //////////////////// var nBox = 0; var maxBox = 5; var chatBoxWidth = 230; var chatBoxHeight = 170; var videoBoxHeight = 150; var visibleChatBoxes = new Array(); var chatBoxSeparation = chatBoxWidth+12; function createChatBox(guest_slug,guest_name,guest_jid,user_name,user_jid){ //Create chatbox for new conversations //Open chatbox for old conversations //Box Variable name = getChatVariableFromSlug(guest_slug) if (typeof window[getChatVariableFromSlug(guest_slug)] == 'undefined') { //Add div with id = guest_slug $("#chat_divs").append("
") //Offset Management for new box boxParams = getBoxParams(); var offset = boxParams[0]; var position = boxParams[1]; window[getChatVariableFromSlug(guest_slug)] = $("#" + guest_slug).chatbox({id: user_name, user:{key : "value"}, hidden: false, offset: offset, // relative to right edge of the browser window width: chatBoxWidth, // width of the chatbox height: chatBoxHeight, // height of the chatbox video: 0, //height of the videoBox title : guest_name, position: position, priority: visibleChatBoxes.length+1, boxClosed: function(id) { position = $("#" + guest_slug).chatbox("option", "position"); for (i=position+1;i