            var browserName = navigator.appName; var browserVersion = navigator.appVersion; var b_version = parseFloat(browserVersion); var isIE = false; if(browserVersion.indexOf('MSIE')>0) { isIE = true; }   var VcomAPI = Class.create(); VcomAPI.prototype = Object.extend({}, {  XML_ARG: 0x0001,          CONFIG_XML: 0x0002,       PERSISTENT_XML: 0x0004,   CACHE_XML: 0x0008,        RELOAD: 0x0010,           NOTIFY_ALL: 0x0020,       SYNCHRONUS: 0x0040,       LOCK_FIRST: 0x0080,       ONLY_SAVE_PERSISTENT_XML: 0x0100,    PERSISTENT_XML_APPEND: 0x0200,   PERSISTENT_XML_REMOVE_LAST: 0x0400,    Z_FRONT: 99999,           Z_MIDDLE_FRONT: 9999,     Z_MIDDLE_CENTER: 999,     Z_MIDDL_BACK: 99,         Z_BACK: 9, bringToFront: function(element) { var par = "requestId="+vcomLIB.requestId+"&id="+element.id+"&zindex="; if(element.style.zIndex >= this.Z_MIDDLE_FRONT){ element.style.zIndex = element.style.zIndex + 1; par += element.style.zIndex; }else{ element.style.zIndex = this.Z_MIDDLE_FRONT; par += this.Z_MIDDLE_FRONT; } new Ajax.Request('/room/setZIndex',{ method:'get', parameters:par }); }, sendToBack: function(element) { var par = "requestId="+vcomLIB.requestId+"&id="+element.id+"&zindex="; if(element.style.zIndex <= this.Z_MIDDL_BACK){ element.style.zIndex = element.style.zIndex - 1; par += element.style.zIndex; }else{ element.style.zIndex = this.Z_MIDDL_BACK; par += this.Z_MIDDL_BACK; } new Ajax.Request('/room/setZIndex',{ method:'get', parameters:par }); }, bringForward: function(element) { this.adjustZIndex(element); var zIndex = parseInt(element.style.zIndex); if (zIndex <= this.Z_MIDDLE_FRONT) { element.style.zIndex = zIndex * 10 + 9; } else { element.style.zIndex = this.Z_FRONT; } }, sendBackward: function(element) { this.adjustZIndex(element); var zIndex = parseInt(element.style.zIndex); if (zIndex >= this.Z_MIDDL_BACK) { element.style.zIndex = parseInt(zIndex / 10); } else { element.style.zIndex = this.Z_FRONT; } }, adjustZIndex: function(element) { var zIndex = parseInt(element.style.zIndex); if (zIndex <= this.Z_BACK) { element.style.zIndex = this.Z_BACK; return; } if (zIndex <= this.Z_MIDDL_BACK) { element.style.zIndex = this.Z_MIDDL_BACK; return; } if (zIndex <= this.Z_MIDDLE_CENTER) { element.style.zIndex = this.Z_MIDDLE_CENTER; return; } if (zIndex <= this.Z_MIDDLE_FRONT) { element.style.zIndex = this.Z_MIDDLE_FRONT; return; } element.style.zIndex = this.Z_FRONT;  return; },  isUserInRoom: false, avatarNumInRoom: 0, avatarNumLimitInRoom: 0, roomOwnerId: null, isRoomOwner: false, isVisitor: false, chatAlarm: true, chatScroll: true, avatarId: null, avatarDivString: null, userId: null, userName: null, isShowUnloadAlert: true, roomWidth:    700, roomHeight:   540,     avatarWidth:    94, avatarHeight:   150, initialize: function () {}, resize: function (width, height) {}, updateAll: function (dataHash) {}, getDivIdFromId: function(ID) { if(ID.indexOf('AvatarDiv_')>=0 || ID.indexOf('ItemDiv_')>=0){ return ID.substr(ID.indexOf('Div_')+4); }else{ return ""; } }, getStatusFromId: function(ID) { if(ID.lastIndexOf('_')>0 && "A,V,T".indexOf(ID.substr(ID.lastIndexOf('_')+1))>=0){ return ID.substr(ID.lastIndexOf('_')+1); }else{ return ""; } }, getUserIdFromId: function(ID) { if(ID.indexOf('AvatarDiv_')>=0){ var divid = this.getDivIdFromId(ID); return divid.substring(divid.indexOf("_")+1,divid.lastIndexOf("_")); }else{ return ""; } }, getItemIdFromId: function(ID) { if(ID.indexOf('ItemDiv_')>=0){ var divid = this.getDivIdFromId(ID); return divid.substr(divid.indexOf("_")+1); }else{ return ""; } }, getVariable: function (id) { if (id && id.indexOf("AvatarDiv_") == 0) { return "vcomAvatar" + id.substr(id.indexOf("_")+1); }else if (id && id.indexOf("ItemDiv_") == 0) { return "vcomItem" + id.substr(id.indexOf("_")+1); }else{ return ""; }         }, kickOut: function(id) {this.evalWithTryCatch("vcomAvatar"+this.getDivIdFromId(id)+".vcomRemoveFromRoom();","vcomAPI.kickOut");}, addItem: function(id) { var div_id = id.substring(id.indexOf("_")+1); var roomID = div_id.substring(0,div_id.indexOf("_")); var itemID = div_id.substring(div_id.indexOf("_")+1); new Ajax.Request('http://'+document.domain+'/room/add_item', { method:'get',  parameters:'owneritemid='+itemID+'&roomid='+roomID }); }, removeItem: function(id) { this.evalWithTryCatch("vcomItem"+this.getDivIdFromId(id)+".vcomRemoveFromRoom();","vcomAPI.removeItem"); }, getLoseDivBackRoom: function(id){ if (id.indexOf("AvatarDiv_") == 0 || id.indexOf("ItemDiv_") == 0) { new Ajax.Request('/room/getLoseDivBackRoom', { method:'get',  parameters:'id='+id+'&requestId='+vcomLIB.requestId }); } }, reloadItem: function(id) { if($(id)){ new Ajax.Request('http://'+document.domain+'/room/reloadItem',{ method:'get', parameters: 'id='+id+'&requestId='+vcomLIB.requestId }); } }, getAllAvatar: function(){ var avatarArr = new Array(); var divs = document.getElementsByTagName("div");  for(var i=0;i < divs.length;i++){ var div = divs[i]; if(div.id.indexOf("AvatarDiv_")==0){ var divid = this.getDivIdFromId(div.id); var name = eval("vcomAvatar"+divid+".vcomUserName"); avatarArr.push({id:div.id, name:name, left:parseInt(div.style.left), top:parseInt(div.style.top), face:$("face_"+divid).src, body:$("body_"+divid).src, hair:$("hair_"+divid).src, hat:$("hat_"+divid).src}); } }    return avatarArr; }, getAllItem: function(){ var itemArr = new Array(); var divs = document.getElementsByTagName("div");  for(var i=0;i < divs.length;i++){ var div = divs[i]; if(div.id.indexOf("ItemDiv_")==0){ var divid = this.getDivIdFromId(div.id); var name = eval("vcomItem"+divid+".vcomItemName"); itemArr.push({id:div.id, name:name, left:parseInt(div.style.left), top:parseInt(div.style.top), width:parseInt(div.style.width), height:parseInt(div.style.height)}); } }    return itemArr; },  parseXML: function (text) { text=text.replace(new RegExp("&","gm"),"&amp;"); if (!text || (typeof text == 'undefined') || text == "" || text == "nil" || text == "null") return null; if (typeof DOMParser != "undefined") {  var doc = (new DOMParser()).parseFromString(text, "application/xml"); if (typeof doc == 'undefined' || doc.firstChild.nodeName=="parsererror") { return null; }  return doc;   } else if (typeof ActiveXObject != "undefined") {  var doc = new ActiveXObject("Microsoft.XMLDOM");   try { doc.loadXML(text);             } catch (e) { return null; } return doc;                      } }, XMLToString: function (xmlDoc) {  if (!xmlDoc || (typeof xmlDoc == 'undefined')) return null; if (typeof DOMParser != "undefined") {  return (new XMLSerializer()).serializeToString(xmlDoc); } else if (typeof ActiveXObject != "undefined") {  return xmlDoc.xml;                    } }, XMLGetFirstNode: function (xmlDoc, nodeName) { if (!xmlDoc || typeof xmlDoc != 'object') return null; if (xmlDoc.getElementsByTagName(nodeName).length ) { return xmlDoc.getElementsByTagName(nodeName).item(0); } else { return null; } }, XMLGetFirstNodeValue: function (xmlDoc, nodeName) { return this.XMLGetNodeValue(xmlDoc, nodeName, 0); }, XMLSetFirstNodeValue: function (xmlDoc, nodeName, nodeValue) { return this.XMLSetNodeValue(xmlDoc, nodeName, nodeValue, 0); },     XMLGetNodeValue: function (xmlDoc, nodeName, nth) { if (!xmlDoc || typeof xmlDoc != 'object') return null; if (xmlDoc.getElementsByTagName(nodeName).item(nth) && xmlDoc.getElementsByTagName(nodeName).item(nth).childNodes[0] && xmlDoc.getElementsByTagName(nodeName).item(nth).childNodes[0].nodeValue) { return xmlDoc.getElementsByTagName(nodeName).item(nth).childNodes[0].nodeValue; } else { return null; } },  XMLSetNodeValue: function (xmlDoc, nodeName, nodeValue, nth) { if (!xmlDoc || typeof xmlDoc != 'object') return null; if (xmlDoc.getElementsByTagName(nodeName).item(nth)) { if (xmlDoc.getElementsByTagName(nodeName).item(nth).childNodes[0]) { xmlDoc.getElementsByTagName(nodeName).item(nth).childNodes[0].nodeValue = nodeValue; } else {                xmlDoc.getElementsByTagName(nodeName).item(nth).appendChild(xmlDoc.createTextNode(nodeValue)); } } else { vcomLIB.errorMessage("XMLSetNodeValue:node does not exist:"+nodeName+":"+nth); } return xmlDoc; },     XMLGetNode: function (xmlDoc, nodeName, nth) { if (!xmlDoc || typeof xmlDoc != 'object') return null; if (xmlDoc.getElementsByTagName(nodeName).length && xmlDoc.getElementsByTagName(nodeName).length>nth) { return xmlDoc.getElementsByTagName(nodeName)[nth]; } else { return null; } }, XMLGetNodes: function (xmlDoc, nodeName) { if (!xmlDoc || typeof xmlDoc != 'object') return null; return xmlDoc.getElementsByTagName(nodeName); }, alert: function(entity, strMessage){ var alertBackgroundDiv=document.createElement('div'); alertBackgroundDiv.style.width=document.body.scrollWidth; alertBackgroundDiv.style.height= document.body.scrollHeight; alertBackgroundDiv.id=rand(1000000000); var item_alert_message_div = document.createElement('div'); var itemname=""; itemname='vcomItem'+entity.element.id.substr(entity.element.id.indexOf('_')+1,entity.element.id.length);  item_alert_message_div.style.width='300'; item_alert_message_div.style.cssText= 'position:absolute;z-index:'+this.Z_FRONT; item_alert_message_div.id="alert_div_"+entity.element.id; var innerstr="<table border='0' cellpadding='0' cellspacing='0' height='17' width='300'>"; innerstr=innerstr+"<tbody>"; innerstr=innerstr+"<tr>"; innerstr=innerstr+"<td id='VcomAPI_Alert_TitleBar' style='cursor:move' background='"+vcomStringsConstants.staticUrlstr+"/images/win_1.gif' height='17' width='280'>&nbsp;&nbsp;&nbsp;"+ vcomStrings.messageWindow +" </td>"; innerstr=innerstr+"<td width='20'><span class='showhand'><img src='"+vcomStringsConstants.staticUrlstr+"/images/win_2.gif' onclick=\"document.body.removeChild($('"+item_alert_message_div.id+"'));$('"+alertBackgroundDiv.id+"').parentNode.removeChild($('"+alertBackgroundDiv.id+"'));\" border='0' height='26' width='20' /></span></td>"; innerstr=innerstr+"</tr>"; innerstr=innerstr+"</tbody>"; innerstr=innerstr+"</table>"; innerstr=innerstr+"<table border='0' cellpadding='0' cellspacing='0' width='300'>"; innerstr=innerstr+"<tbody>"; innerstr=innerstr+"<tr>"; innerstr=innerstr+"<td background='"+vcomStringsConstants.staticUrlstr+"/images/win_3.gif' width='280'><table border='0' cellpadding='0' cellspacing='0' width='100%'>"; innerstr=innerstr+"<tbody>"; innerstr=innerstr+"<tr>"; innerstr=innerstr+"<td height='10' width='6%'>&nbsp;<span id='showpass'></span></td>"; innerstr=innerstr+"<td width='94%'><table border='0' cellpadding='0' cellspacing='0' width='100%'>"; innerstr=innerstr+"<tbody>"; innerstr=innerstr+"<tr>"; innerstr=innerstr+"<td><div id=\"vcomAPI_Alert\" style=\"height:80px;width:100%;overflow:auto;overflow-x:auto;overflow-y:auto;word-wrap:break-word\">"+strMessage+"</div></textarea></td>"; innerstr=innerstr+"</tr>"; innerstr=innerstr+"<tr><td class='dw_st1' height='26' align='center'><input name='close' onclick=\"if(!document.body){document.body.removeChild($('"+item_alert_message_div.id+"'));document.body.removeChild($('"+alertBackgroundDiv.id+"'));}else{if($('"+item_alert_message_div.id+"'))$('"+item_alert_message_div.id+"').parentNode.removeChild($('"+item_alert_message_div.id+"'));if($('"+alertBackgroundDiv.id+"'))$('"+alertBackgroundDiv.id+"').parentNode.removeChild($('"+alertBackgroundDiv.id+"'));}\" value='OK' type='button' /></td>"; innerstr=innerstr+"</tr>"; innerstr=innerstr+"</tbody>"; innerstr=innerstr+"</table>"; innerstr=innerstr+"<table border='0' cellpadding='0' cellspacing='0' width='100%'>"; innerstr=innerstr+"<tbody><tr><td bgcolor='#cccccc' height='1'></td></tr></tbody></table></td></tr></tbody></table></td><td background='"+vcomStringsConstants.staticUrlstr+"/images/win_4.gif' height='100' width='20'>&nbsp;</td></tr></tbody></table>"; innerstr=innerstr+"<table border='0' cellpadding='0' cellspacing='0' width='300'>"; innerstr=innerstr+"<tbody><tr><td background='"+vcomStringsConstants.staticUrlstr+"/images/win_5.gif' height='15' width='280'>&nbsp;</td>"; innerstr=innerstr+"<td width='20'><img src='"+vcomStringsConstants.staticUrlstr+"/images/win_6.gif' height='19' width='20' /></td></tr></tbody></table>"; item_alert_message_div.innerHTML=innerstr; var window_height = document.body.clientHeight;    var window_width	= document.body.clientWidth;    var self_height = 300;    var self_width = 300;        scrollTop = document.body.scrollTop;    if (!isIE) scrollTop = document.documentElement.scrollTop;    var self_top =  scrollTop + 200;        var self_left =  document.body.scrollLeft + ( window_width - self_width)/2;       alertBackgroundDiv.style.cssText="position:absolute; z-index:99998;background-color:#C5C5C5;filter:alpha(opacity=50);-moz-opacity:0.5;opacity:0.5;left:"+self_left+"px; top:"+self_top+"px;"; document.body.appendChild(alertBackgroundDiv); document.body.appendChild(item_alert_message_div); var draggable_editor = new Draggable();  draggable_editor.setUp('alert_div_'+entity.element.id,'',{handle:'VcomAPI_Alert_TitleBar'});       }, alertMessage: function(strMessage){ if (typeof $('alert_div_in_room') != 'undefined'){ document.body.removeChild($('alert_div_in_room')); } var alertBackgroundDiv=document.createElement('div'); alertBackgroundDiv.style.width=document.body.scrollWidth; alertBackgroundDiv.style.height= document.body.scrollHeight; alertBackgroundDiv.id=rand(1000000000); var item_alert_message_div = document.createElement('div');  item_alert_message_div.style.width='300'; item_alert_message_div.style.cssText= 'position:absolute;z-index:'+this.Z_FRONT; item_alert_message_div.id="alert_div_in_room"; var width = 300; var height = 300; item_alert_message_div.style.left = (lastClickX-300)+'px'; item_alert_message_div.style.top  = (lastClickY+20)+'px';  var innerstr= "<table border='0' cellpadding='0' cellspacing='0' width='"+width+"'>"+ "<tr>"+ "<td>"+ "<table width='100%' border='0' cellspacing='0' cellpadding='0' id='"+item_alert_message_div.id+"_header' style='cursor:move;'>"+ "<tr>"+ "<td width='13' height='40' background='"+vcomStringsConstants.staticUrlstr+"/images/web/popwindow_left_top.gif'>&nbsp;</td>"+ "<td width='"+(width-27)+"' background='"+vcomStringsConstants.staticUrlstr+"/images/web/popwindow_center_top.gif'>"+ "<table width='100%' border='0' cellspacing='0' cellpadding='0'>"+ "<tr>"+ "<td>"+ "<table width='"+(width-27-15)+"' border='0' align='center' cellpadding='0' cellspacing='0'>"+ "<tr>"+ "<td id='VcomAPI_SHOWHTML_TitleBar' style='cursor:move' valign='center' class='popwindow_title'>"+ vcomStrings.messageWindow +"</td>"+ "</tr>"+ "</table>"+ "</td>"+ "<td valign='center' width='15'><img src='"+vcomStringsConstants.staticUrlstr+"/images/web/popwindow_close.gif' class='showhand' onclick=\"document.body.removeChild($('"+item_alert_message_div.id+"'));$('"+alertBackgroundDiv.id+"').parentNode.removeChild($('"+alertBackgroundDiv.id+"'));\"/></td>"+ "</tr>"+ "</table>"+ "</td>"+              "<td width='14' background='"+vcomStringsConstants.staticUrlstr+"/images/web/popwindow_right_top.gif'>&nbsp;</td>"+ "</tr>"+ "</table>"+ "</td>"+ "</tr>";   innerstr +="<tr>"+ "<td>"+ "<table width='100%' border='0' cellspacing='0' cellpadding='0'>"+ "<tr>"+ "<td width='13' background='"+vcomStringsConstants.staticUrlstr+"/images/web/popwindow_left_center.gif'></td>"+ "<td bgcolor='#FFFFFF' width='"+(width-27)+"'>"+ "<table border='0' cellpadding='0' cellspacing='0' width='100%'>"+ "<tr><td><div id=\"vcomAPI_Html\" style=\"height:"+(height-200)+"px;width:100%;overflow:auto;overflow-x:auto;overflow-y:auto;word-wrap:break-word\">"+strMessage+"</div></textarea></td></tr>"+ "<tr><td class='dw_st1' height='26' align='center'><input type=\"button\" class=\"button\" onclick=\"document.body.removeChild($('alert_div_in_room'));\" value=\""+ vcomStrings.cloneButton +"\"/></td></tr>"+ "</table>"+ "</td>"+ "<td width='14' background='"+vcomStringsConstants.staticUrlstr+"/images/web/popwindow_right_center.gif'>&nbsp;</td>"+ "</tr>"+ "</table>"+ "</td>"+ "</tr>";   innerstr+="<tr><td><table width='100%' border='0' cellspacing='0' cellpadding='0'><tr>"+ "<td width='13' height='22' background='"+vcomStringsConstants.staticUrlstr+"/images/web/popwindow_left_bottom.gif'>&nbsp;</td>"+ "<td width='"+(width-27)+"' background='"+vcomStringsConstants.staticUrlstr+"/images/web/popwindow_center_bottom.gif'>&nbsp;</td>"+ "<td width='14' background='"+vcomStringsConstants.staticUrlstr+"/images/web/popwindow_right_bottom.gif'>&nbsp;</td>"+   "</tr></table>"+ "</td></tr></table>"; item_alert_message_div.innerHTML=innerstr; var window_height = document.body.clientHeight;    var window_width	= document.body.clientWidth;    var self_height = 300;    var self_width = 300;        scrollTop = document.body.scrollTop;    if (!isIE) scrollTop = document.documentElement.scrollTop;    var self_top =  scrollTop + 200;        var self_left =  document.body.scrollLeft + ( window_width - self_width)/2;       alertBackgroundDiv.style.cssText="position:absolute; z-index:99998;background-color:#C5C5C5;filter:alpha(opacity=50);-moz-opacity:0.5;opacity:0.5;left:"+self_left+"px; top:"+self_top+"px;"; document.body.appendChild(alertBackgroundDiv); document.body.appendChild(item_alert_message_div); var draggable_editor = new Draggable();  draggable_editor.setUp(item_alert_message_div.id,'',{handle:item_alert_message_div.id+'_header'});       }, showHtmlWindow: function(entity, htmlString, width, height, isModal, okFunction, cancelFunction){ if (!okFunction) okFunction = ""; if (!cancelFunction) cancelFunction = ""; var htmlBackgroundDiv=document.createElement('div'); htmlBackgroundDiv.style.cssText="position:absolute; z-index:99998;top:0;left:0;background-color:#C5C5C5;filter:alpha(opacity=50);-moz-opacity:0.5;opacity:0.5;left:0px; top:0px;"; htmlBackgroundDiv.style.width=document.body.scrollWidth; htmlBackgroundDiv.style.height= document.body.scrollHeight; htmlBackgroundDiv.id=rand(1000000000); var item_html_message_div = document.createElement('div'); var itemname=""; itemname='vcomItem'+entity.element.id.substr(entity.element.id.indexOf('_')+1,entity.element.id.length);  item_html_message_div.style.width=width; item_html_message_div.style.cssText= 'position:absolute;z-index:'+this.Z_FRONT; item_html_message_div.id="html_div_"+entity.element.id; if ($(item_html_message_div.id)) { $(item_html_message_div.id).parentNode.removeChild($(item_html_message_div.id)); } var innerstr= "<table border='0' cellpadding='0' cellspacing='0' width='"+width+"'>"+ "<tr>"+ "<td>"+ "<table width='100%' border='0' cellspacing='0' cellpadding='0' id='edithtmlheadline' style='cursor:move;'>"+ "<tr>"+ "<td width='13' height='40' background='"+vcomStringsConstants.staticUrlstr+"/images/web/popwindow_left_top.gif'>&nbsp;</td>"+ "<td width='"+(width-27)+"' background='"+vcomStringsConstants.staticUrlstr+"/images/web/popwindow_center_top.gif'>"+ "<table width='100%' border='0' cellspacing='0' cellpadding='0'>"+ "<tr>"+ "<td>"+ "<table width='"+(width-27-15)+"' border='0' align='center' cellpadding='0' cellspacing='0'>"+ "<tr>"+ "<td id='VcomAPI_SHOWHTML_TitleBar' style='cursor:move' valign='center' class='popwindow_title'>"+ vcomStrings.messageWindow +"</td>"+ "</tr>"+ "</table>"+ "</td>"+ "<td valign='center' width='15'><img src='"+vcomStringsConstants.staticUrlstr+"/images/web/popwindow_close.gif' class='showhand' onclick=\"vcomAPI.showHtmlCancel('"+entity.element.id+"','"+cancelFunction+"','"+htmlBackgroundDiv.id+"');\"/></td>"+ "</tr>"+ "</table>"+ "</td>"+              "<td width='14' background='"+vcomStringsConstants.staticUrlstr+"/images/web/popwindow_right_top.gif'>&nbsp;</td>"+ "</tr>"+ "</table>"+ "</td>"+ "</tr>"; innerstr=innerstr+    "<tr>"+ "<td>"+ "<table width='100%' border='0' cellspacing='0' cellpadding='0'>"+ "<tr>"+ "<td width='13' background='"+vcomStringsConstants.staticUrlstr+"/images/web/popwindow_left_center.gif'></td>"+ "<td bgcolor='#FFFFFF' width='"+(width-27)+"'>"+ "<table border='0' cellpadding='0' cellspacing='0' width='100%'>"+ "<tr>"+ "<td><div id=\"vcomAPI_Html\" style=\"height:"+(height-200)+"px;width:100%;overflow:auto;overflow-x:auto;overflow-y:auto;word-wrap:break-word\">"+htmlString+"</div></textarea></td>"+ "</tr>"+ "<tr>"+ "<td class='dw_st1' height='26' align='center'>"+ "<input name='ok' onclick=\"vcomAPI.showHtmlOK('"+entity.element.id+"','"+okFunction+"','"+htmlBackgroundDiv.id+"');\" value='OK' type='button' />"+ "<input name='cancel' onclick=\"vcomAPI.showHtmlCancel('"+entity.element.id+"','"+cancelFunction+"','"+htmlBackgroundDiv.id+"');\" value='Cancel' type='button' />"+ "</td>"+ "</tr>"+ "</table>"+ "</td>"+ "<td width='14' background='"+vcomStringsConstants.staticUrlstr+"/images/web/popwindow_right_center.gif'>&nbsp;</td>"+ "</tr>"+ "</table>"+ "</td>"+ "</tr>"; innerstr=innerstr+ "<tr>"+ "<td>"+ "<table width='100%' border='0' cellspacing='0' cellpadding='0'>"+ "<tr>"+ "<td width='13' height='22' background='"+vcomStringsConstants.staticUrlstr+"/images/web/popwindow_left_bottom.gif'>&nbsp;</td>"+ "<td width='"+(width-27)+"' background='"+vcomStringsConstants.staticUrlstr+"/images/web/popwindow_center_bottom.gif'>&nbsp;</td>"+ "<td width='14' background='"+vcomStringsConstants.staticUrlstr+"/images/web/popwindow_right_bottom.gif'>&nbsp;</td>"+   "</tr>"+ "</table>"+ "</td>"+ "</tr>"+ "</table>";  item_html_message_div.innerHTML=innerstr;                         var self_top = parseInt($(entity.element.id).style.top)+100;    var self_left = parseInt($(entity.element.id).style.left)+100;       item_html_message_div.style.top=self_top+"px"; item_html_message_div.style.left=self_left+"px"; if (typeof isModal != 'undefined' && isModal == true) { document.body.appendChild(htmlBackgroundDiv); document.body.appendChild(item_html_message_div); } else { $('backgroundDiv').appendChild(item_html_message_div);        } var draggable = new Draggable(); draggable.setUp('html_div_'+entity.element.id,'',{handle:'edithtmlheadline'});       }, showHtmlOK: function(element_id, functionName, BackgroundDivId){  if (functionName!=null && functionName != "null" && functionName != "") { vcomLIB.debugMessage(functionName); this.evalWithTryCatch("vcomItem"+this.getDivIdFromId(element_id)+"."+functionName+"()", "showHtmlOK callback failed");        } $("html_div_"+element_id).style.visibility='hidden'; if($(''+BackgroundDivId)){ $(''+BackgroundDivId).style.visibility='hidden'; } return null; }, showHtmlCancel: function(element_id, functionName, BackgroundDivId){ if (functionName!=null && functionName != "null" && functionName != "") { this.evalWithTryCatch('vcomItem'+this.getDivIdFromId(element_id)+'.'+functionName+'()', 'showHtmlCancel callback failed');     } if(!document.body){ document.body.removeChild($("html_div_"+element_id)); document.body.removeChild($(''+BackgroundDivId)); }else{ if($("html_div_"+element_id)){ $("html_div_"+element_id).parentNode.removeChild($("html_div_"+element_id)); } if($(''+BackgroundDivId)){ $(''+BackgroundDivId).parentNode.removeChild($(''+BackgroundDivId)); } } return null; }, confirm: function(element_id,OFunctionName,CFunctionName,strMessage){ var element_id = element_id; var OFunctionName = OFunctionName; var CFunctionName = CFunctionName; var strMessage = strMessage; var confirmBackgroundDiv=document.createElement('div'); confirmBackgroundDiv.style.cssText="position:absolute; z-index:99998;top:0px;left:0px;background-color:#C5C5C5;filter:alpha(opacity=50);-moz-opacity:0.5;opacity:0.5;"; confirmBackgroundDiv.style.width=document.body.scrollWidth; confirmBackgroundDiv.style.height= document.body.scrollHeight; confirmBackgroundDiv.id=rand(1000000000);  var item_alert_message_div = document.createElement('div'); var itemname='vcomItem'+this.getDivIdFromId(element_id); item_alert_message_div.style.width='300'; item_alert_message_div.style.cssText= 'position:absolute;z-index:'+this.Z_FRONT; item_alert_message_div.id="confirm_div_"+element_id; var innerstr= "<table border='0' cellpadding='0' cellspacing='0' width='327'>"+ "<tr>"+ "<td width='13' height='40' background='"+vcomStringsConstants.staticUrlstr+"/images/web/popwindow_left_top.gif'>&nbsp;</td>"+ "<td width='300' background='"+vcomStringsConstants.staticUrlstr+"/images/web/popwindow_center_top.gif'>"+ "<table width='100%' border='0' cellspacing='0' cellpadding='0'>"+ "<tr>"+                                     "<td width='285' id='VcomAPI_Alert_TitleBar' style='cursor:move' valign='center' class='popwindow_title'>"+ vcomStrings.messageWindow +"</td>"+                                     "<td valign='center' width='15'><img src='"+vcomStringsConstants.staticUrlstr+"/images/web/popwindow_close.gif' class='showhand' onclick=\"vcomAPI.cancelConfirm('"+element_id+"','"+CFunctionName+"','"+confirmBackgroundDiv.id+"');\"/></td>"+ "</tr>"+ "</table>"+ "</td>"+ "<td width='14' background='"+vcomStringsConstants.staticUrlstr+"/images/web/popwindow_right_top.gif'>&nbsp;</td>"+ "</tr>"; innerstr=innerstr+ "<tr>"+ "<td width='13' background='"+vcomStringsConstants.staticUrlstr+"/images/web/popwindow_left_center.gif'>&nbsp;</td>"+ "<td width='300' bgcolor='#FFFFFF'>"+ "<table border='0' cellpadding='0' cellspacing='0' width='100%'>"+ "<tr>"+ "<td><div id=\"vcomAPI_Alert\" style=\"height:80px;width:100%;overflow:auto;overflow-x:auto;overflow-y:auto;word-wrap:break-word\">"+strMessage+"</div></textarea></td>"+ "</tr>"+ "<tr>"+ "<td class='dw_st1' height='26' align='center'>"+ "<input name='close' onclick=\"vcomAPI.submitConfirm('"+element_id+"','"+OFunctionName+"','"+confirmBackgroundDiv.id+"');\" value='"+vcomStrings.InPlaceOkText+"' type='button' />&nbsp;&nbsp;&nbsp;"+ "<input name='cancel' onclick=\"vcomAPI.cancelConfirm('"+element_id+"','"+CFunctionName+"','"+confirmBackgroundDiv.id+"');\" value='"+vcomStrings.InPlaceCancelText+"' type='button' />"+ "</td>"+ "</tr>"+ "</table>"+ "</td>"+ "<td width='14' background='"+vcomStringsConstants.staticUrlstr+"/images/web/popwindow_right_center.gif'>&nbsp;</td>"+  "</tr>"; innerstr=innerstr+ "<tr>"+ "<td width='13' height='22' background='"+vcomStringsConstants.staticUrlstr+"/images/web/popwindow_left_bottom.gif'>&nbsp;</td>"+ "<td width='300' background='"+vcomStringsConstants.staticUrlstr+"/images/web/popwindow_center_bottom.gif'>&nbsp;</td>"+ "<td width='14' background='"+vcomStringsConstants.staticUrlstr+"/images/web/popwindow_right_bottom.gif'>&nbsp;</td>"+   "</tr>"+ "</table>";         item_alert_message_div.innerHTML=innerstr; var window_height = document.body.clientHeight;     var window_width	= document.body.clientWidth;            var self_height = 160;    var self_width = 320;    scrollTop = document.body.scrollTop;    if (!isIE) scrollTop = document.documentElement.scrollTop;    var self_top =  scrollTop + 200;        var self_left =  document.body.scrollLeft + ( window_width - self_width)/2; item_alert_message_div.style.top=self_top+"px"; item_alert_message_div.style.left=self_left+"px";  document.body.appendChild(confirmBackgroundDiv); document.body.appendChild(item_alert_message_div); var draggable_editor = new Draggable();  draggable_editor.setUp('confirm_div_'+element_id,'',{handle:'VcomAPI_Alert_TitleBar'});       }, submitConfirm:function(element_id,OFunctionName,confirmBackgroundDivid){ eval('vcomItem'+this.getDivIdFromId(element_id)+'.'+OFunctionName+'()'); $('confirm_div_'+element_id).parentNode.removeChild($('confirm_div_'+element_id)); $(''+confirmBackgroundDivid).parentNode.removeChild($(''+confirmBackgroundDivid)); }, cancelConfirm:function(element_id,CFunctionName,confirmBackgroundDivid){ if(CFunctionName!="doNothing")  eval('vcomItem'+this.getDivIdFromId(element_id)+'.'+CFunctionName+'()'); $('confirm_div_'+element_id).parentNode.removeChild($('confirm_div_'+element_id)); $(''+confirmBackgroundDivid).parentNode.removeChild($(''+confirmBackgroundDivid)); }, evalWithTryCatch: function(evalString, exceptionMessage) {  if (exceptionMessage == null) { exceptionMessage = ""; } eval('try{'+evalString+'}catch(e){var msg = \"'+exceptionMessage+'\" + \":e=\"+e.name+\"::\"+e.message;vcomLIB.errorMessage(msg);}');      }, promptOK: function(element_id, functionName, promptBackgroundDivId) {  if (functionName!=null && functionName != "null" && functionName != "") {  var promptValue = $(element_id + "_PROMPT").value; this.evalWithTryCatch("vcomItem"+this.getDivIdFromId(element_id)+"."+functionName+"(\""+promptValue+"\")", "promptOK callback failed");        } $('prompt_div_'+element_id).parentNode.removeChild($('prompt_div_'+element_id)); $(''+promptBackgroundDivId).parentNode.removeChild($(''+promptBackgroundDivId));   return null; }, promptCancel: function(element_id, functionName, promptBackgroundDivId) { if (functionName!=null && functionName != "null" && functionName != "") { eval('vcomItem'+this.getDivIdFromId(element_id)+'.'+functionName+'()');     } $('prompt_div_'+element_id).parentNode.removeChild($('prompt_div_'+element_id)); $(''+promptBackgroundDivId).parentNode.removeChild($(''+promptBackgroundDivId));   $(element_id + "_PROMPT").value = ""; return null; }, prompt: function(entity, promptMessage, okFunction, cancelFunction, promptDefaultValue){ var element_id = entity.element.id;   if (promptMessage == null) promptMessage = ""; if (promptDefaultValue == null) promptDefaultValue = ""; if (!okFunction) okFunction = ""; if (!cancelFunction) cancelFunction = ""; var promptBackgroundDiv=document.createElement('div'); promptBackgroundDiv.style.cssText="position:absolute; z-index:99998;top:0;left:0;background-color:#C5C5C5;filter:alpha(opacity=50);-moz-opacity:0.5;opacity:0.5;left:0px; top:0px;"; promptBackgroundDiv.style.width=document.body.scrollWidth; promptBackgroundDiv.style.height= document.body.scrollHeight; promptBackgroundDiv.id=rand(1000000000); var item_prompt_message_div = document.createElement('div'); var itemname='vcomItem'+this.getDivIdFromId(element_id); item_prompt_message_div.style.width='300'; item_prompt_message_div.style.cssText= 'position:absolute;z-index:'+this.Z_FRONT; item_prompt_message_div.id="prompt_div_"+element_id; var innerstr="<table border='0' cellpadding='0' cellspacing='0' height='17' width='300'>"; innerstr=innerstr+"<tbody>"; innerstr=innerstr+"<tr>"; innerstr=innerstr+"<td id='VcomAPI_Prompt_TitleBar' style='cursor:move' background='"+vcomStringsConstants.staticUrlstr+"/images/win_1.gif' height='17' width='280'>&nbsp;&nbsp;&nbsp;Message</td>"; innerstr=innerstr+"<td width='20'><span class='showhand'><img src='"+vcomStringsConstants.staticUrlstr+"/images/win_2.gif' onclick=\"vcomAPI.promptCancel('"+element_id+"','"+cancelFunction+"','"+promptBackgroundDiv.id+"');\" border='0' height='26' width='20' /></span></td>"; innerstr=innerstr+"</tr>"; innerstr=innerstr+"</tbody>"; innerstr=innerstr+"</table>"; innerstr=innerstr+"<table border='0' cellpadding='0' cellspacing='0' width='300'>"; innerstr=innerstr+"<tbody>"; innerstr=innerstr+"<tr>"; innerstr=innerstr+"<td background='"+vcomStringsConstants.staticUrlstr+"/images/win_3.gif' width='280'><table border='0' cellpadding='0' cellspacing='0' width='100%'>"; innerstr=innerstr+"<tbody>"; innerstr=innerstr+"<tr>"; innerstr=innerstr+"<td height='10' width='6%'>&nbsp;<span id='showpass'></span></td>"; innerstr=innerstr+"<td width='94%'><table border='0' cellpadding='0' cellspacing='0' width='100%'>"; innerstr=innerstr+"<tbody>"; innerstr=innerstr+"<tr>"; innerstr=innerstr+"<td><div id=\"vcomAPI_Prompt\" style=\"height:40px;width:100%;overflow:auto;overflow-x:auto;overflow-y:auto;word-wrap:break-word\">"+promptMessage+"</div></textarea></td>"; innerstr=innerstr+"</tr>"; innerstr=innerstr+"<tr><td class='dw_st1' height='26' align='left'><input id='" + element_id + "_PROMPT' value='" + promptDefaultValue + "' type='text' size='36' maxlength='256'/>&nbsp;&nbsp;&nbsp;"; innerstr=innerstr+"</td>"; innerstr=innerstr+"</tr>"; innerstr=innerstr+"<tr><td class='dw_st1' height='26' align='center'><input name='close' onclick=\"vcomAPI.promptOK('"+element_id+"','"+okFunction+"','"+promptBackgroundDiv.id+"');\" value='OK' type='button' />&nbsp;&nbsp;&nbsp;"; innerstr=innerstr+"<input name='cancel' onclick=\"vcomAPI.promptCancel('"+element_id+"','"+cancelFunction+"','"+promptBackgroundDiv.id+"');\" value='Cancel' type='button' /></td>"; innerstr=innerstr+"</tr>"; innerstr=innerstr+"</tbody>"; innerstr=innerstr+"</table>"; innerstr=innerstr+"<table border='0' cellpadding='0' cellspacing='0' width='100%'>"; innerstr=innerstr+"<tbody><tr><td bgcolor='#cccccc' height='1'></td></tr></tbody></table></td></tr></tbody></table></td><td background='"+vcomStringsConstants.staticUrlstr+"/images/win_4.gif' height='100' width='20'>&nbsp;</td></tr></tbody></table>"; innerstr=innerstr+"<table border='0' cellpadding='0' cellspacing='0' width='300'>"; innerstr=innerstr+"<tbody><tr><td background='"+vcomStringsConstants.staticUrlstr+"/images/win_5.gif' height='15' width='280'>&nbsp;</td>"; innerstr=innerstr+"<td width='20'><img src='"+vcomStringsConstants.staticUrlstr+"/images/win_6.gif' height='19' width='20' /></td></tr></tbody></table>"; item_prompt_message_div.innerHTML=innerstr; var window_height = document.body.clientHeight; var window_width	= document.body.clientWidth;   var self_height = 300; var self_width = 300;     scrollTop = document.body.scrollTop;     if (!isIE) scrollTop = document.documentElement.scrollTop;     var self_top =  scrollTop + 200;  var self_left =  document.body.scrollLeft + ( window_width - self_width)/2; item_prompt_message_div.style.top=self_top+"px"; item_prompt_message_div.style.left=self_left+"px"; document.body.appendChild(promptBackgroundDiv); document.body.appendChild(item_prompt_message_div); var draggable_editor = new Draggable();  draggable_editor.setUp('prompt_div_'+element_id,'',{handle:'VcomAPI_Prompt_TitleBar'});    },     EVENT_ENTER_ROOM:         0x0001,      EVENT_EXIT_ROOM:          0x0002,      EVENT_MOVE:               0x0004,      EVENT_ITEM_LOCK:          0x0010,      EVENT_ITEM_UNLOCK:        0x0020,      EVENT_AVATAR_CHAT:        0x0040,      EVENT_ITEM_CHAT:          0x0080,      EVENT_ITEM_RESIZE:        0x0100,      EVENT_ITEM_PIN:           0x0200,      EVENT_ITEM_UNPIN:         0x0400,      EVENT_ROOM_PRELOAD:       0x1000,      EVENT_ROOM_POSTLOAD:      0x2000,      EVENT_ITEM_OWNERCONTROL:  0x4000,      EVENT_ITEM_UNOWNERCONTROL:0x8000,      EVENT_ALL:                0xFFFF,      callbacks: [], registerEvent: function(event, callback) {  this.callbacks.push([event, callback]); }, unregisterEvent: function(event, callback) {  var length = this.callbacks.length; for (var i=0; i<length; i++) { var eventCallback = this.callbacks.shift();  if ((eventCallback[0] & event) &&  (!callback || (eventCallback[1] == callback) || (eventCallback[1].toString==callback.toString)) ) { if (eventCallback[0] != event ) {  eventCallback[0] ^= event;       this.callbacks.push(eventCallback); } } else { this.callbacks.push(eventCallback); } } }, fireCallbacks: function(event, data) { try{  if(this.callbacks.length){ for (var i=0; i<this.callbacks.length; i++) {  if (this.callbacks[i][0] & event) {    this.callbacks[i][1](event, data);                 } } } }catch(e){ var msg = "fireCallbacks: Event="+event+":data="+data+":e="+e.name+"::"+e.message; vcomLIB.errorMessage(msg); } }, removeRightMenu: function() { if(!vcomAPI.clickShowRightMenu){ var menuItem=$(menuDivId);  if(menuItem) menuItem.parentNode.removeChild(menuItem); }else{ vcomAPI.clickShowRightMenu = false; } }, getStringByLanguage: function(str,enString,twString,zhString){  var fieldName = str; if (fieldName.indexOf("_(")>=0 && fieldName.indexOf(")")>0){ var fieldNameStr = fieldName.substring(fieldName.indexOf("_(")+2,fieldName.lastIndexOf(")"));  var fieldNameArr = fieldNameStr.split(",");  for(var k=0;k<fieldNameArr.length;k++){ if(k==0){   var lang = vcomAPI.roomArea; if(!lang){ lang = GetCookie('lang'); }  var fieldNameF = ""; var fieldNameL = ""; var fieldNameTra = fieldNameStr;  if(lang=="tw" && twString && eval('twString.'+fieldNameArr[k])){ fieldNameTra = eval('twString.'+fieldNameArr[k]); }else if(lang=="zh" && zhString && eval('zhString.'+fieldNameArr[k])){ fieldNameTra = eval('zhString.'+fieldNameArr[k]); }else if(lang=="en" && enString && eval('enString.'+fieldNameArr[k])){ fieldNameTra = eval('enString.'+fieldNameArr[k]); }  if(fieldName.indexOf("_(")>0){ fieldNameF = fieldName.substring(0,fieldName.indexOf("_("));  } if(fieldName.lastIndexOf(")")>0 && fieldName.lastIndexOf(")")!=fieldName.length-1){ fieldNameL = fieldName.substring(fieldName.indexOf(")")+1);  } fieldName = fieldNameF + fieldNameTra + fieldNameL;  }else{  if(fieldName.indexOf("$"+k)>0){ var str = /\$1/g; if(k==2){ str = /\$2/g; }else if(k==3){ str = /\$3/g; }else if(k==4){ str = /\$4/g; }else if(k==5){ str = /\$5/g; }else if(k==6){ str = /\$6/g; }  fieldName = fieldName.replace(str,""+fieldNameArr[k]);  } } } } return fieldName; }, serialize: function(objectToSerilize, objectName, indentSpace) { JSerialize(objectToSerilize, objectName, indentSpace); }, deserialize: function(XmlText) { JDeserialize(xmlText); }, onMouseClickBackGround: function (evt)  { var button = 0; if(isIE) { button = window.event.button; }else{  button = evt.button; } if(button==0||button==1){ vcomAPI.removeRightMenu(); }   MM_showHideLayers('LayerChatMessageColor','','hide'); MM_showHideLayers('LayerChatExpression','','hide'); }, onMouseClickChatField: function (evt)  { MM_showHideLayers('LayerChatMessageColor','','hide'); MM_showHideLayers('LayerChatExpression','','hide'); }, vcomShowHelp:function(itemType){ var lang = vcomAPI.roomArea; if(!lang){ lang = GetCookie('lang'); }  new Ajax.Request("/menu/replace_picture?selectedHelp="+itemType + "&lang="+lang,{method:"get",onSuccess:function(response){ var width = 620; var height = 650; var divId = "showHelpByItemType"; var innerstr= "<table border='0' cellpadding='0' cellspacing='0' width='"+width+"'>"+ "<tr>"+ "<td>"+ "<table width='100%' border='0' cellspacing='0' cellpadding='0' id='"+divId+"_header' style='cursor:move;'>"+ "<tr>"+ "<td width='13' height='40' background='"+vcomStringsConstants.staticUrlstr+"/images/web/popwindow_left_top.gif'>&nbsp;</td>"+ "<td width='"+(width-27)+"' background='"+vcomStringsConstants.staticUrlstr+"/images/web/popwindow_center_top.gif'>"+ "<table width='100%' border='0' cellspacing='0' cellpadding='0'>"+ "<tr>"+ "<td>"+ "<table width='"+(width-27-15)+"' border='0' align='center' cellpadding='0' cellspacing='0'>"+ "<tr>"+ "<td id='VcomAPI_SHOWHTML_TitleBar' style='cursor:move' valign='center' class='popwindow_title'>"+ vcomStrings.messageWindow +"</td>"+ "</tr>"+ "</table>"+ "</td>"+ "<td valign='center' width='15'><img src='"+vcomStringsConstants.staticUrlstr+"/images/web/popwindow_close.gif' class='showhand' onclick=\"javascript:Element.hide('"+divId+"')\"/></td>"+ "</tr>"+ "</table>"+ "</td>"+              "<td width='14' background='"+vcomStringsConstants.staticUrlstr+"/images/web/popwindow_right_top.gif'>&nbsp;</td>"+ "</tr>"+ "</table>"+ "</td>"+ "</tr>";   innerstr +="<tr>"+ "<td>"+ "<table width='100%' border='0' cellspacing='0' cellpadding='0'>"+ "<tr>"+ "<td width='13' background='"+vcomStringsConstants.staticUrlstr+"/images/web/popwindow_left_center.gif'></td>"+ "<td bgcolor='#FFFFFF' width='"+(width-27)+"'>"+ "<table border='0' cellpadding='0' cellspacing='0' width='100%'><tr>"+ "<td><div id=\"vcomAPI_Html\" style=\"height:"+(height-200)+"px;width:100%;overflow:auto;overflow-x:auto;overflow-y:auto;word-wrap:break-word\">"+response.responseText+"</div></textarea></td>"+ "</tr><tr>"+ "<td class='dw_st1' height='26' align='center'>"+                                           "</td>"+ "</tr>"+ "</table>"+ "</td>"+ "<td width='14' background='"+vcomStringsConstants.staticUrlstr+"/images/web/popwindow_right_center.gif'>&nbsp;</td>"+ "</tr>"+ "</table>"+ "</td>"+ "</tr>";   innerstr+="<tr><td><table width='100%' border='0' cellspacing='0' cellpadding='0'><tr>"+ "<td width='13' height='22' background='"+vcomStringsConstants.staticUrlstr+"/images/web/popwindow_left_bottom.gif'>&nbsp;</td>"+ "<td width='"+(width-27)+"' background='"+vcomStringsConstants.staticUrlstr+"/images/web/popwindow_center_bottom.gif'>&nbsp;</td>"+ "<td width='14' background='"+vcomStringsConstants.staticUrlstr+"/images/web/popwindow_right_bottom.gif'>&nbsp;</td>"+   "</tr></table>"+ "</td></tr></table>";                             $(divId).innerHTML = innerstr; Element.show(divId);  var showHelp = new Draggable(); showHelp.setUp(divId,'',{handle:divId+"_header"}); }});  }, getFieldValueConfigXml:function(configXML,fieldName){ if(configXML == null || configXML== undefined){ return ""; } var fields = configXML.getElementsByTagName('field'); var length = fields.length; for(var i = 0 ; i < length; i++){ var field = fields[i]; if(field != null && field != undefined){                         var id = vcomAPI.XMLGetFirstNodeValue(field, 'id');             if(id.toLowerCase()== fieldName){ return vcomAPI.XMLGetFirstNodeValue(field, "value"); } } } return ""; } }); var vcomAPI = new VcomAPI();   var VcomLIB = Class.create(); VcomLIB.prototype = Object.extend({}, { initialize: function () {}, showReceiveMessageFlag : false, logMessageDraggable:null, resize: function (x, width, height) { if(x.style) { x.style.width = width+"px"; x.style.height = height+"px"; }else{ x.width = width+"px"; x.height = height+"px"; } }, resizeArray: function (x, width, height) { for (var i = 0; i < x.length; i++) { this.resize(x[i], width, height); } }, roomId:null, requestId:null, skipBeforeUnloadEvent: false, listenUnloadRoomIndex: function () { Event.observe(window, "unload", this.onUnloadRoomIndex.bindAsEventListener(this)); window.onbeforeunload = function (oEvent) {  if(vcomAPI.isShowUnloadAlert && vcomAPI.isUserInRoom){ if (!oEvent) oEvent = window.event; oEvent.returnValue = vcomStrings.leaveRoomConfirmStr; } vcomAPI.isShowUnloadAlert=true; } }, onUnloadRoomIndex: function () {   var paras = "id="+vcomAPI.avatarId+"&user_name="+encodeURIComponent(vcomAPI.userName)+"&requestId="+vcomLIB.requestId; new Ajax.Request('/room/onUnload',{parameters:paras}); }, LOG_ERROR:  0x0001, LOG_WARN:   0x0010,  LOG_INFO1:  0x0020,   LOG_INFO2:  0x0040,   LOG_INFO3:  0x0080,   LOG_INFO:   0x0100,   LOG_DEBUG1: 0x0200,   LOG_DEBUG2: 0x0400,   LOG_DEBUG3: 0x0800,   LOG_DEBUG:  0x1000, LOG_ALL:0xFFFF, logLevel:0x0001, logMethod:'by_level',  setUpLogMessage: function (logLevel, logMethod){ if (logLevel) this.logLevel = logLevel; if (logMethod) this.logMethod = logMethod; if (!this.logMessageDraggable) { $('vcomLogMessageWindow').innerHTML =  "<table width=\"427\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">" + "<tr>" + "<td width=\"13\" height=\"40\" background=\""+vcomStringsConstants.staticUrlstr+"/images/web/popwindow_left_top.gif\"></td>" + "<td width=\"400\" background=\""+vcomStringsConstants.staticUrlstr+"/images/web/popwindow_center_top.gif\">" + "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" id=\"vcomLogTitleBar\">" + "<tr>" + "<td width=\"385\">"+ "<table width=\"100%\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">"+ "<tr>"+ "<td valign=\"center\" class=\"popwindow_title\">"+vcomStrings.sysPostStr+"</td>"+ "</tr>"+ "</table>"+ "</td>" + "<td valign=\"center\" width=\"15\"><img src=\""+vcomStringsConstants.staticUrlstr+"/images/web/popwindow_close.gif\" class=\"showhand\" onclick=\"MM_showHideLayers('vcomLogMessageWindow','','hide');\"/></td>"+ "</tr>" + "</table>" + "</td>" + "<td width=\"14\" background=\""+vcomStringsConstants.staticUrlstr+"/images/web/popwindow_right_top.gif\"></td>" + "</tr>" + "<tr>" +                 "<td width=\"13\" background=\""+vcomStringsConstants.staticUrlstr+"/images/web/popwindow_left_center.gif\">&nbsp;</td>"+ "<td width=\"400\" bgcolor=\"#FFFFFF\">"+                 "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">" + "<tr>" + "<td width=\"100%\" height=\"28\" class=\"dw_st1\">" + "<div id=\"vcomLogMessage\" style=\"height:180px;width:400px;overflow:auto;\"></div>" + "</td>" + "</tr>" +                   "</table>" +                  "</td>" +                 "<td width=\"14\" background=\""+vcomStringsConstants.staticUrlstr+"/images/web/popwindow_right_center.gif\">&nbsp;</td>"+ "</tr>" +                 "<tr>"+ "<td width=\"13\" height=\"22\" background=\""+vcomStringsConstants.staticUrlstr+"/images/web/popwindow_left_bottom.gif\">&nbsp;</td>"+ "<td width=\"400\" background=\""+vcomStringsConstants.staticUrlstr+"/images/web/popwindow_center_bottom.gif\">&nbsp;</td>"+ "<td width=\"14\" background=\""+vcomStringsConstants.staticUrlstr+"/images/web/popwindow_right_bottom.gif\">&nbsp;</td>"+ "</tr>"+ "</table>"; this.logMessageDraggable = new Draggable(); this.logMessageDraggable.setUp('vcomLogMessageWindow',"",{handle:'vcomLogTitleBar'});  this.resetLogMessage(); } },     showLogMessage: function (){ this.setUpLogMessage(this.logLevel,this.logMethod); MM_showHideLayers('vcomLogMessageWindow','','show'); }, hideLogMessage: function (){ MM_showHideLayers('vcomLogMessageWindow','','hide'); },     setLogMessageOptions: function (logLevel, logMethod){ if (logLevel) this.logLevel = logLevel; if (logMethod) this.logMethod = logMethod; }, appendLogMessage: function (level, message){ var logWindow = $('vcomLogMessage'); if (((this.logMethod == 'by_level') && (level <= this.logLevel)) || ((this.logMethod == 'by_match') && (level & this.logLevel))) { var levelStr; switch (level) { case this.LOG_ERROR: levelStr = "ERROR"; break; case this.LOG_WARN: levelStr = "WARN"; break;                 case this.LOG_INFO: case this.LOG_INFO1: case this.LOG_INFO2: case this.LOG_INFO3: levelStr = "INFO"; break;                 case this.LOG_DEBUG: case this.LOG_DEBUG1: case this.LOG_DEBUG2: case this.LOG_DEBUG3: levelStr = "DEBUG"; break;                 default: levelStr = level; }                  var messageStr = message?message.escapeHTML():message; logWindow.innerHTML =logWindow.innerHTML + "<br />" +  "<font color='navy'><b>[" + levelStr + "]</b></font>::<font color='teal'>" + new Date() + "</font>"; logWindow.innerHTML = logWindow.innerHTML + "<br />" +  (level==this.LOG_ERROR?"<font color='red'>":"") + messageStr + (level==this.LOG_ERROR?"</font>":""); logWindow.scrollTop = logWindow.scrollHeight; } }, resetLogMessage: function() { $('vcomLogMessage').innerHTML =  "<font color='navy'><b>[Start Logging]</b></font>::<font color='teal'>" + new Date() + "</font>" + "<br />" +  "=============";  }, errorMessage: function(message) { this.appendLogMessage(this.LOG_ERROR, message);}, warnMessage: function(message) { this.appendLogMessage(this.LOG_WARN, message);}, infoMessage: function(message) { this.appendLogMessage(this.LOG_INFO, message);}, debugMessage: function(message) { this.appendLogMessage(this.LOG_DEBUG, message);},   keepAlive: function (){ vcomLIB.requestNumber = vcomLIB.requestNumber + 1; if(vcomLIB.requestId){  var paras = "id=" + vcomAPI.avatarId + "&requestId=" + vcomLIB.requestId + "&requestNumber=" + vcomLIB.requestNumber + "&user_name=" + encodeURIComponent(vcomAPI.userName); new Ajax.Request('/room/keepAlive',{parameters:paras,onComplete:vcomLIB.keepAliveTimer,evalScripts:true}); }else{ vcomLIB.errorMessage("ERROR:: keepAlive :id="+vcomAPI.avatarId+":vcomLIB.requestId="+vcomLIB.requestId); } refreshOnlineFriendPara = "rid="+ vcomLIB.roomId ; if (vcomLIB.embed != "") refreshOnlineFriendPara += "&embed="+vcomLIB.embed ; new Ajax.Updater('onlineFriendList','/room/refreshOnlineFriend', {method:'get', parameters:refreshOnlineFriendPara,onComplete:vcomLIB.checkOnlineStatus}); },   keepAliveTimer: function (){  if (parseInt(vcomLIB.keepAlivePeriod) < 20) vcomLIB.keepAlivePeriod = 20; setTimeout("vcomLIB.keepAlive()", vcomLIB.keepAlivePeriod * 1000); setTimeout("vcomLIB.setShowReceiveMessageTimenow()",3000); },  checkOnlineStatus: function (originalRequest){ if ($('connectStatusImage')){ if (originalRequest.statusText == 'OK'){ $('connectStatusImage').style.display = ""; $('disConnectStatusImage').style.display = "none"; $('LastConnectTimeDiv').innerHTML = new Date().format('MM/dd/yyyy hh:mm:ss'); }else{ $('connectStatusImage').style.display = "none"; $('disConnectStatusImage').style.display = ""; } } },  showConnentORDisconnectMessage: function (){ showCRDcMessage = ""; if ($('connectStatusImage').style.display == ""){ showCRDcMessage = vcomStrings.connectStatusMessage; } else { showCRDcMessage = vcomStrings.disconnectStatusMessage; } showCRDcMessage += " "+ $('LastConnectTimeDiv').innerHTML;  vcomAPI.alertMessage(showCRDcMessage); },  setShowReceiveMessageTimenow: function () {   if ($('ShowReceiveMessageHidden').innerHTML != ""){ $('ShowReceiveMessageDiv').style.display = ''; var today = new Date(); $('ShowReceiveMessageTime').innerHTML = today.format('MM/dd/yyyy hh:mm:ss'); var addHtml = "<table><tr><td>"+$('ShowReceiveMessageTime').innerHTML+"</td></tr><tr><td>&nbsp;&nbsp;"+ $('ShowReceiveMessageHidden').innerHTML +"</td></tr></table>"; $('ShowReceiveMessage').innerHTML = $('ShowReceiveMessage').innerHTML + addHtml; $('ShowReceiveMessageHidden').innerHTML = ""; $('ShowReceiveMessage').scrollTop = parseInt($('ShowReceiveMessage').scrollHeight);  if (!this.showReceiveMessageFlag){ vcomLIB.originalTitle = document.title; }  this.showReceiveMessageFlag = true; scrollWindowTitle(vcomStrings.receiveNewMessage); playReceiveMessageAudio(); }  },   send: function (){ vcomLIB.requestNumber = vcomLIB.requestNumber + 1; vcomLIB.retries = vcomLIB.retries + 1; var paras = "roomId="+ vcomLIB.roomId + "&type=avatar&requestId=" + vcomLIB.requestId + "&requestNumber=" + vcomLIB.requestNumber + "&xml=true"; new Ajax.Request(vcomLIB.cacheHost+'/cache_reader',{parameters:paras,onSuccess:vcomLIB.showResponse,onFailure:vcomLIB.sendWithTimer,onException:vcomLIB.sendWithTimer,evalScripts:true}); },   sendWithTimer: function (originalRequest){ vcomLIB.errorMessage("<<<<<<<<< vcomLIB.send onFailure: sendWithTimer <<<<<<<<<<<<<<< status: "+originalRequest.status); setTimeout("vcomLIB.send()", Math.pow(2, Math.min(vcomLIB.retries, vcomLIB.maxRetries) - 1) * 1000); },   resend: function (){ vcomLIB.requestNumber = vcomLIB.requestNumber + 1; vcomLIB.retries = vcomLIB.retries + 1; var paras = "rid="+ vcomLIB.roomId + "&requestId=" + vcomLIB.requestId + "&requestNumber=" + vcomLIB.requestNumber + "&errorCount=" + vcomLIB.errorCount; new Ajax.Request(vcomLIB.cacheHost+'/cache_reader_wait',{parameters:paras,onSuccess:vcomLIB.showResponse,onFailure:vcomLIB.resendWithTimer,onException:vcomLIB.resendWithTimer,evalScripts:true}); },   resendWithTimer: function (){ setTimeout("vcomLIB.resend()", Math.pow(2, Math.min(vcomLIB.retries, vcomLIB.maxRetries) - 1) * 1000); }, addItem: function (){ $('LayerAddItem').innerHTML=''; new Ajax.Updater('LayerAddItem','/room/add_itemlist', {method:'get', parameters:'roomid='+vcomLIB.roomId, onComplete:this.showLayer('LayerAddItem'),evalScripts:true}); $('LayerAddItem').style.left = (lastClickX-400)+'px'; $('LayerAddItem').style.top  = (lastClickY+10)+'px';  },     removeItem: function (){ $('LayerRemItem').innerHTML=''; new Ajax.Updater('LayerRemItem','/room/rem_itemlist', {method:'get', parameters:'roomid='+vcomLIB.roomId, onComplete:this.showLayer('LayerRemItem'),evalScripts:true}); $('LayerRemItem').style.left = (lastClickX-400)+'px'; $('LayerRemItem').style.top  = (lastClickY+10)+'px';  }, editRoom: function(id) { $('LayerEditRoom').innerHTML='';  new Ajax.Updater('LayerEditRoom','/room/room_edit', {method:'get', parameters:'roomid='+id, onComplete:this.showLayer('LayerEditRoom'),evalScripts:true}); $('LayerEditRoom').style.left = (lastClickX - 400)+'px'; $('LayerEditRoom').style.top  = (lastClickY+10)+'px'; }, inviteFriend: function (){ $('InviteFriend').innerHTML=''; new Ajax.Updater('InviteFriend','/room/invite_friend', {method:'get', onComplete:this.showLayer('InviteFriend')}); var m = new Draggable(); m.setUp('InviteFriend','',{handle:'headlineInviteFriend'}); $('InviteFriend').style.left = (lastClickX - 400)+'px'; $('InviteFriend').style.top  = (lastClickY + 10)+'px'; },     sendInviteMessage: function (user_id,room_id,send_type){  $('SendInviteMessage').innerHTML=''; var sendtype = ''; var roomid = ''; if(send_type=='reply'){ sendtype = '&sendtype='+send_type; } if(send_type=='send'){ sendtype = '&sendtype='+send_type; } if(room_id!=''){ roomid = '&roomid='+room_id; } new Ajax.Updater('SendInviteMessage','/room/send_invite_message', {method:'get', parameters:'id='+user_id+roomid+sendtype, onComplete:this.showLayer('SendInviteMessage')}); var m = new Draggable(); m.setUp('SendInviteMessage','',{handle:'headlineSendInviteMessage'}); if(send_type=='reply'){ $('SendInviteMessage').style.left = lastClickX+'px'; $('SendInviteMessage').style.top = lastClickY+'px'; }else{ $('SendInviteMessage').style.left = (lastClickX - 432)+'px'; $('SendInviteMessage').style.top = (lastClickY - 100)+'px'; } },     showTravelMessage: function (travel_id){ $('LayerTravelMessage').innerHTML=''; new Ajax.Updater('LayerTravelMessage','/user/travel_log_message', {method:'get', parameters:'travel_id='+travel_id, onComplete:this.showLayer('LayerTravelMessage'),evalScripts:true}); $('LayerTravelMessage').style.left = (lastClickX - 750)+'px'; $('LayerTravelMessage').style.top = (lastClickY - 350)+'px'; },     showTravelGift: function (travel_id){ $('LayerTravelGift').innerHTML=''; new Ajax.Updater('LayerTravelGift','/user/travel_log_gift', {method:'get', parameters:'travel_id='+travel_id, onComplete:this.showLayer('LayerTravelGift'),evalScripts:true}); $('LayerTravelGift').style.left = (lastClickX - 900)+'px'; $('LayerTravelGift').style.top = (lastClickY - 690)+'px'; },     showLayer: function(layer){ MM_showHideLayers(layer,'','show'); },  enterRoom: function (left,top){  var cookieStr = "nil"; var oid = vcomAPI.avatarId; if(oid.indexOf("_V")>0){ if(!vcomAPI.allowGuestEnetr){ showMessageWindow(vcomStrings.warningStr,"<center>"+vcomStrings.enterBlockPostStr+"</center>"); return; } } if(!$(oid)){ var avatarnum = vcomAPI.avatarNumInRoom; if (vcomAPI.allowedEnterRoom){ if(vcomAPI.avatarNumLimitInRoom>avatarnum||vcomAPI.isRoomOwner){ new Ajax.Request('/room/enter',{ method:'get', parameters:'id='+oid+'&requestId='+vcomLIB.requestId+'&left='+left+'&top='+top }); var w_left = parseInt($('waitAvatar').offsetLeft) - parseInt($('backgroundDiv').offsetLeft)+20; var w_top = parseInt($('waitAvatar').offsetTop) - parseInt($('backgroundDiv').offsetTop)+10;  var elem = document.createElement('div'); elem.id = oid; elem.style.cssText = 'position:absolute;width:94px;height:150px;top:'+w_top+'px;left:'+w_left+'px;z-index:'+vcomAPI.Z_MIDDLE_CENTER+';visibility:visible'; elem.innerHTML = vcomAPI.avatarDivString;      var body = $('backgroundDiv'); if(body){ body.appendChild(elem); }  onLoadDirectionForAvatar(); addBubble('Avatar',vcomAPI.getDivIdFromId(oid),"","none"); $('waitAvatar').style.display='none'; move_div(oid,left,top); vcomAPI.isUserInRoom = true;  $('exit_IMG').style.display=''; $('enter_IMG').style.display='none'; $('gray_IMG').style.display='none';  vcomAPI.avatarNumInRoom = vcomAPI.avatarNumInRoom+1; eval('vcomAvatar'+vcomAPI.getDivIdFromId(oid)+' = new VcomAvatar()'); eval('vcomAvatar'+vcomAPI.getDivIdFromId(oid)+'.setUp("'+oid+'","yes",{})'); eval('vcomAvatar'+vcomAPI.getDivIdFromId(oid)+'.onStart("'+vcomAPI.userName+'")');  var divs = document.getElementsByTagName("div");  for(var i=0;i < divs.length;i++){    eid = divs[i].id; var divid = vcomAPI.getDivIdFromId(eid); if(eid.indexOf('AvatarDiv_')==0 && oid!=eid){ if(vcomAPI.isRoomOwner){ eval('vcomAvatar'+divid+'.onReStart()'); }else if(vcomAPI.isVisitor){ eval('vcomAvatar'+divid+'.onShowMessage()'); }else{ if(vcomAPI.getStatusFromId(eid)=="V"){ eval('vcomAvatar'+divid+'.onStop()'); }else{ eval('vcomAvatar'+divid+'.onReStart()'); } } } if(eid.indexOf('ItemDiv_')==0){ if(vcomAPI.isRoomOwner || !eval('vcomItem'+divid+'.vcomIsLock')) { eval('vcomItem'+divid+'.onReStart()'); } if(!eval('vcomItem'+divid+'.vcomIsLock') && !eval('vcomItem'+divid+'.vcomIsPin') && eval('vcomItem'+divid+'.canOwnerControlOperate()')){ eval('vcomItem'+divid+'.relive()'); } eval('vcomItem'+divid+'.onStopMessage()');  /* if(!eval('vcomItem'+divid+'.drawing_flag') || (eval('vcomItem'+divid+'.drawing_flag') && eval('vcomItem'+divid+'.vcomIsPin'))){  if($("flashCover_"+divid)){ $("flashCover_"+divid).parentNode.removeChild($("flashCover_"+divid)); }                        }else if(eval('vcomItem'+divid+'.drawing_flag')){                         try{eval('vcomItem'+divid+'.enterRoomCheck()');} catch (e) {}                         } */ } } sendChatMessage('0',' ALL','ENTER ROOM'); $("backgroundDivIMG").onclick = Prototype.emptyFunction.bind(); vcomAPI.fireCallbacks(vcomAPI.EVENT_ENTER_ROOM, {id:oid, name:vcomAPI.userName, x:left, y:top, isOriginator:'yes'}); $('chatTextField').focus(); }else{ showMessageWindow(vcomStrings.warningStr,"<center>"+vcomStrings.enterPreStr+" "+vcomAPI.avatarNumLimitInRoom+" "+vcomStrings.enterPostStr+"</center>"); } }else{ if (vcomAPI.isRoomOwner && !vcomAPI.isRoommate){ joinVIPDivShowByXY("enterroom", -360, 25);  }else{ showMessageWindow(vcomStrings.warningStr,"<center>"+vcomStrings.guestRoomOwnernovipEnterRoom+"</center>"); } } } }, quitRoom: function (){ var avatar = $(vcomAPI.avatarId); if(avatar){ new Ajax.Request('/room/quit',{ method:'get', parameters:'id='+vcomAPI.avatarId+'&user_name='+encodeURIComponent(vcomAPI.userName)+'&requestId='+vcomLIB.requestId });  vcomAPI.isUserInRoom = false; sendChatMessage('0',' ALL','EXIT ROOM'); var obj = $('waitAvatarTD'); var x = obj.offsetLeft; var y = obj.offsetTop; while (obj = obj.offsetParent){ x += obj.offsetLeft; y += obj.offsetTop; }   var w_left = x - $('backgroundDiv').offsetLeft + 20; var w_top = y - $('backgroundDiv').offsetTop + 10; move_div(avatar,w_left,w_top); setTimeout("$(vcomAPI.avatarId).parentNode.removeChild($(vcomAPI.avatarId));if($('waitAvatar')) $('waitAvatar').style.display='';",1000);  $('enter_IMG').style.display=''; $('exit_IMG').style.display='none'; $('gray_IMG').style.display='none';  vcomAPI.avatarNumInRoom = vcomAPI.avatarNumInRoom-1; var divs = document.getElementsByTagName("div"); for(var i=0;i < divs.length;i++){ eid = divs[i].id; var divid = vcomAPI.getDivIdFromId(eid); if(eid.indexOf('AvatarDiv_')==0 && eid!=vcomAPI.avatarId){ eval('vcomAvatar'+divid+'.onStop()'); if(vcomAPI.isVisitor){ eval('vcomAvatar'+divid+'.onStopMessage()'); } } if(eid.indexOf('ItemDiv_')==0){ eval('vcomItem'+divid+'.onStop()'); eval('vcomItem'+divid+'.destroy()'); eval('vcomItem'+divid+'.onShowMessage()');    if($("flash_"+divid)){ if($("flashCover_"+divid)){ $("flashCover_"+divid).parentNode.removeChild($("flashCover_"+divid));           } var elem = $(eid);                                   var cover = document.createElement('div'); cover.id = "flashCover_"+divid; cover.style.cssText = 'position:absolute;width:'+elem.style.width+';height:'+elem.style.height+';top:0px;left:0px;z-index:9999;visibility:visible;border-color:#ffffff;border-width:4px;background-image:url(\"/images/items/jump chess/null.gif\")'; cover.innerHTML="<img src='/images/items/jump chess/null.gif' width='"+elem.style.width+"' height='"+elem.style.height+"' />"; elem.appendChild(cover); }    } } $("backgroundDivIMG").onclick = showMessageWindowLocal.bind(window,vcomStrings.sysPostStr, "<center>"+vcomStrings.enterRemind+"</center>"); vcomAPI.fireCallbacks(vcomAPI.EVENT_EXIT_ROOM, {id:vcomAPI.avatarId, name:vcomAPI.userName, isOriginator:'yes'});  } } }); var vcomLIB = new VcomLIB();  var VcomDragAndResizeable = Class.create(); VcomDragAndResizeable.prototype = Object.extend(new Draggable(), { initialize: function () {},   vcomNe: null,  vcomNw: null, vcomSe: null, vcomSw: null, vcomAttachments: {},   options: {onDrag:function(draggable, event){  var elementTop = parseInt(draggable.element.style.top); var elementLeft = parseInt(draggable.element.style.left); var elementHeight = parseInt(draggable.element.height || draggable.element.style.height); var elementWidth = parseInt(draggable.element.width || draggable.element.style.width);  var eId = draggable.element.id; if ($('vcomNe' + eId)) {   var temp_top = elementTop - 24;   var temp_left = elementLeft + elementWidth;                       $('vcomNe' + eId).style.top = temp_top+"px";     $('vcomNe' + eId).style.left = temp_left+"px"; } if ($('vcomNw' + eId)) {   var temp_top = elementTop - 24;   var temp_left = elementLeft - 24;                     $('vcomNw' + eId).style.top = temp_top+"px";             $('vcomNw' + eId).style.left = temp_left+"px"; } if ($('vcomSe' + eId)) {   var temp_top = elementTop + elementHeight;   var temp_left = elementLeft + elementWidth;                 $('vcomSe' + eId).style.top = temp_top+"px";                 $('vcomSe' + eId).style.left = temp_left+"px"; } if ($('vcomSw' + eId)) {   var temp_top = elementTop + elementHeight;   var temp_left = elementLeft - 24;		                     $('vcomSw' + eId).style.top = temp_top+"px";                     $('vcomSw' + eId).style.left = temp_left+"px";					  } for (var attachment in draggable.vcomAttachments) {          var att = $(attachment);     if (att && !att.isDragged) {                  var temp_left = parseInt(elementLeft) + parseInt(draggable.vcomAttachments[attachment][0]);         var temp_top = parseInt(elementTop) + parseInt(draggable.vcomAttachments[attachment][1]);								                 att.style.left = temp_left+"px";         att.style.top  = temp_top+"px";								                     }   } },     onStart: function(draggable, event) {         draggable.element.isDragged = true;       	draggable.element.originalX = draggable.element.style.left;       	draggable.element.originalY = draggable.element.style.top;     }, onEnd: function(draggable, event) {	            try { var element_id = draggable.element.id; var elementTop = parseInt(draggable.element.style.top); var elementLeft = parseInt(draggable.element.style.left); var name = ""; var type = ""; if(element_id){ var moveX = parseInt(draggable.element.originalX)-parseInt(draggable.element.style.left); var moveY = parseInt(draggable.element.originalY)-parseInt(draggable.element.style.top);  if(-3<moveX && moveX<3 && -3<moveY && moveY<3){ draggable.element.style.left = draggable.element.originalX; draggable.element.style.top = draggable.element.originalY; }else{ if(element_id.indexOf('ItemDiv_')==0){ type = 'Item'; name = eval("vcom"+type+vcomAPI.getDivIdFromId(element_id)+".vcomItemName"); }else if(element_id.indexOf('AvatarDiv_')==0) { type = 'Avatar'; if(vcomAPI.avatarId==element_id) name = vcomAPI.userName; else name = eval("vcom"+type+vcomAPI.getDivIdFromId(element_id)+".vcomUserName"); } if(type!="" && name!=""){ move_synchronization(type,element_id,name,draggable.element.originalX,draggable.element.originalY,parseInt(draggable.element.style.left),parseInt(draggable.element.style.top),'yes'); /* new Ajax.Request('/room/setMoveUpdate',{ method:'get', parameters:"requestId="+vcomLIB.requestId+"&id="+element_id+"&name="+encodeURIComponent(name)+"&left="+parseInt(draggable.element.style.left)+"&top="+parseInt(draggable.element.style.top)+"&user_id="+vcomAPI.avatarId+"&user_name="+encodeURIComponent(vcomAPI.userName) }); vcomAPI.fireCallbacks(vcomAPI.EVENT_MOVE, {type:type, id:element_id, name:name, originalX:draggable.element.originalX, originalY:draggable.element.originalY, x:parseInt(draggable.element.left || draggable.element.style.left), y:parseInt(draggable.element.top || draggable.element.style.top), isOriginator:'yes'}); */ } } } for (var attachment in draggable.vcomAttachments) {          var att = $(attachment); if (att && !att.isDragged) {                  var temp_left = parseInt(elementLeft) + parseInt(draggable.vcomAttachments[attachment][0]);         var temp_top = parseInt(elementTop) + parseInt(draggable.vcomAttachments[attachment][1]);								                 att.style.left = temp_left+"px";         att.style.top = temp_top+"px";     } } } catch (e) { var id = null; if (draggable && draggable.element) id = draggable.element.id;  var msg = "onEnd:id="+id+":e="+e.name+"::"+e.message; vcomLIB.errorMessage(msg); }  draggable.element.isDragged = false; } },  relive:function(){ this.dragging = false;    this.eventMouseDown = this.initDrag.bindAsEventListener(this); Event.observe(this.handle, "mousedown", this.eventMouseDown);     Draggables.register(this);    }, vcomSetUpResizer: function () { this.vcomEventMouseDown = this.vcomOnMouseDown.bindAsEventListener(this); Event.observe(this.handle, "mousedown", this.vcomEventMouseDown); if (isIE)  this.element.onclick=this.vcomEventMouseDown; }, vcomAttach: function(id, x, y, isRemote) {  if (id && $(id)) { if (typeof x == 'undefined' || x == null) { x = parseInt(this.element.style.left) - parseInt($(id).style.left); } if (typeof y == 'undefined' || y == null) { y = parseInt(this.element.style.top) - parseInt($(id).style.top); } x = parseInt(x); y = parseInt(y);  this.vcomAttachments[id]=[-x, -y]; var thisElementId=this.element.id; eval("vcomAPI.getVariable("+id+").vcomAttachments["+thisElementId+"]=["+x+","+y+"];");  if (!isRemote) this.vcomConcurrentCall("vcomAttachRemote", id+" "+x+" "+y); } }, vcomAttachRemote: function(rString) { var args=rString.split(/\s+/); this.vcomAttach(args[0], args[1], args[2], true) }, vcomDetach: function(id, isRemote) {  delete this.vcomAttachments[id]; var aVar = eval(vcomAPI.getVariable(id)); if (aVar) {    delete aVar.vcomAttachments[this.element.id]; if (!isRemote) this.vcomConcurrentCall("vcomDetachRemote", id+""); } },   vcomDetachRemote: function(rString) { var args=rString.split(/\s+/); this.vcomDetach(args[0], true); },    vcomDetachAll: function(id, isRemote) { this.vcomAttachments = {}; if (!isRemote) this.vcomConcurrentCall("vcomDetachAllRemote", id+""); },    vcomDetachAll: function(id) { var args=rString.split(/\s+/); this.vcomDetach(args[0], true); },     vcomOnMouseDown: function (evt) { var button = 0; if(isIE) {       button = window.event.button;     } else{  button = evt.button; }   if (evt.shiftKey && button == 0) { this.vcomToggleResizer(); } }, vcomIsMoveSyn:function(){return true;}, vcomToggleResizer: function () {    var elementTop = parseInt(this.element.style.top); var elementLeft = parseInt(this.element.style.left); var elementHeight = parseInt(this.element.height || this.element.style.height); var elementWidth = parseInt(this.element.width || this.element.style.width);   var element = this.element; var childElements = this.element.childNodes; var eId = this.element.id; if ($("vcomNw" + eId) == null) {      this.vcomNe = document.createElement('IMG'); this.vcomNe.id = "vcomNe" + eId; this.vcomNe.src=vcomStringsConstants.staticUrlstr+"/images/spacerollover.gif"; this.vcomNe.style.cssText = "position: absolute; z-index: "+vcomAPI.Z_FRONT+"; cursor: ne-resize; left: "+(elementLeft+elementWidth)+"px; top: "+(elementTop-24)+"px;width:12px;height:12px;"; this.element.parentNode.appendChild(this.vcomNe);  this.vcomNw = document.createElement('IMG'); this.vcomNw.id = "vcomNw" + eId; this.vcomNw.src=vcomStringsConstants.staticUrlstr+"/images/spacerollover.gif"; this.vcomNw.style.cssText = "position: absolute; z-index: "+vcomAPI.Z_FRONT+"; cursor: nw-resize; left: "+(elementLeft-24)+"px; top: "+((elementTop-24))+"px;width:12px;height:12px;"; this.element.parentNode.appendChild(this.vcomNw);  this.vcomSe = document.createElement('IMG'); this.vcomSe.id = "vcomSe" + eId; this.vcomSe.src=vcomStringsConstants.staticUrlstr+"/images/spacerollover.gif"; this.vcomSe.style.cssText = "position: absolute; z-index: "+vcomAPI.Z_FRONT+"; cursor: se-resize; left: "+(elementLeft+elementWidth)+"px; top: "+(elementTop+elementHeight)+"px;width:12px;height:12px;"; this.element.parentNode.appendChild(this.vcomSe);  this.vcomSw = document.createElement('IMG'); this.vcomSw.id = "vcomSw" + eId; this.vcomSw.src=vcomStringsConstants.staticUrlstr+"/images/spacerollover.gif"; this.vcomSw.style.cssText = "position: absolute; z-index: "+vcomAPI.Z_FRONT+"; cursor: sw-resize; left: "+(elementLeft-24)+"px; top: "+((elementTop+elementHeight))+"px;width:12px;height:12px;"; this.element.parentNode.appendChild(this.vcomSw);  var nwDraggable = new Draggable(); nwDraggable.setUp('vcomNw' + eId, 'yes', {snap:function(x,y,draggable) { function constrain(n, lower, upper) { if (n > upper) return upper; else if (n < lower) return lower; else return n; } se_left = $("vcomSe" + eId).style.left;   se_left=parseInt(se_left);   se_top = $("vcomSe" + eId).style.top;   se_top=parseInt(se_top);   return[constrain(x, 0, se_left-50),constrain(y, 0, se_top-50)]; }, onDrag:function(draggable, event){   $('vcomNe' + eId).style.top=$("vcomNw" + eId).style.top;   $('vcomSw' + eId).style.left=$("vcomNw" + eId).style.left;     nw_top=$("vcomNw" + eId).style.top;   nw_top=parseInt(nw_top);    nw_left=$("vcomNw" + eId).style.left;   nw_left=parseInt(nw_left);     ne_left=$("vcomNe" + eId).style.left;   ne_left=parseInt(ne_left);       sw_top=$("vcomSw" + eId).style.top;   sw_top=parseInt(sw_top);       ne_left=$("vcomNe" + eId).style.left;   ne_left=parseInt(ne_left);    element.style.top=(nw_top+24)+"px";   element.style.left=(nw_left+24)+"px";   vcomLIB.resize(element, ne_left-nw_left-24, sw_top-nw_top-24);         vcomLIB.resizeArray(childElements, ne_left-nw_left-24, sw_top-nw_top-24); }, onEnd: function(draggable, event) {	   if(draggable.element.id.indexOf('vcomNwItemDiv_')==0){ eval('vcomItem'+vcomAPI.getDivIdFromId(draggable.element.id)+'.clientWidth='+parseInt(element.clientWidth)); eval('vcomItem'+vcomAPI.getDivIdFromId(draggable.element.id)+'.clientHeight='+parseInt(element.clientHeight));       var dimensions = Element.getDimensions(draggable.element); var name = eval('vcomItem'+vcomAPI.getDivIdFromId(eId)+".vcomItemName"); new Ajax.Request('/room/setResizeUpdate',{ method:'get',  parameters:"requestId="+vcomLIB.requestId+"&id="+eId+"&name="+encodeURIComponent(name)+"&left="+parseInt(element.style.left)+"&top="+parseInt(element.style.top)+"&width="+parseInt(element.clientWidth)+"&height="+parseInt(element.clientHeight)+"&user_id="+vcomAPI.avatarId+"&user_name="+encodeURIComponent(vcomAPI.userName), onComplete:this.cancelNS }); }   }, cancelNS: function() {  element.parentNode.removeChild($("vcomNe" + eId)); element.parentNode.removeChild($("vcomNw" + eId)); element.parentNode.removeChild($("vcomSe" + eId)); element.parentNode.removeChild($("vcomSw" + eId)); var name = eval('vcomItem'+vcomAPI.getDivIdFromId(eId)+".vcomItemName"); vcomAPI.fireCallbacks(vcomAPI.EVENT_ITEM_RESIZE, {id:eId,name:name,left:parseInt(element.style.left),top:parseInt(element.style.top),width:parseInt(element.clientWidth),height:parseInt(element.clientHeight),isOriginator:'yes'});  }   }); var neDraggable = new Draggable(); neDraggable.setUp('vcomNe' + eId, 'yes',{snap:function(x,y,draggable) { function constrain(n, lower, upper) { if (n > upper) return upper; else if (n < lower) return lower; else return n; } sw_left = $("vcomSw" + eId).style.left;   sw_left=parseInt(sw_left);   sw_top = $("vcomSw" + eId).style.top;   sw_top=parseInt(sw_top);   return[constrain(x,sw_left+50,700),constrain(y,0,sw_top-50)]; }, onDrag:function(draggable, event){  $('vcomNw' + eId).style.top=$("vcomNe" + eId).style.top;  $('vcomSe' + eId).style.left=$("vcomNe" + eId).style.left;    nw_left=$("vcomNw" + eId).style.left;  nw_left=parseInt(nw_left);    ne_top=$("vcomNe" + eId).style.top;  ne_top=parseInt(ne_top);  ne_left=$("vcomNe" + eId).style.left;  ne_left=parseInt(ne_left);    sw_top=$("vcomSw" + eId).style.top;  sw_top=parseInt(sw_top);  ne_left=$("vcomNe" + eId).style.left;  ne_left=parseInt(ne_left);   element.style.top=(ne_top+24)+"px";  element.style.left=(nw_left+24)+"px";  vcomLIB.resize(element, ne_left-nw_left-24, sw_top-ne_top-24);      	                 vcomLIB.resizeArray(childElements, ne_left-nw_left-24, sw_top-ne_top-24);								 								  }, onEnd: function(draggable, event) {	   if(draggable.element.id.indexOf('vcomNeItemDiv_')==0){ eval('vcomItem'+vcomAPI.getDivIdFromId(draggable.element.id)+'.clientWidth='+parseInt(element.clientWidth)); eval('vcomItem'+vcomAPI.getDivIdFromId(draggable.element.id)+'.clientHeight='+parseInt(element.clientHeight));       var dimensions = Element.getDimensions(draggable.element); var name = eval('vcomItem'+vcomAPI.getDivIdFromId(eId)+".vcomItemName"); new Ajax.Request('/room/setResizeUpdate',{ method:'get',  parameters:"requestId="+vcomLIB.requestId+"&id="+eId+"&name="+encodeURIComponent(name)+"&left="+parseInt(element.style.left)+"&top="+parseInt(element.style.top)+"&width="+parseInt(element.clientWidth)+"&height="+parseInt(element.clientHeight)+"&user_id="+vcomAPI.avatarId+"&user_name="+encodeURIComponent(vcomAPI.userName), onComplete:this.cancelNS }); }   }, cancelNS: function() {  element.parentNode.removeChild($("vcomNe" + eId)); element.parentNode.removeChild($("vcomNw" + eId)); element.parentNode.removeChild($("vcomSe" + eId)); element.parentNode.removeChild($("vcomSw" + eId)); var name = eval('vcomItem'+vcomAPI.getDivIdFromId(eId)+".vcomItemName"); vcomAPI.fireCallbacks(vcomAPI.EVENT_ITEM_RESIZE, {id:eId,name:name,left:parseInt(element.style.left),top:parseInt(element.style.top),width:parseInt(element.clientWidth),height:parseInt(element.clientHeight),isOriginator:'yes'});                  }  								 }); var swDraggable = new Draggable(); swDraggable.setUp('vcomSw' + eId, 'yes',{snap:function(x,y,draggable) { function constrain(n, lower, upper) { if (n > upper) return upper; else if (n < lower) return lower; else return n; } ne_left = $("vcomNe" + eId).style.left;   ne_left=parseInt(ne_left);   ne_top = $("vcomNe" + eId).style.top;   ne_top=parseInt(ne_top);   return[constrain(x, 0, ne_left-50),constrain(y, ne_top+50,540)]; }, onDrag:function(draggable, event){						           $('vcomSe' + eId).style.top=$("vcomSw" + eId).style.top;  $('vcomNw' + eId).style.left=$("vcomSw" + eId).style.left;    nw_top=$("vcomNw" + eId).style.top;  nw_top=parseInt(nw_top);  nw_left=$("vcomNw" + eId).style.left;  nw_left=parseInt(nw_left);    sw_top=$("vcomSw" + eId).style.top;  sw_top=parseInt(sw_top);  ne_left=$("vcomNe" + eId).style.left;  ne_left=parseInt(ne_left);   element.style.top=(nw_top+24)+"px";  element.style.left=(nw_left+24)+"px";	  vcomLIB.resize(element, ne_left-nw_left-24, sw_top-nw_top-24);                      vcomLIB.resizeArray(childElements, ne_left-nw_left-24, sw_top-nw_top-24);								 					  }, onEnd: function(draggable, event) {	   if(draggable.element.id.indexOf('vcomSwItemDiv_')==0){ eval('vcomItem'+vcomAPI.getDivIdFromId(draggable.element.id)+'.clientWidth='+parseInt(element.clientWidth)); eval('vcomItem'+vcomAPI.getDivIdFromId(draggable.element.id)+'.clientHeight='+parseInt(element.clientHeight));       var dimensions = Element.getDimensions(draggable.element); var name = eval('vcomItem'+vcomAPI.getDivIdFromId(eId)+".vcomItemName"); new Ajax.Request('/room/setResizeUpdate',{ method:'get',  parameters:"requestId="+vcomLIB.requestId+"&id="+eId+"&name="+encodeURIComponent(name)+"&left="+parseInt(element.style.left)+"&top="+parseInt(element.style.top)+"&width="+parseInt(element.clientWidth)+"&height="+parseInt(element.clientHeight)+"&user_id="+vcomAPI.avatarId+"&user_name="+encodeURIComponent(vcomAPI.userName), onComplete:this.cancelNS }); }   }, cancelNS: function() {  element.parentNode.removeChild($("vcomNe" + eId)); element.parentNode.removeChild($("vcomNw" + eId)); element.parentNode.removeChild($("vcomSe" + eId)); element.parentNode.removeChild($("vcomSw" + eId)); var name = eval('vcomItem'+vcomAPI.getDivIdFromId(eId)+".vcomItemName"); vcomAPI.fireCallbacks(vcomAPI.EVENT_ITEM_RESIZE, {id:eId,name:name,left:parseInt(element.style.left),top:parseInt(element.style.top),width:parseInt(element.clientWidth),height:parseInt(element.clientHeight),isOriginator:'yes'});  }   }); var seDraggable = new Draggable(); seDraggable.setUp('vcomSe' + eId, 'yes',{snap:function(x,y,draggable) { function constrain(n, lower, upper) { if (n > upper) return upper; else if (n < lower) return lower; else return n; } nw_left = $("vcomNw" + eId).style.left;   nw_left=parseInt(nw_left);   nw_top = $("vcomNw" + eId).style.top;   nw_top=parseInt(nw_top);   return[constrain(x, nw_left+50, 700),constrain(y, nw_top+50, 540)]; }, onDrag:function(draggable, event){  $("vcomSw" + eId).style.top=$("vcomSe" + eId).style.top;  $("vcomNe" + eId).style.left=$("vcomSe" + eId).style.left;  nw_left=$("vcomNw" + eId).style.left;  nw_left=parseInt(nw_left);    ne_top=$("vcomNe" + eId).style.top;  ne_top=parseInt(ne_top);  ne_left=$("vcomNe" + eId).style.left;  ne_left=parseInt(ne_left);    sw_top=$("vcomSw" + eId).style.top;  sw_top=parseInt(sw_top);  ne_left=$("vcomNe" + eId).style.left;  ne_left=parseInt(ne_left);   element.style.top=(ne_top+24)+"px";  element.style.left=(nw_left+24)+"px";  vcomLIB.resize(element, ne_left-nw_left-24, sw_top-ne_top-24);                      vcomLIB.resizeArray(childElements, ne_left-nw_left-24, sw_top-ne_top-24); }, onEnd: function(draggable, event) {   if(draggable.element.id.indexOf('vcomSeItemDiv_')>=0){       eval('vcomItem'+vcomAPI.getDivIdFromId(draggable.element.id)+'.clientWidth='+parseInt(element.clientWidth)); eval('vcomItem'+vcomAPI.getDivIdFromId(draggable.element.id)+'.clientHeight='+parseInt(element.clientHeight));       var dimensions = Element.getDimensions(draggable.element); var name = eval('vcomItem'+vcomAPI.getDivIdFromId(eId)+".vcomItemName"); new Ajax.Request('/room/setResizeUpdate',{ method:'get',  parameters:"requestId="+vcomLIB.requestId+"&id="+eId+"&name="+encodeURIComponent(name)+"&left="+parseInt(element.style.left)+"&top="+parseInt(element.style.top)+"&width="+parseInt(element.clientWidth)+"&height="+parseInt(element.clientHeight)+"&user_id="+vcomAPI.avatarId+"&user_name="+encodeURIComponent(vcomAPI.userName), onComplete:this.cancelNS }); }   }, cancelNS: function() {  element.parentNode.removeChild($("vcomNe" + eId)); element.parentNode.removeChild($("vcomNw" + eId)); element.parentNode.removeChild($("vcomSe" + eId)); element.parentNode.removeChild($("vcomSw" + eId)); var name = eval('vcomItem'+vcomAPI.getDivIdFromId(eId)+".vcomItemName"); vcomAPI.fireCallbacks(vcomAPI.EVENT_ITEM_RESIZE, {id:eId,name:name,left:parseInt(element.style.left),top:parseInt(element.style.top),width:parseInt(element.clientWidth),height:parseInt(element.clientHeight),isOriginator:'yes'});                    }   });	 } else {      this.element.parentNode.removeChild($("vcomNe" + eId)); this.element.parentNode.removeChild($("vcomNw" + eId)); this.element.parentNode.removeChild($("vcomSe" + eId)); this.element.parentNode.removeChild($("vcomSw" + eId)); } } });   var VcomEntity = Class.create(); VcomEntity.prototype = Object.extend(new VcomDragAndResizeable(), { initialize: function () {}, onLoad: function () {}, onUnload: function () {}  });   var menuDivId = 'E_rbpm'; var VcomAvatarMenu = Class.create(); VcomAvatarMenu.prototype = Object.extend(new VcomEntity(),{ initialize: function() {}, vcomAvatarMenu:null, vcomUserName:null, vcomMyself:false, vcomDivId:null,            vcomAvatarType:null,       getId: function () { return this.element.id; }, getDivId: function () { return this.element.id.substring(this.element.id.indexOf("_")+1); }, getVariable: function () { return 'vcomAvatar' + this.getDivId(); }, getDBId: function () { return this.getDivId().substring(this.getDivId().indexOf("_")+1,this.getDivId().lastIndexOf("_")) }, onStart: function (userName) { this.vcomDivId = this.getDivId(); this.vcomUserName = userName; this.vcomAvatarType = vcomAPI.getStatusFromId(this.getId()); if(this.getDBId()==vcomAPI.userId) this.vcomMyself=true;  this.vcomAvatarMenu = { vcomOnMenu0:null, vcomOnMenu8:null, vcomOnMenu1:null, vcomOnMenu2:null, vcomOnMenu3:null, vcomOnMenu4:null, vcomOnMenu5:null, vcomOnMenu6:vcomStrings.mAvatarMenu6, vcomOnMenu61:vcomStrings.mAvatarMenu61, vcomOnMenu62:vcomStrings.mAvatarMenu62, vcomOnMenu7:null, vcomOnMenu71:null, vcomOnMenu72:null, vcomOnMenu73:null, vcomOnMenu74:null, vcomOnMenu75:null, vcomOnMenu76:null, vcomOnMenu77:null, vcomOnMenu78:null, vcomOnMenu79:null, vcomOnMenu9:null,      vcomOnMenuA:null, vcomOnMenuB:null       }; if(this.vcomMyself){ if(this.vcomAvatarType=="A"){ this.vcomAvatarMenu['vcomOnMenu0']=vcomStrings.mAvatarMenu0; }else{ this.vcomAvatarMenu['vcomOnMenu0']=null; } this.vcomAvatarMenu['vcomOnMenu1']=null; this.vcomAvatarMenu['vcomOnMenu2']=null; this.vcomAvatarMenu['vcomOnMenu3']=null; this.vcomAvatarMenu['vcomOnMenu4']=null; this.vcomAvatarMenu['vcomOnMenu5']=vcomStrings.mAvatarMenu51; this.vcomAvatarMenu['vcomOnMenu7']=vcomStrings.mAvatarMenu7; this.vcomAvatarMenu['vcomOnMenu71']=vcomStrings.mAvatarMenu71; this.vcomAvatarMenu['vcomOnMenu72']=vcomStrings.mAvatarMenu72; this.vcomAvatarMenu['vcomOnMenu73']=vcomStrings.mAvatarMenu73; this.vcomAvatarMenu['vcomOnMenu74']=vcomStrings.mAvatarMenu74; this.vcomAvatarMenu['vcomOnMenu75']=vcomStrings.mAvatarMenu75; this.vcomAvatarMenu['vcomOnMenu76']=vcomStrings.mAvatarMenu76; this.vcomAvatarMenu['vcomOnMenu77']=vcomStrings.mAvatarMenu77; this.vcomAvatarMenu['vcomOnMenu78']=vcomStrings.mAvatarMenu78; this.vcomAvatarMenu['vcomOnMenu79']=vcomStrings.mAvatarMenu79; if(this.vcomAvatarType=="A"){ this.vcomAvatarMenu['vcomOnMenu9']=vcomStrings.mAvatarMenu9; }else{ this.vcomAvatarMenu['vcomOnMenu9']=null; } }else if(vcomAPI.isRoomOwner){ if(this.vcomAvatarType=="A"){ this.vcomAvatarMenu['vcomOnMenu0']=vcomStrings.mAvatarMenu0; this.vcomAvatarMenu['vcomOnMenu1']=vcomStrings.mAvatarMenu1; this.vcomAvatarMenu['vcomOnMenu2']=null; this.vcomAvatarMenu['vcomOnMenu3']=vcomStrings.mAvatarMenu3; this.vcomAvatarMenu['vcomOnMenu4']=vcomStrings.mAvatarMenu4; this.vcomAvatarMenu['vcomOnMenu5']=vcomStrings.mAvatarMenu52; this.vcomAvatarMenu['vcomOnMenu8']=vcomStrings.mAvatarMenu8; this.vcomAvatarMenu['vcomOnMenuA']=vcomStrings.mAvatarMenuA; this.vcomAvatarMenu['vcomOnMenuB']=vcomStrings.mAvatarMenuB; }else if(this.vcomAvatarType=="T"){ this.vcomAvatarMenu['vcomOnMenu0']=vcomStrings.mAvatarMenu0; this.vcomAvatarMenu['vcomOnMenu1']=vcomStrings.mAvatarMenu1; this.vcomAvatarMenu['vcomOnMenu2']=null; this.vcomAvatarMenu['vcomOnMenu3']=vcomStrings.mAvatarMenu3; this.vcomAvatarMenu['vcomOnMenu4']=vcomStrings.mAvatarMenu4; this.vcomAvatarMenu['vcomOnMenu5']=vcomStrings.mAvatarMenu52; this.vcomAvatarMenu['vcomOnMenu8']=vcomStrings.mAvatarMenu8; this.vcomAvatarMenu['vcomOnMenuB']=vcomStrings.mAvatarMenuB; }else if(this.vcomAvatarType=="V"){ this.vcomAvatarMenu['vcomOnMenu0']=null; this.vcomAvatarMenu['vcomOnMenu1']=null; this.vcomAvatarMenu['vcomOnMenu2']=null; this.vcomAvatarMenu['vcomOnMenu3']=null; this.vcomAvatarMenu['vcomOnMenu4']=null; this.vcomAvatarMenu['vcomOnMenu5']=vcomStrings.mAvatarMenu52; } }else{ if(this.vcomAvatarType=="T"){ this.vcomAvatarMenu['vcomOnMenu0']=vcomStrings.mAvatarMenu0; this.vcomAvatarMenu['vcomOnMenu1']=vcomStrings.mAvatarMenu1; this.vcomAvatarMenu['vcomOnMenu2']=null; this.vcomAvatarMenu['vcomOnMenu3']=vcomStrings.mAvatarMenu3; this.vcomAvatarMenu['vcomOnMenu4']=vcomStrings.mAvatarMenu4; this.vcomAvatarMenu['vcomOnMenu5']=null; this.vcomAvatarMenu['vcomOnMenu8']=vcomStrings.mAvatarMenu8; this.vcomAvatarMenu['vcomOnMenuB']=vcomStrings.mAvatarMenuB; }else{ this.vcomAvatarMenu['vcomOnMenu0']=vcomStrings.mAvatarMenu0; this.vcomAvatarMenu['vcomOnMenu1']=vcomStrings.mAvatarMenu1; this.vcomAvatarMenu['vcomOnMenu2']=null; this.vcomAvatarMenu['vcomOnMenu3']=vcomStrings.mAvatarMenu3; this.vcomAvatarMenu['vcomOnMenu4']=vcomStrings.mAvatarMenu4; this.vcomAvatarMenu['vcomOnMenu5']=null; this.vcomAvatarMenu['vcomOnMenu8']=vcomStrings.mAvatarMenu8; this.vcomAvatarMenu['vcomOnMenuA']=vcomStrings.mAvatarMenuA; this.vcomAvatarMenu['vcomOnMenuB']=vcomStrings.mAvatarMenuB; } } this.vcomAvatarShowRightMenuEvent = this.onShowRightMenu.bindAsEventListener(this); Event.observe(this.element, "mouseup", this.vcomAvatarShowRightMenuEvent); this.vcomAvatarShowRightMessageEvent = this.onShowRightMessage.bindAsEventListener(this); }, onReStart: function () { Event.observe(this.element, "mouseup", this.vcomAvatarShowRightMenuEvent); },     onStop: function () { Event.stopObserving(this.element, "mouseup", this.vcomAvatarShowRightMenuEvent); }, onShowMessage: function () { Event.observe(this.element, "mouseup", this.vcomAvatarShowRightMessageEvent); }, onStopMessage: function () { Event.stopObserving(this.element, "mouseup", this.vcomAvatarShowRightMessageEvent); }, onShowRightMenu: function (evt) { var button = 0; var y = 30; var x = 30; if(isIE) { button = window.event.button;     x=window.event.x; y=window.event.y; }else{  button = evt.button; x = evt.pageX-$('backgroundDiv').offsetLeft; y = evt.pageY-$('backgroundDiv').offsetTop; } if(button==2) {  var menuItem=$(menuDivId);  if(menuItem){ menuItem.parentNode.removeChild(menuItem); }  HTMLstr  = ""; HTMLstr += "<!-- RightButton PopMenu -->\n"; HTMLstr += "\n"; HTMLstr += "<!-- PopMenu Starts -->\n"; HTMLstr += "<table width='100%' border='0' cellspacing='0' cellpadding='0'>\n";  HTMLstr += "<tr class='out'><td>\n"; HTMLstr += "<!-- Insert A Extend Menu or Item On Here For E_rbpm -->\n"; HTMLstr += "</td></tr></table>\n"; HTMLstr += "\n"; HTMLstr += "<!-- PopMenu Ends -->\n";  var TempStr = "<div><ul id='nav'>"; TempStr += "<li><span id='"+this.element.id+"_name' style='cursor:pointer;'>"+this.vcomUserName+"</span></li>";  var mainMenu = new Array(); var subMenuArr = new Array(); var subMenu = new Array(); var m=0; var n=0; for(var thisMenu in this.vcomAvatarMenu) { if(thisMenu.length==11) { mainMenu[m] = thisMenu; m = m+1; } else { n = parseInt(thisMenu.substr(10,1)); if(!subMenuArr[n]) subMenuArr[n] = new Array(); subMenuArr[n].push(thisMenu); } } for(var l=0;l<mainMenu.length;l++) { var name = this.vcomAvatarMenu[mainMenu[l]]; if(name!=null) {  TempStr += "<li><a style='cursor:pointer;' id='"+this.element.id+"_"+mainMenu[l]+"' name='"+this.element.id+"_"+mainMenu[l]+"'>"+name+"</a>"; n = parseInt(mainMenu[l].substr(10,1)); subMenu = subMenuArr[n]; if(subMenu && subMenu.length>0) { TempStr += "<ul>"; for(var t=0;t<=subMenu.length-1;t++) { TempStr += "<li><a style='cursor:pointer;' id='"+this.element.id+"_"+subMenu[t]+"' name='"+this.element.id+"_"+subMenu[t]+"'>"+this.vcomAvatarMenu[subMenu[t]]+"</a></li>"; } TempStr += "</ul>"; } TempStr += "</li>"; } }  TempStr +="</ul></div>";    var elem = document.createElement('div'); elem.style.cssText = 'position:absolute;top:'+y+'px;left:'+x+'px;z-index:'+vcomAPI.Z_FRONT+';display:block;';  elem.style.display=''; elem.id=menuDivId; elem.innerHTML = TempStr;  var body = $('backgroundDiv'); if(body) body.appendChild(elem);  Event.observe(this.element.id+'_name', "click", eval('this.vcomOnMenu0.bindAsEventListener(this)'));  for(var thisMenu in this.vcomAvatarMenu) { if(this.vcomAvatarMenu[thisMenu]!=null&&this.vcomAvatarMenu[thisMenu]!="null"){ if($(this.element.id+'_'+thisMenu)){ Event.observe(this.element.id+'_'+thisMenu, "click", eval('this.'+thisMenu+'.bindAsEventListener(this)'));       }   } } var sfEls = $("nav").getElementsByTagName("li");  for (var i=1; i<sfEls.length; i++) { sfEls[i].onmouseover=function() { this.className+=(this.className.length>0? " ": "") + "sfhover"; }; sfEls[i].onMouseDown=function() { this.className+=(this.className.length>0? " ": "") + "sfhover"; }; sfEls[i].onMouseUp=function() { this.className+=(this.className.length>0? " ": "") + "sfhover"; }; sfEls[i].onmouseout=function() { this.className=this.className.replace(new RegExp("( ?|^)sfhover\\b"), ""); }; }      }else{ var menuItem=$(menuDivId);  if(menuItem) menuItem.parentNode.removeChild(menuItem);         } }, onShowRightMessage: function (evt) { var button = 0; var y = 30; var x = 30; if(isIE) { button = window.event.button; }else{  button = evt.button; }        if(button==2) { showMessageWindow(vcomStrings.warningStr,"<center>"+vcomStrings.registerPreStr+"</center>"); } }, vcomOnMenu0: function () { myname = vcomStrings.mAvatarMenu0;  showprofileAtRight(this.getDBId());         }, vcomOnMenu1: function () { if(this.vcomMyself==true){  new Ajax.Updater('MessageWindow','/room/alertmessage',{ method:'get', parameters:"requestId="+vcomLIB.requestId+"&message="+encodeURIComponent(vcomStrings.requestPostStr), onComplete:MM_showHideLayers('MessageWindow','','show'), evalScripts:true });  }else{ new Ajax.Updater('MessageWindow','/room/add_friend',{ method:'get', parameters:"requestId="+vcomLIB.requestId+"&from_user="+vcomAPI.userId+"&to_user="+this.getDBId()+"&roomid="+vcomLIB.roomId,  onComplete:MM_showHideLayers('MessageWindow','','show'), evalScripts:true });    } $('MessageWindow').style.left = lastClickX+'px'; $('MessageWindow').style.top  = lastClickY+'px'; return false; }, vcomOnMenu2: function () {  new Ajax.Updater('SendMessageLayer','/room/send_message',{ method:'get', parameters:"requestId="+vcomLIB.requestId+"&id="+this.getId(), evalScripts:true }); MM_showHideLayers('SendMessageLayer','','show'); MM_showHideLayers('SendGiftLayer','','hide'); MM_showHideLayers('SendMoneyLayer','','hide'); var m = new Draggable(); m.setUp('SendMessageLayer','yes',{}); return false; }, vcomOnMenu3: function () { new Ajax.Updater('SendGiftLayer','/room/send_gift',{ method:'get', parameters:"requestId="+vcomLIB.requestId+"&id="+this.getId(), evalScripts:true   }); MM_showHideLayers('SendGiftLayer','','show'); MM_showHideLayers('SendMessageLayer','','hide'); MM_showHideLayers('SendMoneyLayer','','hide'); $('SendGiftLayer').style.left = (lastClickX - 100)+'px'; $('SendGiftLayer').style.top  = (lastClickY - 400)+'px';   return false;  }, vcomOnMenu4: function () { $('SendMoneyLayer').innerHTML = "<img src='"+vcomStringsConstants.staticUrlstr+"/images/indicator.gif'>"; new Ajax.Updater('SendMoneyLayer','/room/send_money',{ method:'get', parameters:"requestId="+vcomLIB.requestId+"&id="+this.getId(), evalScripts:true }); MM_showHideLayers('SendMoneyLayer','','show'); MM_showHideLayers('SendGiftLayer','','hide'); MM_showHideLayers('SendMessageLayer','','hide'); $('SendMoneyLayer').style.left = (lastClickX - 100)+'px'; $('SendMoneyLayer').style.top  = (lastClickY - 400)+'px';   return false;   }, vcomOnMenu5: function () { if(this.vcomMyself){ vcomLIB.quitRoom(); }else{ new Ajax.Request('/room/quit',{ method:'get',  parameters:'id='+this.getId()+'&user_name='+encodeURIComponent(this.vcomUserName)+'&requestId='+vcomLIB.requestId }); var avatarDiv = this.element; avatarDiv.parentNode.removeChild(avatarDiv); vcomAPI.avatarNumInRoom = vcomAPI.avatarNumInRoom-1;  var options=$('to_user').options; for(i=0;i<options.length;i++){ if(options[i].value==this.getId()) { options[i]=null; if($('to_user').selectedIndex==i) $('to_user').selectedIndex=0; } } sendChatMessage('0',' ALL',this.vcomUserName+' has been kicked out.'); }  MM_showHideLayers('SendMoneyLayer','','hide'); MM_showHideLayers('SendGiftLayer','','hide'); MM_showHideLayers('SendMessageLayer','','hide');   return false; }, vcomOnMenu6: function () {  }, vcomOnMenu61: function () {  vcomAPI.bringToFront(this.element); }, vcomOnMenu62: function () {  vcomAPI.sendToBack(this.element); }, vcomOnMenu7: function () {  }, vcomOnMenu71: function () {  this.vcomChangeStatus('Active'); }, vcomOnMenu72: function () {  this.vcomChangeStatus('idle'); }, vcomOnMenu73: function () {  this.vcomChangeStatus('boss'); }, vcomOnMenu74: function () {  this.vcomChangeStatus('dinner'); }, vcomOnMenu75: function () {  this.vcomChangeStatus('drink'); }, vcomOnMenu76: function () {  this.vcomChangeStatus('leave'); }, vcomOnMenu77: function () {  this.vcomChangeStatus('phone'); }, vcomOnMenu78: function () {  this.vcomChangeStatus('shower'); }, vcomOnMenu79: function () {  this.vcomChangeStatus('washRoom'); }, vcomOnMenu8: function () { new Ajax.Updater('LayerUserRecommend','/user/user_recommend',{ method:'get', parameters:"requestId="+vcomLIB.requestId+"&id="+this.getId(), onComplete:MM_showHideLayers('LayerUserRecommend','','show'), evalScripts:true   }); $('LayerUserRecommend').style.left = lastClickX+'px'; $('LayerUserRecommend').style.top  = lastClickY+'px'; }, vcomOnMenu9: function (){ if(currlanguage=="zh"||currlanguage=="tw"){ window.location.href="/avatar/creator?zonetype=oriental"; }else{ window.location.href="/avatar/creator?zonetype=occidental"; } }, vcomOnMenuA: function (){ new Ajax.Updater('LayerSendGroupInvitation','/group/send_group_invitation',{ method:'get', parameters:"requestId="+vcomLIB.requestId+"&id="+this.getId(), onComplete:MM_showHideLayers('LayerSendGroupInvitation','','show'), evalScripts:true   }); $('LayerSendGroupInvitation').style.left = lastClickX+'px'; $('LayerSendGroupInvitation').style.top  = lastClickY+'px'; }, vcomOnMenuB: function (){ $("LayerRoommateRequestSelect").innerHTML="<table height='100%' width='100%'><tr><td>&nbsp;</td></tr><tr><td>&nbsp;</td></tr><tr align = center><td valign='center' align=center width='100%'><img src='"+vcomStringsConstants.staticUrlstr+"/images/indicator.gif'></td></tr><tr><td>&nbsp;</td></tr></table>";   new Ajax.Updater('LayerRoommateRequestSelect','/roommate/roommate_request_select',{ method:'get', parameters:"requestId="+vcomLIB.requestId+"&id="+this.getId(), onComplete:MM_showHideLayers('LayerRoommateRequestSelect','','show'), evalScripts:true   }); $('LayerRoommateRequestSelect').style.left = (lastClickX-200)+'px'; $('LayerRoommateRequestSelect').style.top  = (lastClickY-100)+'px'; }, vcomChangeStatus: function (status){ new Ajax.Request('/room/setAvatarStatus',{ method:'get',  parameters:'id='+this.getId()+'&requestId='+vcomLIB.requestId+'&status='+status }); }, vcomOnMouseOver: function(evt){ if(isIE) {  evt.srcElement.className="over"; }else{ evt.target.className="over"; } }, vcomOnMouseOut: function(evt){ if(isIE) { evt.srcElement.className="out"; }else{ evt.target.className="out"; } }, vcomRemoveFromRoom: function(){ this.vcomOnMenu5(); } ,  attachElement:function(elem,align)  { var avatarWidth= parseInt($(this.element.id).style.width);  var div = document.createElement("div");                var type = typeof(elem); if(type.toString().toLowerCase()== "string"){  div.innerHTML = elem;             }else if(type.toString().toLowerCase()== "object"){ div.appendChild(elem); } if(align.replace(/\s+/g,"").toLowerCase() == "left"){ var style= "position:absolute;margin-top:10px;right:"+(avatarWidth+5)+"px;"; div.setAttribute("style",style); div.style.cssText = style; }else{ var style = "position:absolute;margin-top:10px;left:"+(avatarWidth+5)+"px;"; div.setAttribute("style",style); div.style.cssText = style; }    var avatarDiv = $(this.getId()); avatarDiv.cleanWhitespace(); avatarDiv.insertBefore(div,avatarDiv.down());  } });  var VcomItemMenu = Class.create();  VcomItemMenu.prototype = Object.extend(new VcomEntity(),{ initialize: function() {}, vcomItemMenu:null, vcomConfigDom:null, vcomConfigXML:null, vcomDefaultConfigXML:null, vcomPersistentXML:null, vcomCacheXML:null, vcomIsNote:false, vcomIsMinimize:false, vcomIsLock:false, vcomIsPin:false, vcomIsOwnerControl:false, vcomShowOwnerControl:false, vcomIsOwnerPin:false, vcomPinnerId:null, vcomPinnerName:null,     vcomShowResize:true, vcomItemName:null, vcomRecommendCounts:null, vcomOwnerId:null, getId: function () { return this.element.id; },     getDivId: function () { return this.element.id.substring(this.element.id.indexOf("_")+1); }, getVariable: function () { return 'vcomItem' + this.getDivId(); },   getDBId: function () { return this.element.id.substring(this.element.id.lastIndexOf("_")+1); },  onStart: function (js,lock,minimize,name,note,recommendCounts,owner_id,owner_control) { if(note=="true"){ this.vcomShowResize=false; }  this.vcomItemName = name; this.vcomRecommendCounts = recommendCounts; this.vcomOwnerId = owner_id; this.vcomIsOwnerControl = owner_control=="1";  this.vcomItemMenu = { vcomOnMenu9:null, vcomOnMenu0:null, vcomOnMenu1:null, vcomOnMenu2:null, vcomOnMenu8:null, vcomOnMenu7:null,  vcomOnMenu3:null, vcomOnMenu4:null, vcomOnMenu5:null, vcomOnMenu6:vcomStrings.mItemMenu6, vcomOnMenu61:vcomStrings.mItemMenu61, vcomOnMenu62:vcomStrings.mItemMenu62, vcomOnMenu7:null, vcomOnMenuA:null }; if (vcomAPI.isRoomOwner){ if (lock=="yes"){ this.vcomIsLock=true; this.vcomItemMenu['vcomOnMenu0']=null; this.vcomItemMenu['vcomOnMenu1']=null; this.vcomItemMenu['vcomOnMenu2']=vcomStrings.mItemMenu21; this.vcomItemMenu['vcomOnMenu3']=null; this.vcomItemMenu['vcomOnMenu4']=null; this.vcomItemMenu['vcomOnMenu5']=null; this.vcomItemMenu['vcomOnMenu7']=null; this.vcomItemMenu['vcomOnMenu8']=null; this.vcomItemMenu['vcomOnMenuA']=null; if (minimize=="yes") this.vcomIsMinimize=true; else this.vcomIsMinimize=false; }else{ this.vcomIsLock=false; if(this.vcomOwnerId==vcomAPI.userId){ this.vcomItemMenu['vcomOnMenu1']=vcomStrings.mItemMenu1; this.vcomItemMenu['vcomOnMenu5']=vcomStrings.mItemMenu5; }else{ this.vcomItemMenu['vcomOnMenu1']=null;           this.vcomItemMenu['vcomOnMenu5']=null; }  this.vcomItemMenu['vcomOnMenu2']=vcomStrings.mItemMenu22; this.vcomItemMenu['vcomOnMenu7']=vcomStrings.mItemMenu7;  this.vcomItemMenu['vcomOnMenu3']=vcomStrings.mItemMenu3;   if (minimize=="yes"){ this.vcomIsMinimize=true; this.vcomItemMenu['vcomOnMenu4']=vcomStrings.mItemMenu42; this.vcomItemMenu['vcomOnMenu0']=null; }else{ this.vcomIsMinimize=false; this.vcomItemMenu['vcomOnMenu4']=vcomStrings.mItemMenu41; if(this.vcomShowResize) this.vcomItemMenu['vcomOnMenu0']=vcomStrings.mItemMenu0; } if(this.vcomIsPin){ this.vcomItemMenu['vcomOnMenu8']=vcomStrings.mItemMenu81; }else{ this.vcomItemMenu['vcomOnMenu8']=vcomStrings.mItemMenu82; } if (this.vcomShowOwnerControl){ if(this.vcomIsOwnerControl){ this.vcomItemMenu['vcomOnMenuA']=vcomStrings.mItemMenuA1; }else{ this.vcomItemMenu['vcomOnMenuA']=vcomStrings.mItemMenuA0; } }else{ this.vcomItemMenu['vcomOnMenuA']=null; } } }else{ this.resetvcomOnMenu9(); this.vcomItemMenu['vcomOnMenu2']=null; this.vcomItemMenu['vcomOnMenu7']=null; this.vcomItemMenu['vcomOnMenu3']=null; this.vcomItemMenu['vcomOnMenu5']=null;   if (lock!="yes"){   this.vcomIsLock=false; if (minimize=="yes"){ this.vcomIsMinimize=true; this.vcomItemMenu['vcomOnMenu4']=vcomStrings.mItemMenu42; this.vcomItemMenu['vcomOnMenu0']=null; }else{ this.vcomIsMinimize=false; this.vcomItemMenu['vcomOnMenu4']=vcomStrings.mItemMenu41; if(this.vcomShowResize) this.vcomItemMenu['vcomOnMenu0']=vcomStrings.mItemMenu0; }    if(this.vcomIsPin){ this.vcomItemMenu['vcomOnMenu8']=vcomStrings.mItemMenu81; }else{ this.vcomItemMenu['vcomOnMenu8']=vcomStrings.mItemMenu82; } if(this.vcomIsOwnerControl){ this.vcomItemMenu['vcomOnMenu1']=null; this.vcomItemMenu['vcomOnMenu4']=null; this.vcomItemMenu['vcomOnMenu6']=null; this.vcomItemMenu['vcomOnMenu8']=null; if (this.vcomShowOwnerControl){ this.vcomItemMenu['vcomOnMenuA']=vcomStrings.mItemMenuA1; }else{ this.vcomItemMenu['vcomOnMenuA']=null; } }else{ if (this.vcomShowOwnerControl){ this.vcomItemMenu['vcomOnMenuA']=vcomStrings.mItemMenuA0; }else{ this.vcomItemMenu['vcomOnMenuA']=null; } }  }else{ this.vcomIsLock=true; if (minimize=="yes"){ this.vcomIsMinimize=true; this.vcomItemMenu['vcomOnMenu4']=vcomStrings.mItemMenu42; this.vcomItemMenu['vcomOnMenu0']=null; }else{ this.vcomIsMinimize=false; this.vcomItemMenu['vcomOnMenu4']=vcomStrings.mItemMenu41; if(this.vcomShowResize) this.vcomItemMenu['vcomOnMenu0']=vcomStrings.mItemMenu0; }        } } this.vcomShowRightMenuEvent = this.vcomOnShowRightMenu.bindAsEventListener(this); Event.observe(this.element, "mouseup", this.vcomShowRightMenuEvent); this.vcomItemShowRightMessageEvent = this.onShowRightMessage.bindAsEventListener(this);  this.vcomRestoreEvnet = this.vcomRestore.bindAsEventListener(this); Event.observe(this.element, "dblclick", this.vcomRestoreEvnet); }, canOwnerControlOperate: function(){ return !this.vcomShowOwnerControl || vcomAPI.isRoomOwner || !this.vcomIsOwnerControl; }, resetvcomOnMenu9: function () { if(!vcomAPI.isRoomOwner && !vcomAPI.isVisitor){ this.vcomItemMenu['vcomOnMenu9']="<IMG src=\"/images/vote_yes.gif\" border=\"0\" />("+this.vcomRecommendCounts+")&nbsp;"+vcomStrings.mAvatarMenu8; } }, onReStart: function () { Event.observe(this.element, "mouseup", this.vcomShowRightMenuEvent); },     onStop: function () { Event.stopObserving(this.element, "mouseup", this.vcomShowRightMenuEvent); }, onShowMessage: function () { Event.observe(this.element, "mouseup", this.vcomItemShowRightMessageEvent); }, onStopMessage: function () { Event.stopObserving(this.element, "mouseup", this.vcomItemShowRightMessageEvent); }, onShowRightMessage: function (evt) { var button = 0; var y = 30; var x = 30; if(isIE) { button = window.event.button; if(button==1||button==2) showMessageWindowLocal(vcomStrings.warningStr,"<center>"+vcomStrings.enterRemind+"</center>"); }else{  button = evt.button; if(button==0||button==2) showMessageWindowLocal(vcomStrings.warningStr,"<center>"+vcomStrings.enterRemind+"</center>"); }  }, vcomOnShowRightMenu: function (evt) { var button = 0; if(isIE) { button = window.event.button;     }else{  button = evt.button; } if(button==2) { this.onShowRightMenu(evt); }else{ vcomAPI.removeRightMenu(); } }, showItemRightMenu: function(evt){ if(vcomAPI.isUserInRoom && (vcomAPI.isRoomOwner || !this.vcomIsLock )){ this.onShowRightMenu(evt); vcomAPI.clickShowRightMenu = true; } }, onShowRightMenu:function(evt){ if(vcomAPI.isUserInRoom){ var y = 30; var x = 30; if($(this.element.id)){ y = parseInt($(this.element.id).style.top); x = parseInt($(this.element.id).style.left); } if(isIE) { if(window.event && window.event.x && window.event.y){ x=window.event.x; y=window.event.y; } }else{  if(evt && evt.pageX && evt.pageY){ x = evt.pageX-$('backgroundDiv').offsetLeft; y = evt.pageY-$('backgroundDiv').offsetTop; } }   var menuItem=$(menuDivId);  if(menuItem) menuItem.parentNode.removeChild(menuItem); HTMLstr  = "";  HTMLstr += "<!-- RightButton PopMenu -->\n"; HTMLstr += "\n"; HTMLstr += "<!-- PopMenu Starts -->\n"; HTMLstr += "<table width='100%' border='0' cellspacing='0' cellpadding='0'>\n";  HTMLstr += "<tr class='out'><td>\n"; HTMLstr += "<!-- Insert A Extend Menu or Item On Here For E_rbpm -->\n"; HTMLstr += "</td></tr></table>\n"; HTMLstr += "\n"; HTMLstr += "<!-- PopMenu Ends -->\n";   var TempStr = "<div><ul id='nav'>"; TempStr += "<li><span style='cursor:pointer;'>"+this.vcomItemName+"</span></li>"; var subMenuArr = new Array(); var mainMenuArr = new Array(); var menuChildHash = {}; for(var thisMenu in this.vcomItemMenu) { if(thisMenu.length==11){  mainMenuArr.push(thisMenu);  }else if(thisMenu.length==12 && thisMenu.substring(10,11)=="U"){ mainMenuArr.push(thisMenu); } for(var itemMenu in this.vcomItemMenu) { if(itemMenu == thisMenu.substring(0,thisMenu.length-1)){ if(!menuChildHash[itemMenu]) menuChildHash[itemMenu] = new Array(); menuChildHash[itemMenu].push(thisMenu); } } }  for(var l=0;l<mainMenuArr.length;l++) { var FunctionName = mainMenuArr[l]; var name = this.vcomItemMenu[FunctionName]; if(name!=null) {  TempStr += "<li><a style='cursor:pointer;' id='"+this.element.id+"_"+FunctionName+"' name='"+this.element.id+"_"+FunctionName+"'>"+name+"</a>"; subMenuArr = menuChildHash[mainMenuArr[l]]; if(subMenuArr && subMenuArr.length>0) { TempStr += "<ul>"; for(var t=0;t<=subMenuArr.length-1;t++) { TempStr += "<li><a style='cursor:pointer;' id='"+this.element.id+"_"+subMenuArr[t]+"' name='"+this.element.id+"_"+subMenuArr[t]+"'>"+this.vcomItemMenu[subMenuArr[t]]+"</a>"; subMenuArr2 = menuChildHash[subMenuArr[t]]; if(subMenuArr2 && subMenuArr2.length>0) { TempStr += "<ul>"; for(var k=0;k<=subMenuArr2.length-1;k++) { TempStr += "<li><a style='cursor:pointer;' id='"+this.element.id+"_"+subMenuArr2[k]+"' name='"+this.element.id+"_"+subMenuArr2[k]+"'>"+this.vcomItemMenu[subMenuArr2[k]]+"</a></li>"; } TempStr += "</ul>"; } TempStr += "</li>"; } TempStr += "</ul>"; } TempStr += "</li>"; } }  TempStr +="</ul></div>";    var elem = document.createElement('div'); elem.style.cssText = 'position:absolute;top:'+y+'px;left:'+x+'px;z-index:'+vcomAPI.Z_FRONT+';display:block;';  elem.style.display=''; elem.id=menuDivId; elem.innerHTML = TempStr;  var body = $('backgroundDiv'); if(body) body.appendChild(elem);  for(var thisMenu in this.vcomItemMenu) { if(this.vcomItemMenu[thisMenu]!=null&&this.vcomItemMenu[thisMenu]!="null"){ if($(this.element.id+'_'+thisMenu)){ Event.observe(this.element.id+'_'+thisMenu, "click", eval('this.'+thisMenu+'.bindAsEventListener(this)'));       }   } } var sfEls = $("nav").getElementsByTagName("li"); for (var i=1; i<sfEls.length; i++) { sfEls[i].onmouseover=function() { this.className+=(this.className.length>0? " ": "") + "sfhover"; }; sfEls[i].onMouseDown=function() { this.className+=(this.className.length>0? " ": "") + "sfhover"; }; sfEls[i].onMouseUp=function() { this.className+=(this.className.length>0? " ": "") + "sfhover"; }; sfEls[i].onmouseout=function() { this.className=this.className.replace(new RegExp("( ?|^)sfhover\\b"), ""); }; }    }      }, canBeOperated: function () { if (!vcomAPI.isUserInRoom || this.vcomIsLock || this.vcomIsPin && this.vcomPinnerId != vcomAPI.avatarId){ return false; } return true;  }, _:function() { }, vcomSaveConfigXML:function(){  var fieldlist=this.vcomConfigXML.getElementsByTagName('field'); var dbParameterXmlStr='<fields>'; if (vcomAPI.XMLGetFirstNode(this.vcomConfigXML,"version")!=null){ dbParameterXmlStr=dbParameterXmlStr+"<version>"+vcomAPI.XMLGetFirstNodeValue(this.vcomConfigXML,'version')+"</version>"; } for(i=0;i<fieldlist.length;i++){ if($(this.element.id+vcomAPI.XMLGetFirstNodeValue(fieldlist[i],'id')).type=='checkbox'){ dbParameterXmlStr=dbParameterXmlStr+"<field><id>"+vcomAPI.XMLGetFirstNodeValue(fieldlist[i],'id')+"</id><name>"+vcomAPI.XMLGetFirstNodeValue(fieldlist[i],'name')+"</name><default_value>"+vcomAPI.XMLGetFirstNodeValue(fieldlist[i],'default_value')+"</default_value>"; if($(this.element.id+vcomAPI.XMLGetFirstNodeValue(fieldlist[i],'id')).checked==true){ dbParameterXmlStr=dbParameterXmlStr + "<value>YES</value><input_type>checkbox</input_type>"; }else{ dbParameterXmlStr=dbParameterXmlStr + "<value>NO</value><input_type>checkbox</input_type>"; } dbParameterXmlStr=dbParameterXmlStr+"</field>"; }else{ dbParameterXmlStr=dbParameterXmlStr+"<field><id>"+vcomAPI.XMLGetFirstNodeValue(fieldlist[i],'id')+"</id><name>"+vcomAPI.XMLGetFirstNodeValue(fieldlist[i],'name')+"</name><value>"+this.vcomYahooVideoEmbedHack($F(this.element.id+vcomAPI.XMLGetFirstNodeValue(fieldlist[i],'id')))+"</value><default_value>"+vcomAPI.XMLGetFirstNodeValue(fieldlist[i],'default_value')+"</default_value>"; var sourceSelect=vcomAPI.XMLGetFirstNodeValue(fieldlist[i],'source_select'); if(sourceSelect!=null){ if(sourceSelect=="true"){ dbParameterXmlStr=dbParameterXmlStr+"<source_select>true</source_select>"; }else{ dbParameterXmlStr=dbParameterXmlStr+"<source_select>false</source_select>"; } } var sourceType=vcomAPI.XMLGetFirstNodeValue(fieldlist[i],'source_type'); if(sourceType!=null){ dbParameterXmlStr=dbParameterXmlStr+"<source_type>" + sourceType + "</source_type>"; }else{ dbParameterXmlStr=dbParameterXmlStr+"<source_type>item_image</source_type>"; } var commentElement=vcomAPI.XMLGetFirstNode(fieldlist[i],'comment'); if (commentElement!=null){ dbParameterXmlStr=dbParameterXmlStr+"<comment><id>"+vcomAPI.XMLGetFirstNodeValue(commentElement,'id')+"</id><name>"+vcomAPI.XMLGetFirstNodeValue(commentElement,'name')+"</name><value>"+this.vcomYahooVideoEmbedHack($F(this.element.id+vcomAPI.XMLGetFirstNodeValue(commentElement,'id')))+"</value></comment>"; } var cpElement=vcomAPI.XMLGetFirstNode(fieldlist[i],'constrain_proportions'); if (cpElement!=null){ var cpchecked = $(this.element.id+vcomAPI.XMLGetFirstNodeValue(cpElement,'id')).checked; dbParameterXmlStr=dbParameterXmlStr+"<constrain_proportions><id>"+vcomAPI.XMLGetFirstNodeValue(cpElement,'id')+"</id><name>"+vcomAPI.XMLGetFirstNodeValue(cpElement,'name')+"</name><value>"+cpchecked+"</value><default_value>"+vcomAPI.XMLGetFirstNodeValue(cpElement,'default_value')+"</default_value><input_type>"+vcomAPI.XMLGetFirstNodeValue(cpElement,'input_type')+"</input_type></constrain_proportions>"; } dbParameterXmlStr=dbParameterXmlStr+"</field>" } } dbParameterXmlStr=dbParameterXmlStr+'</fields>'; dbParameterXmlStr=dbParameterXmlStr.replace(new RegExp("&","gm"),"%26");   this.vcomConfigXML=vcomAPI.parseXML(dbParameterXmlStr); this.vcomConcurrentCall(null, null,vcomAPI.CONFIG_XML|vcomAPI.NOTIFY_ALL);  MM_showHideLayers('config_div_'+this.element.id,'','hide'); document.body.removeChild($('config_div_'+this.element.id)); }, vcomYahooVideoEmbedHack: function(embed) { if (embed.indexOf('embed')!=-1&&embed.indexOf('yahoo')!=-1&&embed.indexOf('flashvars')!=-1) { var start = embed.indexOf('flashvars')+'flashvars'.length+2; var end = embed.substring(start).indexOf('\'') -1; embed = embed.substring(start).substring(0, end); } if (embed.indexOf('embed')!=-1&&embed.indexOf('src')!=-1) { var start = embed.indexOf('src=')+5; quote = embed.substring(start - 1).substring(0, 1); var end = embed.substring(start).indexOf(quote); embed = embed.substring(start).substring(0, end); } tempValue = vcomAPI.XMLToString(vcomAPI.parseXML("<testNode>"+embed+"</testNode>")); if (tempValue == "" ) embed = ""; return embed; }, vcomShowConfigWindow:function(actionmode){ if(this.vcomConfigXML){ if ($('config_div_'+this.element.id)!=undefined){ MM_showHideLayers('config_div_'+this.element.id,'','hide'); document.body.removeChild($('config_div_'+this.element.id)); } var item_script_div = document.createElement('div'); var itemname=this.getVariable();  item_script_div.id="config_div_"+this.element.id; var innerstr= "<table border=0 cellpadding=0 cellspacing=0 width=527 id='"+this.element.id+"Edit_Conf'>"+ "<tr>"+ "<td>"+ "<table width='100%' border=0 cellpadding=0 cellspacing=0 id='editconfheadline' style='cursor:move;'>"+ "<tr>"+ "<td width=13 height=40 ><img src='"+vcomStringsConstants.staticUrlstr+"/images/web/popwindow_left_top.gif'/></td>"+ "<td width=500 background='"+vcomStringsConstants.staticUrlstr+"/images/web/popwindow_center_top.gif'>"+ "<table width=100% border=0 cellspacing=0 cellpadding=0>"+ "<tr>"+ "<td width=485>"+ "<table width=100% border=0 align=center cellpadding=0 cellspacing=0>"+ "<tr>"+ "<td style='cursor:move' valign=center class=popwindow_title>"+vcomStrings.mItemMenu3+"</td>"+ "</tr>"+ "</table>"+ "</td>"+ "<td width=\"15\" valign=\"center\" ><img src='"+vcomStringsConstants.staticUrlstr+"/images/web/popwindow_close.gif' class=\"showhand\" onclick=\"MM_showHideLayers( 'config_div_"+this.element.id+"','','hide');\"/></td>"+ "</tr>"+ "</table>"+ "</td>"+ "<td width=\"14\"><span class='showhand' onclick=\"document.body.removeChild($('config_div_"+this.element.id+"'));\"><img src='"+vcomStringsConstants.staticUrlstr+"/images/web/popwindow_right_top.gif'/></span></td>"+ "</tr>"+ "</table>"+ "</td>"+   "</tr>"+ "<tr>"+ "<td>"+ "<table width='100%' border=0 cellpadding=0 cellspacing=0>"+ "<tr>"+ "<td width='13' background='"+vcomStringsConstants.staticUrlstr+"/images/web/popwindow_left_center.gif'></td>"+ "<td width=\"500\" bgcolor=\"#FFFFFF\">"+ "<table border=0 cellpadding=0 cellspacing=0 width='100%'>"+ "<tr>"+ "<td class='dw_st1' width='100%' align=center>";  fieldlist = this.vcomConfigXML.getElementsByTagName('field'); var fieldlistLength =fieldlist.length; if(fieldlistLength < 18){ innerstr=innerstr+"<div style='overflow: auto; height: "+fieldlistLength*26+"px; width: 500px;'>"; }else{ innerstr=innerstr+"<div style='overflow: auto; height: 450px; width: 500px;'>"; } innerstr=innerstr+"<table border='0' cellpadding='1' cellspacing='1'>";  for (i=0;i<fieldlistLength;i++){ if (actionmode=='restore'){ var fieldValue=vcomAPI.XMLGetFirstNodeValue(fieldlist[i],'default_value'); }else{ var fieldValue=vcomAPI.XMLGetFirstNodeValue(fieldlist[i],'value'); } if (fieldValue==null||fieldValue=='null'){ fieldValue=''; }else{ fieldValue=fieldValue.replace(new RegExp("SHIFTPLUS7","gm"),"&"); } var inputType=vcomAPI.XMLGetFirstNodeValue(fieldlist[i],'input_type'); var sourceSelect=vcomAPI.XMLGetFirstNodeValue(fieldlist[i],'source_select');  var fieldName = vcomAPI.XMLGetFirstNodeValue(fieldlist[i],'name'); fieldName = vcomAPI.getStringByLanguage(fieldName,this.enString,this.twString,this.zhString);   if(sourceSelect!=null && sourceSelect=="true"){ innerstr=innerstr+"<tr><td align=right>"+fieldName+":</td><td><input type=text name='" + this.element.id + vcomAPI.XMLGetFirstNodeValue(fieldlist[i],'id')+"' id='"+this.element.id+vcomAPI.XMLGetFirstNodeValue(fieldlist[i],'id')+"' value=\""+fieldValue+"\" size=24 /> &nbsp;<input style=\"font-size:12px;\" name='"+this.element.id+vcomAPI.XMLGetFirstNodeValue(fieldlist[i],'id')+"' id='"+this.element.id+vcomAPI.XMLGetFirstNodeValue(fieldlist[i],'id')+"'  value=\""+ vcomStrings.browse +"\" type=button onClick=\"showUploadResourceDiv('"+this.getDBId()+"','"+vcomAPI.XMLGetFirstNodeValue(fieldlist[i],'source_type')+"','"+this.element.id+vcomAPI.XMLGetFirstNodeValue(fieldlist[i],'id')+"');\"/></td></tr>"; }else{ innerstr=innerstr+"<tr><td align=right>"+fieldName+":</td><td><input type=text name='" + this.element.id + vcomAPI.XMLGetFirstNodeValue(fieldlist[i],'id')+"' id='"+this.element.id+vcomAPI.XMLGetFirstNodeValue(fieldlist[i],'id')+"' value=\""+fieldValue+"\" size=24 /></td></tr>"; } /*}else if(inputType=="checkbox"){ if (fieldValue=='NO'||fieldValue==''){ innerstr=innerstr+"<tr><td align=right>"+fieldName+":</td><td><input type=checkbox name='" + this.element.id + vcomAPI.XMLGetFirstNodeValue(fieldlist[i],'id')+"' id='"+this.element.id+vcomAPI.XMLGetFirstNodeValue(fieldlist[i],'id')+"' value='checkbox' size=26 /></td></tr>";  }else{ innerstr=innerstr+"<tr><td align=right>"+fieldName+":</td><td><input type=checkbox name='" + this.element.id + vcomAPI.XMLGetFirstNodeValue(fieldlist[i],'id')+"' id='"+this.element.id+vcomAPI.XMLGetFirstNodeValue(fieldlist[i],'id')+"' value='checkbox' checked='checked' size=26 /></td></tr>"; }  }*/   var commentElement=vcomAPI.XMLGetFirstNode(fieldlist[i],'comment');  var fieldValue; if (actionmode=='restore'){ fieldValue=vcomAPI.XMLGetFirstNodeValue(commentElement,'default_value'); }else{ fieldValue=vcomAPI.XMLGetFirstNodeValue(commentElement,'value'); } if (fieldValue==null||fieldValue=='null'){ fieldValue=''; }else{ fieldValue=fieldValue.replace(new RegExp("SHIFTPLUS7","gm"),"&"); } if(commentElement!=null){ var commentName = vcomAPI.XMLGetFirstNodeValue(commentElement,'name'); commentName = vcomAPI.getStringByLanguage(commentName,this.enString,this.twString,this.zhString); innerstr=innerstr+"<tr><td align=right>"+commentName+":</td><td><input type=text name='" + this.element.id + vcomAPI.XMLGetFirstNodeValue(commentElement,'id')+"' id='"+this.element.id+vcomAPI.XMLGetFirstNodeValue(commentElement,'id')+"' value=\""+fieldValue+"\" size=24 /></td></tr>"; }  var cpElement=vcomAPI.XMLGetFirstNode(fieldlist[i],'constrain_proportions'); if (cpElement!=null){ if (actionmode=='restore'){ fieldValue=vcomAPI.XMLGetFirstNodeValue(cpElement,'default_value'); }else{ fieldValue=vcomAPI.XMLGetFirstNodeValue(cpElement,'value'); } if(fieldValue=="true"){ fieldValue="checked"; }else{ fieldValue=''; } if(cpElement!=null){ var cpName = vcomAPI.XMLGetFirstNodeValue(cpElement,'name'); cpName = vcomAPI.getStringByLanguage(cpName,this.enString,this.twString,this.zhString); innerstr=innerstr+"<tr><td align=right>"+cpName+":</td><td><input type=checkbox name='" + this.element.id + vcomAPI.XMLGetFirstNodeValue(cpElement,'id')+"' id='"+this.element.id+vcomAPI.XMLGetFirstNodeValue(cpElement,'id')+"' value='checkbox' "+fieldValue+" size=24 /></td></tr>"; } } }  innerstr=innerstr+ "</table></div></td></tr>"+        "<tr>"+ "<td class='dw_st1' height='30' valign='bottom' align='center'>"+ "<input name='submit' onclick='"+itemname+".vcomSaveConfigXML();' value='"+vcomStrings.saveStr+"' type='button' />&nbsp;&nbsp;&nbsp;"+ "<input name='restore' onclick=\""+itemname+".vcomShowConfigWindow('restore');\" value='"+vcomStrings.restoreStr+"' type='button' />&nbsp;&nbsp;&nbsp;"+ "<input name='cancel' onclick=\"document.body.removeChild($('config_div_"+this.element.id+"'));\" value='"+vcomStrings.cancelStr+"' type='button' />"+ "</td>"+ "</tr>"+ "</table></td>"+ "<td width=\"14\" background='"+vcomStringsConstants.staticUrlstr+"/images/web/popwindow_right_center.gif'></td>"+ "</tr>"+ "</table>"+ "</td>"+   "</tr>"+ "<tr>"+ "<td>"+ "<table width='100%' border=0 cellpadding=0 cellspacing=0>"+ "<tr>"+ "<td width=\"13\" height=\"22\" background='"+vcomStringsConstants.staticUrlstr+"/images/web/popwindow_left_bottom.gif'>&nbsp;</td>"+ "<td width=\"500\" background='"+vcomStringsConstants.staticUrlstr+"/images/web/popwindow_center_bottom.gif'>&nbsp;</td>"+ "<td width=\"14\" background='"+vcomStringsConstants.staticUrlstr+"/images/web/popwindow_right_bottom.gif' /></td>"+ "</tr>"+ "</table>"+ "</td>"+   "</tr>"+ "</table>";   item_script_div.innerHTML=innerstr; var window_height = document.body.clientHeight;    var window_width	= document.body.clientWidth;            var self_height = 300;    var self_width = 540;        scrollTop = document.body.scrollTop;    if (!isIE) scrollTop = document.documentElement.scrollTop;    var self_top =  scrollTop + 250;        var self_left =  document.body.scrollLeft + ( window_width - self_width)/2;       item_script_div.style.cssText= 'width:450px;position:absolute;z-index:'+vcomAPI.Z_MIDDLE_FRONT+";top:"+self_top+"px;left: "+self_left+"px;"; document.body.appendChild(item_script_div); var draggable_editor = new Draggable();  draggable_editor.setUp('config_div_'+this.element.id,'',{handle:'editconfheadline'}); }else{ showMessageWindow("System","<center>"+vcomStrings.vcomPostStr+"</center>"); }  }, vcomOnMenu0: function () { this.vcomToggleResizer(); return false; }, vcomOnMenu1: function () { removeItemDiv(this.getId()); vcomAPI.isShowUnloadAlert=false;    var mypage = "/room/removeToEdit?id="+this.getId()+"&requestId="+vcomLIB.requestId;  window.location.href = mypage; }, vcomOnMenu2: function () {  if (this.vcomItemMenu['vcomOnMenu2']==vcomStrings.mItemMenu22){ this.vcomIsLock=true; this.destroy(); this.vcomItemMenu['vcomOnMenu0']=null; this.vcomItemMenu['vcomOnMenu1']=null; this.vcomItemMenu['vcomOnMenu2']=vcomStrings.mItemMenu21; this.vcomItemMenu['vcomOnMenu3']=null; this.vcomItemMenu['vcomOnMenu4']=null; this.vcomItemMenu['vcomOnMenu5']=null; this.vcomItemMenu['vcomOnMenu7']=null; this.vcomItemMenu['vcomOnMenu8']=null;   vcomAPI.fireCallbacks(vcomAPI.EVENT_ITEM_LOCK, {id:this.getId(), name:this.vcomItemName, isOriginator:'yes'}); /* new Ajax.Request('/room/setLockUpdate',{ method:'get', parameters:"requestId="+vcomLIB.requestId+"&id="+this.getId()+"&name="+encodeURIComponent(this.vcomItemName)+"&user_id="+vcomAPI.avatarId+"&user_name="+encodeURIComponent(vcomAPI.userName)+"&par=yes" }); */ new Ajax.Request('/room/lockItem',{ method:'get', parameters:"requestId="+vcomLIB.requestId+"&id="+this.getId()+"&name="+encodeURIComponent(this.vcomItemName)+"&user_id="+vcomAPI.avatarId+"&user_name="+encodeURIComponent(vcomAPI.userName) }); this.vcomShowBubble('Lock'); setTimeout("removeBubble('"+this.getDivId()+"')",20000); }else{ this.vcomIsLock=false; if(!this.vcomIsPin){ this.relive(); }  if(this.vcomIsMinimize==true){ this.vcomItemMenu['vcomOnMenu4']=vcomStrings.mItemMenu42; }else{ this.vcomItemMenu['vcomOnMenu4']=vcomStrings.mItemMenu41; } if(this.vcomIsMinimize==false && this.vcomShowResize){ this.vcomItemMenu['vcomOnMenu0']=vcomStrings.mItemMenu0; }else{ this.vcomItemMenu['vcomOnMenu0']=null; } if(vcomAPI.isRoomOwner){ this.vcomItemMenu['vcomOnMenu1']=vcomStrings.mItemMenu1; this.vcomItemMenu['vcomOnMenu5']=vcomStrings.mItemMenu5; this.vcomItemMenu['vcomOnMenu7']=vcomStrings.mItemMenu7; } this.vcomItemMenu['vcomOnMenu2']=vcomStrings.mItemMenu22; this.vcomItemMenu['vcomOnMenu3']=vcomStrings.mItemMenu3; if(this.vcomIsPin){ this.vcomItemMenu['vcomOnMenu8']=vcomStrings.mItemMenu81; }else{ this.vcomItemMenu['vcomOnMenu8']=vcomStrings.mItemMenu82; }     vcomAPI.fireCallbacks(vcomAPI.EVENT_ITEM_UNLOCK, {id:this.getId(), name:this.vcomItemName, isOriginator:'yes'}); /* new Ajax.Request('/room/setLockUpdate',{ method:'get', parameters:"requestId="+vcomLIB.requestId+"&id="+this.element.id+"&name="+encodeURIComponent(this.vcomItemName)+"&user_id="+vcomAPI.avatarId+"&user_name="+encodeURIComponent(vcomAPI.userName)+"&par=no" }); */ new Ajax.Request('/room/unLockItem',{ method:'get', parameters:"requestId="+vcomLIB.requestId+"&id="+this.element.id+"&name="+encodeURIComponent(this.vcomItemName)+"&user_id="+vcomAPI.avatarId+"&user_name="+encodeURIComponent(vcomAPI.userName) }); this.vcomShowBubble('Unlock'); setTimeout("removeBubble('"+this.getDivId()+"')",20000); } return false; }, vcomOnMenuA: function () {  if (this.vcomItemMenu['vcomOnMenuA']==vcomStrings.mItemMenuA0){ if (vcomAPI.isRoomOwner){ this.vcomIsOwnerControl=true; this.vcomItemMenu['vcomOnMenuA']=vcomStrings.mItemMenuA1; new Ajax.Request('/room/ownerControl',{  method:'get', parameters:"requestId="+vcomLIB.requestId+"&id="+this.getId()+"&name="+encodeURIComponent(this.vcomItemName)+"&user_id="+vcomAPI.avatarId+"&user_name="+encodeURIComponent(vcomAPI.userName) }); this.vcomShowBubble(vcomStrings.mItemMenuA0); setTimeout("removeBubble('"+this.getDivId()+"')",20000); }else{ showMessageWindow(vcomStrings.warningStr,"<center>"+vcomStrings.notAllowedToDo+"</center>"); } }else{ if (vcomAPI.isRoomOwner){ this.vcomIsOwnerControl=false; this.vcomItemMenu['vcomOnMenuA']=vcomStrings.mItemMenuA0; new Ajax.Request('/room/unOwnerControl',{  method:'get', parameters:"requestId="+vcomLIB.requestId+"&id="+this.getId()+"&name="+encodeURIComponent(this.vcomItemName)+"&user_id="+vcomAPI.avatarId+"&user_name="+encodeURIComponent(vcomAPI.userName) }); this.vcomShowBubble(vcomStrings.mItemMenuA1); setTimeout("removeBubble('"+this.getDivId()+"')",20000); }else{ showMessageWindow(vcomStrings.warningStr,"<center>"+vcomStrings.notAllowedToDo+"</center>"); } } return false; }, vcomOnMenu8: function () {  if ( !this.vcomIsPin){         if(vcomAPI.isRoomOwner){ this.vcomIsOwnerPin = true; }else{ this.vcomIsOwnerPin = false; }  this.vcomPinnerId = vcomAPI.avatarId; this.vcomPinnerName = vcomAPI.userName.stripScripts().stripTags();  this.vcomIsPin=true; this.destroy();  this.vcomItemMenu['vcomOnMenu8']=vcomStrings.mItemMenu81;  vcomAPI.fireCallbacks(vcomAPI.EVENT_ITEM_PIN, {id:this.getId(), name:this.vcomItemName, isOriginator:'yes'});  new Ajax.Request('/room/pinItem',{ method:'get', parameters:"requestId="+vcomLIB.requestId+"&id="+this.getId()+"&name="+encodeURIComponent(this.vcomItemName)+"&user_id="+vcomAPI.avatarId+"&user_name="+encodeURIComponent(this.vcomPinnerName)+"&owner_pin="+this.vcomIsOwnerPin }); this.vcomShowBubble(vcomStrings.mItemMenu82); setTimeout("removeBubble('"+this.getDivId()+"')",20000); }else{  if(this.vcomIsOwnerPin && !vcomAPI.isRoomOwner){ this.vcomShowBubble(vcomStrings.pinOwnerWarningMessage,"no",vcomAPI.avatarId,vcomAPI.userName.stripScripts().stripTags());  }else{                     this.vcomIsPin=false; this.vcomIsOwnerPin=false; this.vcomPinnerId = ""; this.vcomPinnerName = ""; if(!this.vcomIsLock){ this.relive();         }  this.vcomItemMenu['vcomOnMenu8']=vcomStrings.mItemMenu82;           vcomAPI.fireCallbacks(vcomAPI.EVENT_ITEM_UNPIN, {id:this.getId(), name:this.vcomItemName, isOriginator:'yes'});  new Ajax.Request('/room/unPinItem',{ method:'get', parameters:"requestId="+vcomLIB.requestId+"&id="+this.element.id+"&name="+encodeURIComponent(this.vcomItemName)+"&user_id="+vcomAPI.avatarId+"&user_name="+encodeURIComponent(vcomAPI.userName.stripScripts().stripTags())+"&owner_pin="+this.vcomIsOwnerPin }); this.vcomShowBubble(vcomStrings.mItemMenu81); setTimeout("removeBubble('"+this.getDivId()+"')",20000); } } return false; },  vcomOnMenu9: function () { new Ajax.Updater('LayerItemRecommend','/room/item_recommend',{ method:'get', parameters:"requestId="+vcomLIB.requestId+"&id="+this.element.id, onComplete:MM_showHideLayers('LayerItemRecommend','','show'), evalScripts:true   }); $('LayerItemRecommend').style.left = lastClickX+'px'; $('LayerItemRecommend').style.top  = lastClickY+'px';     },  vcomOnMenu3: function () { this.vcomShowConfigWindow(); return false; }, vcomOnMenu4: function () { if (this.vcomItemMenu['vcomOnMenu4']==vcomStrings.mItemMenu41){ this.vcomItemMenu['vcomOnMenu0']=null; this.vcomIsMinimize=true; this.beforeMinimize(); this.vcomItemMenu['vcomOnMenu4']=vcomStrings.mItemMenu42; this.beforeMinimize(); if(this.isMinSyn()){ new Ajax.Request('/room/setMinUpdate',{ method:'get', parameters:"id="+this.element.id+"&name="+encodeURIComponent(this.vcomItemName)+"&requestId="+vcomLIB.requestId+"&clientWidth="+this.clientWidth+"&clientHeight="+this.clientHeight+"&user_id="+vcomAPI.avatarId+"&user_name="+encodeURIComponent(vcomAPI.userName)+"&par=yes" }); }else{ var divObject = this.element; divObject.style.width=40+"px"; divObject.style.height=40+"px"; var divId = this.getDivId(); if($('DIVcontent'+divId) && $('IMG_ItemDiv_'+divId)){ $('IMG_ItemDiv_'+divId).style.width = "40px"; $('IMG_ItemDiv_'+divId).style.height = "40px"; $('MINcontent'+divId).style.display='';                 $('DIVcontent'+divId).style.display='none'; }else if(!$('IMG_ItemDiv_'+divId)){ new Ajax.Updater('MINcontent'+divId,"/room/setMinOnlySelf",{method:"get",parameters:"id="+this.element.id,onSuccess:function(){          $('MINcontent'+divId).style.display=''; $('DIVcontent'+divId).style.display='none'; }}); }  this.vcomItemMenu['vcomOnMenu0']=null; this.vcomItemMenu['vcomOnMenu4']=vcomStrings.mItemMenu42;          } }else{ var flowout_x = this.clientWidth + parseInt(this.element.style.left) - parseInt($('backgroundDiv').style.width); var flowout_y = this.clientHeight + parseInt(this.element.style.top) - parseInt($('backgroundDiv').style.height); if(flowout_x>0 && flowout_y>0){ flowout_x = parseInt(this.element.style.left) - flowout_x; flowout_y = parseInt(this.element.style.top) - flowout_y; this.vcomMoveTo(flowout_x,flowout_y); } if(flowout_x>0 && flowout_y<=0){ flowout_x = parseInt(this.element.style.left) - flowout_x; flowout_y = parseInt(this.element.style.top); this.vcomMoveTo(flowout_x,flowout_y); } if(flowout_x<=0 && flowout_y>0){ flowout_x = parseInt(this.element.style.left); flowout_y = parseInt(this.element.style.top) - flowout_y; this.vcomMoveTo(flowout_x,flowout_y); } if(this.vcomShowResize) this.vcomItemMenu['vcomOnMenu0']=vcomStrings.mItemMenu0; this.vcomIsMinimize=false; this.vcomItemMenu['vcomOnMenu4']=vcomStrings.mItemMenu41; this.beforeMiniRestore(); if(this.isRestoreSyn()){ new Ajax.Request('/room/setMinUpdate',{ method:'get', parameters:"id="+this.element.id+"&name="+encodeURIComponent(this.vcomItemName)+"&requestId="+vcomLIB.requestId+"&clientWidth="+this.clientWidth+"&clientHeight="+this.clientHeight+"&user_id="+vcomAPI.avatarId+"&user_name="+encodeURIComponent(vcomAPI.userName)+"&par=no" }); }else{ var divId = this.getDivId(); var divObject = this.element;  if($('DIVcontent'+divId)){ $('MINcontent'+divId).style.display='none'; $('DIVcontent'+divId).style.display=''; }           if($('IMG_ItemDiv_'+divId)){ $('IMG_ItemDiv_'+divId).style.width=parseInt(this.clientWidth)+"px"; $('IMG_ItemDiv_'+divId).style.height=parseInt(this.clientHeight)+"px"; divObject.style.width=parseInt(this.clientWidth)+"px"; divObject.style.height=parseInt(this.clientHeight)+"px"; } divObject.style.width=eval('vcomItem'+divId+'.clientWidth')+"px"; divObject.style.height=eval('vcomItem'+divId+'.clientHeight')+"px";   moveOverFlowBackRoom(divId);  if($('nameDiv_'+divId)) divObject.removeChild($('nameDiv_'+divId)); if(this.vcomShowResize){ this.vcomItemMenu['vcomOnMenu0']=vcomStrings.mItemMenu0; }     this.vcomItemMenu['vcomOnMenu4']=vcomStrings.mItemMenu41; }  } return false; }, isMinSyn:function(){return true;}, beforeMinimize:function(){}, beforeMinimizeSyn:function(){}, afterMinimizeSyn:function(){}, isRestoreSyn:function(){return true;}, beforeMiniRestore:function(){}, afterMiniRestore:function(){}, vcomOnMenu5: function () {   removeItemDiv(this.getId());  new Ajax.Request('http://'+document.domain+'/room/rem_item',{ method:'get', parameters:"rid="+vcomLIB.roomId+"&itemids="+this.getDBId()+"&requestId="+vcomLIB.requestId });  }, vcomOnMenu6: function () {   }, vcomOnMenu61: function () {  vcomAPI.bringToFront(this.element); }, vcomOnMenu62: function () {  vcomAPI.sendToBack(this.element); }, vcomOnMenu7: function () { showEditHtmlContentDiv(this.getDBId(),this.getId()); } });   var VcomAvatar = Class.create(); VcomAvatar.prototype = Object.extend(new VcomAvatarMenu(), { initialize: function () {} });  var VcomItem = Class.create(); VcomItem.prototype = Object.extend(new VcomItemMenu(), { initialize: function () {}, script: null, execScript: function () { }, isSizeVariable: false, isShowBubble: true, /* vcomSetInitialSize: function(width, height) { var w = this.element.width || this.element.style.width; var h = this.element.height || this.element.style.height; if ((w=="" && h=="") || (w=="0px" && h == "0px")) { this.element.style.width=width + "px"; this.element.style.height=height + "px"; } }, vcomSetSizeVariable: function() { this.isSizeVariable = true; }, */ vcomSetInitialSize: function() { this.isSizeVariable = true; },  vcomSetSize: function(width, height) { this.element.style.width=width + "px"; this.element.style.height=height + "px"; },     vcomGetSize: function(width, height) { return {x:this.element.width||this.element.style.width, y:this.element.height||this.element.style.height} },         vcomShowBubble: function(text, onlyBubble, toId, toName){ if (!this.isShowBubble) return; if (!toId){ toId = "0"; toName = " ALL"; }else if(!toName){ toName = " ALL"; if(toId.indexOf("ItemDIV_")==0){ toName = eval("vcomItem"+vcomAPI.getDivIdFromId(toId)+".vcomItemName"); }else if(toId.indexOf("AvatarDIV_")==0){ toName = eval("vcomAvatar"+vcomAPI.getDivIdFromId(toId)+".vcomUserName"); } } if(onlyBubble && onlyBubble=="yes"){ this.vcomShowBubbleOnly(text); this.vcomConcurrentCall("vcomShowBubbleOnly",text); }else{ new Ajax.Request('/room/showItemBubble',{ method:'get', parameters:"requestId="+vcomLIB.requestId +"&from_id="+this.getId()+"&from_name="+encodeURIComponent(this.vcomItemName)+"&to_id="+toId+"&to_name="+encodeURIComponent(toName)+"&text="+encodeURIComponent(text) }); vcomAPI.fireCallbacks(vcomAPI.EVENT_ITEM_CHAT, {id:this.getId(), name:this.vcomItemName, toId:toId, toName:toName, chatMessage:text,isOriginator:'yes'}); } }, vcomShowBubbleOnly: function(text){ if(!this.isSyn || this.isSyn==true){ addBubble("Item",this.getDivId(),text,""); setTimeout("displayBubble('"+this.getDivId()+"')",20000); } }, vcomShowHelpArray: function(arr){ for(var i=0;i < arr.length;i++){ if(i==0){ this.vcomShowBubble(arr[0]); }else{ var time = i*10000; setTimeout("vcomItem"+this.getDivId()+".vcomShowBubble('"+arr[i]+"')",time); } } }, vcomRemoveBubble: function(){ removeBubble(this.getDivId()); }, vcomRemoveFromRoom: function(){ this.vcomOnMenu5(); }, vcomMoveTo: function (x, y) { var originalX = parseInt($(this.element.id).style.left); var originalY = parseInt($(this.element.id).style.top); move_div(this.element.id,x,y); if(this.element.id.indexOf('ItemDiv_')==0){ move_synchronization('Item',this.element.id,this.vcomItemName,originalX,originalY,parseInt(x),parseInt(y),''); } }, vcomMoveToAvatar: function(avatarId) {  try {  if (vcomAPI.isUserInRoom ) {  var ay = parseInt($(vcomAPI.avatarId).style.top);  var ax = parseInt($(vcomAPI.avatarId).style.left);  var ah = parseInt($(vcomAPI.avatarId).style.height);  var aw = parseInt($(vcomAPI.avatarId).style.width);  var itemHeight = parseInt($(this.element.id).style.height);  var itemWidth = parseInt($(this.element.id).style.width);   var x = ax + aw;  var y = ay + ah - itemHeight;  if (x > 700 - itemHeight) {  x = ax - itemWidth;  }   ax = x;  ay = y;  this.vcomMoveTo(ax, ay);  vcomLIB.debugMessage ( "MoveTo:" + ax + "," + ay);  }      }catch(e) {  vcomLIB.errorMessage("moveToAvatar:e="+e.name+":"+e.message);  }  },     vcomResizeTo: function (width, height) { if(this.element.id.indexOf('ItemDiv_')==0||this.element.id.indexOf('AvatarDiv_')==0){ new Ajax.Request('/room/setResizeUpdate',{ method:'get', parameters:"requestId="+vcomLIB.requestId+"&id="+this.getId()+"&name="+encodeURIComponent(this.vcomItemName)+"&width="+parseInt(width)+"&height="+parseInt(height)+"&user_id="+vcomAPI.avatarId+"&user_name="+encodeURIComponent(vcomAPI.userName) }); }       }, vcomMinimize: function(){ if(this.vcomIsLock==false && vcomAPI.isUserInRoom==true && this.canOwnerControlOperate()){ if (this.vcomItemMenu['vcomOnMenu4']==vcomStrings.mItemMenu41){ this.vcomOnMenu4(); } } }, vcomRestore: function(){ if(this.vcomIsLock==false && vcomAPI.isUserInRoom==true && this.canOwnerControlOperate()){ if (this.vcomItemMenu['vcomOnMenu4']==vcomStrings.mItemMenu42){ this.vcomOnMenu4(); } } },   vcomIsLocked: function(){ return this.vcomIsLock; }, vcomLock: function(){        this.vcomIsLock=true; if(vcomAPI.isRoomOwner){  this.destroy(); this.vcomItemMenu['vcomOnMenu0']=null; this.vcomItemMenu['vcomOnMenu1']=null; this.vcomItemMenu['vcomOnMenu2']=vcomStrings.mItemMenu21; this.vcomItemMenu['vcomOnMenu3']=null; this.vcomItemMenu['vcomOnMenu4']=null; this.vcomItemMenu['vcomOnMenu5']=null; this.vcomItemMenu['vcomOnMenu7']=null; this.vcomItemMenu['vcomOnMenu8']=null;         }else{ if(this.vcomItemMenu['vcomOnMenu2']!=null){ this.vcomItemMenu['vcomOnMenu2']=vcomStrings.mItemMenu21; } this.destroy(); this.onStop();         }     }, vcomUnlock: function(){           this.vcomIsLock=false;  if(vcomAPI.isRoomOwner){ if(!this.vcomIsPin){ this.relive(); }              if(this.vcomIsMinimize==true){ this.vcomItemMenu['vcomOnMenu4']=vcomStrings.mItemMenu42; }else{ this.vcomItemMenu['vcomOnMenu4']=vcomStrings.mItemMenu41; } if(this.vcomIsMinimize==false && this.vcomShowResize){ this.vcomItemMenu['vcomOnMenu0']=vcomStrings.mItemMenu0; }else{ this.vcomItemMenu['vcomOnMenu0']=null; } if(vcomAPI.isRoomOwner){ this.vcomItemMenu['vcomOnMenu1']=vcomStrings.mItemMenu1; this.vcomItemMenu['vcomOnMenu5']=vcomStrings.mItemMenu5; this.vcomItemMenu['vcomOnMenu7']=vcomStrings.mItemMenu7; } this.vcomItemMenu['vcomOnMenu2']=vcomStrings.mItemMenu22; this.vcomItemMenu['vcomOnMenu3']=vcomStrings.mItemMenu3; if(this.vcomIsPin){ this.vcomItemMenu['vcomOnMenu8']=vcomStrings.mItemMenu81; }else{ this.vcomItemMenu['vcomOnMenu8']=vcomStrings.mItemMenu82; }  }else{           if(this.vcomItemMenu['vcomOnMenu2']!=null){ this.vcomItemMenu['vcomOnMenu2']=vcomStrings.mItemMenu22; }  if(vcomAPI.isUserInRoom){ if(!this.vcomIsPin){ this.relive();             } this.onReStart(); } } }, vcomOwnerControl: function(){ if (this.vcomShowOwnerControl){ this.vcomIsOwnerControl=true; this.vcomItemMenu['vcomOnMenuA']=vcomStrings.mItemMenuA1; if(!vcomAPI.isRoomOwner){ this.destroy(); this.vcomItemMenu['vcomOnMenu0']=null; this.vcomItemMenu['vcomOnMenu1']=null; this.vcomItemMenu['vcomOnMenu2']=null; this.vcomItemMenu['vcomOnMenu3']=null; this.vcomItemMenu['vcomOnMenu4']=null; this.vcomItemMenu['vcomOnMenu5']=null; this.vcomItemMenu['vcomOnMenu7']=null; this.vcomItemMenu['vcomOnMenu8']=null;         this.onStop(); } } }, vcomUnOwnerControl: function(){           if (this.vcomShowOwnerControl){ this.vcomIsOwnerControl=false; this.vcomItemMenu['vcomOnMenuA']=vcomStrings.mItemMenuA0; if(!vcomAPI.isRoomOwner){ if(!this.vcomIsPin){ this.relive(); }              if(this.vcomIsMinimize==true){ this.vcomItemMenu['vcomOnMenu4']=vcomStrings.mItemMenu42; }else{ this.vcomItemMenu['vcomOnMenu4']=vcomStrings.mItemMenu41; } if(this.vcomIsMinimize==false && this.vcomShowResize){ this.vcomItemMenu['vcomOnMenu0']=vcomStrings.mItemMenu0; }else{ this.vcomItemMenu['vcomOnMenu0']=null; } this.vcomItemMenu['vcomOnMenu2']=null; if(this.vcomIsPin){ this.vcomItemMenu['vcomOnMenu8']=vcomStrings.mItemMenu81; }else{ this.vcomItemMenu['vcomOnMenu8']=vcomStrings.mItemMenu82; } this.onReStart(); } } }, vcomPin: function(isOwnerPin,vcomPinnerId,vcomPinnerName){ if(this.vcomItemMenu['vcomOnMenu8']!=null){ this.vcomItemMenu['vcomOnMenu8']=vcomStrings.mItemMenu81; }   this.vcomIsPin = true; this.vcomPinnerId  = vcomPinnerId; this.vcomPinnerName = vcomPinnerName;  if(isOwnerPin == "yes" || isOwnerPin ==true || isOwnerPin =="true"){ this.vcomIsOwnerPin = true; }else{ this.vcomIsOwnerPin = false; } this.destroy(); if(this.vcomPinnerId != vcomAPI.avatarId && this.vcomIsOwnerPin){ this.vcomItemMenu['vcomOnMenu4']=null; }                  }, vcomUnpin: function(isOwnerPin,vcomPinnerId,vcomPinnerName){ if(this.vcomItemMenu['vcomOnMenu8']!=null){ this.vcomItemMenu['vcomOnMenu8']=vcomStrings.mItemMenu82; }    this.vcomIsPin = false;   this.vcomPinnerId  = vcomPinnerId; this.vcomPinnerName = vcomPinnerName; if(isOwnerPin == "no" || isOwnerPin ==false || isOwnerPin =="false"){ this.vcomIsOwnerPin = false; }else{ this.vcomIsOwnerPin = true; } this.relive();        if(this.vcomIsMinimize && this.vcomPinnerId != vcomAPI.avatarId && this.vcomIsOwnerPin){ this.vcomItemMenu['vcomOnMenu4']=vcomStrings.mItemMenu42; }else{ this.vcomItemMenu['vcomOnMenu4']=vcomStrings.mItemMenu41; }        }, vcomSetConfigXML: function (configXML) { if (typeof configXML == 'string') { if (configXML!="" && configXML!="nil" && configXML!="null") this.vcomConfigXML = vcomAPI.parseXML(configXML); } else { this.vcomConfigXML = configXML; } },     vcomGetConfigXML: function () { return this.vcomConfigXML },    vcomSetPersistentXML: function (persistentXML) { if (typeof persistentXML == 'string') { if (persistentXML!="" && persistentXML!="nil" && persistentXML!="null") this.vcomPersistentXML = vcomAPI.parseXML(persistentXML); } else { this.vcomPersistentXML = persistentXML; }      },     vcomGetPersistentXML: function () { return this.vcomPersistentXML; },     vcomSetCacheXML: function (cacheXML) { if (typeof cacheXML == 'string') { this.vcomCacheXML = vcomAPI.parseXML(cacheXML); } else { this.vcomCacheXML = cacheXML; }         },     vcomGetCacheXML: function (cacheXML) { return this.vcomCacheXML },            vcomConcurrentCall: function (functionName, params, mode, persistentXMLAppend, onCompleteCallback, onFailureCallback) { var configXML = null; var persistentXML = null; var cacheXML = null; if ((typeof mode == 'undefined') || mode == null) mode = 0; var postStr; if (params==null){ postStr = "requestId="+vcomLIB.requestId+"&oid="+this.element.id+"&functionName="+functionName+"&params="+params+"&mode="+mode; }else{ postStr = "requestId="+vcomLIB.requestId+"&oid="+this.element.id+"&functionName="+functionName+"&params="+params.replace(/\+/gi, "%2B")+"&mode="+mode; }  if (mode && (mode & vcomAPI.CONFIG_XML)) { postStr += "&configXML=" + vcomAPI.XMLToString(this.vcomConfigXML); }  if (mode && (mode & vcomAPI.PERSISTENT_XML)) { postStr += "&persistentXML=" + vcomAPI.XMLToString(this.vcomPersistentXML); }  if (mode && (mode & vcomAPI.ONLY_SAVE_PERSISTENT_XML)) { postStr += "&persistentXML=" + vcomAPI.XMLToString(this.vcomPersistentXML); }  if (mode && (mode & vcomAPI.PERSISTENT_XML_APPEND)) { postStr += "&persistentXMLAppend=" + persistentXMLAppend; }  if (mode && (mode & vcomAPI.PERSISTENT_XML_REMOVE_LAST)) { postStr += "&persistentXMLRemoveLast=" + persistentXMLAppend; }   if (mode && (mode & vcomAPI.CACHE_XML)) { postStr += "&cacheXML=" + vcomAPI.XMLToString(this.vcomCacheXML); }  if (mode && (mode & vcomAPI.LOCK_FIRST)) { mode = (mode & vcomAPI.NOTIFY_ALL); }  new Ajax.Request('/roomitem/setConcurrentCall',{ postBody:postStr, onComplete:(typeof onCompleteCallback!='undefined')?onCompleteCallback:null, onFailure:(typeof onFailureCallback!='undefined')?onFailureCallback:null }); },  vcomReleaseLock: function (lockName, onCompleteCallback, onFailureCallback) {  if ((typeof lockName == 'undefined') || lockName == null) lockName = "";  var postStr = "requestId="+vcomLIB.requestId+"&oid="+this.element.id+"&lockName="+lockName;         new Ajax.Request('/roomitem/releaseLock',{ postBody:postStr, onComplete:(typeof onCompleteCallback!='undefined')?onCompleteCallback:null, onFailure:(typeof onFailureCallback!='undefined')?onFailureCallback:null }); },      vcomSetDefaultConfigXML: function (configXML) {  var currentConfigXML = this.vcomGetConfigXML(); if (typeof currentConfigXML == 'undefined' || currentConfigXML == null) { this.vcomSetConfigXML(configXML); } if (typeof configXML == 'string') { this.vcomDefaultConfigXML = vcomAPI.parseXML(configXML); } else { this.vcomDefaultConfigXML = configXML; }   }, vcomRestoreDefaultConfigXML: function (onCompleteCallback, onFailureCallback) {   this.vcomSetConfigXML(this.vcomDefaultConfigXML);  this.vcomConcurrentCall(null, null, vcomAPI.CONFIG_XML|vcomAPI.NOTIFY_ALL|RELOAD);  }, vcomRegisterSingleClick: function () { this.eventSingleClick = this.vcomSingleClick.bindAsEventListener(this); Event.observe(this.handle, "mouseup", this.eventSingleClick); }, vcomUnregisterSingleClick: function () { Event.stopObserving(this.handle, "mouseup", this.eventSingleClick); }, vcomSingleClick: function (evt) { if(vcomAPI.isUserInRoom){ var go = false; var button = 0; if(isIE) { button = window.event.button; if(button==1) go=true; }else{  button = evt.button; if(button==0) go=true; } if(go==true && this.dragging==false){ this.singleClick(evt); } } }, singleClick: function (){}, vcomCommandCallback: function (event, data){  if (data['isOriginator'] == 'true' &&  (data['chatMessage'].indexOf("cmd:") == 0 ||data['chatMessage'].indexOf("vcom:") == 0)) { var commands = data['chatMessage'].split(/\s*:\s*/); if (commands[1] && commands[2] && commands[2] == this.vcomItemName) { switch (commands[1]) { case 'move': if (commands[3]) { var points = commands[3].split(/\s*,\s*/); this.vcomMoveTo(points[0], points[1]); } break; case 'resize': if (commands[3]) { var points = commands[3].split(/\s*,\s*/); this.vcomResizeTo(points[0], points[1]); }                     break; case 'minimize': this.vcomMinimize(); break; case 'restore': this.vcomRestore(); break; case 'lock': this.vcomLock(); break; case 'unlock': this.vcomUnlock(); break;                         default: vcomLIB.warnMessage("commandCallBack:unknown command="+commands[3]); break; }             } } }, vcomRegisterCommand: function () { this.vcomMyCommandCallback = this.vcomCommandCallback.bind(this); vcomAPI.registerEvent(vcomAPI.EVENT_AVATAR_CHAT|vcomAPI.EVENT_ITEM_CHAT, this.vcomMyCommandCallback);     }, vcomUnregisterCommand: function () { vcomAPI.unregisterEvent(vcomAPI.EVENT_AVATAR_CHAT|vcomAPI.EVENT_ITEM_CHAT, this.vcomMyCommandCallback); } });   /* DotNetRemoting JavaScript Serializer/Deserializer */  var isIE = navigator.userAgent.toLowerCase().indexOf("msie") > -1; var isMoz = document.implementation && document.implementation.createDocument;      function JSerialize(ObjectToSerilize, objectName, indentSpace) { indentSpace = indentSpace?indentSpace:'';  var Type = GetTypeName(ObjectToSerilize);  var s = indentSpace  + '<' + objectName +  ' type="' + Type + '">';  switch(Type) { case "number": case "string": case "boolean":		 { s += ObjectToSerilize;  }   break;        case "date":    { s += ObjectToSerilize.toLocaleString();     }    break;     case "array": { s += "\n";  for(var name in ObjectToSerilize) { s += JSerialize(ObjectToSerilize[name], ('index' + name ), indentSpace + "   "); };  s += indentSpace; } break;  		 default: { s += "\n";  for(var name in ObjectToSerilize) { s += JSerialize(ObjectToSerilize[name], name, indentSpace + "   "); };  s += indentSpace; } break;  }  s += "</" + objectName + ">\n";	  return s; };    function JDeserialize(XmlText) { var _doc = GetDom(XmlText);  return Deserial(_doc.childNodes[0]); }   function GetDom(strXml) { var _doc = null;  if (isIE) { _doc = new ActiveXObject("Msxml2.DOMDocument.3.0"); _doc.loadXML(strXml);  } else { var parser = new DOMParser(); _doc = parser.parseFromString(strXml, "text/xml"); }  return _doc; }   function Deserial(xn) { var RetObj;    var NodeType = "object";  if (xn.attributes != null && xn.attributes.length != 0) { var tmp = xn.attributes.getNamedItem("type"); if (tmp != null) { NodeType = xn.attributes.getNamedItem("type").nodeValue; } }  if (IsSimpleVar(NodeType)) { if (isIE) { return StringToObject(xn.text, NodeType); } else { return StringToObject(xn.textContent, NodeType); } }  switch(NodeType) { case "array": { RetObj = [];			 for(var i = 0; i < xn.childNodes.length; i++) { var Node = xn.childNodes[i]; RetObj[i] = Deserial(Node); }  return RetObj; }  case "object": default: { try { RetObj = eval("new "+ NodeType + "()"); } catch(e) {  RetObj = new Object(); } } break; }  for(var i = 0; i < xn.childNodes.length; i++) { var Node = xn.childNodes[i]; RetObj[Node.nodeName] = Deserial(Node); }  return RetObj; }  function IsSimpleVar(type) { switch(type) { case "int": case "string": case "String": case "Number": case "number": case "Boolean": case "boolean": case "bool": case "dateTime": case "Date": case "date": case "float": return true; }  return false; }  function StringToObject(Text, Type) { var RetObj = null;  switch(Type) { case "int": return parseInt(Text);      case "number": { var outNum;  if (Text.indexOf(".") > 0) { return parseFloat(Text);     } else { return parseInt(Text);     } }	  	  case "string": case "String": return Text;   case "dateTime": case "date": case "Date": return new Date(Text);  		 case "float": return parseFloat(Text, 10);  case "bool": { if (Text == "true" || Text == "True") { return true; } else { return false; } } return parseBool(Text);	 }  return RetObj;   }  function GetClassName(obj)  {	  try { var ClassName = obj.constructor.toString(); ClassName = ClassName.substring(ClassName.indexOf("function") + 8, ClassName.indexOf('(')).replace(/ /g,''); return ClassName; } catch(e)  { return "NULL"; } }  function GetTypeName(ObjectToSerilize) { if (ObjectToSerilize instanceof Array) return "array";  if (ObjectToSerilize instanceof Date) return "date";	  var Type  = typeof(ObjectToSerilize);  if (IsSimpleVar(Type)) { return Type; }  Type = GetClassName(ObjectToSerilize);   return Type; }  function getSimpleXmlValue(xmlNode) { return isIE ? xmlNode.text : xmlNode.textContent; }   Array.prototype.baoremove = function(dx) { if(isNaN(dx)||dx>this.length){return false;} this.splice(dx,1); }          