if(typeof deconcept=="undefined"){var deconcept=new Object()}if(typeof deconcept.util=="undefined"){deconcept.util=new Object()}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object()}deconcept.SWFObject=function(o,b,p,f,l,m,j,g,d,n){if(!document.getElementById){return}this.DETECT_KEY=n?n:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(o){this.setAttribute("swf",o)}if(b){this.setAttribute("id",b)}if(p){this.setAttribute("width",p)}if(f){this.setAttribute("height",f)}if(l){this.setAttribute("version",new deconcept.PlayerVersion(l.toString().split(".")))}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true}if(m){this.addParam("bgcolor",m)}var a=j?j:"high";this.addParam("quality",a);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var k=(g)?g:window.location;this.setAttribute("xiRedirectUrl",k);this.setAttribute("redirectUrl","");if(d){this.setAttribute("redirectUrl",d)}};deconcept.SWFObject.prototype={useExpressInstall:function(a){this.xiSWFPath=!a?"expressinstall.swf":a;this.setAttribute("useExpressInstall",true)},setAttribute:function(a,b){this.attributes[a]=b},getAttribute:function(a){return this.attributes[a]},addParam:function(b,a){this.params[b]=a},getParams:function(){return this.params},addVariable:function(b,a){this.variables[b]=a},getVariable:function(a){return this.variables[a]},getVariables:function(){return this.variables},getVariablePairs:function(){var c=new Array();var b;var a=this.getVariables();for(b in a){c[c.length]=b+"="+a[b]}return c},getSWFHTML:function(){var b="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath)}b='<embed type="application/x-shockwave-flash" src="'+this.getAttribute("swf")+'" width="'+this.getAttribute("width")+'" height="'+this.getAttribute("height")+'" style="'+this.getAttribute("style")+'"';b+=' id="'+this.getAttribute("id")+'" name="'+this.getAttribute("id")+'" ';var g=this.getParams();for(var f in g){b+=[f]+'="'+g[f]+'" '}var d=this.getVariablePairs().join("&");if(d.length>0){b+='flashvars="'+d+'"'}b+="/>"}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath)}b='<object id="'+this.getAttribute("id")+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+this.getAttribute("width")+'" height="'+this.getAttribute("height")+'" style="'+this.getAttribute("style")+'">';b+='<param name="movie" value="'+this.getAttribute("swf")+'" />';var c=this.getParams();for(var f in c){b+='<param name="'+f+'" value="'+c[f]+'" />'}var a=this.getVariablePairs().join("&");if(a.length>0){b+='<param name="flashvars" value="'+a+'" />'}b+="</object>"}return b},write:function(b){if(this.getAttribute("useExpressInstall")){var a=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(a)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title)}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var c=(typeof b=="string")?document.getElementById(b):b;c.innerHTML=this.getSWFHTML();return true}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"))}}return false}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var f=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var a=navigator.plugins["Shockwave Flash"];if(a&&a.description){f=new deconcept.PlayerVersion(a.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."))}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var b=1;var c=3;while(b){try{c++;b=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+c);f=new deconcept.PlayerVersion([c,0,0])}catch(d){b=null}}}else{try{var b=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7")}catch(d){try{var b=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");f=new deconcept.PlayerVersion([6,0,21]);b.AllowScriptAccess="always"}catch(d){if(f.major==6){return f}}try{b=new ActiveXObject("ShockwaveFlash.ShockwaveFlash")}catch(d){}}if(b!=null){f=new deconcept.PlayerVersion(b.GetVariable("$version").split(" ")[1].split(","))}}}return f};deconcept.PlayerVersion=function(a){this.major=a[0]!=null?parseInt(a[0]):0;this.minor=a[1]!=null?parseInt(a[1]):0;this.rev=a[2]!=null?parseInt(a[2]):0};deconcept.PlayerVersion.prototype.versionIsValid=function(a){if(this.major<a.major){return false}if(this.major>a.major){return true}if(this.minor<a.minor){return false}if(this.minor>a.minor){return true}if(this.rev<a.rev){return false}return true};deconcept.util={getRequestParameter:function(c){var d=document.location.search||document.location.hash;if(c==null){return d}if(d){var b=d.substring(1).split("&");for(var a=0;a<b.length;a++){if(b[a].substring(0,b[a].indexOf("="))==c){return b[a].substring((b[a].indexOf("=")+1))}}}return""}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var b=document.getElementsByTagName("OBJECT");for(var c=b.length-1;c>=0;c--){b[c].style.display="none";for(var a in b[c]){if(typeof b[c][a]=="function"){b[c][a]=function(){}}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs)};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true}}if(!document.getElementById&&document.all){document.getElementById=function(a){return document.all[a]}}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;var GLOBAL_DEBUGGING=false;var REQUEST_DESTINATION_URL="http://dynamic-lb.mobwarsapp.com/mob";var RESOURCE_DESTINATION_URL="http://cdn0.mobwarsapp.com/prod_mob/mobsters";var FLASH_DESTINATION_URL="http://cdn0.mobwarsapp.com/rpg_swfs/opensocial/mobsters";var USE_QA_SERVER=false;var SWF_LOCATION="production";var SWF_CDN_URL="http://cdn0.mobwarsapp.com/mob";var GBL={};GBL.APP_CANVAS_URL="http://profile.myspace.com/Modules/Applications/Pages/Canvas.aspx?appId=104283&";GBL.APP_ERROR_MSG="Out takin' care of some business.  Mobsters will be back soon... <br/> In the meantime, try your hand at <a target='_blank' href='http://profile.myspace.com/Modules/Applications/Pages/Canvas.aspx?appId=109588&appParams={\"rsrc\":\"maintenance/mobsters\"}'> Poker Palace </a> The best poker game on MySpace! Fun & Easy!";GBL.APP_NOT_INSTALLED=0;GBL.APP_INSTALLED=1;GBL.APP_JUST_INSTALLED=2;GBL.app_install_state=GBL.APP_INSTALLED;GBL.TOMS_ID=6221;GBL.PLAYDOM_ID=452430221;GBL.CCBill={subaccount:"0002",points:"favor points",right:100};GBL.HIDE_OFFER_TITLES=true;GBL.POST_AS_STRING=false;GBL.MAIN_DATA=undefined;GBL.STATUS_DIV=undefined;GBL.MAIN_TABS=undefined;GBL.SUB_TABS=new Array();GBL.REFRESH_STATUS=undefined;GBL.REQUIRED_ITEMS=undefined;GBL.SHOW_USER_ID="show_user_id";GBL.SHOW_BROADCAST="show_broadcast";GBL.APP_LOAD_TIME=(new Date()).getTime();GBL.PP_URL="http://www.pokerpalaceapp.com";GBL.LIVE_NEWSFEED=true;GBL.HOT_TIP_FRIENDS_LOADED=false;GBL.APP_ID="mob";GBL.TRACK_TAG="mob";GBL.STYLES={text:{color:"#FFFFFF",money:{color:"#00FF00"},favorPoint:{color:"#FF7F00"}}};GBL.TRANSFORMATION={question_mark:function(b,a){a.innerHTML="<img src='http://cdn0.mobwarsapp.com/rpg_images/opensocial/mob/ui/loot_r.gif' style='vertical-align:top;'/>"},mastery_level_icon:function(c,a){var b=a.innerHTML;if(isValid(JobMastery.IMAGE_MAP[b])){a.innerHTML='<img style="vertical-align:middle;" src="'+JobMastery.IMAGE_MAP[b]+'" />'}},favor_point_link:function(b,a){$(a).addClass("standardLink");$(a).click(function(){switchTabsByName("Godfather");return false})},skill_point_link:function(b,a){$(a).addClass("standardLink");$(a).click(function(){switchTabsByName("My Mobster");return false})},CCBill_container:function(b,a){if(GBL.MAIN_DATA.getShowDirectPay()){$(a).addClass("CCBillContainer");CCBillDiv(a);$(a).find(".CCBillCardImage").after("<br/>");$(a).find(".CCBillInstantCreditSpan").html("Instant credit!&nbsp;&nbsp;")}},attackReportInappropriateStatus:function(c,a){var b=$(a).attr("data-defenderId");if(isValid(b)){$(a).text("Report Inappropriate Message");addReportInappropriateTaunt(a,b)}}};GBL.USE_SECURITY_SIGN_IN=true;GBL.STATUS_MESSAGE_LIMIT=30;GBL.IPHONE_MARKETING=false;var ABTEST_DESTINATION_URL="http://fremont02.youplusplus.com";function abTest(b,a){makeXMLNotCachedRequest(ABTEST_DESTINATION_URL+"/abtest?userId="+b+"&app=mob&abTestName="+a)}function getOffsiteMsg(b,c){var a="http://www.mobstersapp.com?user_id="+b+"&thumbnail="+escape(c)+"&timestamp="+(new Date()).getTime();return"Sorry, Mobsters on MySpace appears to be non-responsive, <br> <a color='#000000' href='"+a+"' target='_blank'> <span style='text-decoration:underline;'>Click Here</span> to manage your mob at the NEW Mobsters site! </a>"}var UPLOAD_DESTINATION_URL="http://cdn-sisters-avatar{0}.playdom.com/";if(!!(window.attachEvent&&!window.opera)){try{__revertCreateTextNode()}catch(err){}}String.prototype.supplant=function(a){return this.replace(/{([^{}]*)}/g,function(d,c){var f=a[c];return typeof f==="string"||typeof f==="number"?f:d})};String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")};String.prototype.ltrim=function(){return this.replace(/^\s+/,"")};String.prototype.rtrim=function(){return this.replace(/\s+$/,"")};String.prototype.unescapeHtml=function(){return unescape(this).replace(/&apos;/g,"'")};var XML_REQUEST_QUEUE=new XMLRequestQueue();XMLRequestQueue.DO_POST=1;XMLRequestQueue.DO_GET=2;XMLRequestQueue.MAX_RETRIES=1;XMLRequestQueue.MAX_TIMEOUT=20000;XMLRequestQueue.PREEMPT_REQUESTS=false;XMLRequestQueue.CONTENT_TYPE=gadgets.io.ContentType.DOM;XMLRequestQueue.AUTH_KEY=undefined;XMLRequestQueue.USE_FLASH_PROXY=false;XMLRequestQueue.FLASH_PROXY_FAIL_TIMEOUT=5000;function makeXMLNotCachedRequest(d,f,c,j,h){if(isValid(c)){try{var b=0;if(isValid(c.user_id)){b+=parseInt(c.user_id)%123431}if(isValid(c.target_id)){b+=parseInt(c.target_id)%123431}c.session_id=hex_sha1(""+b)}catch(g){c.session_id="none"}}else{c={};c.session_id="none"}if(isOffSite()){c.auth_key=SESSION_KEY}if(isValid(XMLRequestQueue.AUTH_KEY)){c.auth_key=XMLRequestQueue.AUTH_KEY}var a=j;if(!isValid(a)){a=XMLRequestQueue.MAX_RETRIES}if(h==undefined||h==null){h=gadgets.io.ContentType.DOM}XML_REQUEST_QUEUE.addRequest(XMLRequestQueue.DO_GET,d,f,c,a,0,h)}function makeXMLSessionlessCachedRequest(c,d,b,f,j,h){var a=j;if(!isValid(a)){a=XMLRequestQueue.MAX_RETRIES}var g=f;if(!isValid(g)){g=0}if(h==undefined||h==null){h=gadgets.io.ContentType.DOM}if(!isValid(b)){b={}}if(isOffSite()){b.auth_key=SESSION_KEY}else{if(isValid(XMLRequestQueue.AUTH_KEY)){b.auth_key=XMLRequestQueue.AUTH_KEY}}XML_REQUEST_QUEUE.addRequest(XMLRequestQueue.DO_GET,c,d,b,a,f,h)}function XMLRequestQueue(){var k=0;var o=new Array();var y=new Array();var f=new Array();var v=new Array();var E=new Array();var z=new Array();var H=new Array();var w=new Array();var q=new Array();var m=undefined;var t=undefined;var r=undefined;var h=undefined;var n=undefined;var s=undefined;var p=0;var C=-1;var u=-1;var b=undefined;var D=undefined;var j=true;this.addRequest=l;this.timeoutRequest=A;function l(N,K,L,J,P,M,O){if(!isValid(J)){J={}}if(XMLRequestQueue.PREEMPT_REQUESTS&&j&&isValid(n)){outputDebug("Request to "+t+" has been pre-empted by "+K);o.push(m);y.push(t);f.push(r);v.push(h);z.push(s);E.push(p);H.push(C);w.push(u);q.push(O);I()}k+=1;o.push(N);y.push(K);f.push(L);v.push(J);z.push(P);E.push(0);H.push(M);w.push(k);q.push(O);F()}function B(J){return GBL.FLASH_PROXY_ENABLED&&XMLRequestQueue.USE_FLASH_PROXY&&isValid(XMLRequestQueue.AUTH_KEY)&&isValid(J.auth_key)}function F(){if(y.length==0){return}if(n!=undefined){return}m=o.pop();t=y.pop();r=f.pop();h=v.pop();n=(new Date()).getTime();s=z.pop();p=E.pop();C=H.pop();u=w.pop();b=q.pop();D=false;if(p>s){var J=r;I();if(isValidFunction(J)){outputDebug("calling callback with undefined ");J(undefined)}F()}else{x()}}function G(){p+=1;outputDebug("retrying with id="+u+" url="+t+" num_retries="+p+" retries");o.unshift(m);y.unshift(t);f.unshift(r);v.unshift(h);z.unshift(s);E.unshift(p);H.unshift(C);w.unshift(u);q.unshift(b);I();F()}function A(J){if(u!=J){outputDebug("Timeout request is already over for request with id: "+J);return}if(isValid(D)&&D){XMLRequestQueue.USE_FLASH_PROXY=false}outputDebug("Timeout for request with id: "+u);G()}function x(){if(B(h)){outputDebug("setting timeout for flash request ");window.setTimeout("XML_REQUEST_QUEUE.timeoutRequest(parseInt("+u+"));",XMLRequestQueue.FLASH_PROXY_FAIL_TIMEOUT)}else{window.setTimeout("XML_REQUEST_QUEUE.timeoutRequest(parseInt("+u+"));",XMLRequestQueue.MAX_TIMEOUT)}if(m==XMLRequestQueue.DO_GET){d(u)}else{if(m==XMLRequestQueue.DO_POST){g(u)}else{outputDebug("UNRECOGNIZED REQUEST TYPE!!! "+m);I();F()}}}function d(K){var R="?";if(t.indexOf("?")>-1){R="&"}var P=t;if(isValid(h)){var Q="";for(var N in h){if(typeof(h[N])=="number"||typeof(h[N])=="string"||typeof(h[N])=="boolean"){Q+=N+"="+h[N]+"&"}}if(Q.length>0&&Q.lastIndexOf("&")==Q.length-1){Q=Q.substr(0,Q.length-1)}P+=R+Q}R="?";if(P.indexOf("?")>-1){R="&"}if(C<=0){var J=new Date().getTime();P=[P,R,"nocache=",J].join("")}else{var O=a(C);P=[P,R,"cache=",O].join("")}var L={};L.METHOD="GET";L.CONTENT_TYPE=b;L[gadgets.io.RequestParameters.AUTHORIZATION]=gadgets.io.AuthorizationType.SIGNED;outputDebug("GET request with id "+K+" sent to "+P+" expecting content type: "+b);outputDebug("GBL.FLASH_PROXY_ENABLED "+GBL.FLASH_PROXY_ENABLED);outputDebug("XMLRequestQueue.USE_FLASH_PROXY "+XMLRequestQueue.USE_FLASH_PROXY);outputDebug("isValid(XMLRequestQueue.AUTH_KEY) "+isValid(XMLRequestQueue.AUTH_KEY));outputDebug("isValid(m_cur_param[auth_key] "+isValid(h.auth_key));if(B(h)){D=true;var M=function(S){if(isValid(S)){try{S.text=decodeURI(S.data)}catch(T){alert(T)}try{S.data=parseXML(S.text)}catch(T){alert(T)}}c(S,K)};RequestProxyJS.makeRequest(P,M,L)}else{D=false;M=function(S){c(S,K)};gadgets.io.makeRequest(P,M,L)}}function g(P){var O=function(Q){c(Q,P)};if(isValid(GBL.POST_AS_STRING)&&GBL.POST_AS_STRING){var J="";for(var N in h){if(typeof(h[N])=="number"||typeof(h[N])=="string"||typeof(h[N])=="boolean"){J+=N+"="+h[N]+"&"}}if(C<=0){var L=new Date().getTime();J+="nocache="+L}else{var M=a(C);J+="cache="+M}var K={};K[gadgets.io.RequestParameters.POST_DATA]=J;K[gadgets.io.RequestParameters.METHOD]=gadgets.io.MethodType.POST;K[gadgets.io.RequestParameters.CONTENT_TYPE]=b;K[gadgets.io.RequestParameters.AUTHORIZATION]=gadgets.io.AuthorizationType.SIGNED;outputDebug("POST string request with id "+P+" sent to "+t+" with param "+J+" expecting content type: "+b);gadgets.io.makeRequest(t,O,K)}else{if(C<=0){h.nocache=new Date().getTime()}else{h.cache=a(C)}K={};K[gadgets.io.RequestParameters.POST_DATA]=h;K[gadgets.io.RequestParameters.METHOD]=gadgets.io.MethodType.POST;K[gadgets.io.RequestParameters.CONTENT_TYPE]=b;K[gadgets.io.RequestParameters.AUTHORIZATION]=gadgets.io.AuthorizationType.SIGNED;outputDebug("POST object request with id "+P+" sent to "+t+" with param "+h+" expecting content type: "+b);gadgets.io.makeRequest(t,O,K)}}function c(N,O){if(u!=O){outputDebug(" OUT of order request came back with id: "+O);return}j=false;if(m==XMLRequestQueue.DO_GET){outputDebug(" GET request with id "+O+" cameback for "+t+" after "+p+" num retries in "+((new Date()).getTime()-n)+" >>> "+N)}else{outputDebug(" POST request with id "+O+" cameback for "+t+" after "+p+" num retries in "+((new Date()).getTime()-n)+" >>> "+N)}var J=true;try{J=isValid(N.data)||isValid(N.text)}catch(L){J=false}if(!J){outputDebug(" response is not valid");G()}else{try{var K=getGadgetResponseData(N);if(isValid(getXMLNodeValue(K,"auth_key"))){XMLRequestQueue.AUTH_KEY=getXMLNodeValue(K,"auth_key")}}catch(L){}var M=r;I();if(isValidFunction(M)){M(N)}F()}j=true}function I(){m=undefined;t=undefined;r=undefined;h=undefined;n=undefined;s=XML_REQUEST_QUEUE.MAX_RETRIES;p=0;u=-1;b=undefined}function a(K){var J=new Date().getTime();return Math.floor(J/1000/K)}}function getGadgetResponseXML(b){var a=getGadgetResponseData(b);return getXMLFirstNode(a,"xml")}function getGadgetResponseData(b){try{if(b.data==null||b.data==undefined){outputDebug("Unfortunately, there was an unknown error. Please check back later: "+b.errors);return undefined}}catch(a){return undefined}return b.data}function getGadgetResponseText(a){if(a.text==null||a.text==undefined){outputDebug("Unfortunately, there was no text. Please check back later: "+a.errors);return undefined}return a.text}function parseXML(a){if(typeof DOMParser!="undefined"){return(new DOMParser()).parseFromString(a,"application/xml")}else{if(typeof ActiveXObject!="undefined"){var d=new ActiveXObject("Microsoft.XMLDOM");d.async="false";d.loadXML(a);return d}else{var b="data:text/xml;charset=utf-8,"+encodeURIComponent(a);var c=new XMLHttpRequest();c.open("GET",b,false);c.send(null);return c.responseXML}}}function getXMLFirstChild(c,a){if(!isValid(c)||!isValid(a)||!c.hasChildNodes()){return undefined}var b=undefined;jQuery.each(c.childNodes,function(f,d){if(d.tagName==a){b=d;return false}});return b}function getXMLChildNodes(b,a){if(!isValid(b)||!isValid(a)||!b.hasChildNodes()){return undefined}return jQuery.grep(b.childNodes,function(c,d){return(c.tagName==a)})}function getXMLTextValue(a){if(isValid(a)&&isValid(a.firstChild)&&isValid(a.firstChild.nodeValue)){return a.firstChild.nodeValue}else{return undefined}}function getXMLFirstChildValue(b,a){return getXMLTextValue(getXMLFirstChild(b,a))}function getXMLFirstNode(c,d){var b=undefined;try{b=c.getElementsByTagName(d)}catch(a){}if(isValid(b)&&b.length>0&&isValid(b[0])){return b[0]}else{return undefined}}function getXMLNodeValue(c,d){var b=undefined;try{b=c.getElementsByTagName(d)}catch(a){}if(isValid(b)&&b.length>0&&isValid(b[0].firstChild)&&isValid(b[0].firstChild.nodeValue)){return b[0].firstChild.nodeValue}else{return undefined}}function getXMLList(d,g,a){var c=undefined;try{c=d.getElementsByTagName(g)}catch(b){}var f=[];if(isValid(c)&&c.length>0){jQuery.each(c,function(h,k){var j=a(k);f.push(j)})}return f}function parseBoolean(a){if(typeof a=="boolean"){return a}return(typeof a=="string"&&a.toLowerCase()=="true")}function getXMLEncodedStringNodeValue(b,c){var a=getXMLNodeValue(b,c);if(a==undefined){return undefined}return decodeEncodedStringValue(a)}function getXMLIntValue(a,b){return parseInt(getXMLNodeValue(a,b))}function getXMLBooleanValue(a,b){return parseBoolean(getXMLNodeValue(a,b))}function customEncoding(a){return"cstm_"+encodeURIComponent(a).replace(/%/g,"@")}function customDecoding(c){if(c==undefined){return undefined}else{var b=c;if(b.indexOf("cstm_")==0){b=b.substr(5)}if(!isValid(b)||b==""){return""}b=b.replace(/@/g,"%");try{var a=decodeURIComponent(b)}catch(d){a=b}return a}}function decodeEncodedStringValue(b){if(!isValid(b)){return undefined}try{var a=decodeURIComponent(b)}catch(c){a=b}return a}function addEvent(d,c,a){if(d.addEventListener){d.addEventListener(c,a,false);return true}else{if(d.attachEvent){var b=d.attachEvent("on"+c,a);return b}else{return false}}}function addEventWithParameter(f,d,b,a){if(f.addEventListener){f.addEventListener(d,function(){b(a);return false},false);return true}else{if(f.attachEvent){var c=f.attachEvent("on"+d,function(){b(a);return false});return c}else{return false}}}function showMessage(b){var a=document.getElementById("messageBox");if(a==undefined||a==null){outputDebug("can't find messageBox");return}a.innerHTML=b;a.style.display="block"}function hideMessage(){var a=document.getElementById("messageBox");if(a==undefined||a==null){outputDebug("can't find messageBox");return}a.innerHTML="";a.style.display="none"}function isListValid(){var a=true;jQuery.each(arguments,function(b,c){if(!isValid(c)){a=false;return false}});return a}function isValid(a){return(a!=undefined&&a!=null)}function isValidFunction(a){return isValid(a)&&(typeof(a)=="function")}function checkValid(b,a){return isValid(b)?b:a}function plural(c,b,a){return c+" "+(Math.abs(c)>1?a:b)}function encodeText(a){var d="";for(var c=0;c<a.length;c++){var b=a.charCodeAt(c);if((c!=0)&&((64<=b&&b<64+26)||(97<=b&&b<97+26))){d+=a.charAt(c)}else{d+="&";d+="#";d+=b;d+=";"}}return encodeURIComponent(d)}function getBooleanValue(a){if(!isValid(a)){return false}var b=""+a;b.toLowerCase();if(b=="true"){return true}else{if(b=="false"){return false}else{return Boolean(a)}}}function validateAmount(b){if(!isValid(b)||b.length==0){return false}var a=undefined;try{a=parseInt(b)}catch(c){a=undefined}return isValid(a)}function extendClass(c,b){function a(){}a.prototype=b.prototype;c.prototype=new a();c.prototype.constructor=c;c.baseConstructor=b;c.superClass=b.prototype}function isOnContainer(){try{return(isValid(CONTAINER_DEBUGGING)&&CONTAINER_DEBUGGING)}catch(a){return false}}function isDebugging(){try{return(isValid(GLOBAL_DEBUGGING)&&GLOBAL_DEBUGGING)}catch(a){return false}}function outputDebug(b){try{if(isDebugging()){var d=document.getElementById("debugOutput");if(isValid(d)&&isValid(d.style)&&d.style.display!="none"){var a=document.createElement("div");a.innerHTML=b;document.getElementById("debugOutput").appendChild(a)}}}catch(c){}}function consoleLog(a){try{if(isDebugging()){if(typeof console=="undefined"){console={log:function(){}}}console.log(a)}}catch(b){}}function outputAlert(a){try{if(isDebugging()){alert(a)}}catch(b){}}function getOpenSocialParameter(a){try{var c=gadgets.views.getParams();if(isValid(c[a])){return c[a]}else{return undefined}}catch(b){outputDebug("getOSParam Error: "+b);return undefined}}function shortenedStringKeepEscapedCharacters(a,g){if(!isValid(a)){return a}if(a.length<=g){return a}var f=a.substring(0,g);var d=a.substring(g-1,a.length-1);var c=f.lastIndexOf("&");var b=d.indexOf(";");if(c!==-1&&b!==-1&&g-c-1+b<9){return f+d.substring(0,b+1)+".."}else{return f+".."}}function getRandomElement(a){if(!isValid(a)||a.length==0){return undefined}var b=Math.floor(Math.random()*(a.length-1));return a[b]}function getRandomNumbers(a,c){var g=new Array();if(a<c){for(var d=0;d<=a;d++){g.push(d)}return g}g=new Array();var b={};for(d=0;d<c;d++){var f=Math.round(Math.random()*a)%a;while(isValid(b[f])){f=(f+1)%a}b[f]=1;g.push(f)}return g}function getRandomItems(d,b){var a=getRandomNumbers(d.length,b);var f=new Array();for(var c=0;c<a.length;++c){f.push(d[a[c]])}return f}function getPPURLParams(){return"user_id="+GBL.MAIN_DATA.getViewer().getUserId()+"&session_key="+GBL.MAIN_DATA.getPPSessionKey()}function isOffSite(){try{return isValid(OFFSITE)&&OFFSITE}catch(a){return false}}function isIE6(){return $.browser.msie&&parseInt($.browser.version)==6}var g_hexcase=0;var g_chrsz=8;var g_b64pad="";function hex_sha1(a){return binb2hex(core_sha1(str2binb(a),a.length*g_chrsz))}function b64_sha1(a){return binb2b64(core_sha1(str2binb(a),a.length*g_chrsz))}function core_sha1(v,o){v[o>>5]|=128<<(24-o%32);v[((o+64>>9)<<4)+15]=o;var y=Array(80);var u=1732584193;var s=-271733879;var r=-1732584194;var q=271733878;var p=-1009589776;for(var l=0;l<v.length;l+=16){var n=u;var m=s;var k=r;var h=q;var f=p;for(var g=0;g<80;g++){if(g<16){y[g]=v[l+g]}else{y[g]=rol(y[g-3]^y[g-8]^y[g-14]^y[g-16],1)}var z=safe_add(safe_add(rol(u,5),sha1_ft(g,s,r,q)),safe_add(safe_add(p,y[g]),sha1_kt(g)));p=q;q=r;r=rol(s,30);s=u;u=z}u=safe_add(u,n);s=safe_add(s,m);r=safe_add(r,k);q=safe_add(q,h);p=safe_add(p,f)}return Array(u,s,r,q,p)}function sha1_ft(f,a,h,g){if(f<20){return(a&h)|((~a)&g)}if(f<40){return a^h^g}if(f<60){return(a&h)|(a&g)|(h&g)}return a^h^g}function sha1_kt(a){return(a<20)?1518500249:(a<40)?1859775393:(a<60)?-1894007588:-899497514}function safe_add(a,d){var c=(a&65535)+(d&65535);var b=(a>>16)+(d>>16)+(c>>16);return(b<<16)|(c&65535)}function rol(a,b){return(a<<b)|(a>>>(32-b))}function str2binb(d){var c=Array();var a=(1<<g_chrsz)-1;for(var b=0;b<d.length*g_chrsz;b+=g_chrsz){c[b>>5]|=(d.charCodeAt(b/g_chrsz)&a)<<(32-g_chrsz-b%32)}return c}function binb2hex(c){var b=g_hexcase?"0123456789ABCDEF":"0123456789abcdef";var d="";for(var a=0;a<c.length*4;a++){d+=b.charAt((c[a>>2]>>((3-a%4)*8+4))&15)+b.charAt((c[a>>2]>>((3-a%4)*8))&15)}return d}function binb2b64(d){var c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";var g="";for(var b=0;b<d.length*4;b+=3){var f=(((d[b>>2]>>8*(3-b%4))&255)<<16)|(((d[b+1>>2]>>8*(3-(b+1)%4))&255)<<8)|((d[b+2>>2]>>8*(3-(b+2)%4))&255);for(var a=0;a<4;a++){if(b*8+a*6>d.length*32){g+=g_b64pad}else{g+=c.charAt((f>>6*(3-a))&63)}}}return g}function getCSSRule(d,g){d=d.toLowerCase();if(document.styleSheets){var f=document.styleSheets[document.styleSheets.length-1];var c=0;var b=false;var a=0;if(f.cssRules){a=f.cssRules.length}else{a=f.rules.length}for(c=0;c<a;++c){if(f.cssRules){b=f.cssRules[c]}else{b=f.rules[c]}if(b){if(b.selectorText.toLowerCase()==d){if(g=="delete"){if(f.cssRules){f.deleteRule(c)}else{f.removeRule(c)}return true}else{return b}}}}}return false}function killCSSRule(a){return getCSSRule(a,"delete")}Function.prototype.bind=function(d){var b=this;var c=[];for(var a=1;a<arguments.length;++a){c.push(arguments[a])}return function(){var f=c.slice(0);for(var g=0;g<arguments.length;++g){f.push(arguments[g])}return b.apply(d,f)}};var IE=document.all?true:false;var CSSFLOAT=IE?"styleFloat":"cssFloat";function addCSSRule(g,k){var b=g.split(",");for(var f=0;f<b.length;f++){var a=b[f].trim();if(document.styleSheets){if(!getCSSRule(a)){var d=document.styleSheets[document.styleSheets.length-1];if(jQuery.browser.msie){d.addRule(a,null,0)}else{d.insertRule(a+" { }",0)}}}var h=getCSSRule(a);if(k){for(var c in k){if(c=="float"){h.style[CSSFLOAT]=k[c]}else{h.style[c]=k[c]}}}}return h}var convertCSSToJavascript=function(g){var d=document.createElement("STYLE");d.innerHTML=g;var h=document.getElementsByTagName("HEAD")[0];if(!h){throw new Error("Requires a HEAD element.")}h.appendChild(d);var j=document.styleSheets[document.styleSheets.length-1].cssRules;var k="";for(var f=0;f<j.length;f++){k+='addCSSRule("'+j[f].selectorText+'",\n';var c=j[f].style;var a=new Object();for(var b in c){if(typeof(c[b])=="string"&&c[b]!=""&&!parseInt(b)&&b!="0"&&b!="cssText"){if(b=="cssFloat"){a["float"]=c[b]}else{a[b]=c[b]}}}k+="  "+uneval(a)+"\n);\n"}document.styleSheets[document.styleSheets.length-1].disabled=true;return k};function initializeGA(b){try{_uacct=b;if(isValid(GBL.GA_SAMPLE_RATE)){_usample=GBL.GA_SAMPLE_RATE}GBL.pageTracker=_gat._getTracker(b);if(isValid(GBL.GA_SAMPLE_RATE)){GBL.pageTracker._setSampleRate(GBL.GA_SAMPLE_RATE)}GBL.pageTracker._trackPageview()}catch(a){outputDebug(a)}outputDebug("GA: initialized "+b+" (_gat is not defined means we're using old urchin tracker, and all is fine)")}function gaTrackPageview(){try{if(urchinTracker){urchinTracker(arguments[0]);outputDebug("GA-urchin: track page view "+arguments[0])}}catch(a){outputDebug("gaTrackPageview Error: "+a)}try{if(GBL.pageTracker){GBL.pageTracker._trackPageview.apply(GBL.pageTracker,arguments);outputDebug("GA: track page view "+arguments[0])}}catch(a){outputDebug("gaTrackPageview Error: "+a)}}function gaTrackEvent(){try{if(urchinTracker){var c="";for(var a=0;a<arguments.length;++a){c+="/"+arguments[a]}urchinTracker(c);outputDebug("GA-urchin: track event page view "+c)}}catch(b){outputDebug("gaTrackEvent Error: "+b)}try{if(GBL.pageTracker){c="";for(a=0;a<arguments.length;++a){c+="/"+arguments[a]}GBL.pageTracker._trackEvent.apply(GBL.pageTracker,arguments);outputDebug("GA: track event "+c)}}catch(b){outputDebug("gaTrackEvent Error: "+b)}}var BrowserDetect={init:function(){this.browser=this.searchString(this.dataBrowser)||"An unknown browser";this.version=this.searchVersion(navigator.userAgent)||this.searchVersion(navigator.appVersion)||"an unknown version";this.OS=this.searchString(this.dataOS)||"an unknown OS"},searchString:function(d){for(var a=0;a<d.length;a++){var b=d[a].string;var c=d[a].prop;this.versionSearchString=d[a].versionSearch||d[a].identity;if(b){if(b.indexOf(d[a].subString)!=-1){return d[a].identity}}else{if(c){return d[a].identity}}}},searchVersion:function(b){var a=b.indexOf(this.versionSearchString);if(a==-1){return}return parseFloat(b.substring(a+this.versionSearchString.length+1))},dataBrowser:[{string:navigator.userAgent,subString:"Chrome",identity:"Chrome"},{string:navigator.userAgent,subString:"OmniWeb",versionSearch:"OmniWeb/",identity:"OmniWeb"},{string:navigator.vendor,subString:"Apple",identity:"Safari",versionSearch:"Version"},{prop:window.opera,identity:"Opera"},{string:navigator.vendor,subString:"iCab",identity:"iCab"},{string:navigator.vendor,subString:"KDE",identity:"Konqueror"},{string:navigator.userAgent,subString:"Firefox",identity:"Firefox"},{string:navigator.vendor,subString:"Camino",identity:"Camino"},{string:navigator.userAgent,subString:"Netscape",identity:"Netscape"},{string:navigator.userAgent,subString:"MSIE",identity:"Explorer",versionSearch:"MSIE"},{string:navigator.userAgent,subString:"Gecko",identity:"Mozilla",versionSearch:"rv"},{string:navigator.userAgent,subString:"Mozilla",identity:"Netscape",versionSearch:"Mozilla"}],dataOS:[{string:navigator.platform,subString:"Win",identity:"Windows"},{string:navigator.platform,subString:"Mac",identity:"Mac"},{string:navigator.userAgent,subString:"iPhone",identity:"iPhone/iPod"},{string:navigator.platform,subString:"Linux",identity:"Linux"}]};BrowserDetect.init();var isSafariLTE3=function(){return(BrowserDetect.browser=="Safari"&&parseInt(BrowserDetect.version)<=3)};var isOpera=function(){return(BrowserDetect.browser=="Opera")};var isSupportedImageFlipperBrowser=function(){return(BrowserDetect.browser=="Explorer"&&parseInt(BrowserDetect.version)>=6)||(BrowserDetect.browser=="Firefox"&&parseInt(BrowserDetect.version)>=3)};function addReportInappropriateTaunt(a,c){var b=false;$(a).click(function(){if(b||!isValid(c)){return}var d={};d.user_id=GBL.MAIN_DATA.getViewer().getUserId();d.offensive_id=c;makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/report_offensive_taunt",function(f){},d);b=true;a.innerHTML="Reported";a.style.cursor="auto"})}function delayCallback(a){return function(){setTimeout(a,1)}}function checkValid(b,a){return isValid(b)?b:a}function getXMLListFirstChild(f,a,b){try{var d=getXMLChildNodes(f,a)}catch(c){}return parseXMLList(d,b)}function parseXMLList(c,b){var d=[];if(isValid(c)&&c.length>0){for(var a=0;a<c.length;++a){d.push(b(c[a]))}}return d}function getNodeBooleanValue(a){return parseBoolean(getXMLTextValue(a))}function getNodeEncodedStringValue(a){return parseEncodedString(getXMLTextValue(a))}function getXMLIntAmount(a){return getXMLIntValue(a,"amount")}function getNodeIntValue(a){var b=parseInt(getXMLTextValue(a));return(isNaN(b))?undefined:b}function getNodeFloatValue(a){var b=parseFloat(getXMLTextValue(a));return(isNaN(b))?undefined:b}function makeParseXMLList(a){return function(b){return parseXMLList(b,a)}}function makeGetXMLListFirstChild(b,a){return function(c){return getXMLListFirstChild(c,b,a)}}function parseEncodedString(a){return isValid(a)?decodeEncodedStringValue(a):undefined}var InviteUtil={};InviteUtil.REQUEST_URL="http://install-dynamic-lb.playdom.com/";InviteUtil.APP=GBL.TRACK_TAG;InviteUtil.MULTI_INVITE_BUCKET=20;InviteUtil.sendInvite=function(f,b,d,h){if(GBL.MAIN_DATA.takeMessageLock()){var c=f.getUserId===undefined?f:f.getUserId();var g=opensocial.newMessage(b);var j=InviteUtil.handleRequestShareApp(c,h,d);var a=function(k){GBL.MAIN_DATA.releaseMessageLock();j(k)};opensocial.requestShareApp(c,g,a)}};InviteUtil.sendMultipleInvite=function(g,b,c,f){if(GBL.MAIN_DATA.takeMessageLock()){g=g.slice(0,Math.min(g.length,InviteUtil.MULTI_INVITE_BUCKET));var d=opensocial.newMessage(b);var h=InviteUtil.handleMultipleRequestShareApp(g,f,c);var a=function(j){GBL.MAIN_DATA.releaseMessageLock();h(j)};opensocial.requestShareApp(g,d,a)}};InviteUtil.trackInvite=function(b,f,a){var d=InviteUtil.REQUEST_URL+"send_invite";if(!isValid(f)){f="invite"}var c={app:InviteUtil.APP,from_id:GBL.MAIN_DATA.getViewer().getUserId(),to_id:b,source:f,result:a};makeXMLNotCachedRequest(d,function(){},c)};InviteUtil.trackMultipleInvites=function(b,f,a){var d=InviteUtil.REQUEST_URL+"send_invite";if(!isValid(f)){f="invite"}var c={app:InviteUtil.APP,from_id:GBL.MAIN_DATA.getViewer().getUserId(),to_id:escape(b.join(",")),source:f,result:a};makeXMLNotCachedRequest(d,function(){},c)};InviteUtil.handleRequestShareApp=function(a,c,b){return function(f){var d=f.hadError();var h=f.getData();var g=0;if(d||h==MyOpenSpace.PostTo.Result.ERROR){g=-1;InviteUtil.trackInvite(a,c,"block")}else{if(h==MyOpenSpace.PostTo.Result.CANCELLED){g=0;InviteUtil.trackInvite(a,c,"cancel")}else{if(h==MyOpenSpace.PostTo.Result.SUCCESS){g=1;InviteUtil.trackInvite(a,c,"ok")}}}if(b){b(g)}}};InviteUtil.handleMultipleRequestShareApp=function(a,c,b){return function(f){var d=f.hadError();var h=f.getData();var g=0;if(d||h==MyOpenSpace.PostTo.Result.ERROR){g=-1;InviteUtil.trackMultipleInvites(a,c,"block")}else{if(h==MyOpenSpace.PostTo.Result.CANCELLED){g=0;InviteUtil.trackMultipleInvites(a,c,"cancel")}else{if(h==MyOpenSpace.PostTo.Result.SUCCESS){g=1;InviteUtil.trackMultipleInvites(a,c,"ok")}}}if(b){b(g)}}};var V_LIBRARY_OS_CONTAINER=opensocial.Container.get();var MS_OS_TOKEN=MyOpenSpace.MySpaceContainer.OSToken;function sendMessage(f,a,c,d){if(GBL.MAIN_DATA.takeMessageLock()){var b=function(h){GBL.MAIN_DATA.releaseMessageLock();if(isValid(d)){d(h)}};var g;g=opensocial.newMessage(c);g.setField(opensocial.Message.Field.TITLE,a);g.setField(opensocial.Message.Field.TYPE,opensocial.Message.Type.PRIVATE_MESSAGE);goToPageTop();if(f.getUserId()!=GBL.PLAYDOM_ID){opensocial.requestSendMessage(f.getUserId(),g,makeErrorCheckCallback("sendMessage",b))}}}function sendComment(d,b,c){if(GBL.MAIN_DATA.takeMessageLock()){var a=function(g){GBL.MAIN_DATA.releaseMessageLock();if(isValid(c)){c(g)}};var f;f=opensocial.newMessage(b);f.setField(opensocial.Message.Field.TYPE,opensocial.Message.Type.PUBLIC_MESSAGE);goToPageTop();if(d.getUserId()!=GBL.PLAYDOM_ID){opensocial.requestSendMessage(d.getUserId(),f,makeErrorCheckCallback("sendComment",a))}}}function sendCommentWOGoToPageTop(d,b,c){if(GBL.MAIN_DATA.takeMessageLock()){var a=function(g){GBL.MAIN_DATA.releaseMessageLock();if(isValid(c)){c(g)}};var f;f=opensocial.newMessage(b);f.setField(opensocial.Message.Field.TYPE,opensocial.Message.Type.PUBLIC_MESSAGE);if(d.getUserId()!=GBL.PLAYDOM_ID){opensocial.requestSendMessage(d.getUserId(),f,makeErrorCheckCallback("sendCommentWOGoToPageTop",a))}}}function sendInvite(c,a,b,d){InviteUtil.sendInvite(c,a,b,d)}function sendMultipleInvite(d,a,b,c){InviteUtil.sendMultipleInvite(d,a,b,c)}var BulletinUtil={};BulletinUtil.REQUEST_URL="http://install-dynamic-lb.playdom.com/";BulletinUtil.APP="lifebites";BulletinUtil.trackInvite=function(d,a){var c=InviteUtil.REQUEST_URL+"send_invite";var b={app:BulletinUtil.APP,from_id:GBL.MAIN_DATA.getViewer().getUserId(),to_id:-1,source:d,result:a};makeXMLNotCachedRequest(c,function(){},b)};function postToBulletin(d,a,c,h,j){if(GBL.MAIN_DATA.takeMessageLock()){var b=function(k){GBL.MAIN_DATA.releaseMessageLock();if(isValid(h)){h(k)}};var g={};g[opensocial.Message.Field.TITLE]=a;g[opensocial.Message.Field.TYPE]=opensocial.Message.Type.NOTIFICATION;var f=opensocial.newMessage(c,g);goToPageTop();if(d.getUserId()!=GBL.PLAYDOM_ID){opensocial.requestSendMessage(d.getUserId(),f,makeErrorCheckCallback("postToBulletin",b,j))}}}function postToBulletinWOGoToPageTop(f,a,c,d,j){if(GBL.MAIN_DATA.takeMessageLock()){var b=function(k){GBL.MAIN_DATA.releaseMessageLock();if(isValid(d)){d(k)}};var h={};h[opensocial.Message.Field.TITLE]=a;h[opensocial.Message.Field.TYPE]=opensocial.Message.Type.NOTIFICATION;var g=opensocial.newMessage(c,h);if(f.getUserId()!=GBL.PLAYDOM_ID){opensocial.requestSendMessage(f.getUserId(),g,makeErrorCheckCallback("postToBulletinWOGoToPageTop",b,j))}}}function makeErrorCheckCallback(c,a,b){return function(f){var d=f.hadError();var h=f.getData();var g=0;if(d||h==MyOpenSpace.PostTo.Result.ERROR){g=-1}else{if(h==MyOpenSpace.PostTo.Result.CANCELLED){g=0}else{if(h==MyOpenSpace.PostTo.Result.SUCCESS){g=1}}}if(isValid(a)){a(g)}}}var idSpecUtil={};if(!isValid(opensocial.IdSpec.GroupId)){opensocial.IdSpec.GroupId={FRIENDS:"FRIENDS",SELF:"SELF"}}idSpecUtil.viewer=function(){var a={};a[opensocial.IdSpec.Field.USER_ID]=opensocial.IdSpec.PersonId.VIEWER;return opensocial.newIdSpec(a)};idSpecUtil.owner=function(){var a={};a[opensocial.IdSpec.Field.USER_ID]=opensocial.IdSpec.PersonId.OWNER;return opensocial.newIdSpec(a)};idSpecUtil.viewerFriends=function(a){var b={};b[opensocial.IdSpec.Field.USER_ID]=opensocial.IdSpec.PersonId.VIEWER;if(!isValid(a)){b[opensocial.IdSpec.Field.NETWORK_DISTANCE]=1}else{b[opensocial.IdSpec.Field.NETWORK_DISTANCE]=1;b[opensocial.IdSpec.Field.GROUP_ID]=a}return opensocial.newIdSpec(b)};idSpecUtil.ownerFriends=function(a){var b={};b[opensocial.IdSpec.Field.USER_ID]=opensocial.IdSpec.PersonId.OWNER;if(!isValid(a)){b[opensocial.IdSpec.Field.GROUP_ID]=opensocial.IdSpec.GroupId.FRIENDS}else{b[opensocial.IdSpec.Field.NETWORK_DISTANCE]=1;b[opensocial.IdSpec.Field.GROUP_ID]=a}return opensocial.newIdSpec(b)};idSpecUtil.userId=function(b,a){var c={};c[opensocial.IdSpec.Field.USER_ID]=b;if(isValid(a)){c[opensocial.IdSpec.Field.GROUP_ID]=opensocial.IdSpec.GroupId.SELF}else{c[opensocial.IdSpec.Field.NETWORK_DISTANCE]=0;c[opensocial.IdSpec.Field.GROUP_ID]=a}return opensocial.newIdSpec(c)};idSpecUtil.userIdArray=function(a,b){var c={};c[opensocial.IdSpec.Field.USER_ID]=a;if(isValid(b)){c[opensocial.IdSpec.Field.GROUP_ID]=opensocial.IdSpec.GroupId.SELF}else{c[opensocial.IdSpec.Field.NETWORK_DISTANCE]=0;c[opensocial.IdSpec.Field.GROUP_ID]=b}return opensocial.newIdSpec(c)};function UserStatusMessage(a){this.m_xmlNode=a;this.m_statusMessage=undefined;this.m_winMessage=undefined;this.m_loseMessage=undefined;this.fillFromXML()}UserStatusMessage.prototype.updateFromXML=function(a){this.m_xmlNode=a;this.fillFromXML()};UserStatusMessage.prototype.fillFromXML=function(){if(!isValid(this.m_xmlNode)){return}try{this.m_statusMessage=customDecoding(getXMLNodeValue(this.m_xmlNode,"status_message"))}catch(a){}try{this.m_winMessage=customDecoding(getXMLNodeValue(this.m_xmlNode,"win_message"))}catch(a){}try{this.m_loseMessage=customDecoding(getXMLNodeValue(this.m_xmlNode,"lose_message"))}catch(a){}};UserStatusMessage.prototype.getStatusMessage=function(){return this.m_statusMessage};UserStatusMessage.prototype.getWinMessage=function(){return this.m_winMessage};UserStatusMessage.prototype.getLoseMessage=function(){return this.m_loseMessage};UserStatusMessage.prototype.setStatusMessage=function(a){this.m_statusMessage=a};UserStatusMessage.prototype.setWinMessage=function(a){this.m_winMessage=a};UserStatusMessage.prototype.setLoseMessage=function(a){this.m_loseMessage=a};UserStatusMessage.prototype.isEmpty=function(){return(this.m_statusMessage==undefined||this.m_statusMessage.length==0)&&(this.m_winMessage==undefined||this.m_winMessage.length==0)&&(this.m_loseMessage==undefined||this.m_loseMessage.length==0)};function User(a){this.m_userId=undefined;this.m_name=undefined;this.m_thumbnail_url=undefined;this.m_profile_url=undefined;this.m_age=undefined;this.m_gender=undefined;this.m_city=undefined;this.m_region=undefined;this.m_postalCode=undefined;this.m_mobName=undefined;this.m_mobClass=undefined;this.m_mobSize=undefined;this.m_numHiredGuns=undefined;this.m_topMobsActive=undefined;this.m_cash=undefined;this.m_cashInBank=undefined;this.m_attackStrength=undefined;this.m_defenseStrength=undefined;this.m_health=undefined;this.m_maxHealth=undefined;this.m_energy=undefined;this.m_maxEnergy=undefined;this.m_stamina=undefined;this.m_maxStamina=undefined;this.m_experience=undefined;this.m_percentToNextLevel=undefined;this.m_expPointsToNextLevel=undefined;this.m_level=undefined;this.m_skillPoints=undefined;this.m_favorPoints=undefined;this.m_secondsToHealthRefresh=undefined;this.m_secondsToEnergyRefresh=undefined;this.m_secondsToStaminaRefresh=undefined;this.m_secondsToHeal=undefined;this.m_numRequests=undefined;this.m_joinedDaysAgo=undefined;this.m_income=undefined;this.m_upkeep=undefined;this.m_partOfViewerMob=undefined;this.m_requestedByUser=undefined;this.m_inviteBlocked=undefined;this.m_commentsBlocked=undefined;this.m_winLoss=undefined;this.m_roundedCash=undefined;this.m_is_cheater=undefined;this.m_hasApp=undefined;this.m_is_owner=false;this.m_is_viewer=false;this.m_small_avatar_url=undefined;this.m_big_avatar_url=undefined;this.m_darkness=undefined;this.m_location=undefined;this.m_current_quest_id=0;this.m_hasInstalledIPhone=false;this.m_total_win=undefined;this.m_total_raid_win=undefined;this.m_total_loss=undefined;this.m_raid_disabled=undefined;this.m_secondsLeftNitroRefresh=undefined;this.m_nitroRefreshImage=undefined;this.m_userStatusMessage=undefined;if(isValid(a)){this.createOsUser(a)}}User.prototype.createOsUser=function(a){this.m_userId=a.getField(opensocial.Person.Field.ID);if(isValid(this.m_userId)){this.m_userId=parseInt((""+this.m_userId).split(":").pop())}this.m_name=a.getDisplayName();this.m_thumbnail_url=a.getField(opensocial.Person.Field.THUMBNAIL_URL);this.m_profile_url=a.getField(opensocial.Person.Field.PROFILE_URL);try{this.m_age=a.getField(opensocial.Person.Field.AGE)}catch(b){outputDebug("createOsUser: "+b)}try{this.m_gender=a.getField(opensocial.Person.Field.GENDER)}catch(b){outputDebug("createOsUser: "+b)}try{this.m_region=a.getField(opensocial.Person.Field.CURRENT_LOCATION).getField(opensocial.Address.Field.REGION);this.m_postalCode=a.getField(opensocial.Person.Field.CURRENT_LOCATION).getField(opensocial.Address.Field.POSTAL_CODE)}catch(b){}try{this.m_hasApp=a.getField("hasAppInstalled")}catch(b){outputDebug("createOsUser: "+b)}};User.prototype.createXMLUser=function(a){try{this.m_userId=getXMLNodeValue(a,"user_id")}catch(b){}try{this.m_name=getXMLEncodedStringNodeValue(a,"display_name")}catch(b){}try{this.m_thumbnail_url=getXMLEncodedStringNodeValue(a,"thumbnail_url")}catch(b){}try{this.m_profile_url=getXMLEncodedStringNodeValue(a,"profile_url")}catch(b){}this.fillSpecificInfoFromXML(a)};User.prototype.constructParamForReq=function(){var a={};a.user_id=this.m_userId;if(isValid(this.m_age)){a.age=this.m_age}if(isValid(this.m_gender)){a.gender=this.m_gender}if(isValid(this.m_thumbnail_url)){a.thumbnail_url=this.m_thumbnail_url}if(isValid(this.m_profile_url)){a.profile_url=this.m_profile_url}if(isValid(this.m_name)){a.display_name=customEncoding(this.m_name)}if(isValid(this.m_city)){a.city=customEncoding(this.m_city)}if(isValid(this.m_region)){a.region=customEncoding(this.m_region)}if(isValid(this.m_postalCode)){a.postalCode=this.m_postalCode}return a};User.prototype.signInViewer=function(b){if(!isValid(this.m_userId)){outputDebug("viewer is undefined ");var a=gadgets.views.getParams();this.m_userId=a.viewerid}var c=this.constructParamForReq();c.sign_in="true";makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/sign_in",b,c)};User.prototype.signInViewerSecured=function(b){if(!isValid(this.m_userId)){outputDebug("viewer is undefined ");var a=gadgets.views.getParams();this.m_userId=a.viewerid}var c={};c.user_id=this.m_userId;c.sign_in="true";makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/sign_in_secured",b,c)};User.prototype.getUserId=function(){return this.m_userId};User.prototype.getGender=function(){return this.m_gender};User.prototype.getAge=function(){return this.m_age};User.prototype.getThumbnailUrl=function(){return this.m_thumbnail_url};User.prototype.getName=function(){return this.m_name};User.prototype.getShortName=function(){return shortenedStringKeepEscapedCharacters(this.m_name,12)};User.prototype.getProfileUrl=function(){return this.m_profile_url};User.prototype.getRegion=function(){return this.m_region};User.prototype.getTotalWin=function(){return this.m_total_win};User.prototype.getTotalRaidWin=function(){return this.m_total_raid_win};User.prototype.isRaidDisabled=function(){return this.m_raid_disabled};User.prototype.getTotalLoss=function(){return this.m_total_loss};User.prototype.getShortRegion=function(){return shortenedStringKeepEscapedCharacters(this.m_region,10)};User.prototype.output=function(){outputDebug("userId: "+this.m_userId);outputDebug("name: "+this.m_name);outputDebug("gender: "+this.m_gender)};User.prototype.fillSpecificInfoFromXML=function(a){try{if(isValid(getXMLNodeValue(a,"mob_name"))){this.m_mobName=getXMLEncodedStringNodeValue(a,"mob_name")}}catch(d){}try{if(isValid(getXMLNodeValue(a,"mob_class"))){this.m_mobClass=getXMLEncodedStringNodeValue(a,"mob_class")}}catch(d){}try{if(isValid(getXMLNodeValue(a,"mob_size"))){this.m_mobSize=parseInt(getXMLNodeValue(a,"mob_size"))}}catch(d){}try{if(isValid(getXMLNodeValue(a,"num_hired_guns"))){this.m_numHiredGuns=parseInt(getXMLNodeValue(a,"num_hired_guns"))}}catch(d){}try{if(isValid(getXMLNodeValue(a,"top_mobs_active"))){this.m_topMobsActive=parseInt(getXMLNodeValue(a,"top_mobs_active"))}}catch(d){}try{if(isValid(getXMLNodeValue(a,"cash"))){this.m_cash=parseInt(getXMLNodeValue(a,"cash"))}}catch(d){}try{if(isValid(getXMLNodeValue(a,"rounded_cash"))){this.m_roundedCash=parseInt(getXMLNodeValue(a,"rounded_cash"))}}catch(d){}try{if(isValid(getXMLNodeValue(a,"cash_in_bank"))){this.m_cashInBank=parseInt(getXMLNodeValue(a,"cash_in_bank"))}}catch(d){}try{if(isValid(getXMLNodeValue(a,"attack_strength"))){this.m_attackStrength=parseInt(getXMLNodeValue(a,"attack_strength"))}}catch(d){}try{if(isValid(getXMLNodeValue(a,"defense_strength"))){this.m_defenseStrength=parseInt(getXMLNodeValue(a,"defense_strength"))}}catch(d){}try{if(isValid(getXMLNodeValue(a,"health"))){this.m_health=parseInt(getXMLNodeValue(a,"health"))}}catch(d){}try{if(isValid(getXMLNodeValue(a,"max_health"))){this.m_maxHealth=parseInt(getXMLNodeValue(a,"max_health"))}}catch(d){}try{if(isValid(getXMLNodeValue(a,"energy"))){this.m_energy=parseInt(getXMLNodeValue(a,"energy"))}}catch(d){}try{if(isValid(getXMLNodeValue(a,"max_energy"))){this.m_maxEnergy=parseInt(getXMLNodeValue(a,"max_energy"))}}catch(d){}try{if(isValid(getXMLNodeValue(a,"stamina"))){this.m_stamina=parseInt(getXMLNodeValue(a,"stamina"))}}catch(d){}try{if(isValid(getXMLNodeValue(a,"max_stamina"))){this.m_maxStamina=parseInt(getXMLNodeValue(a,"max_stamina"))}}catch(d){}try{if(isValid(getXMLNodeValue(a,"experience"))){this.m_experience=parseInt(getXMLNodeValue(a,"experience"))}}catch(d){}try{if(isValid(getXMLNodeValue(a,"percent_to_next_level"))){this.m_percentToNextLevel=parseInt(getXMLNodeValue(a,"percent_to_next_level"))}}catch(d){}try{if(isValid(getXMLNodeValue(a,"exp_pt_to_next_level"))){this.m_expPointsToNextLevel=parseInt(getXMLNodeValue(a,"exp_pt_to_next_level"))}}catch(d){}try{if(isValid(getXMLNodeValue(a,"level"))){this.m_level=parseInt(getXMLNodeValue(a,"level"))}}catch(d){}try{if(isValid(getXMLNodeValue(a,"skill_points"))){this.m_skillPoints=parseInt(getXMLNodeValue(a,"skill_points"))}}catch(d){}try{if(isValid(getXMLNodeValue(a,"favor_points"))){this.m_favorPoints=parseInt(getXMLNodeValue(a,"favor_points"))}}catch(d){}try{if(isValid(getXMLNodeValue(a,"win_loss"))){this.m_winLoss=getXMLNodeValue(a,"win_loss")}}catch(d){}try{if(isValid(getXMLNodeValue(a,"installed_iphone"))){this.m_hasInstalledIPhone=getXMLNodeValue(a,"installed_iphone")}}catch(d){}try{this.m_secondsToHealthRefresh=undefined;if(isValid(getXMLNodeValue(a,"seconds_to_health_refresh"))){this.m_secondsToHealthRefresh=parseInt(getXMLNodeValue(a,"seconds_to_health_refresh"))}}catch(d){}try{this.m_secondsToEnergyRefresh=undefined;if(isValid(getXMLNodeValue(a,"seconds_to_energy_refresh"))){this.m_secondsToEnergyRefresh=parseInt(getXMLNodeValue(a,"seconds_to_energy_refresh"))}}catch(d){}try{this.m_secondsToStaminaRefresh=undefined;if(isValid(getXMLNodeValue(a,"seconds_to_stamina_refresh"))){this.m_secondsToStaminaRefresh=parseInt(getXMLNodeValue(a,"seconds_to_stamina_refresh"))}}catch(d){}try{this.m_secondsToHeal=undefined;if(isValid(getXMLNodeValue(a,"seconds_to_heal"))){this.m_secondsToHeal=parseInt(getXMLNodeValue(a,"seconds_to_heal"))}}catch(d){}try{if(isValid(getXMLNodeValue(a,"num_requests"))){this.m_numRequests=parseInt(getXMLNodeValue(a,"num_requests"))}}catch(d){}try{if(isValid(getXMLNodeValue(a,"joined_days_ago"))){this.m_joinedDaysAgo=parseInt(getXMLNodeValue(a,"joined_days_ago"))}}catch(d){}try{if(isValid(getXMLNodeValue(a,"land_income"))){this.m_income=parseInt(getXMLNodeValue(a,"land_income"))}}catch(d){}try{if(isValid(getXMLNodeValue(a,"item_upkeep"))){this.m_upkeep=parseInt(getXMLNodeValue(a,"item_upkeep"))}}catch(d){}try{this.m_partOfViewerMob=getXMLNodeValue(a,"part_of_viewer_mob")}catch(d){}try{this.m_requestedByUser=getXMLNodeValue(a,"requested_by_viewer")}catch(d){}try{this.m_inviteBlocked=getXMLNodeValue(a,"invite_blocked")}catch(d){}try{if(isValid(getXMLNodeValue(a,"avatar_url_small"))){this.m_small_avatar_url=getXMLEncodedStringNodeValue(a,"avatar_url_small")}}catch(d){}try{if(isValid(getXMLNodeValue(a,"avatar_url_big"))){this.m_big_avatar_url=getXMLEncodedStringNodeValue(a,"avatar_url_big")}}catch(d){}try{if(isValid(getXMLNodeValue(a,"darkness"))){this.m_darkness=parseInt(getXMLNodeValue(a,"darkness"))}else{this.m_darkness=0}}catch(d){}try{if(isValid(getXMLNodeValue(a,"total_win"))){this.m_total_win=getXMLEncodedStringNodeValue(a,"total_win")}}catch(d){}try{if(isValid(getXMLNodeValue(a,"total_raid_win"))){this.m_total_raid_win=getXMLEncodedStringNodeValue(a,"total_raid_win")}}catch(d){}try{if(isValid(getXMLNodeValue(a,"total_loss"))){this.m_total_loss=getXMLEncodedStringNodeValue(a,"total_loss")}}catch(d){}try{this.m_raid_disabled=isValid(getXMLNodeValue(a,"raid_disabled"))}catch(d){}this.m_secondsLeftNitroRefresh=undefined;this.m_nitroRefreshImage=undefined;var b=undefined;var c=undefined;try{b=a.getElementsByTagName("buff_info")[0];c=b.getElementsByTagName("nitrousboost")[0];if(isValid(getXMLNodeValue(c,"seconds_left"))){this.m_secondsLeftNitroRefresh=getXMLNodeValue(c,"seconds_left")}if(isValid(getXMLNodeValue(c,"small_image_url"))){this.m_nitroRefreshImage=getXMLNodeValue(c,"small_image_url")}}catch(d){}try{if(isValid(Location)&&isValid(getXMLFirstNode(a,"location"))){this.m_location=new Location(getXMLFirstNode(a,"location"))}}catch(d){}try{this.m_userStatusMessage=new UserStatusMessage(a)}catch(d){}};User.prototype.getMobName=function(){return this.m_mobName};User.prototype.setMobName=function(a){this.m_mobName=a};User.prototype.getShortMobName=function(a){if(!isValid(this.m_mobName)||!isValid(a)||this.m_mobName.length<=a){return this.m_mobName}return this.m_mobName.substr(0,a-2)+"..."};User.prototype.getMobClass=function(){return this.m_mobClass};User.prototype.setMobClass=function(a){this.m_mobClass=a};User.prototype.getMobSize=function(){return this.m_mobSize};User.prototype.getNumHiredGuns=function(){return this.m_numHiredGuns};User.prototype.getTopMobsActive=function(){return this.m_topMobsActive};User.prototype.getCash=function(){return this.m_cash};User.prototype.getCashInBank=function(){return this.m_cashInBank};User.prototype.getAttackStrength=function(){return this.m_attackStrength};User.prototype.getDefenseStrength=function(){return this.m_defenseStrength};User.prototype.getHealth=function(){return this.m_health};User.prototype.getMaxHealth=function(){return this.m_maxHealth};User.prototype.getEnergy=function(){return this.m_energy};User.prototype.getMaxEnergy=function(){return this.m_maxEnergy};User.prototype.getStamina=function(){return this.m_stamina};User.prototype.getMaxStamina=function(){return this.m_maxStamina};User.prototype.getExperience=function(){return this.m_experience};User.prototype.getPercentToNextLevel=function(){return this.m_percentToNextLevel};User.prototype.getExpPointsToNextLevel=function(){return this.m_expPointsToNextLevel};User.prototype.getLevel=function(){return this.m_level};User.prototype.getSkillPoints=function(){return this.m_skillPoints};User.prototype.getFavorPoints=function(){return this.m_favorPoints};User.prototype.setFavorPoints=function(a){this.m_favorPoints=a};User.prototype.getSecondsToHealthRefresh=function(){return this.m_secondsToHealthRefresh};User.prototype.getSecondsToEnergyRefresh=function(){return this.m_secondsToEnergyRefresh};User.prototype.getSecondsToStaminaRefresh=function(){return this.m_secondsToStaminaRefresh};User.prototype.getSecondsToHeal=function(){return this.m_secondsToHeal};User.prototype.getSecondsLeftNitroRefresh=function(){return this.m_secondsLeftNitroRefresh};User.prototype.getNitroRefreshImage=function(){return this.m_nitroRefreshImage};User.prototype.getNumRequests=function(){return this.m_numRequests};User.prototype.getJoinedDaysAgo=function(){return this.m_joinedDaysAgo};User.prototype.getIncome=function(){return this.m_income};User.prototype.getUpkeep=function(){return this.m_upkeep};User.prototype.getpartOfViewerMob=function(){return getBooleanValue(this.m_partOfViewerMob)};User.prototype.setRequestedByUser=function(a){if(!this.getpartOfViewerMob()){this.m_requestedByUser=a}};User.prototype.getRequestedByUser=function(){return getBooleanValue(this.m_requestedByUser)};User.prototype.setInviteBlocked=function(a){this.m_inviteBlocked=a};User.prototype.getInviteBlocked=function(){return getBooleanValue(this.m_inviteBlocked)};User.prototype.setCommentsBlocked=function(a){this.m_commentsBlocked=a};User.prototype.isCommentsBlocked=function(){return getBooleanValue(this.m_commentsBlocked)};User.prototype.setIsCheater=function(a){this.m_is_cheater=a};User.prototype.getIsCheater=function(){return this.m_is_cheater};User.prototype.setHasApp=function(a){this.m_hasApp=a};User.prototype.getHasApp=function(){return getBooleanValue(this.m_hasApp)};User.prototype.setBigAvatarUrl=function(a){this.m_big_avatar_url=a};User.prototype.setSmallAvatarUrl=function(a){this.m_small_avatar_url=a};User.prototype.getSmallAvatarUrl=function(){var a=this.m_small_avatar_url;return avatarMakeThumbNice(a)};User.prototype.getBigAvatarUrl=function(){var a=this.m_big_avatar_url;return avatarMakeThumbNice(a)};User.prototype.getDarkness=function(){return this.m_darkness};User.prototype.getLocation=function(){return this.m_location};User.prototype.getUserStatusMessage=function(){return this.m_userStatusMessage};User.prototype.getField=function(a){switch(a){case opensocial.Person.Field.ID:return this.m_userId;case opensocial.Person.Field.NAME:return this.m_name;case opensocial.Person.Field.AGE:return this.m_age;case opensocial.Person.Field.GENDER:return this.m_gender;case opensocial.Person.Field.THUMBNAIL_URL:return this.m_thumbnail_url;case opensocial.Person.Field.PROFILE_URL:return this.m_profile_url}return undefined};User.prototype.getShortDisplayName=function(a){if(!isValid(this.m_name)||!isValid(a)||this.m_name.length<=a){return this.m_name}return this.m_name.substr(0,a-2)+"..."};User.prototype.getDisplayName=function(){return this.m_name};User.prototype.getId=function(){return this.m_userId};User.prototype.isOwner=function(){return this.m_is_owner};User.prototype.setIsOwner=function(a){this.m_is_owner=a};User.prototype.isViewer=function(){return this.m_is_viewer};User.prototype.setIsViewer=function(a){this.m_is_viewer=a};User.prototype.setCurrentQuestId=function(a){this.m_current_quest_id=a};User.prototype.getCurrentQuestId=function(){return this.m_current_quest_id};User.prototype.getWinLoss=function(){return this.m_winLoss};User.prototype.getRoundedCash=function(){return this.m_roundedCash};User.prototype.getAuthKey=function(){return XMLRequestQueue.AUTH_KEY};User.prototype.hasInstalledIPhone=function(){return getBooleanValue(this.m_hasInstalledIPhone)};GBL.BACKED_USER_CACHED=new CachedOSFriendListByIsAppUser("GBL.BACKED_USER_CACHED");function CachedOSFriendListByIsAppUser(k){var l=undefined;var r=1;var d=k;var b=new Array();var a=new Array();var j=new Object();var o=100;var g=new Object();this.getNumUsers=n;this.getUsers=u;this.loadMoreUsers=c;this.getUserById=q;this.invalidateCache=m;this.getNumUsersHelper=t;var s=undefined;var p=undefined;function m(){outputDebug("invalidate CachedOSFriendList cache");l=undefined;r=0;b=new Array();a=new Array();j=new Object()}function n(v){outputDebug("CachedOSFriendList: getNumUsers");if(isValid(l)){v(l);return}s=v;t()}function t(){if(!isValid(GBL.ALL_USERS_CACHE.getNumUsers())){window.setTimeout(d+".getNumUsersHelper()",300);return}l=GBL.ALL_USERS_CACHE.getNumUsers();if(isValidFunction(s)){var v=s;s=undefined;v(l)}}function u(E,v,A){var C=E;outputDebug("CachedOSFriendList: getUsers start "+C+" num "+v);var y=Math.min(C+v,l);outputDebug("m_appUsersCache.length: "+b.length+" m_nonAppUsersCache.length: "+a.length+" l_indexEnd: "+y);var F=undefined;var D=a.length;if(D>=y){F=a.slice(C,y)}else{if(r<l){p=function(){u(C,v,A)};c()}else{var x=Math.min(C,D);var w=Math.min(y,D);var B=Math.max(0,C-D);var z=Math.max(0,y-D);F=a.slice(x,w);F=F.concat(b.slice(B,z))}}if(isValid(F)&&isValid(A)){A(F)}}function c(){outputDebug("getOSUsers: "+r);MyOpenSpace.DefaultPageSize=o;var v={};v[opensocial.DataRequest.PeopleRequestFields.FIRST]=r;v[opensocial.DataRequest.PeopleRequestFields.MAX]=o;var w=opensocial.newDataRequest();w.add(w.newFetchPeopleRequest(idSpecUtil.viewerFriends(),v),"viewerFriends");w.send(f)}function f(z){outputDebug("onLoadFriends: "+r);g=new Object();var A=false;var v="";try{var w=z.get("viewerFriends").getData();if(isValid(w)){A=true;w.each(function(C){var B=new User(C);j[B.getUserId()]=B;v+=B.getUserId()+",";g[B.getUserId()]=B});r+=o}}catch(y){A=false;outputDebug("onLoadFriends "+y)}if(!A){outputDebug("Getting OS Users failed, should I retry?")}else{}if(isValid(v)&&v.length>0){var x={};x.user_id=GBL.MAIN_DATA.getViewer().getUserId();x.query_ids=v;makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/get_app_users",h,x,true)}}function h(w){outputDebug("onLoadAppUsers");var z=getGadgetResponseData(w);if(z!=undefined){var A=z.getElementsByTagName("user");if(isValid(A)&&A.length>0){for(var v=0;v<A.length;v++){try{var D=getXMLNodeValue(A[v],"user_id");var B=getXMLNodeValue(A[v],"invite_blocked");var x=j[D];if(isValid(x)){x.fillSpecificInfoFromXML(A[v]);x.setHasApp(true);g[x.getUserId()]=undefined;if(x.getInviteBlocked()||x.getpartOfViewerMob()){b.push(x)}else{b.unshift(x)}}}catch(y){outputDebug("onLoadAppFriends: "+y)}}}}for(D in g){if(isValid(g[D])){a.push(g[D])}}if(isValid(p)){var C=p;p=undefined;C()}}function q(v){return j[v]}}CachedUserList.MY_REQUESTS=1;CachedUserList.MY_MOB=2;function CachedUserList(d){var o=d;var b=undefined;var p=new Array();var a=new Object();this.setTotalNumUsers=r;this.addUser=g;this.invalidateCache=h;var q=undefined;this.getNumUsers=l;this.onLoadNumUsers=n;var k=undefined;this.getUsers=m;this.onLoadUsers=f;this.getUserById=c;function r(s){b=s}function g(s){p.push(s);a[s.getUserId()]=s}function h(){outputDebug("invalidate user cache");b=undefined;p=new Array();a=new Object()}function l(t){if(b!=undefined){t(b);return}q=t;var s={};s.user_id=GBL.MAIN_DATA.getViewer().getUserId();s.action=j(o);makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/get_num_users",n,s)}function n(s){var t=getGadgetResponseData(s);if(t!=undefined){try{b=getXMLNodeValue(t,"num")}catch(u){outputAlert(u)}}if(isValidFunction(q)){var v=q;q=undefined;v(b)}}function m(w,t,s){if(!isValid(b)){l(function(){m(w,t,s)})}var y=Math.min(b-1,w+t-1);if(p.length>y){var x=true;for(var u=w;x&&u<=y;u++){if(!isValid(p[u])){x=false}}if(x){s(p);return}}if(p.length<=y){for(u=(p.length-1);u<=y;u++){p.push(null)}}k=s;var v={};v.user_id=GBL.MAIN_DATA.getViewer().getUserId();v.action=j(o);v.start=w;v.num=Math.min(t,b-w);makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/get_users",function(z){f(w,z)},v)}function f(y,x){var u=getGadgetResponseData(x);if(u!=undefined){var t=u.getElementsByTagName("user");if(isValid(t)&&t.length>0){for(var v=0;v<t.length;v++){var s=new User(undefined);s.createXMLUser(t[v]);p[y+v]=s;a[s.getUserId()]=s}}}if(isValidFunction(k)){var w=k;k=undefined;w(p)}}function c(s){return a[s]}function j(s){switch(s){case CachedUserList.MY_REQUESTS:return"request";case CachedUserList.MY_MOB:return"my_mob";default:outputDebug("Unrecognized category code "+s);return undefined}}}GBL.APP_USERS_CACHE=new CachedOSFriendsAutoFetchList(true,"GBL.APP_USERS_CACHE");GBL.ALL_USERS_CACHE=new CachedOSFriendsAutoFetchList(false,"GBL.ALL_USERS_CACHE");function CachedOSFriendsAutoFetchList(m,j){var d=m;var p=j;var r=100;var b=50;var w=1;var o=undefined;var a=new Array();var t=new Object();var v=undefined;this.isFinished=g;this.fillList=f;this.getNumUsers=l;this.getMoreUsers=h;this.getCachedUsers=k;this.getUserById=q;this.hasUser=u;this.fillInAdditionalData=c;this.grabRandomFriends=n;function g(){return isValid(o)&&isValid(a)&&(a.length>500||a.length>=o)}function f(x){outputDebug("CachedOSFriendsAutoFetchList: fillList");if(g()){if(isValidFunction(x)){x()}return}v=x;h()}function h(){outputDebug("m_appUsersOnly: "+d+" getMoreUsers: "+a.length);if(g()){outputDebug("getMoreUsers: finished");if(isValidFunction(v)){v()}else{outputDebug("Call back is invalid")}return}MyOpenSpace.DefaultPageSize=r;var x={};if(d){x[opensocial.DataRequest.PeopleRequestFields.FILTER]=opensocial.DataRequest.FilterType.HAS_APP}x[opensocial.DataRequest.PeopleRequestFields.FIRST]=w;x[opensocial.DataRequest.PeopleRequestFields.MAX]=r;w+=r;var y=opensocial.newDataRequest();y.add(y.newFetchPeopleRequest(idSpecUtil.viewerFriends(),x),"viewerFriends");y.send(s)}function s(z){outputDebug("m_appUsersOnly: "+d+" onGetMoreUsers: "+a.length);var A=false;try{if(isValid(z.get("viewerFriends").getData())){o=parseInt(z.get("viewerFriends").getData().getTotalSize());outputDebug("onGetMoreUsers totalUsers: "+o);var y=z.get("viewerFriends").getData();if(isValid(y)){A=true;y.each(function(C){var B=new User(C);a.push(B);t[B.getUserId()]=B})}}}catch(x){A=false;outputDebug("onGetMoreUsers error "+x)}if(!A){outputDebug("onGetMoreUsers failed, should I retry?");return}window.setTimeout(p+".getMoreUsers()",b)}function k(){return a}function q(x){return t[x]}function u(x){return isValid(t[x])}function l(){return o}function c(B){try{var x=B.getElementsByTagName("user");if(isValid(x)&&x.length>0){for(var A=0;A<x.length;A++){var z=parseInt(getXMLNodeValue(x[A],"user_id"));if(this.hasUser(z)){var y=this.getUserById(z);y.fillSpecificInfoFromXML(x[A])}}}}catch(C){}}function n(y){if(!isValid(a)||!isValid(y)||y<=0){return[]}else{var z=getRandomNumbers(a.length,y);var x=[];jQuery.each(z,function(B,C){var A=a[C];if(isValid(A)&&A.getUserId()!=6221){x.push(A)}});return x}}}function RPGClass(a){this.m_xmlNode=a;this.m_id=undefined;this.m_code_name=undefined;this.m_name=undefined;this.m_description=undefined;this.fillFromXML()}RPGClass.prototype.fillFromXML=function(){if(!isValid(this.m_xmlNode)){return}try{this.m_id=getXMLNodeValue(this.m_xmlNode,"id")}catch(a){}try{this.m_code_name=getXMLEncodedStringNodeValue(this.m_xmlNode,"code_name")}catch(a){}try{this.m_name=getXMLEncodedStringNodeValue(this.m_xmlNode,"name")}catch(a){}try{this.m_description=getXMLEncodedStringNodeValue(this.m_xmlNode,"description")}catch(a){}};RPGClass.prototype.getId=function(){return this.m_id};RPGClass.prototype.getCodeName=function(){return this.m_code_name};RPGClass.prototype.getName=function(){return this.m_name};RPGClass.prototype.getDescription=function(){return this.m_description};function CentralData(a_finishInitialLoadCallback,a_loadStatusDiv){var m_finishInitialLoadCallback=a_finishInitialLoadCallback;var m_loadStatusDiv=a_loadStatusDiv;var m_viewer=undefined;var m_owner=undefined;var m_viewerFriends=undefined;var m_viewerPokerSessionKey=undefined;var m_myspace_announcement=undefined;var m_broadcastPerMemberCost=undefined;var m_show_notification=undefined;var m_show_multi_user_invite=undefined;var m_message_lock_free=true;var m_login_message=undefined;var m_viewerMobRequestList=undefined;var m_viewerMobMembersList=undefined;var m_cashOfferPerLevel=undefined;var m_showOfferNetwork=undefined;var m_showCCBill=false;var m_rpgClasses=undefined;this.getRPGClasses=getRPGClasses;this.getRPGClassByName=getRPGClassByName;var m_avatar_version=undefined;this.getAvatarVersion=getAvatarVersion;var m_hasMall=undefined;this.getHasMall=getHasMall;var m_hasWardrobeOnly=undefined;this.getHasWardrobeOnly=getHasWardrobeOnly;var m_showDirectPay=false;this.getShowDirectPay=function(){return m_showDirectPay};var m_showFeaturedLEItem=false;var m_featuredLEItem=undefined;this.getFeaturedLEItem=function(){return m_featuredLEItem};this.createUsers=createUsers;this.onLoadUsers=onLoadUsers;this.isInit=isInit;this.getOwner=getOwner;this.getViewer=getViewer;this.getViewerFriends=getViewerFriends;this.getCachedUsers=getCachedUsers;this.getMyspaceAnnouncement=getMyspaceAnnouncement;this.getShowNotification=getShowNotification;this.getShowMultiUserInvite=getShowMultiUserInvite;this.takeMessageLock=takeMessageLock;this.releaseMessageLock=releaseMessageLock;this.getLoginMessage=getLoginMessage;this.setLoginMessage=setLoginMessage;this.getBroadcastPerMemberCost=function(){return m_broadcastPerMemberCost};this.getCashOfferPerLevel=function(){return m_cashOfferPerLevel};this.getShowOfferNetwork=function(){return m_showOfferNetwork};this.getShowCCBill=function(){return m_showCCBill};var m_useMonetizationIframe=false;this.useMonetizationIframe=function(){return m_useMonetizationIframe};this.getIsViewerPPUser=getIsViewerPPUser;this.getPPSessionKey=getPPSessionKey;var m_maxDepositScale=undefined;var m_maxDepositOffset=undefined;this.getMaxDepositScale=getMaxDepositScale;this.getMaxDepositOffset=getMaxDepositOffset;var m_showAvatar=false;this.getShowAvatar=function(){return m_showAvatar};var m_activityFeed=false;this.getActivityFeed=function(){return m_activityFeed};createUsers();function createUsers(){outputDebug("createUsers");var req=opensocial.newDataRequest();outputDebug("creating Param");var param={};param[opensocial.DataRequest.PeopleRequestFields.PROFILE_DETAILS]=[opensocial.Person.Field.ID,opensocial.Person.Field.NAME,opensocial.Person.Field.THUMBNAIL_URL,opensocial.Person.Field.AGE,opensocial.Person.Field.GENDER,opensocial.Person.Field.CURRENT_LOCATION];req.add(req.newFetchPersonRequest(opensocial.IdSpec.PersonId.VIEWER,param),"viewer");req.add(req.newFetchPersonRequest(opensocial.IdSpec.PersonId.OWNER,param),"owner");req.send(onLoadUsers)}function onLoadUsers(dataResponse){outputDebug("load user called: dataResponse: "+dataResponse);try{if(!isOffSite()){var o=dataResponse.get("owner");var v=dataResponse.get("viewer");if(o.hadError()||v.hadError()){if(o.getErrorCode()==opensocial.ResponseItem.Error.UNAUTHORIZED||v.getErrorCode()==opensocial.ResponseItem.Error.UNAUTHORIZED){var reload_canvas=function(){gadgets.views.requestNavigateTo(new gadgets.views.View("canvas"))};var show_error=function(){m_loadStatusDiv.getTextDiv().innerHTML="<span style='font-weight:bold;'>                            <a href=\"javascript:gadgets.views.requestNavigateTo(new gadgets.views.View('canvas'));\">                            Please refresh the whole window in order to play...</a></span"};var modalDialog=new ModalDialog("You MUST refresh the whole window in order to load the game, would you like to do it now?",null,{Close:show_error,Reload:reload_canvas},ModalDialog.ERROR);modalDialog.moveOnResize(false);modalDialog.showDialog();return}}}}catch(e){}try{var ownerData=dataResponse.get("owner").getData();m_owner=new User(ownerData)}catch(err){outputDebug(err);m_owner=null}try{var viewerData=dataResponse.get("viewer").getData();m_viewer=new User(viewerData);m_loadStatusDiv.getTextDiv().innerHTML="<span style='font-weight:bold;'> Loading your info... </span> <br/> <span style='font-size:10px;'> (Please do not refresh unless this takes more than 30 seconds) </span>";if(isValid(GBL.USE_SECURITY_SIGN_IN)){m_viewer.signInViewerSecured(onFinishSignIn)}else{m_viewer.signInViewer(onFinishSignIn)}}catch(err){outputDebug(err);m_viewer=null}}function displayErrorMessage(){m_loadStatusDiv.getTextDiv().style.width="500px";try{if(false&&isValidFunction(getOffsiteMsg)){m_loadStatusDiv.getTextDiv().innerHTML=getOffsiteMsg(m_viewer.getUserId(),m_viewer.getThumbnailUrl())}else{m_loadStatusDiv.getTextDiv().innerHTML=GBL.APP_ERROR_MSG}}catch(err){m_loadStatusDiv.getTextDiv().innerHTML=GBL.APP_ERROR_MSG}goToPageTop()}function onFinishSignIn(a_response){var l_responseXML=undefined;try{l_responseXML=getGadgetResponseData(a_response)}catch(err){}if(!isValid(l_responseXML)){displayErrorMessage();return}if(!isValid(getXMLNodeValue(l_responseXML,"user_id"))){displayErrorMessage();return}try{if(isValid(getXMLNodeValue(l_responseXML,"avatar_version"))){m_avatar_version=parseInt(getXMLNodeValue(l_responseXML,"avatar_version"))}}catch(err){}consoleLog("User avatar version::"+m_avatar_version);try{if(isValid(getXMLNodeValue(l_responseXML,"has_mall"))){m_hasMall=getXMLNodeValue(l_responseXML,"has_mall")}}catch(err){}consoleLog("User has_mall::"+m_hasMall);try{if(isValid(getXMLNodeValue(l_responseXML,"has_wardrobe_only"))){m_hasWardrobeOnly=(getXMLNodeValue(l_responseXML,"has_wardrobe_only")=="true")}}catch(err){}consoleLog("User has_wardrobe_only::"+m_hasWardrobeOnly);m_rpgClasses=[];try{var l_classNodes=l_responseXML.getElementsByTagName("class");if(isValid(l_classNodes)&&l_classNodes.length>0){for(var l_index=0;l_index<l_classNodes.length;l_index++){var l_class=new RPGClass(l_classNodes[l_index]);m_rpgClasses.push(l_class)}}}catch(err){}consoleLog("RPG classes::"+m_rpgClasses);var l_viewerInfoNode=getXMLFirstNode(l_responseXML,"viewer");if(isValid(l_viewerInfoNode)){m_viewer.fillSpecificInfoFromXML(l_viewerInfoNode)}if(getBooleanValue(getXMLNodeValue(l_responseXML,"is_cheater"))){m_viewer.setIsCheater(true)}else{m_viewer.setIsCheater(false)}if(getBooleanValue(getXMLNodeValue(l_responseXML,"comments_blocked"))){m_viewer.setCommentsBlocked(true)}else{m_viewer.setCommentsBlocked(false)}try{m_myspace_announcement=getXMLEncodedStringNodeValue(l_responseXML,"myspace_announcement")}catch(err){}try{m_login_message=getXMLEncodedStringNodeValue(l_responseXML,"login_message")}catch(err){}try{m_viewerPokerSessionKey=getXMLNodeValue(l_responseXML,"poker_session_key")}catch(err){}try{var l_maxDepositXML=getXMLFirstNode(l_responseXML,"max_deposit");m_maxDepositScale=parseInt(getXMLNodeValue(l_maxDepositXML,"scale"));m_maxDepositOffset=parseInt(getXMLNodeValue(l_maxDepositXML,"offset"))}catch(err){m_maxDepositScale=0;m_maxDepositOffset=0}try{m_broadcastPerMemberCost=parseInt(getXMLNodeValue(l_responseXML,"broadcast_cost_per_member"))}catch(err){m_broadcastPerMemberCost=25}try{if(isValid(getXMLNodeValue(l_responseXML,"cash_offer_per_level"))){m_cashOfferPerLevel=parseInt(getXMLNodeValue(l_responseXML,"cash_offer_per_level"))}}catch(err){m_cashOfferPerLevel=undefined}var l_configNode=undefined;var userId=undefined;try{l_configNode=getXMLFirstNode(l_responseXML,"config");if(isValid(l_configNode)){var l_choose_offer_network_str=getXMLEncodedStringNodeValue(l_responseXML,"choose_offer_network");if(isValid(l_choose_offer_network_str)){userId=m_viewer.getUserId();m_showOfferNetwork=eval(l_choose_offer_network_str)}else{m_showOfferNetwork="offerpal"}}}catch(err){m_showOfferNetwork="offerpal"}m_useMonetizationIframe=false;try{l_configNode=getXMLFirstNode(l_responseXML,"config");if(isValid(l_configNode)){var l_use_monetization_iframe_str=getXMLEncodedStringNodeValue(l_responseXML,"use_monetization_iframe");if(isValid(l_use_monetization_iframe_str)){userId=m_viewer.getUserId();m_useMonetizationIframe=eval(l_use_monetization_iframe_str)}}}catch(err){}try{m_show_notification=false;var l_show_notification_str=getXMLEncodedStringNodeValue(l_responseXML,"show_notification");if(isValid(l_show_notification_str)){userId=m_viewer.getUserId();m_show_notification=eval(l_show_notification_str)}}catch(err){}try{m_show_multi_user_invite=getBooleanValue(getXMLEncodedStringNodeValue(l_responseXML,"show_multi_user_invite"))}catch(err){}try{var l_featuredItemsNode=getXMLFirstNode(l_responseXML,"featured_item");if(isValid(l_featuredItemsNode)){var l_featuredItemNodes=l_featuredItemsNode.getElementsByTagName("item");if(l_featuredItemNodes.length>0){m_featuredLEItem=new RPGItem(l_featuredItemNodes[0])}}}catch(err){}try{l_configNode=getXMLFirstNode(l_responseXML,"config");if(isValid(l_configNode)){var l_show_featured_LE_item_str=getXMLEncodedStringNodeValue(l_responseXML,"show_featured_le_item");userId=m_viewer.getUserId();m_showFeaturedLEItem=eval(l_show_featured_LE_item_str)}}catch(err){m_showFeaturedLEItem=false}try{l_configNode=getXMLFirstNode(l_responseXML,"config");if(isValid(l_configNode)){var l_show_ccbill_str=getXMLEncodedStringNodeValue(l_responseXML,"show_ccbill");userId=m_viewer.getUserId();m_showCCBill=eval(l_show_ccbill_str)}}catch(err){m_showCCBill=false}try{l_configNode=getXMLFirstNode(l_responseXML,"config");if(isValid(l_configNode)){var l_show_avatar_str=getXMLEncodedStringNodeValue(l_responseXML,"show_avatar");userId=m_viewer.getUserId();m_showAvatar=eval(l_show_avatar_str)}}catch(err){m_showAvatar=false}try{l_configNode=getXMLFirstNode(l_responseXML,"config");if(isValid(l_configNode)){var l_enableActivityFeedStr=getXMLEncodedStringNodeValue(l_responseXML,"activity_feed");userId=m_viewer.getUserId();m_activityFeed=eval(l_enableActivityFeedStr)}}catch(err){m_activityFeed=false}try{l_configNode=getXMLFirstNode(l_responseXML,"config");if(isValid(l_configNode)){var l_show_direct_pay_str=getXMLEncodedStringNodeValue(l_responseXML,"show_direct_pay");userId=m_viewer.getUserId();m_showDirectPay=eval(l_show_direct_pay_str)}}catch(err){m_showDirectPay=false}if(!isOffSite()){m_viewerFriends=GBL.BACKED_USER_CACHED}m_viewerMobRequestList=new CachedUserList(CachedUserList.MY_REQUESTS);m_viewerMobMembersList=new CachedUserList(CachedUserList.MY_MOB);m_finishInitialLoadCallback(l_responseXML);if(!isOffSite()){GBL.APP_USERS_CACHE.fillList(function(){GBL.ALL_USERS_CACHE.fillList(function(){if(GBL.HOT_TIP_DIV){GBL.HOT_TIP_DIV.onLoadedOSFriends()}})})}if(isValid(GBL.FLASH_PROXY_ENABLED)&&GBL.FLASH_PROXY_ENABLED){try{outputDebug("attempting to refresh stat to get auth key");RequestProxyJS.init();var l_params={};l_params.user_id=GBL.MAIN_DATA.getViewer().getUserId();makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/refresh_stat",function(){},l_params)}catch(err){outputDebug(err)}}}function getMyspaceAnnouncement(){return m_myspace_announcement}function getShowNotification(){return m_show_notification}function getShowMultiUserInvite(){return m_show_multi_user_invite}function takeMessageLock(){if(m_message_lock_free){consoleLog("took lock");m_message_lock_free=false;return true}else{consoleLog("could not take lock");return false}}function releaseMessageLock(){consoleLog("released lock");m_message_lock_free=true}function getLoginMessage(){return m_login_message}function setLoginMessage(a_msg){m_login_message=a_msg}function getOwner(){return m_owner}function getViewer(){return m_viewer}function getIsViewerPPUser(){return isValid(m_viewerPokerSessionKey)}function getPPSessionKey(){return m_viewerPokerSessionKey}function getViewerFriends(){return m_viewerFriends}function getAvatarVersion(){return m_avatar_version}function getHasMall(){return m_hasMall}function getHasWardrobeOnly(){return m_hasWardrobeOnly}function getRPGClassByName(a_name){if(isValid(a_name)){for(var i=0;i<m_rpgClasses.length;++i){if(a_name==m_rpgClasses[i].getName()){return m_rpgClasses[i]}}}return undefined}function getRPGClasses(){return m_rpgClasses}function getCachedUsers(a_type){switch(a_type){case CachedUserList.MY_REQUESTS:return m_viewerMobRequestList;case CachedUserList.MY_MOB:return m_viewerMobMembersList}return undefined}function isInit(){return(m_owner!=undefined||m_viewer!=undefined)}function getMaxDepositScale(){return m_maxDepositScale}function getMaxDepositOffset(){return m_maxDepositOffset}}function setViewerFavorPoints(a){if(isValid(a)){GBL.MAIN_DATA.getViewer().setFavorPoints(a);GBL.FAVOR_POINTS_CHANGED=true;MobDoAutoRefresh(true)}}function goToPageTop(){location.href="#mainFrameTop"}function goToPageBroadcast(){location.href="#mainNewsFeedDiv"}function setStyle(b,c){if(c){for(var a in c){if(a=="float"){b.style[CSSFLOAT]=c[a]}else{b.style[a]=c[a]}}}return b}function makeElement(a,d,g,b){var f=document.createElement(a);if(b!=undefined&&b!=null&&b){var c=d.childNodes;if(c.length>0){d.insertBefore(f,c[0])}}else{d.appendChild(f)}return setStyle(f,g)}function makeElementId(b,c,f,d){var a=makeElement(b,c,d);a.id=f;return a}function makeElementClass(a,d,c,g,b){var f=makeElement(a,d,g,b);f.className=c;return f}function navigateToCanvas(){var a=gadgets.views.getSupportedViews();var b=a.canvas;gadgets.views.requestNavigateTo(b)}function formatNumberWithCommasAndSuffix(f,a,c,g){var h=Math.abs(a);var b=Math.abs(f);if(b<h){return formatNumberWithCommas(f)}if(b/c>=100){var d=Math.floor(f/c);return formatNumberWithCommas(d)+g}else{d=Math.floor(f*100/c)/100;return d+g}}function formatNumberWithAbbreviation(a){if(a>=1000000000){return formatNumberWithCommasAndSuffix(a,1000000000,1000000000,"B")}else{if(a>=1000000){return formatNumberWithCommasAndSuffix(a,1000000,1000000,"M")}else{if(a>=10000){return formatNumberWithCommasAndSuffix(a,1000,1000,"K")}else{if(a<=-1000000000){return formatNumberWithCommasAndSuffix(a,-1000000000,1000000000,"B")}else{if(a<=-1000000){return formatNumberWithCommasAndSuffix(a,-1000000,1000000,"M")}else{if(a<=-10000){return formatNumberWithCommasAndSuffix(a,-1000,1000,"K")}else{return formatNumberWithCommas(a)}}}}}}}function formatNumberWithCommas(d){d+="";var c=d.split(".");var f=c[0];var a=c.length>1?"."+c[1]:"";var b=/(\d+)(\d{3})/;while(b.test(f)){f=f.replace(b,"$1,$2")}return f+a}function ParentButton(f,a,d){this.enable=true;var b=makeElement("div",f,{width:"100%",height:"100%",textAlign:"center",verticalAlign:"middle"});b.innerHTML=a;var c=this;addEventWithParameter(b,"click",function(){if(c.enable){d()}})}ParentButton.prototype.setEnabled=function(a){this.enable=a};loadImage("http://cdn0.mobwarsapp.com/rpg_images/opensocial/mob/ui/button/button_blue.png");loadImage("http://cdn0.mobwarsapp.com/rpg_images/opensocial/mob/ui/button/button_blue_click.png");loadImage("http://cdn0.mobwarsapp.com/rpg_images/opensocial/mob/ui/button/button_blue_hover.png");loadImage("http://cdn0.mobwarsapp.com/rpg_images/opensocial/mob/ui/button/button_gray.png");loadImage("http://cdn0.mobwarsapp.com/rpg_images/opensocial/mob/ui/button/button_gray_click.png");loadImage("http://cdn0.mobwarsapp.com/rpg_images/opensocial/mob/ui/button/button_gray_hover.png");function DivButton(k,d,a,f,c,b,g){var h=this;this.m_colorClass="button_blue";if(isValid(b)){this.m_colorClass="button_"+b}this.m_enabled=true;this.m_parentDiv=k;this.m_btnDiv=makeElementClass("div",this.m_parentDiv,"buttonDiv");this.m_btn=makeElementClass("a",this.m_btnDiv,"button");$(this.m_btn).addClass(this.m_colorClass);this.m_btn.href="javascript:void(0);";if(g!=undefined){this.m_btn.href=g}this.m_span=makeElementClass("span",this.m_btn,"buttonBlueText");this.m_span.innerHTML=d;$(this.m_span).css({whiteSpace:"nowrap"});this.m_clearer=makeElement("div",this.m_btnDiv,{clear:"both"});if(c){var l=/Firefox[\/\s](\d+\.\d+)/.test(navigator.userAgent);if(l){setStyle(this.m_btnDiv,{"float":"left",clear:"left",position:"relative",left:"50%",display:"table"});setStyle(this.m_btn,{position:"relative",left:"-50%",textAlign:"left"})}else{setStyle(this.m_btnDiv,{textAlign:"center"});setStyle(this.m_btn,{display:"inline-block",cssFloat:"none",styleFloat:"none"})}}var j=this;if(isValid(a)){$(this.m_btn).click(function(){if(j.m_enabled){a(f)}})}}DivButton.prototype.getButtonDiv=function(){return this.m_btnDiv};DivButton.prototype.setString=function(a){this.m_span.innerHTML=a};DivButton.prototype.alignCenter=function(){var a=/Firefox[\/\s](\d+\.\d+)/.test(navigator.userAgent);if(a){setStyle(this.m_btnDiv,{"float":"left",clear:"left",position:"relative",left:"50%",display:"table"});setStyle(this.m_btn,{position:"relative",left:"-50%",textAlign:"left"})}else{setStyle(this.m_btnDiv,{textAlign:"center"});setStyle(this.m_btn,{display:"inline-block",cssFloat:"none",styleFloat:"none"})}};DivButton.prototype.alignRight=function(){$(this.m_btnDiv).css("float","right")};DivButton.prototype.setColor=function(b){var a="button_blue";if(isValid(b)){a="button_"+b}$(this.m_btn).removeClass(this.m_colorClass).addClass(a);this.m_colorClass=a};DivButton.prototype.setEnabled=function(a){this.m_enabled=a;if(a){$(this.m_btn).removeClass("disabled");$(this.m_btnDiv).removeClass("disabled");$(this.m_btnDiv).fadeTo("fast",1)}else{$(this.m_btn).addClass("disabled");$(this.m_btnDiv).addClass("disabled");$(this.m_btnDiv).fadeTo("fast",0.4)}};DivButton.prototype.setBold=function(a){if(a){$(this.m_span).css({fontWeight:"bold"})}else{$(this.m_span).css({fontWeight:"normal"})}};function ImageDivNoVCrop(b,c,d,a){this.m_imageDiv=document.createElement("div");this.m_imageDiv.style.width=d;this.m_imageDiv.style.overflow="hidden";this.m_imageDiv.innerHTML="<img src='"+c+"' height='"+a+"'>";b.appendChild(this.m_imageDiv)}ImageDivNoVCrop.prototype.getContainerDiv=function(){return this.m_imageDiv};function ImageDiv(m,j,l,a,o){var k=m;var h=j;var d=l;var n=a;var b=o;var g=null;this.createDiv=f;this.getContainerDiv=c;if(k!=undefined){f(k)}function f(p){k=p;g=document.createElement("div");k.appendChild(g);g.style.backgroundImage="url('"+h+"')";g.style.backgroundPosition="center center";g.style.backgroundRepeat="no-repeat";if(isValid(b)&&b){}else{g.style.backgroundColor="#EEEEEE"}g.style.width=d;g.style.height=n}function c(){return g}}function PaginationDiv(n,g,b,f,l){var j=n;var d=undefined;var a=b;var m=f;var k=l;var c=g;if(isValid(j)){h(j)}function h(w){j=w;d=document.createElement("div");j.appendChild(d);d.style.margin="5px 50px 5px 0px";d.style.textAlign="right";if(a>1&&m>1){var q=document.createElement("a");q.href="#";q.className="paginationProgressionLink";q.appendChild(document.createTextNode("prev<<"));d.appendChild(q);addEventWithParameter(q,"click",c,m-1)}d.appendChild(document.createTextNode("  "));var t=Math.max(Math.ceil(l/2),k-(a-m));var p=Math.max(1,m-t);var u=Math.max(Math.ceil(l/2),k-m);var o=Math.min(a,m+u);if(p>1){var x=document.createElement("a");x.appendChild(document.createTextNode("1"));d.appendChild(x);x.href="#";x.className="paginationPageNum";d.appendChild(document.createTextNode("..."));addEventWithParameter(x,"click",c,1)}for(var r=p;r<=o;r++){if(r!=m){x=document.createElement("a");x.href="#";x.className="paginationPageNum";x.appendChild(document.createTextNode(r));d.appendChild(x);addEventWithParameter(x,"click",c,r)}else{var s=document.createElement("span");d.appendChild(s);s.className="paginationCurPageNum";s.appendChild(document.createTextNode(r))}}if(o<a){d.appendChild(document.createTextNode("..."));x=document.createElement("a");x.appendChild(document.createTextNode(a));x.href="#";x.className="paginationPageNum";d.appendChild(x);addEventWithParameter(x,"click",c,a)}if(b>1&&m<b){var v=document.createElement("a");v.href="#";v.className="paginationProgressionLink";v.appendChild(document.createTextNode("next>>"));d.appendChild(v);addEventWithParameter(v,"click",c,m+1)}}}function SideBySideCells(p,h,o){var m=p;var j=undefined;var f=h;var b=undefined;var d=undefined;var k=undefined;var n=o;this.createDiv=l;this.getTable=g;this.getContainerDiv=c;this.getLeftCell=a;this.getRightCell=q;if(m!=undefined){l(m)}function l(t){m=t;j=document.createElement("div");m.appendChild(j);b=document.createElement("table");j.appendChild(b);var r=document.createElement("tbody");b.appendChild(r);var s=document.createElement("tr");r.appendChild(s);d=document.createElement("td");if(n){d.valign=n;d.style.verticalAlign="top"}s.appendChild(d);k=document.createElement("td");if(n){k.vAlign=n;k.style.verticalAlign="top"}s.appendChild(k);if(f){j.style.textAlign="center";b.style.marginLeft="auto";b.style.marginRight="auto"}}function c(){return j}function a(){return d}function q(){return k}function g(){return b}}function SideBySide3Cells(p,j){var o=p;var l=undefined;var f=j;var b=undefined;var d=undefined;var m=undefined;var h=undefined;this.createDiv=n;this.getTable=g;this.getContainerDiv=c;this.getLeftCell=a;this.getRightCell=q;this.getMiddleCell=k;if(o!=undefined){n(o)}function n(t){o=t;l=document.createElement("div");o.appendChild(l);b=document.createElement("table");l.appendChild(b);var r=document.createElement("tbody");b.appendChild(r);var s=document.createElement("tr");r.appendChild(s);d=document.createElement("td");s.appendChild(d);h=document.createElement("td");s.appendChild(h);m=document.createElement("td");s.appendChild(m);if(f){l.style.textAlign="center";b.style.marginLeft="auto";b.style.marginRight="auto"}}function c(){return l}function a(){return d}function q(){return m}function k(){return h}function g(){return b}}function SideBySide3ClassCells(l){var k=l;var b=undefined;var c=undefined;var h=undefined;var f=undefined;this.createDiv=j;this.getTable=d;this.getLeftCell=a;this.getRightCell=m;this.getMiddleCell=g;if(k!=undefined){j(k)}function j(p){k=p;b=makeElementClass("table",k,"side_by_side_three_cell");var n=makeElement("tbody",b);var o=makeElement("tr",n);c=makeElement("td",o);f=makeElement("td",o);h=makeElement("td",o)}function a(){return c}function m(){return h}function g(){return f}function d(){return b}}function TabsDiv(h,f,k,d,g,c,j,l,b,a,m){this.m_showContentDivTopPosition="155px";this.m_hideContentDivTopPosition="-10000px";this.m_parentDiv=h;this.m_tabsNamesArray=f;this.m_tabsCallbacksArray=k;this.m_tabsAlignArray=d;this.m_defaultTabIndex=g;this.m_unSelectedSpanClassName=c;this.m_selectedSpanClassName=j;this.m_leftWidth=l;this.m_contentX=b;this.m_contentYOffset=a;this.m_contentWidth=m;this.m_curSelectedTabIndex=-1;this.m_curSelectedTabContent=undefined;this.m_curSelectedTabCreationCallback=undefined;this.m_curSelectedTabCreationCallbackArgs=undefined;this.m_tabSpansArray=new Array();this.m_containerDiv=undefined;this.m_tabsDiv=undefined;this.m_contentDivArray=new Array();this.m_contentInitializedArray=new Array();this.m_noTabContentDiv=undefined;this.createDiv()}TabsDiv.prototype.decorateUnselectedTab=function(b,a){b.className=this.m_unSelectedSpanClassName};TabsDiv.prototype.decorateSelectedTab=function(b,a){b.className=this.m_selectedSpanClassName};TabsDiv.prototype.createDiv=function(){this.m_showContentDivTopPosition=isValid(this.m_contentYOffset)?(85+this.m_contentYOffset)+"px":"85px";this.m_containerDiv=makeElementClass("div",this.m_parentDiv,"tabContainer");this.m_tabsDiv=makeElementId("div",this.m_containerDiv,"tabsDiv");this.createTabs();var c=makeElementClass("div",this.m_containerDiv,"tabContentFrame");c.style.zIndex="-1";for(var b=0;b<this.m_tabsNamesArray.length;b++){var a=document.createElement("div");a.style.position="absolute";a.style.zIndex="1";a.style.top=this.m_hideContentDivTopPosition;a.style.left=isValid(this.m_contentX)?this.m_contentX:"45px";a.style.width=isValid(this.m_contentWidth)?this.m_contentWidth:"880px";this.m_containerDiv.appendChild(a);this.m_contentDivArray.push(a);this.m_contentInitializedArray.push(false)}this.m_noTabContentDiv=document.createElement("div");this.m_noTabContentDiv.style.position="absolute";this.m_noTabContentDiv.style.zIndex="1";this.m_noTabContentDiv.style.top=this.m_hideContentDivTopPosition;this.m_noTabContentDiv.style.left=isValid(this.m_contentX)?this.m_contentX:"45px";this.m_noTabContentDiv.style.width=isValid(this.m_contentWidth)?this.m_contentWidth:"880px";this.m_containerDiv.appendChild(this.m_noTabContentDiv);if(this.m_defaultTabIndex>=0){this.switchToTab(this.m_defaultTabIndex)}};TabsDiv.prototype.createTabs=function(){this.m_tabsDiv.innerHTML="";var d=makeElementId("table",this.m_tabsDiv,"tabsTable");var a=document.createElement("tbody");d.appendChild(a);var j=document.createElement("tr");a.appendChild(j);var g=makeElementId("td",j,"tabTableLeftCell");var h=makeElementId("td",j,"tabTableRightCell");j.appendChild(g);g.style.textAlign="left";if(isValid(this.m_leftWidth)){if(this.m_leftWidth!="none"){g.style.width=this.m_leftWidth}}else{g.style.width="850px"}var f=this;for(var c=0;c<this.m_tabsNamesArray.length;c++){var b=document.createElement("span");b.style.cursor="pointer";this.decorateUnselectedTab(b,c);b.innerHTML=this.m_tabsNamesArray[c];if(this.m_tabsAlignArray[c]=="right"){h.appendChild(b)}else{g.appendChild(b)}this.m_tabSpansArray.push(b);addEventWithParameter(b,"click",function(k){f.switchToTab(k)},c)}};TabsDiv.prototype.switchToTab=function(c,a){try{if(isValidFunction(refreshAdvertisement)){refreshAdvertisement()}}catch(g){}GBL.REQUIRED_ITEMS=a;if(isValid(GBL.REQUIRED_ITEMS)&&isValid(GBL.REQUIRED_ITEMS.length)&&GBL.REQUIRED_ITEMS.length>0){gaTrackEvent("missing_item_ui","click",this.m_tabsNamesArray[c])}gaTrackPageview("canvas/"+this.m_tabsNamesArray[c]);if(this.m_curSelectedTabIndex>=0){var b=this.m_tabSpansArray[this.m_curSelectedTabIndex];this.decorateUnselectedTab(b,c);var f=this.m_contentDivArray[this.m_curSelectedTabIndex];f.style.top=this.m_hideContentDivTopPosition}this.m_noTabContentDiv.innerHTML="";this.m_noTabContentDiv.style.top=this.m_hideContentDivTopPosition;this.m_curSelectedTabIndex=c;var d=this.m_tabSpansArray[this.m_curSelectedTabIndex];this.decorateSelectedTab(d,c);this.m_curSelectedTabContent=this.m_contentDivArray[this.m_curSelectedTabIndex];this.m_curSelectedTabContent.style.top=this.m_showContentDivTopPosition;this.m_curSelectedTabCreationCallback=this.m_tabsCallbacksArray[this.m_curSelectedTabIndex];this.m_curSelectedTabCreationCallbackArgs=undefined;this.m_curSelectedTabCreationCallback(this.m_curSelectedTabContent,this.m_contentInitializedArray[this.m_curSelectedTabIndex]);this.m_contentInitializedArray[this.m_curSelectedTabIndex]=true;goToPageTop();return false};TabsDiv.prototype.switchToDynamicTab=function(f,b){try{if(isValidFunction(refreshAdvertisement)){refreshAdvertisement()}}catch(d){}if(this.m_curSelectedTabIndex>=0){var a=this.m_tabSpansArray[this.m_curSelectedTabIndex];this.decorateUnselectedTab(a,this.m_curSelectedTabIndex);var c=this.m_contentDivArray[this.m_curSelectedTabIndex];c.style.top=this.m_hideContentDivTopPosition}this.m_curSelectedTabIndex=-1;goToPageTop();this.m_noTabContentDiv.innerHTML="";this.m_noTabContentDiv.style.top=this.m_showContentDivTopPosition;f(this.m_noTabContentDiv,false,b);this.m_curSelectedTabContent=this.m_noTabContentDiv;this.m_curSelectedTabCreationCallback=f;this.m_curSelectedTabCreationCallbackArgs=b;return false};TabsDiv.prototype.refreshTab=function(){if(isValidFunction(this.m_curSelectedTabCreationCallback)&&isValid(this.m_curSelectedTabContent)){try{if(this.m_curSelectedTabCreationCallback==toMyMobTab){return}}catch(a){}this.m_curSelectedTabContent.innerHTML="";this.m_curSelectedTabCreationCallback(this.m_curSelectedTabContent,false,this.m_curSelectedTabCreationCallbackArgs)}};TabsDiv.prototype.invalidateTabs=function(){for(var a=0;a<this.m_contentInitializedArray.length;a++){this.m_contentInitializedArray[a]=false}};TabsDiv.prototype.getTabsDiv=function(){return this.m_tabsDiv};TabsDiv.prototype.switchToTabWithName=function(b,a){var c=this.getTabIndexWithName(b);if(isValid(c)){this.switchToTab(c,a)}};TabsDiv.prototype.invalidateTabWithName=function(a){var b=this.getTabIndexWithName(a);if(isValid(b)){this.m_contentInitializedArray[b]=false}};TabsDiv.prototype.getTabIndexWithName=function(a){for(var b=0;b<this.m_tabsNamesArray.length;b++){if(this.m_tabsNamesArray[b]==a){return b}}return undefined};function SubTabDiv(j,c,d,a,k,b,f,h,g){this.m_parentDiv=j;this.m_containerDiv=undefined;this.m_tabsDiv=undefined;this.m_tabSpans=undefined;this.m_tabContentDiv=undefined;this.m_tabNames=c;this.m_tabCallbacks=d;this.m_maxFontSize=k;this.m_tabContentHeight=b;this.m_tabAlignment=f;this.m_rightMargin=h;this.m_marginTop=g;if(this.m_maxFontSize==undefined||this.m_maxFontSize==null){this.m_maxFontSize=16}if(this.m_tabContentHeight==undefined||this.m_tabContentHeight==null){this.m_tabContentHeight=1000}if(this.m_tabAlignment==undefined||this.m_tabAlignment==null){this.m_tabAlignment="left"}if(this.m_rightMargin==undefined||this.m_rightMargin==null){this.m_rightMargin=0}if(this.m_marginTop==undefined||this.m_marginTop==null){this.m_marginTop=10}this.m_curSelectedTabIndex=-1;this.createDiv()}SubTabDiv.prototype.createDiv=function(){this.m_containerDiv=makeElement("div",this.m_parentDiv);this.m_tabsDiv=makeElement("div",this.m_containerDiv,{padding:"5px 0px 5px 20px",marginLeft:"0px",marginTop:"10px",marginBottom:"0px",marginRight:this.m_rightMargin+"px",textAlign:this.m_tabAlignment});this.m_tabContentDiv=makeElement("div",this.m_containerDiv,{padding:"0px",margin:this.m_marginTop+"px 0px 0px 0px",height:this.m_tabContentHeight+"px",overflow:"auto"});this.m_tabSpans=new Array();for(var a=0;a<this.m_tabNames.length;a++){this.m_tabSpans.push(this.createTab(a))}};SubTabDiv.prototype.createTab=function(a){var c=makeElementClass("span",this.m_tabsDiv,"subTabUnselected");c.innerHTML=this.m_tabNames[a];c.style.fontSize=this.m_maxFontSize-2+"px";var b=this;addEvent(c,"click",function(){b.selectTab(a)});return c};SubTabDiv.prototype.selectTab=function(c){if(c==this.m_curSelectedTabIndex){return}if(this.m_curSelectedTabIndex>=0){var b=this.m_tabSpans[this.m_curSelectedTabIndex];b.className="subTabUnselected";b.style.fontSize=this.m_maxFontSize-2+"px"}this.m_curSelectedTabIndex=c;var a=this.m_tabSpans[this.m_curSelectedTabIndex];a.style.fontSize=this.m_maxFontSize+"px";a.className="subTabSelected";this.m_tabCallbacks[c](this.m_tabContentDiv)};function ImageSubTabDiv(m,n,b,j,h,a,k){this.m_parentDiv=m;this.m_containerDiv=undefined;this.m_tabsDiv=undefined;this.m_tabCells=undefined;this.m_tabContentDiv=undefined;this.m_tabUnselectedStyles=n;this.m_tabSelectedStyles=b;this.m_spacingStyle=j;this.m_tabCallbacks=h;this.m_contentHeight=a;this.m_defaultTabIndex=k;this.m_curSelectedTabIndex=-1;if(isValid(this.m_tabUnselectedStyles)){for(var f in this.m_tabUnselectedStyles){var c=this.m_tabUnselectedStyles[f];var d=c.width.replace("px","");var l=c.height.replace("px","");var g=c.backgroundImage.replace("url(","").replace(")","");preloadImage(d,l,g)}}if(isValid(this.m_tabSelectedStyles)){for(f in this.m_tabSelectedStyles){c=this.m_tabSelectedStyles[f];d=c.width.replace("px","");l=c.height.replace("px","");g=c.backgroundImage.replace("url(","").replace(")","");preloadImage(d,l,g)}}this.createDiv()}ImageSubTabDiv.prototype.createDiv=function(){this.m_containerDiv=makeElement("div",this.m_parentDiv);this.m_tabsDiv=makeElementClass("div",this.m_containerDiv,"image_tab_container",{padding:"5px 0px 5px 20px",marginLeft:"0px",marginTop:"10px",marginBottom:"0px"});this.m_tabContentDiv=makeElementClass("div",this.m_containerDiv,"image_tab_content_div",{padding:"0px",height:this.m_contentHeight,overflow:"auto"});var c=makeElement("table",this.m_tabsDiv,{borderCollapse:"collapse",cellSpacing:"0px"});var f=makeElement("tbody",c);var a=makeElement("tr",f);this.m_tabCells=new Array();for(var d=0;d<this.m_tabUnselectedStyles.length;d++){var b=this.createTab(a,d);this.m_tabCells.push(b)}b=makeElement("td",a);b.innerHTML="&nbsp;";setStyle(b,this.m_spacingStyle);this.selectTab(this.m_defaultTabIndex)};ImageSubTabDiv.prototype.createTab=function(d,a){var c=makeElement("td",d);c.innerHTML="&nbsp;";setStyle(c,this.m_tabUnselectedStyles[a]);var b=this;addEvent(c,"click",function(){b.selectTab(a)});return c};ImageSubTabDiv.prototype.selectTab=function(a){if(!isValid(a)||a<0){return}if(this.m_curSelectedTabIndex>=0){var c=this.m_tabCells[this.m_curSelectedTabIndex];setStyle(c,this.m_tabUnselectedStyles[this.m_curSelectedTabIndex])}this.m_curSelectedTabIndex=a;var b=this.m_tabCells[this.m_curSelectedTabIndex];setStyle(b,this.m_tabSelectedStyles[this.m_curSelectedTabIndex]);if(isValid(this.m_tabCallbacks)&&isValidFunction(this.m_tabCallbacks[a])){this.m_tabCallbacks[a](this.m_tabContentDiv,a)}};ImageSubTabDiv.prototype.getContainerDiv=function(){return this.m_tabContentDiv};function VerticalSubTabDiv(c,f,d,a,b){this.m_parentDiv=c;this.m_containerDiv=undefined;this.m_tabsDiv=undefined;this.m_tabTds=undefined;this.m_tabContentDiv=undefined;this.m_tabNames=f;this.m_tabCallbacks=d;this.m_tabContentHeight=a;this.m_numGuideCells=b;if(!isValid(this.m_numGuideCells)){this.m_numGuideCells=2}this.m_curSelectedTabIndex=-1;this.createDiv()}VerticalSubTabDiv.prototype.createDiv=function(){this.m_containerDiv=makeElement("div",this.m_parentDiv);var h=makeElement("table",this.m_containerDiv);var b=makeElement("tbody",h);var c=makeElement("tr",b);var l=makeElement("td",c,{verticalAlign:"top",paddingTop:"10px"});var a=makeElement("td",c,{verticalAlign:"top"});this.m_tabsDiv=makeElement("div",l,{padding:"0px",margin:"0px"});this.m_tabContentDiv=makeElement("div",a,{padding:"0px",margin:"0px 0px 0px 0px",height:this.m_tabContentHeight,overflow:"hidden"});this.m_tabTds=new Array();var m=makeElement("table",this.m_tabsDiv,{borderCollapse:"collapse",cellSpacing:"0px"});var k=makeElement("tbody",m);var d=undefined;l=undefined;var j=undefined;for(var f=0;f<this.m_tabNames.length;f++){d=makeElement("tr",k);l=makeElement("td",d,{width:"150px",padding:"0px"});j=makeElement("div",l);this.m_tabTds.push(j);this.createTab(f)}for(var g=0;g<this.m_numGuideCells;g++){d=makeElement("tr",k);l=makeElement("td",d,{width:"150px",padding:"0px"});j=makeElement("div",l,{padding:"3px 10px 3px 10px",backgroundColor:"#000000",color:"#000000",fontSize:"12px",fontWeight:"normal",borderRight:"solid 1px #555555"});j.innerHTML="&nbsp;"}};VerticalSubTabDiv.prototype.createTab=function(a){var c=this.m_tabTds[a];this.decorateUnselectedTab(c);c.innerHTML=this.m_tabNames[a];var b=this;addEvent(c,"click",function(){b.selectTab(a)})};VerticalSubTabDiv.prototype.decorateUnselectedTab=function(a){setStyle(a,{textAlign:"left",padding:"3px 10px 3px 10px",backgroundColor:"#000000",color:"#aaaaaa",fontSize:"12px",fontWeight:"normal",cursor:"pointer",borderTop:"solid 1px #555555",borderLeft:"solid 1px #555555",borderBottom:"solid 1px #555555",borderRight:"solid 1px #555555"})};VerticalSubTabDiv.prototype.decorateSelectedTab=function(a){setStyle(a,{padding:"3px 10px 3px 10px",backgroundColor:"#000000",color:"#CD7F32",fontSize:"14px",fontWeight:"bold",cursor:"pointer",borderTop:"solid 1px #555555",borderLeft:"solid 1px #555555",borderBottom:"solid 1px #555555",borderRight:"none"})};VerticalSubTabDiv.prototype.selectTab=function(b){if(this.m_curSelectedTabIndex>=0){var a=this.m_tabTds[this.m_curSelectedTabIndex];this.decorateUnselectedTab(a)}this.m_curSelectedTabIndex=b;var c=this.m_tabTds[this.m_curSelectedTabIndex];this.decorateSelectedTab(c);this.m_tabCallbacks[b](this.m_tabContentDiv)};function TextBoxDiv(k,l){var h=k;var b=l;var c=null;var a=null;this.createDiv=g;this.getText=j;this.getTextArea=f;this.clear=d;if(h!=undefined){g(h)}function g(m){h=m;c=document.createElement("div");h.appendChild(c);a=document.createElement("textarea");c.appendChild(a);a.rows="3";a.style.fontSize="11px";a.style.fontFamily="lucida grande,tahoma,verdana,arial,sans-serif";if(b!=undefined&&b!=null){a.appendChild(document.createTextNode(b))}}function d(){a.innerHTML=""}function j(){return a.value}function f(){return a}}function TextFieldDiv(l,m,n,b){var j=l;var a=m;var d=null;var h=null;var c=n;var f=b;this.createDiv=g;this.getText=k;if(j!=undefined){g(j)}function g(p){j=p;outputDebug("TextFieldDiv: createDiv");d=document.createElement("div");j.appendChild(d);try{h=document.createElement("<input type='text' size='"+c+"' maxlength='"+f+"'/>")}catch(o){h=document.createElement("input");h.type="text";h.size=c;h.maxLength=b}if(a!=undefined&&a!=null){h.value=m}d.appendChild(h)}function k(){return h.value}}function CenteredTextMessageDiv(l,k,j){var h=l;var b=k;var d=j;var g=null;var c=null;this.createDiv=f;this.getTextDiv=a;if(h!=undefined){f(h)}function f(m){h=m;outputDebug("CenteredTextMessageDiv: createDiv");g=makeElement("div",h);g.style.textAlign="center";c=makeElementClass("div",g,"centeredMessage");c.style.width=d;c.innerHTML=b}function a(){return c}}function TextMessageDiv(d,g){var b=d;var a=g;var c=null;this.createDiv=f;this.getContainerDiv=h;if(b!=undefined){f(b)}function f(j){b=j;outputDebug("HTMLDiv: createDiv");c=makeElementClass("div",b,"textMessage");c.innerHTML=a}function h(){return c}}function getLoadingMessageHTML(){return"<span class='loadingMessage'>Loading ...</span>"}function getCenteredLoadingMessageHTML(){return"<div class='centeredLoadingMessage'>Loading ...</div>"}var _myModalDialog=null;function showLoginMessage(b){var a=GBL.MAIN_DATA.getLoginMessage();if(typeof a!="undefined"&&a!=""){_myModalDialog=new ModalDialog(a,null,{Continue:null},ModalDialog.INFO);_myModalDialog.showDialog();GBL.MAIN_DATA.setLoginMessage("")}}function switchAndCloseDialog(a){switchTabs(a);_myModalDialog.hideModaDialog()}function ZoomableImageDiv(r,n,o,q,b,a,h){var p=r;var m=n;var j=o;var g=q;var s=b;var d=a;var c=h;var l=null;this.createDiv=k;this.getContainerDiv=f;if(p!=undefined){k(p)}function k(t){p=t;l=document.createElement("div");p.appendChild(l);l.style.backgroundImage="url('"+m+"')";l.style.backgroundPosition="center center";l.style.backgroundRepeat="no-repeat";l.style.position="relative";if(isValid(d)){l.style.backgroundColor=d}l.style.width=g;l.style.height=s;appendZoomButton(l,j,c)}function f(){return l}}function appendZoomButton(b,a,c){var d=document.createElement("div");d.className="zoomButton";d.title="Click to zoom.";if(isValid(c)){d.scrollAncestor=c}d.onclick=function(g){if(!g){g=window.event}g.cancelBubble=true;if(g.stopPropagation){g.stopPropagation()}var f=findPos(this);zoomIntoImage(a,f[1]-250)};b.appendChild(d)}function findPos(b){var c=curtop=0;var a=new Array();if(b.scrollAncestor){curtop-=b.scrollAncestor.scrollTop}if(b.offsetParent){do{c+=b.offsetLeft;curtop+=b.offsetTop;a.push(b.offsetTop)}while(b=b.offsetParent)}return[c,curtop]}function findMousePos(b){var a=0;var c=0;if(!b){b=window.event}if(b.pageX||b.pageY){a=b.pageX;c=b.pageY}else{if(b.clientX||b.clientY){a=b.clientX+document.body.scrollLeft+document.documentElement.scrollLeft;c=b.clientY+document.body.scrollTop+document.documentElement.scrollTop}}return[a,c]}function zoomIntoImage(a,b){var c=document.getElementById("Popupcontainer");c.innerHTML="<div class='zoomedDiv' onclick='document.getElementById(\"Popupcontainer\").innerHTML=\"\"'><center>Click to close<br>&nbsp;<br><img src='"+a+"'><br>&nbsp;<br>Click to close</center></div>";c.style.top=b}function useGIF(){return(jQuery.browser.version=="6.0"&&jQuery.browser.msie)}function FAQDiv(c,a,b){this.m_parentDiv=c;this.m_containerDiv=undefined;this.m_iframeDiv=undefined;this.m_gameName=a;this.m_faqText=b;this.initialize();this.createDiv()}FAQDiv.prototype.initialize=function(){};FAQDiv.prototype.getFAQDiv=function(){return this.m_containerDiv};FAQDiv.prototype.getIFRAMEDiv=function(){return this.m_iframeDiv};FAQDiv.prototype.createDiv=function(){this.m_containerDiv=makeElementClass("div",this.m_parentDiv,"faq");this.m_containerDiv.innerHTML=this.m_faqText;var a=this;$(makeElementClass("a",this.m_containerDiv,"blueLink bold")).attr("href","#").text("Reset Support page").click(function(){a.showSupportIFrame();return false});$(this.m_containerDiv).append(", ");$(makeElementClass("a",this.m_containerDiv,"blueLink bold")).attr("href","#").text("Terms of Service").click(function(){a.showTermsOfService();return false});$(this.m_containerDiv).append(", ");$(makeElementClass("a",this.m_containerDiv,"blueLink bold")).attr("href","#").text("Privacy Policy").click(function(){a.showPrivacyPolicy();return false});$(this.m_containerDiv).append(", ");$(makeElementClass("a",this.m_containerDiv,"blueLink bold")).attr("href","#").text("Privacy Settings").click(function(){a.showPrivacySettings();return false});this.m_iframeDiv=makeElement("div",this.m_parentDiv);$(this.m_iframeDiv).css({"padding-top":"15px",height:"2000px"})};FAQDiv.prototype.showSupportIFrame=function(){$(this.m_iframeDiv).empty();var f=this.m_gameName;var c=GBL.MAIN_DATA.getViewer().getId();var b=GBL.MAIN_DATA.getViewer().getMobName();var a=GBL.MAIN_DATA.getShowOfferNetwork();var g="http://support-lb.myspacegamingapps.com/";if(REQUEST_DESTINATION_URL.search(/qa|127\.0\.0\.1/)!=-1){g="http://74.86.60.37:8080/"}var d=g+f+"/support_n?user_id="+c+"&amp;network=myspace&amp;user_name="+b+"&amp;reward_page="+a;$(this.m_iframeDiv).html("<iframe id='supportIFrame' frameborder='0' src ='"+d+"' style='width:100%; height:100%; overflow-x: hidden;'></iframe>");$(this.m_iframeDiv).css({border:"none 0px"});goToPageTop()};FAQDiv.prototype.showTermsOfService=function(){$(this.m_iframeDiv).empty();var a="http://cdn0.mobwarsapp.com/fb_mobv2/mobsters_v2/html/tos.html";$(this.m_iframeDiv).html("<iframe frameborder='0' src ='"+a+"' style='border: none 0px; width:100%; height:100%;'></iframe>");goToPageTop()};FAQDiv.prototype.showPrivacyPolicy=function(){$(this.m_iframeDiv).empty();var a="http://cdn0.mobwarsapp.com/fb_mobv2/mobsters_v2/html/pp.html";$(this.m_iframeDiv).html("<iframe frameborder='0' src ='"+a+"' style='border: none 0px; width:100%; height:100%;'></iframe>");goToPageTop()};FAQDiv.prototype.showPrivacySettings=function(){$(this.m_iframeDiv).empty();new PrivacySettingsDiv(this.m_iframeDiv)};PDDialog.maxZIndex=100;function makePDDialog(a){return new PDDialog(checkValid(a.titleDiv,document.createElement("div")),checkValid(a.contentDiv,document.createElement("div")),checkValid(a.width,600),checkValid(a.height,undefined),checkValid(a.dialogStyle,{}),checkValid(a.cancelCallback,undefined))}function PDDialog(g,c,f,b,d,a){this.m_titleDiv=g;this.m_contentDiv=c;this.m_onCancellCallback=a;this.m_width=f;this.m_height=b;this.m_dialogStyle=d;this.m_moveOnResize=true;this.m_overlay=undefined;this.m_dialog=undefined}PDDialog.prototype.showDialog=function(g){var d=this;d.m_overlay=document.createElement("div");document.body.appendChild(d.m_overlay);$(d.m_overlay).addClass("pd_dialog_overlay");var c=2000;if(isValid($("mainFrame"))&&isValid($("mainFrame").clientHeight)){c=Math.max(c,document.getElementById("mainFrame").clientHeight)}$(d.m_overlay).css({position:"absolute",left:"0px",top:"0px",height:c+"px",width:"100%",zIndex:(PDDialog.maxZIndex++),backgroundColor:"#aaaaaa",opacity:"0.5",margin:"0px auto",textAlign:"center"});d.m_dialog=document.createElement("div");document.body.appendChild(d.m_dialog);$(d.m_dialog).addClass("pd_dialog_content");var b=300;var f=(document.body.clientWidth-d.m_width)/2;$(d.m_dialog).css({padding:"0px",margin:"auto",top:b+"px",left:f+"px",verticalAlign:"top",border:"8px solid #555555",zIndex:(PDDialog.maxZIndex++),opacity:"1",position:"absolute"});if(isValid(this.m_height)){$(this.m_dialog).css("height",this.m_height+"px")}if(isValid(this.m_width)){$(this.m_dialog).css("width",this.m_width+"px")}if(isValid(this.m_dialogStyle)){$(this.m_dialog).css(this.m_dialogStyle)}var a=document.createElement("div");d.m_dialog.appendChild(a);$(a).addClass("cancel_button");addEvent(a,"click",function(){d.cancellModalDialog()});addEvent(a,"mouseover",function(){$(a).css({color:"#FF0000"})});addEvent(a,"mouseout",function(){$(a).css({color:"#FFFFFF"})});a.innerHTML="X";$(a).css({position:"absolute",zIndex:"102",top:"0px",right:"0px",cursor:"pointer",height:"15px",width:"15px",background:"#555555",textAlign:"center",fontFamily:"arial",fontSize:"11px",fontWeight:"800",color:"#FFFFFF"});d.m_dialog.appendChild(d.m_titleDiv);d.m_dialog.appendChild(d.m_contentDiv);if(!(isValid(g)&&g)){new DivButton(d.m_dialog,"OK",function(){d.cancellModalDialog()},undefined,true,undefined,undefined)}};PDDialog.prototype.cancellModalDialog=function(){this.hideModalDialog();if(isValidFunction(this.m_onCancellCallback)){this.m_onCancellCallback()}};PDDialog.prototype.hideModalDialog=function(){$(this.m_overlay).remove();$(this.m_dialog).remove()};PDDialog.prototype.setBorderColor=function(a){$(this.m_dialog).css("border","8px solid "+a);$(this.m_dialog).children(".cancel_button").css("background",a)};function hideALLPDDialog(){$(".pd_dialog_overlay").remove();$(".pd_dialog_content").remove()}ModalDialog.ERROR=0;ModalDialog.WARNING=1;ModalDialog.INFO=2;ModalDialog.QUESTION=3;function ModalDialog(d,c,a,b){this.type=ModalDialog.ERROR;this.button_n_params=a;this.title=null;this.text=d;this.hederImage=null;this.iconImage=null;this.height=200;this.width=500;this.wrapper=null;this.moveOnResze=false;if(b!=null&&b!=undefined){this.type=b}if(c==null||c==undefined){switch(this.type){case ModalDialog.ERROR:this.title="Error Occurred";break;case ModalDialog.WARNING:this.title="Warning";break;case ModalDialog.INFO:this.title="Information";break;case ModalDialog.QUESTION:this.title="Question...";break;default:this.title="Error Occurred"}}else{this.title=c}switch(this.type){case ModalDialog.ERROR:this.headerImage="http://cdn0.mobwarsapp.com/rpg_images/opensocial/mob/ui/error_stripe.gif";this.iconImage="http://cdn0.mobwarsapp.com/rpg_images/opensocial/mob/ui/icon_error.png";break;case ModalDialog.WARNING:this.headerImage="http://cdn0.mobwarsapp.com/rpg_images/opensocial/mob/ui/warning_stripe.gif";this.iconImage="http://cdn0.mobwarsapp.com/rpg_images/opensocial/mob/ui/icon_warning.png";break;case ModalDialog.INFO:this.headerImage="http://cdn0.mobwarsapp.com/rpg_images/opensocial/mob/ui/info_stripe.gif";this.iconImage="http://cdn0.mobwarsapp.com/rpg_images/opensocial/mob/ui/icon_info.png";break;case ModalDialog.QUESTION:this.headerImage="http://cdn0.mobwarsapp.com/rpg_images/opensocial/mob/ui/question_stripe.gif";this.iconImage="http://cdn0.mobwarsapp.com/rpg_images/opensocial/mob/ui/icon_question.png";break;default:this.headerImage="http://cdn0.mobwarsapp.com/rpg_images/opensocial/mob/ui/error_stripe.gif";this.iconImage="http://cdn0.mobwarsapp.com/rpg_images/opensocial/mob/ui/icon_error.png"}if(this.button_n_params==undefined||this.button_n_params==null){this.button_n_params={Close:null}}}ModalDialog.prototype.moveOnResize=function(b){var a=this;a.moveOnResze=b;if(a.moveOnResze){function d(){var f=(document.body.clientHeight-a.height)/2;var g=(document.body.clientWidth-a.width)/2;$(a.wrapper).css({top:f+"px",left:g+"px"})}window.onresize=d}else{var c=(document.body.clientWidth-a.width)/2;$(a.wrapper).css({top:"100px",left:c+"px"});goToPageTop()}};ModalDialog.prototype.setDimensions=function(a,b){this.height=a;this.width=b};ModalDialog.prototype.showDialog=function(){var n=this;var d=document.createElement("div");d.setAttribute("id","modal_overlay_id");var k="#f4f4f4";var p=2000;if(document.getElementById("mainFrame")!=null&&document.getElementById("mainFrame").clientHeight!=null){p=document.getElementById("mainFrame").clientHeight}$(d).css({position:"absolute",left:"0px",top:"0px",height:p+"px",width:"100%",zIndex:"10",backgroundColor:k,opacity:"0.5",margin:"0px auto",textAlign:"center"});this.wrapper=document.createElement("div");var o=(document.body.clientHeight-n.height)/2;var j=(document.body.clientWidth-n.width)/2;$(this.wrapper).css({padding:"0px",margin:"auto",top:o+"px",left:j+"px",height:n.height+"px",width:n.width+"px",backgroundColor:"#fff",verticalAlign:"top",border:"5px solid #E5E5E5",zIndex:"11",opacity:"1",position:"absolute"});this.wrapper.setAttribute("id","modal_dialog_id");document.body.appendChild(d);document.body.appendChild(this.wrapper);var q=document.createElement("table");$(q).css({width:"100%",height:"100%",border:"2px solid #999",padding:"0px",margin:"0px",zIndex:"12"});var f=document.createElement("tbody");q.appendChild(f);var b=document.createElement("tr");var m=document.createElement("td");b.appendChild(m);f.appendChild(b);$(m).css({background:"transparent url("+n.headerImage+") repeat scroll left top",height:"14px"});var h=document.createElement("tr");var c=document.createElement("td");h.appendChild(c);$(c).css({textAlign:"center"});$(c).html('<table style="margin-left:50px;margin-right:10px;font-family:Georgia, Aria, sans-serif;"><tr><td style="vertical-align:top;width:50px" rowspan="2"><img src="'+this.iconImage+'" style="height:48px;width:48px;" /></td><td style="border-bottom:1px solid #ccc;font-weight:bold;">'+n.title+"</td></tr><tr><td>"+n.text+"</td></tr></table>");f.appendChild(h);var a=document.createElement("tr");var l=document.createElement("td");a.appendChild(l);f.appendChild(a);$(l).css({textAlign:"center"});for(var g in n.button_n_params){l.appendChild(n.constructButton(g,n.button_n_params[g]))}n.wrapper.appendChild(q);n.moveOnResize(n.moveOnResze)};ModalDialog.prototype.constructButton=function(b,f){var a=this;if(f==null){f=a.hideModaDialog}var c=document.createElement("input");c.setAttribute("type","button");c.setAttribute("value",b);var d=function(){if(f){f()}a.hideModaDialog()};$(c).click(d);$(c).css({marginRight:"10px"});return c};ModalDialog.prototype.hideModaDialog=function(){$("#modal_dialog_id").remove();$("#modal_overlay_id").remove()};function DynamicFloatingMessage(l,m,c,f,n,a){this.title=l;this.text=m;this.clickCallback=c;this.hideDelay=(f!=undefined&&f!=null)?f:5000;this.height=(n!=undefined&&n!=null)?n:60;this.width=(a!=undefined&&a!=null)?a:250;var g=document.body.clientHeight;var o=document.body.clientWidth;var k=document.createElement("div");document.body.appendChild(k);if(this.text.length>87){this.text=this.text.substring(0,84)+"..."}this.unique_id="dynamic_floatingMessage_div_"+(new Date().getTime());k.setAttribute("id",this.unique_id);$(k).css({position:"absolute",height:this.height+"px",width:this.width+"px",backgroundColor:"#f4f4f4",border:"1px solid black",zIndex:9,display:"none",verticalAlign:"top"});var b=g-this.height-20;var h=o-this.width-20;$(k).html('<table style="width:100%;"><tr><td style="vertical-align:top;font-family:Georgia, Aria, sans-serif;font-size:11px;font-weight:bold">'+this.title+'</td><td style="width:30px;text-align:right;"><a href="javascript:void(0);" onclick="DynamicFloatingMessage_remove(\''+this.unique_id+'\');" style="font-size:11px;color:#0099FF;">close</a></td></tr><tr><td colspan="2" style="vertical-align:top;font-family:Georgia, Aria, sans-serif;cursor:pointer;font-size:11px;"><div id="dynamic_floatingMessage_div_message_id">'+this.text+"</td></tr></table>");var j=this;var d=function(){if(c){c()}DynamicFloatingMessage_remove(j.unique_id)};$("#dynamic_floatingMessage_div_message_id").click(c);$(k).css({top:b,left:h});$(k).show(500);setTimeout("DynamicFloatingMessage_remove('"+j.unique_id+"')",this.hideDelay)}function DynamicFloatingMessage_remove(a){$("#"+a).slideUp(300,function(){$("#"+a).remove()})}function preloadImage(c,a,b){if(document.images){var d=new Image(c,a);d.src=b;return d}return undefined}function loadImage(a){if(document.images){var b=new Image();b.src=a;return b}return undefined}(function(c){var b=c.browser.msie&&parseInt(c.browser.version)==6&&typeof window.XMLHttpRequest!="object",d=null,a=[];c.modal=function(g,f){return c.modal.impl.init(g,f)};c.modal.close=function(){c.modal.impl.close()};c.fn.modal=function(f){return c.modal.impl.init(this,f)};c.modal.defaults={opacity:50,overlayId:"simplemodal-overlay",overlayCss:{},containerId:"simplemodal-container",containerCss:{},dataCss:{},zIndex:1000,close:true,closeHTML:'<a class="modalCloseImg" title="Close"></a>',closeClass:"simplemodal-close",position:null,persist:false,onOpen:null,onShow:null,onClose:null};c.modal.impl={opts:null,dialog:{},init:function(g,f){if(this.dialog.data){return false}d=c.browser.msie&&!c.boxModel;this.opts=c.extend({},c.modal.defaults,f);this.zIndex=this.opts.zIndex;this.occb=false;if(typeof g=="object"){g=g instanceof jQuery?g:c(g);if(g.parent().parent().size()>0){this.dialog.parentNode=g.parent();if(!this.opts.persist){this.dialog.orig=g.clone(true)}}}else{if(typeof g=="string"||typeof g=="number"){g=c("<div/>").html(g)}else{alert("SimpleModal Error: Unsupported data type: "+typeof g);return false}}this.dialog.data=g.addClass("simplemodal-data").css(this.opts.dataCss);g=null;this.create();this.open();if(c.isFunction(this.opts.onShow)){this.opts.onShow.apply(this,[this.dialog])}return this},create:function(){a=this.getDimensions();if(b){this.dialog.iframe=c('<iframe src="javascript:false;"/>').css(c.extend(this.opts.iframeCss,{display:"none",opacity:0,position:"fixed",height:a[0],width:a[1],zIndex:this.opts.zIndex,top:0,left:0})).appendTo("body")}this.dialog.overlay=c("<div/>").attr("id",this.opts.overlayId).addClass("simplemodal-overlay").css(c.extend(this.opts.overlayCss,{display:"none",opacity:this.opts.opacity/100,height:a[0],width:a[1],position:"fixed",left:0,top:0,zIndex:this.opts.zIndex+1})).appendTo("body");this.dialog.container=c("<div/>").attr("id",this.opts.containerId).addClass("simplemodal-container").css(c.extend(this.opts.containerCss,{display:"none",position:"fixed",zIndex:this.opts.zIndex+2})).append(this.opts.close?c(this.opts.closeHTML).addClass(this.opts.closeClass):"").appendTo("body");this.setPosition();if(b||d){this.fixIE()}this.dialog.container.append(this.dialog.data.hide())},bindEvents:function(){var f=this;c("."+this.opts.closeClass).bind("click.simplemodal",function(g){g.preventDefault();f.close()});c(window).bind("resize.simplemodal",function(){a=f.getDimensions();f.setPosition();if(b||d){f.fixIE()}else{f.dialog.iframe&&f.dialog.iframe.css({height:a[0],width:a[1]});f.dialog.overlay.css({height:a[0],width:a[1]})}})},unbindEvents:function(){c("."+this.opts.closeClass).unbind("click.simplemodal");c(window).unbind("resize.simplemodal")},fixIE:function(){var f=this.opts.position;c.each([this.dialog.iframe||null,this.dialog.overlay,this.dialog.container],function(r,k){if(k){var p="document.body.clientHeight",u="document.body.clientWidth",w="document.body.scrollHeight",t="document.body.scrollLeft",n="document.body.scrollTop",j="document.body.scrollWidth",h="document.documentElement.clientHeight",q="document.documentElement.clientWidth",o="document.documentElement.scrollLeft",x="document.documentElement.scrollTop",y=k[0].style;y.position="absolute";if(r<2){y.removeExpression("height");y.removeExpression("width");y.setExpression("height",""+w+" > "+p+" ? "+w+" : "+p+' + "px"');y.setExpression("width",""+j+" > "+u+" ? "+j+" : "+u+' + "px"')}else{var m,g;if(f&&f.constructor==Array){var v=f[0]?typeof f[0]=="number"?f[0].toString():f[0].replace(/px/,""):k.css("top").replace(/px/,"");m=v.indexOf("%")==-1?v+" + (t = "+x+" ? "+x+" : "+n+') + "px"':parseInt(v.replace(/%/,""))+" * (("+h+" || "+p+") / 100) + (t = "+x+" ? "+x+" : "+n+') + "px"';if(f[1]){var l=typeof f[1]=="number"?f[1].toString():f[1].replace(/px/,"");g=l.indexOf("%")==-1?l+" + (t = "+o+" ? "+o+" : "+t+') + "px"':parseInt(l.replace(/%/,""))+" * (("+q+" || "+u+") / 100) + (t = "+o+" ? "+o+" : "+t+') + "px"'}}else{m="("+h+" || "+p+") / 2 - (this.offsetHeight / 2) + (t = "+x+" ? "+x+" : "+n+') + "px"';g="("+q+" || "+u+") / 2 - (this.offsetWidth / 2) + (t = "+o+" ? "+o+" : "+t+') + "px"'}y.removeExpression("top");y.removeExpression("left");y.setExpression("top",m);y.setExpression("left",g)}}})},getDimensions:function(){var g=c(window);var f=c.browser.opera&&c.browser.version>"9.5"&&c.fn.jquery<="1.2.6"?document.documentElement.clientHeight:g.height();return[f,g.width()]},setPosition:function(){var j,h,g=(a[0]/2)-((this.dialog.container.height()||this.dialog.data.height())/2),f=(a[1]/2)-((this.dialog.container.width()||this.dialog.data.width())/2);if(this.opts.position&&this.opts.position.constructor==Array){j=this.opts.position[0]||g;h=this.opts.position[1]||f}else{j=g;h=f}this.dialog.container.css({left:h,top:j})},open:function(){this.dialog.iframe&&this.dialog.iframe.show();if(c.isFunction(this.opts.onOpen)){this.opts.onOpen.apply(this,[this.dialog])}else{this.dialog.overlay.show();this.dialog.container.show();this.dialog.data.show()}this.bindEvents()},close:function(){if(!this.dialog.data){return false}if(c.isFunction(this.opts.onClose)&&!this.occb){this.occb=true;this.opts.onClose.apply(this,[this.dialog])}else{if(this.dialog.parentNode){if(this.opts.persist){this.dialog.data.hide().appendTo(this.dialog.parentNode)}else{this.dialog.data.remove();this.dialog.orig.appendTo(this.dialog.parentNode)}}else{this.dialog.data.remove()}this.dialog.container.remove();this.dialog.overlay.remove();this.dialog.iframe&&this.dialog.iframe.remove();this.dialog={}}this.unbindEvents()}}})(jQuery);function CustomTab(c,a,d,f,b){this.m_name=c;this.m_tabCreateCallback=a;this.m_contentCreateCallback=d;this.m_selectedCallback=f;this.m_unselectedCallback=b}CustomTab.prototype.getName=function(){return this.m_name};CustomTab.prototype.getTabCreateCallback=function(){return this.m_tabCreateCallback};CustomTab.prototype.getContentCreateCallback=function(){return this.m_contentCreateCallback};CustomTab.prototype.getSelectedCallback=function(){return this.m_selectedCallback};CustomTab.prototype.getUnselectedCallback=function(){return this.m_unselectedCallback};function CustomTabDiv(a,b){this.m_parentDiv=a;this.m_containerDiv=makeElement("div",this.m_parentDiv);this.m_tabs=b;this.m_tabsDiv=undefined;this.m_tabCells=undefined;this.m_tabContentDiv=undefined;this.m_tabNames=undefined;this.createDiv()}CustomTabDiv.prototype.createDiv=function(){this.m_tabNames={};for(var b=0;b<this.m_tabs.length;++b){this.m_tabNames[this.m_tabs[b].getName()]=b}this.m_curSelectedTabIndex=-1;$(this.m_containerDiv).html("");this.m_tabsDiv=makeElement("div",this.m_containerDiv,{padding:"5px 0px 5px 0px",marginLeft:"0px",marginTop:"0px",marginBottom:"0px"});this.m_tabTable=makeElement("ul",this.m_tabsDiv,{padding:"0px",margin:"0px",textAlign:"left",borderCollapse:"collapse",cellSpacing:"0px",border:"none"});this.m_tabCells=new Array();for(var c=0;c<this.m_tabs.length;c++){var a=this.createTab(this.m_tabTable,c);this.m_tabCells.push(a)}this.m_tabContentDiv=makeElement("div",this.m_containerDiv,{padding:"0px",height:"0px",overflow:"auto"})};CustomTabDiv.prototype.getTabDiv=function(){return this.m_tabsDiv};CustomTabDiv.prototype.getTabTable=function(){return this.m_tabTable};CustomTabDiv.prototype.createTab=function(d,a){var c=makeElement("li",d,{display:"inline",cursor:"pointer"});c.innerHTML="";this.m_tabs[a].getTabCreateCallback()(c);var b=this;$(c).bind("click",function(){b.selectTab(a)});return c};CustomTabDiv.prototype.selectTab=function(b){if(!isValid(b)||b<0||b==this.m_curSelectedTabIndex){return}if(this.m_curSelectedTabIndex>=0){var a=this.m_curSelectedTabIndex;var f=this.m_tabCells[a];this.m_tabs[a].getUnselectedCallback()(f)}this.m_curSelectedTabIndex=b;var c=this.m_curSelectedTabIndex;var d=this.m_tabCells[c];this.m_tabs[c].getSelectedCallback()(d);this.m_tabs[c].getContentCreateCallback()(this.m_tabContentDiv)};CustomTabDiv.prototype.selectTabByName=function(a){var b=this.m_tabNames[a];if(isValid(b)&&b>=0){this.selectTab(b)}};CustomTabDiv.prototype.removeTab=function(a){var b=this.m_tabNames[a];if(isValid(b)&&b>=0){this.m_tabs.splice(b,1);this.createDiv();if(this.m_tabs.length>0){this.selectTab(0)}}};CustomTabDiv.imageTabDomFunc=function(b,a){return function(f){$(f).html("");var d=makeElementClass("img",f,"TabUnselected");d.src=a;var c=makeElementClass("img",f,"TabSelected");c.src=b;$(c).hide()}};CustomTabDiv.showTabContentFunc=function(a,b){return function(c){$(c).hide();$("."+b).hide();$(a).show()}};CustomTabDiv.tabSelectedFunc=function(a,b){return function(c){GBL[b]=a;$(c).children(".TabUnselected").hide();$(c).children(".TabSelected").show()}};CustomTabDiv.tabUnselectedFunc=function(){return function(a){$(a).children(".TabSelected").hide();$(a).children(".TabUnselected").show()}};if(!isValid(GBL.TRANSFORMATION)){GBL.TRANSFORMATION={}}if(!isValid(GBL.TRANSFORMATION.encoded_string)){GBL.TRANSFORMATION.encoded_string=function(b,a){$(a).text(customDecoding($(a).text()))}}function setInnerHTML(b,a,c){if(!isValid(b)||!isValid(a)){return}$(b).html(a);if(!isValid(c)){if(!isValid(GBL.TRANSFORMATION)){return}else{c=GBL.TRANSFORMATION}}jQuery.each(c,function(d,f){if(isValidFunction(f)){$(b).find("."+d).each(f)}})}function handleItemsGrid(h,g,f,c,l){if(isValid(l)==false){l=3}var k=makeElement("table",h);var b=makeElement("tbody",k);var d=makeElement("tr",b);var a=undefined;var j=undefined;jQuery.each(g,function(o,n){if(o%l==0){a=makeElement("tr",b);j=makeElement("tr",b)}var m=makeElement("td",a);var p=makeElement("td",j);f(m,n);c(p,n)});return k}jQuery.fn.fadeToggle=function(a,c,b){return this.animate({opacity:"toggle"},a,c,b)};var $guid=jQuery.data;function HelpfulInput(b,c,d){var a=this;this.m_input=makeElementClass("input",b,"helpful_input");this.m_input.size=30;this.m_input.style.fontFamily="verdana";this.m_help=c;$(this.m_input).val(this.m_help);this.m_hasText=false;if(!isValid(d)){$(this.m_input).focus(this.hideHelp.bind(this)).blur(this.showHelp.bind(this)).keyup(this.keyup.bind(this))}this.showHelp()}extendClass(HelpfulInput,EventDispatcher);HelpfulInput.prototype.showHelp=function(){if(!this.m_hasText){$(this.m_input).val(this.m_help)}};HelpfulInput.prototype.hideHelp=function(){if(!this.m_hasText){$(this.m_input).val("")}$(this.m_input).removeClass("helpful_input_blank")};HelpfulInput.prototype.keyup=function(){this.m_hasText=$(this.m_input).val()!="";this.hideHelp()};HelpfulInput.prototype.getInput=function(){return this.m_input};HelpfulInput.prototype.getValue=function(){if(this.m_hasText){return this.m_input.value}else{return""}};HelpfulInput.prototype.getValueIncludeDefault=function(){return this.m_input.value};function EventDispatcher(){this.m_handlers={}}EventDispatcher.prototype.bind=function(b,a){if(!this.m_handlers[b]){this.m_handlers[b]={}}this.m_handlers[b][$guid(a)]=a;return this};EventDispatcher.prototype.unbind=function(c,a){try{delete this.m_handlers[c][$guid(a)]}catch(b){}return this};EventDispatcher.prototype.trigger=function(g,j,h,d){var c=this.m_handlers[g];if(!c){return}var b=[];for(var f=1;f<arguments.length;++f){b.push(arguments[f])}for(var a in c){c[a].apply(this,b)}return this};EventDispatcher.prototype.declareEvent=function(a){this.m_handlers[a]={};return this};function JTimer(c,a){var h=false;this.start=b;this.stop=g;this.tick=f;this.isRunning=k;var j=this;var d=function(){j.tick()};function b(){h=true;f()}function k(){return h}function g(){h=false}function f(){if(h){a();window.setTimeout(d,c)}}}function gifTrack(d,f){var c=+new Date();var b="http://install-dynamic-lb.playdom.com/log.gif?c="+c+"&app="+d;for(l_key in f){b+="&"+l_key+"="+f[l_key]}var a=new Image();a.src=b}function ProgressBar(b,a){if(!isValid(a)){a={}}this.m_parent=b;this.m_barDiv=makeElement("div",this.m_parent,{margin:"0px",padding:"0px",fontSize:"0px",textAlign:"left"});this.m_color="#8F1319";this.m_borderColor="#B9BBC0";this.m_percent=0;this.m_percentVal=0;this.m_width=116;this.m_height=10;this.m_border=1;this.m_textColor=isValid(a.textColor)?a.textColor:"white";this.m_innerBorderColor=isValid(a.innerBorderColor)?a.innerBorderColor:"black";this.m_borderColor=isValid(a.borderColor)?a.borderColor:"#B9BBC0";this.m_barBackground=isValid(a.barBackground)?a.barBackground:"http://cdn0.mobwarsapp.com/rpg_images/opensocial/mob/ui/mastery/mastery_bar_gradient.gif";this.m_barBackgroundColor=isValid(a.barBackgroundColor)?a.barBackgroundColor:"";this.createDiv()}ProgressBar.prototype.createDiv=function(){$(this.m_barDiv).html("");var g=makeElement("ul",this.m_barDiv,{margin:"0px",padding:"0px",display:"inline",listStyleType:"none"});var j=IE?(this.m_width-(0)):(this.m_width+(2*this.m_border));var c=IE?(this.m_height-(0)):(this.m_height+(2*this.m_border));j=Math.max(0,j);c=Math.max(0,c);var a=makeElement("li",g);$(a).css({width:j+"px",border:(this.m_border+"px")+" solid "+(this.m_borderColor),CSSFLOAT:"left",position:"relative",backgroundColor:this.m_barBackgroundColor});var b=IE?(this.m_percent-(0)):(this.m_percent);var f=IE?(this.m_height-(0)):(this.m_height);b=Math.max(0,b);f=Math.max(0,f);var d=makeElement("div",a);$(d).css({width:"100%",position:"absolute",textAlign:"center",verticalAlign:"middle",color:this.m_textColor,fontSize:"10px",paddingTop:"0px",paddingBottom:"0px",fontFamily:"verdana"});$(d).html(this.m_percentVal+"%");var h=makeElement("div",a);if(b!=0){$(h).css({width:b+"px",height:f+"px",background:"url("+this.m_barBackground+")",border:(this.m_border+"px")+" solid "+this.m_innerBorderColor,fontSize:"10px",fontFamily:"verdana"})}else{$(h).css({width:b+"px",height:f+"px",backgroundColor:"transparent",border:(this.m_border+"px")+" solid transparent",fontSize:"10px",fontFamily:"verdana"})}};ProgressBar.prototype.setVal=function(b,a){b=isValid(b)?b:0;a=isValid(a)?a:this.m_width;b=Math.max(0,b);b=Math.min(b,a);this.m_percentVal=Math.floor(b*100/a);this.m_percent=Math.floor(b*this.m_width/a);this.createDiv()};function hugeQuote(b){var a=makeElementClass("span",b,"huge_quote");$(a).text('"')}function avatarMakeThumbNice(a){if(isValid(a)){if(a.search(".gif")){a=a.replace(".gif",".png")}}return a}if(!Array.clearAll){Array.prototype.clearAll=function(){return this.splice(0,this.length)}}function makeSafeImage(a,b){if(isIE6()){a.style.cssText="_filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=scale, src='"+b+"')";a.src=b}else{a.src=b}}function makeSafeBackground(b,a){if(isIE6()){b.style.cssText="_filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=scale, src='"+a+"')"}else{b.style.backgroundImage="url('"+a+"')"}}function makeSafeBackgroundNoRepeat(f,b,d,a){if(isIE6()){var c="";if(isValid(d)){c+="width: "+d+"px;"}if(isValid(a)){c+="height: "+a+"px;"}f.style.cssText=c+" _filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=crop, src='"+b+"')"}else{f.style.background="no-repeat url('"+b+"')"}}function makeSafeBackgroundInChild(g,c,f,b){var a=makeElementClass("div",g,"",{width:f+"px",height:b+"px"});if(isIE6()){var d="";if(isValid(f)){d+="width: "+f+"px;"}if(isValid(b)){d+="height: "+b+"px;"}a.style.cssText=d+" _filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=crop, src='"+c+"')"}else{a.style.background="no-repeat url('"+c+"')"}}function removeElement(a){if(isValid(a)){$(a).empty().remove()}}function emptyElement(a){if(isValid(a)){$(a).empty()}}function setNumericInputValue(h,d,a){var b=h.value;if(b.length==0){h.value=0;return true}var j="[0-9]*";j="^"+j;j=j+"$";var f=new RegExp(j);if(f.test(b)){h.value=(isValid(d))?Math.max(d,parseInt(h.value)):h.value;h.value=(isValid(a))?Math.min(a,parseInt(h.value)):h.value;return true}var g="[^0-9]";var c=new RegExp(g,"g");b=b.replace(c,"");h.value=b;h.value=(isValid(d))?Math.max(d,parseInt(h.value)):h.value;h.value=(isValid(a))?Math.min(a,parseInt(h.value)):h.value;return true}function getNumericInputValue(f){var a=f.value;var g="[0-9]*";g="^"+g;g=g+"$";var c=new RegExp(g);if(c.test(a)){return isNaN(a)?0:parseInt(a)}var d="[^0-9]";var b=new RegExp(d,"g");a=a.replace(b,"");f.value=a;return isNaN(a)?0:parseInt(a)}function validateNumericInputValue(a){var b;var d=false;var f;var c;if(window.event){b=a.keyCode;d=window.event.ctrlKey}else{if(a.which){b=a.which;d=a.ctrlKey}}if(isNaN(b)){return true}f=String.fromCharCode(b);if(b==8||d){return true}c=/\d/;return c.test(f)}function updateUserStatus(b){var a=getXMLFirstNode(b,"viewer");if(isValid(a)){GBL.MAIN_DATA.getViewer().fillSpecificInfoFromXML(a);if(isValid(GBL.STATUS_DIV)&&isValid(GBL.REFRESH_STATUS)){GBL.STATUS_DIV.refreshStatus();GBL.REFRESH_STATUS.refreshStatus()}}}function TwoColumnLayout(a){this.m_parentDiv=a;this.m_frameTable=undefined;this.m_leftColumn=undefined;this.m_marginColumn=undefined;this.m_rightColumn=undefined;this.createDiv()}TwoColumnLayout.prototype.createTwoColumn=function(){this.m_frameTable=makeElement("table",this.m_parentDiv);$(this.m_frameTable).attr({cellSpacing:0,cellPadding:0});var a=makeElement("tr",makeElement("tbody",this.m_frameTable));this.m_leftColumn=makeElement("td",a,{width:"500px",position:"relative",verticalAlign:"top"});this.m_marginColumn=makeElement("td",a,{width:"10px",position:"relative"});this.m_rightColumn=makeElement("td",a,{position:"relative",verticalAlign:"top"})};TwoColumnLayout.prototype.createDiv=function(){this.createTwoColumn()};TwoColumnLayout.prototype.getTable=function(){return this.m_frameTable};TwoColumnLayout.prototype.getLeftColumn=function(){return this.m_leftColumn};TwoColumnLayout.prototype.getMarginColumn=function(){return this.m_marginColumn};TwoColumnLayout.prototype.getRightColumn=function(){return this.m_rightColumn};function SimpleSubTabDiv(a,d,c,b){this.m_parentDiv=a;this.m_containerDiv=undefined;this.m_tabsDiv=undefined;this.m_tabsUL=undefined;this.m_underlineDiv=undefined;this.m_tabSpans=undefined;this.m_tabContentDiv=undefined;this.m_tabIds=undefined;this.m_tabNames=d;this.m_tabCallbacks=c;this.m_curSelectedTabIndex=-1;this.m_isDisabled=false;this.m_tabParentDiv=undefined;if(isValid(b)){this.m_tabParentDiv=b.tabParentDiv}this.createDiv()}SimpleSubTabDiv.prototype.createDiv=function(){this.m_containerDiv=makeElement("div",this.m_parentDiv);if(isValid(this.m_tabParentDiv)){this.m_tabsDiv=makeElementClass("div",this.m_tabParentDiv,"clearfix")}else{this.m_tabsDiv=makeElementClass("div",this.m_containerDiv,"clearfix")}this.m_tabsUL=makeElementClass("ul",this.m_tabsDiv,"tabUL");this.m_underlineDiv=makeElement("div",this.m_containerDiv);this.m_tabContentDiv=makeElement("div",this.m_containerDiv);this.m_tabSpans=new Array();for(var a=0;a<this.m_tabNames.length;a++){this.m_tabSpans.push(this.createTab(a))}};SimpleSubTabDiv.prototype.getTabElement=function(){return this.m_tabsUL};SimpleSubTabDiv.prototype.createTab=function(a){var c=makeElementClass("li",this.m_tabsUL,"simpleSubTabUnselected click");var d=makeElement("span",c);d.innerHTML=this.m_tabNames[a];var b=this;$(c).click(function(){if(!b.m_isDisabled){b.selectTab(a)}});return c};SimpleSubTabDiv.prototype.selectTab=function(c){if(c==this.m_curSelectedTabIndex){return}if(this.m_curSelectedTabIndex>=0){var b=this.m_tabSpans[this.m_curSelectedTabIndex];$(b).removeClass("simpleSubTabSelected");$(b).addClass("simpleSubTabUnselected click")}this.m_curSelectedTabIndex=c;var a=this.m_tabSpans[this.m_curSelectedTabIndex];$(a).removeClass("simpleSubTabUnselected").removeClass("click");$(a).addClass("simpleSubTabSelected");this.m_tabCallbacks[c](this.m_tabContentDiv,this.m_containerDiv)};SimpleSubTabDiv.prototype.selectTabWithId=function(b){if(!isValid(this.m_tabIds)){return}var a=-1;jQuery.each(this.m_tabIds,function(c,d){if(d==b){a=c}});if(a!=-1){this.selectTab(a)}};SimpleSubTabDiv.prototype.setTabId=function(a){this.m_tabIds=a};SimpleSubTabDiv.prototype.setIsDisabled=function(a){this.m_isDisabled=a};SimpleSubTabDiv.prototype.getTabsDiv=function(){return this.m_tabsDiv};SimpleSubTabDiv.prototype.getUnderlineDiv=function(){return this.m_underlineDiv};function switchTabs(b,a){hideALLPDDialog();GBL.MAIN_TABS.switchToTab(b,a)}function switchTabsByName(b,a){hideALLPDDialog();GBL.MAIN_TABS.switchToTabWithName(b,a)}function switchSubTabWithId(c,b,a){GBL.MAIN_TABS.switchToTabWithId(c,a)}function switchTabAndSubTab(b,c,a){switchTabs(b,a)}function showViewerStats(){GBL.STATUS_DIV.showViewerStats()}function showUserStats(a){if(isOnContainer()){showUserStatsDirectly(a)}else{window.open(GBL.APP_CANVAS_URL+"appParams=%7B%22"+GBL.SHOW_USER_ID+"%22%3A%22"+a+"%22%7D")}}function showMobStats(a){if(isOnContainer()){showUserStatsDirectly(a)}else{window.open(GBL.APP_CANVAS_URL+"appParams=%7B%22"+GBL.SHOW_USER_ID+"%22%3A%22"+a+"%22%7D")}}function showUserStatsDirectly(a){GBL.MAIN_TABS.switchToDynamicTab(function(b){b.innerHTML="";new MobStatsDiv(b,a)})}function createWhiteDiv(a,b){return makeElementClass("div",a,"coloredDiv",b)}function createSecondaryItemDiv(a,b){return makeElementClass("div",a,"secondaryItemDiv",b)}function addHeaderStyle(a){a.className="dataTableHeader"}function addHeaderStyleWithInnerDiv(b,a,d){b.style.width=d;b.style.paddingLeft="5px";b.style.paddingRight="5px";var c=makeElementClass("div",b,"dataTableHeader");b.appendChild(c);c.innerHTML=a}function createTitleDiv(l,o,k,n,f,q){l.innerHTML="";var h=makeElementClass("div",l,"titleTableDiv");var m=makeElement("table",h);var j=makeElement("tbody",m);var c=makeElement("tr",j);var p=makeElementClass("td",c,"titleTableTD");if(!!q){p.style.fontSize=q}p.innerHTML=o;outputDebug("options length: "+k+" same row: "+f);if(!isValid(k)||k.length<=0){return}outputDebug("doing options");if(!f){var a=makeElementClass("div",l,"subTitleTableDiv");var g=makeElement("table",a);var d=makeElement("tbody",g);c=makeElement("tr",d)}for(var b=0;b<k.length;b++){p=makeElementClass("td",c,"titleDivOption");p.innerHTML=k[b];if(isValidFunction(n[b])){p.className="clickableTitleDivOption";addEvent(p,"click",n[b])}if(b>0&&!f){p.style.borderLeft="solid 2px #FFFFFF"}}}function handleResult(A,r,E,m){try{var u=getGadgetResponseXML(A)}catch(g){u=undefined}if(!isValid(u)){r.showMessage(undefined,"Sorry, there was an unexpected error. Please refresh and try again.");return false}if(isValidFunction(r.setXMLDoc)){r.setXMLDoc(u)}var f=getBooleanValue(getXMLFirstChildValue(u,"success"));try{var C=getBooleanValue(getXMLFirstChildValue(u,"completed"))}catch(g){C=undefined}var a=decodeEncodedStringValue(getXMLFirstChildValue(u,"message"));var j=getXMLFirstChild(u,"bulletin");var B=getXMLFirstChild(u,"viewer");try{var h=decodeEncodedStringValue(getXMLFirstChildValue(u,"image_url"))}catch(g){h=undefined}var l=undefined;try{l=getXMLEncodedStringNodeValue(u,"swf_content")}catch(g){}var t=undefined;try{t=getXMLFirstNode(u,"swf")}catch(g){}var z=undefined;try{z=getXMLEncodedStringNodeValue(u,"auth_key")}catch(g){}var F=GBL.MAIN_DATA.getViewer().getLevel();var D=GBL.MAIN_DATA.getViewer().getFavorPoints();var v=undefined;if(isValid(f)){if(f){C=true}else{if(!isValid(C)){C=false}}if(C){try{v=getBooleanValue(getXMLNodeValue(u,"repeatable"))}catch(g){}if(isValid(v)&&v&&isValid(m)){r.showMessage(f,a,j,h,m)}else{r.showMessage(f,a,j,h)}if(isValid(l)&&isValid(z)){GBL.FLASH_RESULT_DIV=r;var q=createSWFContent(l,z,700,400,GBL.BACKGROUND_COLOR,null);r.showCustomContent(undefined,q)}if(isValid(t)&&isValid(z)){GBL.FLASH_RESULT_DIV=r;q=createMobSWFContent(t,z,GBL.BACKGROUND_COLOR);r.showCustomContent(undefined,q)}GBL.MAIN_DATA.getViewer().fillSpecificInfoFromXML(B);if(isValid(GBL.MAIN_TABS)&&(F!=GBL.MAIN_DATA.getViewer().getLevel()||D!=GBL.MAIN_DATA.getViewer().getFavorPoints())){GBL.MAIN_TABS.invalidateTabs()}if(isValid(GBL.STATUS_DIV)&&isValid(GBL.REFRESH_STATUS)){GBL.STATUS_DIV.refreshStatus();GBL.REFRESH_STATUS.refreshStatus()}if(isValidFunction(E)){E()}try{var n=parseBoolean(getXMLNodeValue(u,"is_level_up"));if(!isValid(n)){n=isValid(getXMLFirstNode(u,"level_up_gain"))}if(n){postLevelUpAppStream()}}catch(g){}try{var s=getXMLNodeValue(u,"mission_name");var c=parseInt(getXMLNodeValue(u,"num_missions_completed_today"));if(isValid(s)&&c==1){postFirstMissionAppStream(s)}}catch(g){}try{var d=getXMLFirstNode(u,"achievement");if(isValid(d)){var y=getXMLNodeValue(d,"achievement_badge_name");var p=getXMLNodeValue(d,"achievement_badge_description");var w=getXMLNodeValue(d,"achievement_image");if(isValid(y)&&isValid(p)&&isValid(w)){postAchievementAppStream(y)}}}catch(g){}var k=undefined;try{k=customDecoding(getXMLNodeValue(u,"defender_name"))}catch(x){k=undefined}if(f&&isValid(k)&&Math.random()<=0.25){k=shortenedStringKeepEscapedCharacters(k,14);postAttackWonAppStream(k)}}else{r.showMessage(false,a);if(isValid(GBL.APP_ID)&&GBL.APP_ID=="sorority"){var o=$(".missingItemMessage");var b=handleMissingItems(u);if(isValid(o)){o.append(b)}}}}else{r.showMessage(undefined,"Sorry, there was an unexpected error. Please refresh and try again.")}handleAppNotificationCallback(A);return C}function NotificationButton(d){var f=d;var b=undefined;var g={};this.getButtonText=a;this.getAppParams=c;h();function h(){if(!isValid(f)){return}try{b=getXMLEncodedStringNodeValue(f,"button_text")}catch(n){}try{var o=getXMLFirstNode(f,"app_param_list")}catch(n){}if(isValid(o)){try{var k=o.getElementsByTagName("app_param")}catch(n){}if(isValid(k)){for(var m=0;m<k.length;++m){var j=getXMLEncodedStringNodeValue(k[m],"param_name");var l=getXMLEncodedStringNodeValue(k[m],"param_value");g[j]=l}}}}function a(){return b}function c(){return g}}function sendNotification(d,h,c){if(GBL.MAIN_DATA.getShowNotification()){var a=[];for(var g=0;g<c.length;g++){a.push(MyOpenSpace.newNotificationButton(MyOpenSpace.NotificationButton.UrlTypes.CANVAS,c[g].getButtonText(),c[g].getAppParams()))}var j={};j[MyOpenSpace.Notification.Field.BODY]=h;j[MyOpenSpace.Notification.Field.BUTTONS]=a;var k=MyOpenSpace.newNotification(j);var f=[];f.push(opensocial.newMediaItem("",MyOpenSpace.MediaItemHelper.PROFILE_PICTURE));if(f.length>0){j[MyOpenSpace.Notification.Field.MEDIA_ITEMS]=f}var b=[];jQuery.each(d,function(l,m){b.push(m);if((l%10)==9||l==(d.length-1)){setTimeout(sendNotificationOnTimeout(b,k),30*l);b=[]}})}}function sendNotificationOnTimeout(b,a){return function(){MyOpenSpace.requestCreateNotification(b,a,function(c){consoleLog("viral success")})}}function createItemsListDiv(o,p,d,n){if(!isValid(p)||p.length<=0){return}var m=makeElement("div",o);m.style.padding="8px";var j=makeElement("table",m);var g=makeElement("tbody",j);var c=undefined;for(var b=0;b<p.length;b++){if(b%d==0){c=document.createElement("tr");g.appendChild(c)}var l=p[b];if(isValid(l.number)&&l.type!="READABLE"){var h=makeElementClass("td",c,"itemListItemNum");h.innerHTML="<span>"+l.number+" x </span>"}if(l.type=="READABLE"){h=makeElementClass("td",c,"itemListItemNum")}var a=document.createElement("td");a.style.textAlign="center";c.appendChild(a);if(isValid(l.image_url)){var f=document.createElement("img");a.appendChild(f);if(n){f.src=l.small_image_url}else{f.src=l.image_url}}var k=makeElementClass("DIV",a,"itemListItemDesc");k.innerHTML=l.name;if(isValid(l.description)){k.innerHTML+="<br>("+l.description+")"}}}function createSmallItemsListDiv(p,q,f,o,g){if(!isValid(q)||q.length<=0){return undefined}var n=makeElement("div",p,{padding:"8px",textAlign:"center",margin:"auto"});var k=makeElement("table",n,{textAlign:"center",margin:"auto"});var j=makeElement("tbody",k);var d=undefined;var b=undefined;for(var c=0;c<q.length;c++){if(c%f==0){d=makeElement("tr",j);b=makeElement("tr",j,{verticalAlign:"top"})}var m=q[c];var a=makeElement("td",d,{minWidth:"85px"});if(isValid(m.image_url)){var h=document.createElement("img");if(isValid(g)){$(h).width(g+"px")}a.appendChild(h);if(o||isValid(m.small_image_url)){h.src=m.small_image_url}else{h.src=m.image_url}}a=makeElement("td",b,{width:"85px"});var l=makeElementClass("div",a,"itemListItemDesc");if(isValid(m.number)&&m.number>1){l.innerHTML=m.number+" x "+m.name}else{l.innerHTML=m.name}if(isValid(m.description)){l.innerHTML+="<br>("+m.description+")"}}return n}function createToggleItemsListDiv(l,m,c,k){if(!isValid(m)||m.length<=0){return}l.style.textAlign="left";var j=makeElement("div",l);j.style.padding="10px 0px 0px 0px";var a=undefined;var d=makeElement("table",j);var b=makeElement("tbody",d);createToggleItemsListDivHelper(m,b,c,0,Math.min(m.length,c),k);if(c<m.length){var h=makeElement("table",j);var f=makeElement("tbody",h);createToggleItemsListDivHelper(m,f,c,c,m.length,k);var g=makeElement("div",j);g.innerHTML="<a class='standardLink' href='#'><span id='questItemToggleOn'>Show More</span></a><a class='standardLink' href='#'><span id='questItemToggleOff'>Hide</span></a>";g.style.textAlign="center";$("tbody tr",h).hide();$("#questItemToggleOff").hide();$("#questItemToggleOn").click(function(){$("tbody tr",h).slideToggle(500);$("#questItemToggleOn").hide();$("#questItemToggleOff").show();return false});$("#questItemToggleOff").click(function(){$("tbody tr",h).slideToggle(500);$("#questItemToggleOff").hide();$("#questItemToggleOn").show();return false})}}function createToggleItemsListDivHelper(s,k,f,p,h,o){for(var d=p;d<h;d++){if(d%f==0){var c=document.createElement("tr");k.appendChild(c)}var m=s[d];var b=document.createElement("td");b.style.textAlign="center";c.appendChild(b);b.width="95px";if(isValid(m.image_url)){var g=document.createElement("img");b.appendChild(g);if(isValid(o)&&o&&isValid(m.small_image_url)){g.src=m.small_image_url}else{g.src=m.image_url}}if(((d+1)%f)!=0){var n=document.createElement("td");n.style.width="25px";c.appendChild(n)}if((((d+1)%f)==0)||((d+1)==s.length)){c=document.createElement("tr");c.style.verticalAlign="top";k.appendChild(c);var j=f;if((d+1)==s.length){j=s.length%f;if(j==0){j=s.length}}for(var r=0;r<j;r++){var q=d-(j-1)+r;m=s[q];var a=document.createElement("td");a.style.textAlign="center";c.appendChild(a);var l=makeElementClass("DIV",a,"smallLootItemTitle");l.style.width="105px";l.innerHTML=m.number+" x "+m.name+"<br>";if(isValid(m.description)){l.innerHTML+="<br>("+m.description+")"}if(r!=(f-1)){n=document.createElement("td");n.style.width="13px";c.appendChild(n)}}}}}function NumberSelectDiv(m,l,a){var g=m;var f=l;var n=a;var j=undefined;var k=1;var c=new Array();this.getSelectedNumber=o;this.getSelectionBox=b;d();function d(){j=makeElement("select",g);for(var p=1;p<=f;p++){h(p,p,p==k)}if(n!=undefined){for(var q in n){if(typeof(n[q])=="number"){h(n[q],n[q],n[q]==k)}}}}function h(p,q,s){var r=makeElement("OPTION",j);r.innerHTML=p;r.value=q;r.selected=s;c.push(r)}function o(){for(var p=0;p<c.length;p++){if(c[p].selected){return c[p].value}}return undefined}function b(){return j}}function NumberSelectActionDiv(v,k,f,d,w,m,p){var c=v;var x=undefined;var q=k;var l=f;var a=d;var b=w;var s=m;var o=p;var j=1;var u=undefined;this.getSelectionBox=t;this.disable=g;n();function n(){x=makeElement("div",c);var C=undefined;if(!isValid(o)){var z=new SideBySideCells(x);C=z.getRightCell();o=makeElement("select",z.getLeftCell());for(var A=1;A<=q;A++){h(A,A,A==j)}if(s!=undefined){for(var B in s){if(typeof(s[B])=="number"){h(s[B],s[B],s[B]==j)}}}}else{C=x}var y=new DivButton(C,l,function(){a(r())},undefined,false,w);if(isValid(b)){y.setColor(b)}u=y}function h(y,z,B){var A=document.createElement("OPTION");A.innerHTML=y;A.value=z;A.selected=B;o.appendChild(A)}function t(){return o}function r(){return $(o).val()}function g(){u.setEnabled(false)}}function createMobSWFContent(h,j,c){var k={};try{var f=getXMLEncodedStringNodeValue(h,"swf_name")}catch(g){}try{if(isValid(getXMLNodeValue(h,"swf_height"))){var a=parseInt(getXMLNodeValue(h,"swf_height"))}}catch(g){}try{if(isValid(getXMLNodeValue(h,"swf_width"))){var l=parseInt(getXMLNodeValue(h,"swf_width"))}}catch(g){}try{var b=getXMLFirstNode(h,"swf_args")}catch(g){}if(isValid(b)){try{var d=b.getElementsByTagName("swf_var")}catch(g){}if(isValid(d)){for(var m=0;m<d.length;++m){var n=getXMLEncodedStringNodeValue(d[m],"swf_var_name");k[n]=getXMLEncodedStringNodeValue(d[m],"swf_var_value")}}}return createSWFContent(f,j,l,a,c,k)}function createSWFContent(m,j,n,a,f,q){var k=document.createElement("div");k.innerHTML='<div id="mustInstallFlash"><span style="color:red; font-size:14px;">Unfortunately, this page requires the latest version of Adobe Flash Player.<br>Please click on "Get Adobe Flash Player" button below.</span><br><br><a target="_blank" href="http://www.adobe.com/go/getflashplayer"><img alt="Get Adobe Flash" style="margin-left:100px; border:solid 1px #0033AA;" src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif"/></a></div>';k.style.textAlign="center";var h=m.substr(0,m.lastIndexOf("/")+1);var o={userId:GBL.MAIN_DATA.getViewer().getUserId(),favorPoints:GBL.MAIN_DATA.getViewer().getFavorPoints(),authKey:j,bigswf:h};if(typeof REQUEST_DESTINATION_URL!="undefined"){consoleLog("Include request destination URL in flash:"+REQUEST_DESTINATION_URL);o.requestDestinationURL=REQUEST_DESTINATION_URL}if(isValid(q)){for(var l in q){o[l]=q[l]}}var g={menu:"false",allowScriptAccess:"always"};var d=null;d=new SWFObject(m,"Flash payload",isValid(n)?n:"550",isValid(a)?a:"350","9.0.28",isValid(f)?f:"#000000");for(var c in g){d.addParam(c,g[c])}for(var b in o){d.addVariable(b,o[b])}d.write(k);return k}function createGalaSWFContent(j,r,u,g,t,a,d,l,h){var k=isValid(h)?h:document.createElement("div");k.innerHTML+='<div id="mustInstallFlash"><span style="color:red; font-size:14px;">Unfortunately, this page requires the latest version of Adobe Flash Player.<br>Please click on "Get Adobe Flash Player" button below.</span><br><br><a target="_blank" href="http://www.adobe.com/go/getflashplayer"><img alt="Get Adobe Flash" style="margin-left:100px; border:solid 1px #0033AA;" src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif"/></a></div>';k.style.textAlign="center";var f=j.substr(0,j.lastIndexOf("/")+1);var o={userId:GBL.MAIN_DATA.getViewer().getUserId(),favorPoints:GBL.MAIN_DATA.getViewer().getFavorPoints(),authKey:r,bigswf:f};if(typeof SWF_LOCATION!="undefined"){o.location=SWF_LOCATION}if(isValid(a)){for(var b in a){o[b]=a[b]}}var s={menu:"false",allowScriptAccess:"always"};if(isValid(d)){for(b in d){s[b]=d[b]}}var q=null;q=new SWFObject(j,isValid(l)?l:"flashpayload",isValid(u)?u:"550",isValid(g)?g:"350","9.0.28",isValid(t)?t:"#000000");for(var m in s){q.addParam(m,s[m])}for(var c in o){q.addVariable(c,o[c])}var n=q.write(k);return k}function SWFMinigameV2Callback(c,a){var b={};b.user_id=GBL.MAIN_DATA.getViewer().getUserId();b.minigame_name=c;if(isValid(a)&&typeof a=="object"){for(var d in a){b[d]=a[d]}}makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/minigame_result",function(f){handleResult(f,GBL.FLASH_RESULT_DIV,undefined,GBL.LAST_REPEATABLE_JOB_LINK)},b,1)}function SWFminigameCallback(b,d,a){var c={};c.user_id=GBL.MAIN_DATA.getViewer().getUserId();c.minigame_id=b;c.points=d;if(isValid(a)&&typeof a=="object"){consoleLog(a);for(var f in a){c[f]=a[f]}}makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/minigame",function(g){handleResult(g,GBL.FLASH_RESULT_DIV,undefined,GBL.LAST_REPEATABLE_JOB_LINK);if(isValid(GBL.MASTERY_RESULT_POPUP)){GBL.MASTERY_RESULT_POPUP.showDialog();GBL.MASTERY_RESULT_POPUP=undefined}},c,1)}function showXPromos(l,k,h,g){var f={mob:{img:"http://cdn0.mobwarsapp.com/rpg_images/opensocial/mob/xpromo/mobsters.gif",url:"http://profile.myspace.com/Modules/Applications/Pages/Canvas.aspx?appId=104283&track=topbar"},racing:{img:"http://cdn0.mobwarsapp.com/rpg_images/opensocial/mob/xpromo/overdrive.gif",url:"http://profile.myspace.com/Modules/Applications/Pages/Canvas.aspx?appId=123192&track=topbar"},vampires:{img:"http://cdn0.mobwarsapp.com/rpg_images/opensocial/mob/xpromo/bloodline.gif",url:"http://profile.myspace.com/Modules/Applications/Pages/Canvas.aspx?appId=123150&track=topbar"},poker:{img:"http://cdn0.mobwarsapp.com/rpg_images/opensocial/mob/xpromo/poker_palace.gif",url:"http://profile.myspace.com/Modules/Applications/Pages/Canvas.aspx?appId=109588&track=topbar"},sorority:{img:"http://cdn0.mobwarsapp.com/rpg_images/opensocial/mob/xpromo/sorority_life.gif",url:"http://profile.myspace.com/Modules/Applications/Pages/Canvas.aspx?appId=113384&track=topbar"}};var c=document.createElement("div");c.style.position="absolute";c.style.left=k;c.style.top=h;for(var b in f){if(l.indexOf(b)>-1){consoleLog(b);var j=f[b];c.innerHTML+="<a target='_blank' href='"+j.url+"'><img style='border: none; margin-left: 8px;' src='"+j.img+"'></a>"}}if(!!g){$("#headerFrame").css({marginTop:40});var a=document.createElement("a");a.href="http://www.playdom.com/";a.style.border=0;var d=document.createElement("img");d.src="http://cdn0.mobwarsapp.com/rpg_images/opensocial/mob/xpromo/playdom-black-sml.gif";d.style.position="absolute";d.style.right=5;d.style.top=3;a.appendChild(c);document.body.appendChild(a);document.body.appendChild(d);goToPageTop()}else{document.getElementById("headerFrame").appendChild(c)}}function showNewXPromoHandler(x,q,n,f,w,m,a){var l="Like "+m+"?<br>Try these games.";var j=x.split(",");var v={mob:{img:"http://cdn0.mobwarsapp.com/rpg_images/opensocial/mob/xpromo/new/IconStyle/Mobsters_logostyle.gif",url:"http://profile.myspace.com/Modules/Applications/Pages/Canvas.aspx?appId=104283&track=topbar_"+w},racing:{img:"http://cdn0.mobwarsapp.com/rpg_images/opensocial/mob/xpromo/new/IconStyle/Overdrive_LogoStyle.gif",url:"http://profile.myspace.com/Modules/Applications/Pages/Canvas.aspx?appId=123192&track=topbar_"+w},vampires:{img:"http://cdn0.mobwarsapp.com/rpg_images/opensocial/mob/xpromo/new/IconStyle/Bloodline_LogoStyle.gif",url:"http://profile.myspace.com/Modules/Applications/Pages/Canvas.aspx?appId=123150&track=topbar_"+w},poker:{img:"http://cdn0.mobwarsapp.com/rpg_images/opensocial/mob/xpromo/new/IconStyle/Poker_LogoStyle.gif",url:"http://profile.myspace.com/Modules/Applications/Pages/Canvas.aspx?appId=109588&track=topbar_"+w},sorority:{img:"http://cdn0.mobwarsapp.com/rpg_images/opensocial/mob/xpromo/new/IconStyle/Sorority_LogoStyle.gif",url:"http://profile.myspace.com/Modules/Applications/Pages/Canvas.aspx?appId=113384&track=topbar_"+w}};var b=document.createElement("div");var s=document.createElement("table");var d=document.createElement("tbody");var k=document.createElement("tr");s.appendChild(d);b.appendChild(s);d.appendChild(k);b.style.position="absolute";b.style.left=q;b.style.top=n;b.style.width="960px";b.style.background="#FFFFFF";var g=document.createElement("td");g.style.width="10px";k.appendChild(g);var h=document.createElement("td");h.innerHTML=l;$(h).addClass("xpromoText");k.appendChild(h);for(var u=0;u<j.length;u++){var c=j[u];if(isValid(c)&&isValid(v[c])){var p=document.createElement("td");var r=v[c];p.innerHTML="<a target='_blank' href='"+r.url+"'><img style='border: none; margin-left: 8px;' src='"+r.img+"'></a>";p.id="xpromoTd"+r.idName;k.appendChild(p)}}if(!!f){$("#headerFrame").css({marginTop:49+a});var t=document.createElement("a");t.href="http://www.playdom.com/";t.style.border=0;t.style.position="absolute";t.style.right=10;t.style.top=7;t.target="_blank";var o=makeElement("img",t);o.style.borderStyle="none";o.src="http://cdn0.mobwarsapp.com/rpg_images/opensocial/mob/xpromo/new/PlaydomLogo.gif";b.appendChild(t);document.body.appendChild(b);goToPageTop()}else{document.getElementById("headerFrame").appendChild(b)}}function createCallbackLink(b,d){var c=document.createElement("p");var a=makeElementClass("a",c,"standardLink");a.href="#";a.innerHTML=b;$(a).click(function(){d();return false});return c}function switchToMyMobTab(){switchTabsByName("My Mob")}function getOrSeparatedListString(b){var a="";for(var c=0;c<b.length;c++){a+=b[c];if((b.length>2)&&(c!=(b.length-1))){a+=","}if(c!=(b.length-1)){a+=" "}if(c==(b.length-2)){a+="or "}}return a}function postAvatarAppStream(){}function postLevelUpAppStream(){}function postFirstMissionAppStream(a){}function postChooseNameClassAppStream(a,b){}function postAchievementAppStream(a){}function postAttackWonAppStream(a){}function handleAppNotificationCallback(d){var b=undefined;try{b=getGadgetResponseData(d)}catch(c){b=undefined}if(!isValid(b)){return false}var a=undefined;try{a=getXMLFirstNode(b,"notification_msg")}catch(c){}if(isValid(a)){handleAppNotification(a)}return true}function handleAppNotification(j){try{var a=getXMLEncodedStringNodeValue(j,"user_list").split(",")}catch(f){consoleLog(f)}try{var g=getXMLEncodedStringNodeValue(j,"body_text")}catch(f){consoleLog(f)}consoleLog("handleAppNotification::Loaded bodyText");var h=[];try{var b=getXMLFirstNode(j,"button_list")}catch(f){consoleLog(f)}try{var d=b.getElementsByTagName("button")}catch(f){consoleLog(f)}if(isValid(d)){for(var c=0;c<d.length;c++){h.push(new NotificationButton(d[c]))}}if(isValid(a)&&a.length>0&&isValid(g)){sendNotification(a,g,h)}consoleLog("handleAppNotification::Notification sent")}function InitialChooserDiv(b,a){this.m_parentDiv=b;this.m_finishCallback=a;this.m_containerDiv=undefined;this.m_title=undefined;this.m_resultDiv=undefined;this.m_refreshDiv=undefined;this.m_chooseNameTitle=undefined;this.m_chooseNameExplanation=undefined;this.m_chooseClassTitle=undefined;this.m_chooseClassExplanation=undefined;this.m_classDescriptionsArray=undefined;this.m_classNameArray=undefined;this.initialize();this.createDiv()}InitialChooserDiv.prototype.initialize=function(){this.m_chooseNameTitle="Choose Mob Name";this.m_chooseNameExplanation="Choose your mob name (please be tasteful):";this.m_warningText="<span class='initialViewChangeMobName'> Warning! Please change your mob name. </span> <br> Users have complained that your mob name is inappropriate. <br><span style='font-style:italic;'>If your name is reported as inappropriate again, your account will be banned.</span>";this.m_chooseClassTitle="Choose Mob Class";this.m_chooseClassExplanation="Choose your mob class:";this.m_classNameArray=new Array();this.m_classDescriptionsArray=new Array();this.m_classNameArray.push("Insomniac");this.m_classDescriptionsArray.push("Insomniac (get energy faster)");this.m_classNameArray.push("Bulletproof");this.m_classDescriptionsArray.push("Bulletproof (heal faster)");this.m_classNameArray.push("Tycoon");this.m_classDescriptionsArray.push("Tycoon (get money faster)")};InitialChooserDiv.prototype.createDiv=function(){this.m_containerDiv=makeElementId("div",this.m_parentDiv,"initialChooser");this.m_containerDiv.style.padding="15px";this.m_title=document.createElement("div");this.m_containerDiv.appendChild(this.m_title);this.m_resultDiv=new ResultDiv(this.m_containerDiv);this.m_refreshDiv=makeElementClass("div",this.m_containerDiv,"initialViewRefreshDiv");this.refresh()};InitialChooserDiv.prototype.refresh=function(){this.m_refreshDiv.innerHTML="";if(!isValid(GBL.MAIN_DATA.getViewer().getMobName())){this.createChooseNameInterface()}else{if(!isValid(GBL.MAIN_DATA.getViewer().getMobClass())){this.createChooseMobClassInterface()}else{this.m_finishCallback()}}};InitialChooserDiv.prototype.createChooseNameInterface=function(){createTitleDiv(this.m_title,this.m_chooseNameTitle);var b=GBL.MAIN_DATA.getViewer().getExperience();if(isValid(this.m_warningText)&&isValid(b)&&b>0){var f=createWhiteDiv(this.m_refreshDiv);f.innerHTML=this.m_warningText}var g=document.createElement("table");this.m_refreshDiv.appendChild(g);g.style.marginLeft="auto";g.style.marginRight="auto";g.style.borderSpacing="6px";var c=document.createElement("tbody");g.appendChild(c);var a=document.createElement("tr");c.appendChild(a);var j=makeElementClass("td",a,"initialViewChooseNameCell");j.innerHTML=this.m_chooseNameExplanation;j=makeElementClass("td",a,"initialViewChooseNameCell");var d=undefined;try{d=document.createElement("<input type='text' maxlength='20' />")}catch(h){d=document.createElement("input");d.type="text";d.maxLength="20"}d.style.width="150px";j.appendChild(d);j=makeElementClass("td",a,"initialViewChooseNameCell");var k=this;new DivButton(j,"Choose Name",function(){k.m_resultDiv.showMessage(undefined,"Checking ... ");var l={};l.user_id=GBL.MAIN_DATA.getViewer().getUserId();l.mob_name=encodeURIComponent(d.value);makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/choose_name",function(m){handleResult(m,k.m_resultDiv,function(){k.refresh()})},l)})};InitialChooserDiv.prototype.createChooseMobClassInterface=function(){createTitleDiv(this.m_title,this.m_chooseClassTitle);var f=document.createElement("table");this.m_refreshDiv.appendChild(f);f.style.marginLeft="auto";f.style.marginRight="auto";f.style.borderSpacing="6px";var c=document.createElement("tbody");f.appendChild(c);var a=document.createElement("tr");c.appendChild(a);var h=makeElementClass("td",a,"initialViewChooseMobClassCell");h.innerHTML=this.m_chooseClassExplanation;h=makeElementClass("td",a,"initialViewChooseMobClassCell");var k=document.createElement("select");h.appendChild(k);var d=new Array();var g=undefined;for(var b=0;b<this.m_classNameArray.length;b++){g=this.createOption(this.m_classDescriptionsArray[b],this.m_classNameArray[b],b==0);k.appendChild(g);d.push(g)}h=makeElementClass("td",a,"initialViewChooseMobClassCell");var j=this;new DivButton(h,"Choose",function(){j.m_resultDiv.showMessage(undefined,"Checking ... ");var m={};m.user_id=GBL.MAIN_DATA.getViewer().getUserId();for(var l=0;l<d.length;l++){if(d[l].selected){m.mob_class=d[l].value;break}}makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/choose_class",function(n){handleResult(n,j.m_resultDiv,function(){j.refresh()})},m)})};InitialChooserDiv.prototype.createOption=function(a,b,d){var c=document.createElement("OPTION");c.innerHTML=a;c.value=b;c.selected=d;return c};function MobDoRefresh(b){var a={};a.user_id=GBL.MAIN_DATA.getViewer().getUserId();makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/refresh_stat_manual",function(f){var c=getGadgetResponseData(f);var d=getXMLFirstNode(c,"viewer");GBL.MAIN_DATA.getViewer().fillSpecificInfoFromXML(d);if(isValid(GBL.STATUS_DIV)&&isValid(GBL.REFRESH_STATUS)){GBL.MAIN_DATA.getCachedUsers(CachedUserList.MY_REQUESTS).invalidateCache();GBL.MAIN_DATA.getCachedUsers(CachedUserList.MY_MOB).invalidateCache();GBL.STATUS_DIV.refreshStatus();GBL.REFRESH_STATUS.refreshStatus();if(!(isValid(b)&&b)){GBL.MAIN_TABS.refreshTab()}}try{GBL.TOP_MOB.refresh()}catch(g){}},a)}function MobDoAutoRefresh(b){var a={};a.user_id=GBL.MAIN_DATA.getViewer().getUserId();makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/refresh_stat",function(f){var c=getGadgetResponseData(f);var d=getXMLFirstNode(c,"viewer");GBL.MAIN_DATA.getViewer().fillSpecificInfoFromXML(d);if(isValid(GBL.STATUS_DIV)&&isValid(GBL.REFRESH_STATUS)){GBL.MAIN_DATA.getCachedUsers(CachedUserList.MY_REQUESTS).invalidateCache();GBL.STATUS_DIV.refreshStatus();GBL.REFRESH_STATUS.refreshStatus();if(!b){GBL.MAIN_TABS.refreshTab()}}},a)}function ViewerStatusDiv(a){this.m_parentDiv=a;this.m_containerDiv=undefined;this.m_cashLabel=undefined;this.m_healthLabel=undefined;this.m_energyLabel=undefined;this.m_staminaLabel=undefined;this.m_expLabel=undefined;this.m_mobLabel=undefined;this.m_statsDiv=undefined;this.m_topRightDiv=undefined;this.m_oldHealthStatus=undefined;this.m_oldEnergyStatus=undefined;this.m_oldStaminaStatus=undefined;this.m_healthTimerDiv=undefined;this.m_energyTimerDiv=undefined;this.m_staminaTimerDiv=undefined;this.m_refreshButtonDiv=undefined;this.m_refreshButtonEnabled=true;this.m_refresh_image=undefined;this.m_maxNameLength=12;this.m_refreshButtonEnabledColor="#2F2F4F";this.m_refreshButtonActionColor="#555555";this.initialize();this.createDiv()}ViewerStatusDiv.prototype.statusHighlightColor="#cd7f32";ViewerStatusDiv.prototype.statusDefaultColor="#ffffff";ViewerStatusDiv.prototype.initialize=function(){this.m_cashLabel="Cash";this.m_healthLabel="Health";this.m_energyLabel="Energy";this.m_staminaLabel="Stamina";this.m_expLabel="Exp";this.m_mobLabel="Mob";this.m_statsDiv=StatsDiv;this.m_lastRefreshTime=(new Date()).getTime()};ViewerStatusDiv.prototype.createDiv=function(){var a=document.createElement("div");a.style.height=37;this.m_parentDiv.appendChild(a);this.m_containerDiv=makeElementClass("div",this.m_parentDiv,"statusTableDiv");this.m_topRightDiv=document.createElement("div");this.m_topRightDiv.style.width=200;this.m_topRightDiv.style.height=56;this.m_topRightDiv.style.position="absolute";this.m_topRightDiv.style.background=(isIE6()?"black":"url(http://cdn0.mobwarsapp.com/rpg_images/opensocial/mob/ui/fade.png)");this.m_topRightDiv.style.left=810;this.m_topRightDiv.style.top=12;this.m_topRightDiv.innerHTML="<div id='mobNameCell' class='mobNameCell' style='margin-left: 4px;'></div><div id='levelStatCell' class='levelStatCell'></div><table width='100%'><tr><td><div id='expCell' class='statCell'></div></td><td><div id='mobExpCell' class='statCell'></div></td></tr></table><div id='mobSizeCell' class='statCell'></div>";document.getElementById("headerFrame").appendChild(this.m_topRightDiv);this.refreshStatus()};ViewerStatusDiv.prototype.createStatusElement=function(j,c,a){this.addTextStyle(j);$(j).css({position:"relative",left:"0px",top:"0px"});var g=makeElement("div",j);g.innerHTML=a;var d=document.all;var f=null;var k="statsBarReloadTimer";f=makeElementClass("div",j,k);var b=this[c];this[c]=a;var h=this;if(isValid(b)&&b!=a){$(g).css("color",this.statusHighlightColor);$(g).fadeTo("slow",0.6).fadeTo("fast",1).fadeTo("slow",0.6).fadeTo("fast",1).fadeTo("slow",0.6).fadeTo("fast",1).queue(function(){$(g).css("color",h.statusDefaultColor)})}return f};ViewerStatusDiv.prototype.newStatusCell=function(){};ViewerStatusDiv.prototype.refreshStatus=function(){this.m_containerDiv.innerHTML="";var w=GBL.MAIN_DATA.getViewer();var m=document.createElement("table");this.m_containerDiv.appendChild(m);m.setAttribute("id","statusTable");m.style.marginLeft="auto";m.style.marginRight="auto";m.style.borderCollapse="separate";m.style.borderSpacing="3px 3px";var v=document.createElement("tbody");m.appendChild(v);var b=document.createElement("tr");v.appendChild(b);var s=makeElementClass("td",b,"statContentTD");this.addLinkToMyBoss(s);var k=document.createElement("table");s.appendChild(k);k.style.borderCollapse="separate";k.style.borderSpacing="8px 0px";var t=document.createElement("tbody");k.appendChild(t);var r=document.createElement("tr");t.appendChild(r);var y=makeElementClass("td",r,"mobNameCell");y.innerHTML='<span title="'+GBL.MAIN_DATA.getViewer().getMobName()+'">'+GBL.MAIN_DATA.getViewer().getShortMobName(this.m_maxNameLength)+"</span>";var c=makeElementClass("td",r,"statCell");var j=formatNumberWithAbbreviation(w.getCash());c.innerHTML=this.m_cashLabel+": $"+j;var h=makeElementClass("td",r,"statCell");var B=makeElementId("div",h,"healthStatus");this.m_healthTimerDiv=this.createStatusElement(B,"oldHealthStatus",this.m_healthLabel+": "+w.getHealth()+"/"+w.getMaxHealth());var x=makeElementClass("td",r,"statCell");var a=makeElementId("div",x,"energyStatus");this.m_energyTimerDiv=this.createStatusElement(a,"oldEnergyStatus",this.m_energyLabel+": "+w.getEnergy()+"/"+w.getMaxEnergy());var p=makeElementClass("td",r,"statCell");var f=makeElementId("div",p,"staminaStatus");this.m_staminaTimerDiv=this.createStatusElement(f,"oldStaminaStatus",this.m_staminaLabel+": "+w.getStamina()+"/"+w.getMaxStamina());var u=makeElementClass("td",r,"statCell");u.innerHTML=this.m_mobLabel+": ("+w.getMobSize()+")";var z=makeElementClass("td",r,"statCell");z.innerHTML=this.m_expLabel+": "+formatNumberWithCommas(w.getExperience());var q=makeElementClass("td",r,"levelStatCell");q.innerHTML="Level:"+w.getLevel();var A=GBL.MAIN_DATA.getViewer().getPercentToNextLevel();if(isValid(A)){var g=null;g=makeElementClass("div",q,"barOutDiv");var d=makeElementClass("div",g,"percentLevelDiv");d.style.width=A+"%"}var l=makeElementClass("td",b,"statContentTD myStatsLink");l.innerHTML="My Stats";this.addLinkToStats(l);var n=makeElementClass("td",b,"refreshButtonContentTD");this.m_refreshButtonEnabled=true;this.m_refreshButtonDiv=makeElementClass("div",n,"refreshButtonDiv");this.m_refreshButtonDiv.innerHTML="REFRESH";var o=this;addEvent(this.m_refreshButtonDiv,"click",function(){if(o.m_refreshButtonEnabled){o.m_refreshButtonEnabled=false;o.m_refreshButtonDiv.style.cursor="default";o.m_refreshButtonDiv.style.backgroundColor=o.m_refreshButtonActionColor;o.m_refreshButtonDiv.innerHTML="refreshing...";window.setTimeout("GBL.STATUS_DIV.enableRefreshButton()",1000);MobDoRefresh()}})};ViewerStatusDiv.prototype.enableRefreshButton=function(){this.m_refreshButtonEnabled=true;this.m_refreshButtonDiv.style.cursor="pointer";this.m_refreshButtonDiv.style.backgroundColor=this.m_refreshButtonEnabledColor;this.m_refreshButtonDiv.innerHTML="REFRESH"};ViewerStatusDiv.prototype.addLinkToBank=function(a){a.style.cursor="pointer";addEvent(a,"click",function(){GBL.MAIN_TABS.switchToTabWithName("Bank")})};ViewerStatusDiv.prototype.addLinkToHospital=function(a){a.style.cursor="pointer";addEvent(a,"click",function(){GBL.MAIN_TABS.switchToTabWithName("Hospital")})};ViewerStatusDiv.prototype.addLinkToMyMob=function(a){a.style.cursor="pointer";addEvent(a,"click",function(){GBL.MAIN_TABS.switchToTab(9)})};ViewerStatusDiv.prototype.addLinkToMyBoss=function(a){a.style.cursor="pointer";addEvent(a,"click",function(){GBL.MAIN_TABS.switchToTab(10)})};ViewerStatusDiv.prototype.addLinkToStats=function(b){b.style.cursor="pointer";var a=this;addEvent(b,"click",function(){GBL.MAIN_TABS.switchToDynamicTab(function(c){c.innerHTML="";new a.m_statsDiv(c,GBL.MAIN_DATA.getViewer().getUserId())})})};ViewerStatusDiv.prototype.addTextStyle=function(a){a.className="statCell"};ViewerStatusDiv.prototype.showViewerStats=function(a){var b=this;if(a==undefined||a==null){a=GBL.MAIN_DATA.getViewer().getUserId()}GBL.MAIN_TABS.switchToDynamicTab(function(c){c.innerHTML="";new b.m_statsDiv(c,a)})};function Timer(d,f,a){var g=d;var c=f;var j=a;var l=false;this.start=b;this.stop=k;this.tick=h;this.isRunning=m;function b(){l=true;h()}function m(){return l}function k(){l=false}function h(){if(l){j();window.setTimeout(g+".tick()",c)}}}ViewerRefreshStatus.TIMER=undefined;function ViewerRefreshStatus(a){this.m_parentDiv=a;this.m_containerDiv=undefined;this.m_secondsToHealth=undefined;this.m_secondsToEnergy=undefined;this.m_secondsToStamina=undefined;this.m_secondsToEnergySuffix=undefined;this.m_secondsToHealthSuffix=undefined;this.m_secondsToStaminaSuffix=undefined;this.m_healthRefreshDiv=undefined;this.m_energyRefreshDiv=undefined;this.m_staminaRefreshDiv=undefined;this.initialize();this.createDiv()}ViewerRefreshStatus.prototype.initialize=function(){this.m_secondsToEnergySuffix=" sec until more energy.<br>";this.m_secondsToHealthSuffix=" sec until more health.<br>";this.m_secondsToStaminaSuffix=" sec until more stamina.<br>"};ViewerRefreshStatus.prototype.createDiv=function(){outputDebug("ViewerStatusDiv: createDiv");this.refreshStatus();var a=this;if(!isValid(ViewerRefreshStatus.TIMER)){ViewerRefreshStatus.TIMER=new Timer("ViewerRefreshStatus.TIMER",1000,function(){a.onTick()});ViewerRefreshStatus.TIMER.start()}};ViewerRefreshStatus.prototype.refreshStatus=function(){var a=GBL.MAIN_DATA.getViewer();this.m_secondsToHealth=a.getSecondsToHealthRefresh();this.m_secondsToEnergy=a.getSecondsToEnergyRefresh();this.m_secondsToStamina=a.getSecondsToStaminaRefresh();if(isValid(this.m_secondsToEnergy)){this.m_secondsToEnergy=parseInt(this.m_secondsToEnergy)+2}if(isValid(this.m_secondsToHealth)){this.m_secondsToHealth=parseInt(this.m_secondsToHealth)+2}if(isValid(this.m_secondsToStamina)){this.m_secondsToStamina=parseInt(this.m_secondsToStamina)+2}this.onTick()};ViewerRefreshStatus.prototype.formatTimer=function(c){var a=Math.floor(c/60);var b=c%60;return a+":"+(b<10?"0":"")+b+" for more"};ViewerRefreshStatus.prototype.onTick=function(){var a=GBL.MAIN_DATA.getViewer();if(!isValid(a)||!isValid(GBL.STATUS_DIV)){return}var f=GBL.STATUS_DIV.m_healthTimerDiv;var d=GBL.STATUS_DIV.m_energyTimerDiv;var b=GBL.STATUS_DIV.m_staminaTimerDiv;if(!isValid(a.getSecondsToHealthRefresh())&&!isValid(a.getSecondsToEnergyRefresh())&&!isValid(a.getSecondsToStaminaRefresh())){return}var c=false;if(isValid(this.m_secondsToHealth)){if(this.m_secondsToHealth>=1){if(isValid(f)){f.innerHTML=this.formatTimer(this.m_secondsToHealth)}}else{c=true}this.m_secondsToHealth-=1}if(isValid(this.m_secondsToEnergy)){if(this.m_secondsToEnergy>=1){if(isValid(d)){d.innerHTML=this.formatTimer(this.m_secondsToEnergy)}}else{c=true}this.m_secondsToEnergy-=1}if(isValid(this.m_secondsToStamina)){if(this.m_secondsToStamina>=1){if(isValid(b)){b.innerHTML=this.formatTimer(this.m_secondsToStamina)}}else{c=true}this.m_secondsToStamina-=1}if(c){MobDoAutoRefresh(true)}};function ChatWidget(b,d,a,c){this.maxMessageLength=300;this.m_replyLength=60;this.messageCache=new Array();this.isQueueRunning=false;this.m_textArea=null;this.m_parentDiv=b;this.m_resultDiv=d;this.m_bulletinCallback=c;this.m_groupName=a;this.m_queueMessageRecords=new Array();this.m_slideTime=500;this.m_slideDelay=1000;this.latestBroadcastId=0;this.initialize();this.createDiv();this.serverPollInterval=1000*60*10;this.numberOfServerRequest=0;this.serverConnectionOpen=false;this.filterType=0;this.startServerPolling()}ChatWidget.prototype.showLoading=function(){$("#chat_history_wrapper").html(getLoadingMessageHTML())};ChatWidget.prototype.initialize=function(){if(GBL.MAIN_DATA.getBroadcastPerMemberCost()>0){var a=formatNumberWithCommas(GBL.MAIN_DATA.getViewer().getMobSize()*GBL.MAIN_DATA.getBroadcastPerMemberCost());this.m_send_header="Broadcast to your "+this.m_groupName+" for $"+a;this.m_send_to_header="Send message to for $"+a;this.m_reply_to_header='<a name="chat_reply_to_header">Reply to: {0} for $'+a+"</a>"}else{if(isValid(GBL.APP_ID)&&GBL.APP_ID=="sorority"){this.m_send_header="Tell your "+this.m_groupName+" what you are up to!"}else{if(isValid(GBL.APP_ID)&&GBL.APP_ID=="racing"){this.m_send_header="Tell your crew what you are doing!"}else{this.m_send_header="Broadcast to your "+this.m_groupName+" for free!"}}this.m_send_to_header="Send message to ";this.m_reply_to_header='<a name="chat_reply_to_header">Reply to: {0} </a>'}this.m_posting_message_header='<img src="http://cdn0.mobwarsapp.com/rpg_images/opensocial/mob/ui/button/icon_loading.gif"/> Posting your broadcast, please wait...'};function _reset_chat_widget(b,d){var a=document.getElementById("chat_textarea");a.value="";document.getElementById("chat_to_username").value="";document.getElementById("chat_parent_message_id").value=-1;document.getElementById("chat_to_user_id").value=-1;document.getElementById("chat_parent_message_id").value=-1;document.getElementById("chat_header_text_counter").innerHTML=d;document.getElementById("chat_header_reply_to").innerHTML=b;try{a.focus();a.keyup()}catch(c){}}ChatWidget.prototype.reattachDiv=function(){if(document.all){this.createDiv();this.initialize();for(var a=0;a<this.messageCache.length;a++){this.addMessageRecord(this.messageCache[a],false,true)}}else{this.m_parentDiv.appendChild(this.m_containerDiv)}};ChatWidget.prototype.createDiv=function(){this.m_containerDiv=makeElement("div",this.m_parentDiv);var c=formatNumberWithCommas(GBL.MAIN_DATA.getViewer().getMobSize()*25);$(this.m_containerDiv).html('<div class="chat_wrapper"><div style="float:left;width:100%;" id="chat_widget_post_control_wrapper">            <div class="chat_header_status">                <div class="chat_header_reply_to" id="chat_header_reply_to">'+this.m_send_header+'</div>                <div class="chat_header_text_counter" id="chat_header_text_counter">'+this.maxMessageLength+'</div>                <div class="clearall"></div>            </div>            <form action="#" onsubmit="return false;">                <input type="hidden" id="chat_parent_message_id" value="-1" />                <input type="hidden" id="chat_to_user_id" value="-1" />                <input type="hidden" id="chat_to_username" value="" />                <textarea class="chat_textarea" id="chat_textarea"></textarea>                <div class="chat_footer_status"><div class="chat_reset_div"><a href="javascript:_reset_chat_widget(\''+this.m_send_header+"', "+this.maxMessageLength+');" class="chatStandardLink">Reset/Create New</a></div>                </div>            </form></div>            <div class="chat_history_scrollable">                <div class="chat_history_wrapper" id="chat_history_wrapper">                </div>            </div>            <div class="clearall"></div>        </div>');var b=this;this.m_textArea=$(this.m_containerDiv).find("textarea");this.m_textArea.keyup(function(){b.updateTextCounter()});var a=$(this.m_containerDiv).find(".chat_footer_status")[0];this.m_submitBtn=new DivButton(a,"Send",function(){gaTrackEvent("chat","click","send");if(b.m_resultDiv){try{b.m_resultDiv.hideMessage()}catch(d){}}b.sendMessage()},null,false,null,"javascript:void(0);");this.m_submitBtn.alignRight()};ChatWidget.prototype.updateTextCounter=function(){var f=document.getElementById("chat_textarea").value;var b=document.getElementById("chat_header_text_counter");var j=document.getElementById("chat_header_reply_to");var a=document.getElementById("chat_submit_button");b.innerHTML=(this.maxMessageLength-f.length);if(f.length>this.maxMessageLength){document.getElementById("chat_textarea").value=(f.substring(0,this.maxMessageLength-1));$(b).css({color:"#ff0000"});b.innerHTML=0;if(this.m_resultDiv){this.m_resultDiv.showMessage(undefined,"Sorry, the maximum message length is "+this.maxMessageLength+" characters.")}}else{$(b).css({color:""});b.setAttribute("class","chat_header_text_counter")}if(f.length>2&&f.charAt(0)=="@"){var d=f.split(" ",1);var h=d[0];j.innerHTML=this.m_send_to_header+" "+d[0].substring(1)+":"}else{if(document.getElementById("chat_to_user_id").value!=-1){var c=document.getElementById("chat_to_username").value;var g=this.m_reply_to_header;g=this.m_reply_to_header.replace("{0}",c);j.innerHTML=g}else{j.innerHTML=this.m_send_header}}this.m_submitBtn.setEnabled(f.length>0)};ChatWidget.prototype.deleteAllMessages=function(){var b=this;var a=new ModalDialog("Are you sure you want to delete *ALL* messages?\nThere is NO UNDO for this action...","Delete all messages?",{Delete:function(){b.doDeleteAllMessages()},Cancel:function(){}},ModalDialog.QUESTION);a.showDialog()};ChatWidget.prototype.doDeleteAllMessages=function(){this.clear();var a={};a.user_id=GBL.MAIN_DATA.getViewer().getUserId();makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/delete_all_newsfeeds",function(b){},a,0,gadgets.io.ContentType.JSON);this.messageCache=new Array();return true};ChatWidget.prototype.deleteMessage=function(d){var b=document.getElementById("table_"+d);$(b).slideUp(this.m_slideTime,function(){$(this).remove()});var c={};c.user_id=GBL.MAIN_DATA.getViewer().getUserId();c.delete_entry_id=d;makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/delete_newsfeed_entry",function(g){},c,0);var f=new Array();for(var a=0;a<this.messageCache.length;a++){if(this.messageCache[a].getMessageId()!=d){f.push(this.messageCache[a])}}this.messageCache=f;return true};ChatWidget.prototype.clear=function(){$("#chat_history_wrapper").html("")};ChatWidget.prototype.sendMessage=function(){var h=GBL.MAIN_DATA.getViewer().getCash();var l=(GBL.MAIN_DATA.getViewer().getMobSize()*25);var a=document.getElementById("chat_textarea").value;var c=document.getElementById("chat_parent_message_id").value;var b=-1;var d=this.getMessageFromCacheById(c);var m=this;if(jQuery.trim(a).length==0){if(this.m_resultDiv){this.m_resultDiv.showMessage(undefined,"Please type a message.")}return}if(!isOffSite()&&isValidFunction(this.m_bulletinCallback)){this.m_bulletinCallback(a)}document.getElementById("chat_parent_message_id").value=-1;document.getElementById("chat_to_user_id").value=-1;document.getElementById("chat_to_username").value="";$("chat_textarea").attr("disabled",true);var o=new ChatMessage();var k=new Date();if(GBL.MAIN_DATA!=undefined){var g=GBL.MAIN_DATA.getViewer();o.setFromUserId(g.getUserId());o.setFromUserPix(g.getThumbnailUrl());o.setFromUserName(g.getName())}else{o.setFromUserId(USER_ID);o.setFromUserName(USER_NAME);o.setFromUserPix(PHOTO)}o.setToUserId(b);o.setParentMessage(d);o.setMessageText(a);o.setMessageDate(k);o.setDisplayDate("A moment ago...");o.setBroadcast(true);if(c!=-1){o.setParentMessage(this.getMessageFromCacheById(c))}var j={};j.user_id=o.getFromUserId();j.message=customEncoding(o.getMessageText());j.cost=l;j.reply_to=c;var f=document.getElementById("chat_header_reply_to");f.innerHTML=this.m_posting_message_header;var n=this;makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/broadcast",function(p){f.innerHTML=m.m_send_header;if(handleResult(p,n.m_resultDiv)){try{n.m_resultDiv.hideMessage()}catch(q){}}document.getElementById("chat_textarea").value="";$("chat_textarea").attr("disabled",false);document.getElementById("chat_header_text_counter").innerHTML=m.maxMessageLength;if(!m.isQueueRunning){m.refresh(true)}else{m.refresh(true)}},j,0)};ChatWidget.prototype.replyToMessage=function(c){var a=this.getMessageFromCacheById(c);document.getElementById("chat_parent_message_id").value=a.getMessageId();document.getElementById("chat_to_user_id").value=a.getFromUserId();document.getElementById("chat_to_username").value=a.getFromUserName();window.location="#chat_reply_to_header";try{this.m_textArea.focus();this.m_textArea.keyup()}catch(b){}};ChatWidget.prototype.constructInReplyText=function(c,b){var d='<div><span style="color:#666;font-weight:bold;">In reply to &raquo;</span> ';d+='<span style="color: '+GBL.STYLES.text.color+';">';var a=c.getMessageText();var f=c.getFromUserName();if(b){d+=f+"; "+a}else{if(a.length>this.m_replyLength){d+=f+"; "+a.substr(0,this.m_replyLength)+"..."}else{d+=f+"; "+a}}d+="</span></div>";return d};ChatWidget.prototype.showReplyMessage=function(message_id,parent_message_id){var result_td=document.getElementById("inreply_"+message_id+"_"+parent_message_id);result_td.innerHTML="";var more_link=document.getElementById("more_link_"+message_id+"_"+parent_message_id);var l_lessLink=document.getElementById("less_link_"+message_id+"_"+parent_message_id);var inreply_message=this.getMessageFromCacheById(message_id);if(inreply_message!=null){result_td.innerHTML=this.constructInReplyText(inreply_message,true);$(more_link).hide();$(l_lessLink).show()}else{var l_params={};l_params.user_id=GBL.MAIN_DATA.getViewer().getId();l_params.broadcast_by_id=message_id;var _self=this;makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/messages",function(a_response){var message_array=eval(a_response.text);var original_message=_self.buildMessageFromItem(message_array[0]);result_td.innerHTML=_self.constructInReplyText(original_message,true);$(more_link).hide();$(l_lessLink).show()},l_params,0)}};ChatWidget.prototype.hideReplyMessage=function(a,b){var h=document.getElementById("inreply_"+a+"_"+b);h.innerHTML="";var f=document.getElementById("more_link_"+a+"_"+b);var d=document.getElementById("less_link_"+a+"_"+b);var c=this.getMessageFromCacheById(b);if(c!=null){var g=c.getParentMessage();h.innerHTML=this.constructInReplyText(g,false);$(d).hide();$(f).show()}};ChatWidget.prototype.formatDate=function(a){var c=a.getDate();var g=a.getMonth()+1;var f=a.getFullYear();var b=a.getHours();var d=a.getMinutes();var j=a.getSeconds();if(new String(c).length==1){c="0"+c}if(new String(b).length==1){b="0"+b}if(new String(d).length==1){d="0"+d}if(new String(j).length==1){j="0"+j}var h=c+"/"+g+"/"+f+" "+b+":"+d+":"+j;return'<span class="chat_date_span">'+h+"</span>"};ChatWidget.prototype.addMessageRecord=function(j,y,F){var c=document.getElementById("chat_history_wrapper");var K=this;var a=false;if(F!=undefined&&F!=null){a=true}if(document.getElementById("table_"+j.getMessageId())!=null){return}var r=document.createElement("table");var L=makeElement("tbody",r);var E=makeElementClass("tr",L,"chat_tr");var p=makeElement("td",E);var C=makeElement("td",E);var h=makeElement("td",E);r.setAttribute("id","table_"+j.getMessageId());r.setAttribute("islive",y===undefined?false:y);$(r).css({"float":"left",width:"100%",marginTop:"5px",borderTop:"1px #ccc dotted",display:"none"});$(p).css({width:"50px",verticalAlign:"top"});$(C).css({width:"100%",verticalAlign:"top"});$(h).css({width:"20px",verticalAlign:"top"});var g=document.createElement("a");g.setAttribute("href","javascript:;");$(g).click(function(){K.deleteMessage(j.getMessageId())});var m=document.createElement("img");m.src="http://cdn0.mobwarsapp.com/rpg_images/opensocial/mob/ui/button/icon_trash.gif";$(m).css({width:"16px",height:"16px",borderWidth:"0px"});g.appendChild(m);h.appendChild(g);var l=j.isBroadcast();if(l){var n=makeElement("a",h);n.setAttribute("href","javascript:;");$(n).click(function(){K.replyToMessage(j.getMessageId())});var I=makeElement("img",n);I.src="http://cdn0.mobwarsapp.com/rpg_images/opensocial/sororitywars/ui/icon_reply3.gif";$(I).css({width:"16px",height:"16px",borderWidth:"0px"})}var o=makeElement("img",p,{width:"48px",height:"48px",borderWidth:"0px"});if(j.getFromUserPix()==undefined||j.getFromUserPix()==null){o.src="http://x.myspacecdn.com/modules/common/static/img/no_pic.gif"}else{if(!isOffSite()&&j.getFromUserId()==GBL.MAIN_DATA.getViewer().getUserId()){try{o.src=GBL.MAIN_DATA.getViewer().getThumbnailUrl()}catch(J){o.src=j.getFromUserPix()}}else{o.src=j.getFromUserPix()}}if(j.getParentMessage()!=null){var f=j.getParentMessage();var b=makeElement("tr",L);var v=makeElement("td",b);var d=makeElement("td",b);var q=makeElement("td",b);b.appendChild(v);b.appendChild(d);b.appendChild(q);d.setAttribute("id","inreply_"+f.getMessageId()+"_"+j.getMessageId());d.setAttribute("class","chat_reply_td");$(d).css({fontSize:"11px"});d.innerHTML=this.constructInReplyText(f,false);var w=f.getMessageText();if(w.length>this.m_replyLength){var B=makeElement("a",q);B.setAttribute("href","javascript:void(0);");B.setAttribute("id","more_link_"+f.getMessageId()+"_"+j.getMessageId());$(B).click(function(){K.showReplyMessage(f.getMessageId(),j.getMessageId())});var t=makeElement("img",B);t.setAttribute("id","more_pix_"+f.getMessageId()+"_"+j.getMessageId());t.src="http://cdn0.mobwarsapp.com/rpg_images/opensocial/sororitywars/ui/icon_expand.gif";$(t).css({width:"16px",height:"16px",borderWidth:"0px"});var u=makeElement("a",q);u.setAttribute("href","javascript:void(0);");u.setAttribute("id","less_link_"+f.getMessageId()+"_"+j.getMessageId());$(u).click(function(){K.hideReplyMessage(f.getMessageId(),j.getMessageId())});var G=makeElement("img",u);G.setAttribute("id","less_pix_"+f.getMessageId()+"_"+j.getMessageId());G.src="http://cdn0.mobwarsapp.com/rpg_images/opensocial/sororitywars/ui/icon_expand.gif";$(G).css({width:"16px",height:"16px",borderWidth:"0px"});$(u).hide()}$(q).css({verticalAlign:"top"})}var k=(c.firstChild==null);if(k){c.appendChild(r)}else{var D=c.childNodes.length;var x=c.firstChild;if(x){c.insertBefore(r,x)}else{c.appendChild(r)}}var s=document.createElement("span");s.innerHTML='<span class="chat_date_span">'+j.getDisplayDate()+"</span><br/>";C.appendChild(s);var H=document.createElement("span");var z=makeElement("span",H);z.setAttribute("class","chat_message_text");z.innerHTML=j.getMessageText();$(H).css({color:GBL.STYLES.text.color});if(j.isBroadcast()){var A=document.createElement("a");A.setAttribute("href","javascript:;");$(A).click(function(){K.replyToMessage(j.getMessageId())});$(A).css({color:"#999999",textDecoration:"none"});A.innerHTML="&nbsp;reply&raquo;";H.appendChild(A)}C.appendChild(H);if(this.numberOfServerRequest==1||a){$(r).show()}else{$(r).slideDown(this.m_slideTime)}if(!a){this.messageCache.push(j)}};ChatWidget.prototype.getMessageFromCacheById=function(b){for(var a=0;a<this.messageCache.length;a++){if(this.messageCache[a].getMessageId()==b){return this.messageCache[a]}}return null};ChatWidget.prototype.addToMessageToQueue=function(a){if(a instanceof Array){for(var b=0;b<a.length;b++){this.m_queueMessageRecords.push(a[b]);if(a[b].isBroadcast()&&a[b].getMessageId()>this.latestBroadcastId){this.latestBroadcastId=a[b].getMessageId()}}}else{this.m_queueMessageRecords.push(a);if(a.isBroadcast()&&a.getMessageId()>this.latestBroadcastId){this.latestBroadcastId=a.getMessageId()}}};ChatWidget.prototype.getNextMessageFromQueue=function(){return this.m_queueMessageRecords.pop()};ChatWidget.prototype.getNumberOfMessagesInQueue=function(){return this.m_queueMessageRecords.length};ChatWidget.prototype.setMaxMessageLength=function(a){this.maxMessageLength=a};ChatWidget.prototype.startDelayedRecordInsert=function(){var a=this;if(a.getNumberOfMessagesInQueue()>0){a.isQueueRunning=true;var b=a.getNextMessageFromQueue();a.addMessageRecord(b);if(a.numberOfServerRequest==1){setTimeout(function(){a.startDelayedRecordInsert()},0)}else{setTimeout(function(){a.startDelayedRecordInsert()},this.m_slideDelay)}}else{a.isQueueRunning=false}};ChatWidget.prototype.startRecordInsert=function(){var a=this;this.isQueueRunning=true;while(this.getNumberOfMessagesInQueue()>0){var b=this.getNextMessageFromQueue();this.addMessageRecord(b)}a.isQueueRunning=false};ChatWidget.prototype.startServerPolling=function(){var a=this;a.refresh();setTimeout(function(){a.startServerPolling()},this.serverPollInterval);this.numberOfServerRequest++};ChatWidget.prototype.refresh=function(d){var b=this;var a=0;if(d!=undefined&&d!=null&&d){a=1}var c={};c.user_id=GBL.MAIN_DATA.getViewer().getUserId();c.refresh_seconds=(this.serverPollInterval/1000);c.latest_broadcast_id=this.latestBroadcastId;c.num_server_requests=this.numberOfServerRequest;c.post_broadcast=a;if(!this.serverConnectionOpen){this.serverConnectionOpen=true;makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/messages",function(f){b.serverConnectionOpen=false;try{b.onRefresh(f)}catch(g){outputDebug("ui_chat 968"+g)}},c,0)}else{}};ChatWidget.prototype.requestData=function(c){var b=this;this.clear();this.showLoading();this.messageCache=new Array();var d={};var a=document.getElementById("chat_widget_post_control_wrapper");if((c=="ALL"||c=="SOCL")&&!($(a).is(":visible"))){$(a).slideDown(500)}else{if((c!="ALL"&&c!="SOCL")&&($(a).is(":visible"))){$(a).slideUp(500)}}if(!this.serverConnectionOpen){this.serverConnectionOpen=true;d.user_id=GBL.MAIN_DATA.getViewer().getUserId();if(c=="ALL"){makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/messages",function(f){b.serverConnectionOpen=false;try{b.onRequestData(f)}catch(g){outputDebug("ui_chat 968"+g)}},d,0)}else{d.newsfeed_type=c;makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/messages_by_type",function(f){b.serverConnectionOpen=false;try{b.onRequestFilterData(f)}catch(g){outputDebug("ui_chat 968"+g)}},d,0)}}else{}};ChatWidget.prototype.onRequestData=function(a){var b=this.parseJsonData(a);this.insertMessages(b)};ChatWidget.prototype.onRequestFilterData=function(a){var b=this.parseData(a);this.insertMessages(b)};ChatWidget.prototype.insertMessages=function(a){this.clear();if(a.length>0){this.addToMessageToQueue(a);this.startRecordInsert()}else{$("#chat_history_wrapper").html("<h3>No entries...</h3>")}};ChatWidget.prototype.onRefresh=function(a){var b=this.parseJsonData(a);if(b.length>0){this.addToMessageToQueue(b);this.startDelayedRecordInsert()}};ChatWidget.prototype.parseJsonData=function(a_responseData){var message_array=new Array();try{message_array=eval(a_responseData.text)}catch(e){}var final_records=new Array();for(var i=0;i<message_array.length;i++){final_records.push(this.buildMessageFromItem(message_array[i]))}var clean_list=new Array();for(i=0;i<final_records.length;i++){var msg_id=final_records[i].getMessageId();if(this.getMessageFromCacheById(msg_id)==null){clean_list.push(final_records[i])}else{}}return clean_list};ChatWidget.prototype.buildMessageFromItem=function(c){var b=new ChatMessage();b.setFromUserId(c.fromUserId);b.setToUserId(c.toUserId);b.setMessageId(c.id);b.setMessageText(decodeURIComponent(c.message));b.setFromUserPix(c.userpix);b.setFromUserName(decodeURIComponent(c.fromUserName));b.setMessageDate(new Date(c.createdOn));b.setDisplayDate(c.time_ago);b.setBroadcast(c.broadcast);b.setType(c.type);if(c.parentMessageId!=undefined&&c.parentMessageId!=null&&c.parentMessageId>0){var a=new ChatMessage();a.setMessageId(c.parentMessageId);a.setFromUserId(c.parentFromUserId);a.setMessageText(decodeURIComponent(c.parentMessageText));a.setMessageDate(new Date(c.parentMessageCreatedOn));a.setFromUserId(c.parentMessageFromUserId);a.setFromUserName(decodeURIComponent(c.parentMessageFromUserName));b.setParentMessage(a)}return b};ChatWidget.prototype.parseData=function(b){var d=getGadgetResponseData(b);var a=new Array();if(isValid(d)){try{var f=d.getElementsByTagName("category_newsfeed");if(f.length>0){var l=f[0].getElementsByTagName("entry");for(var c=0;c<l.length;c++){a.push(new ChatMessage(l[c]))}}}catch(h){outputAlert(h)}}var k=new Array();for(var j=0;j<a.length;j++){var g=a[j].getMessageId();if(this.getMessageFromCacheById(g)==null){k.push(a[j])}}return k};function ChatMessage(a){this.m_xmlNode=a;this.m_fromUserId=undefined;this.m_toUserId=undefined;this.m_messageId=undefined;this.m_messageText=undefined;this.m_fromUserPix=undefined;this.m_fromUserName=undefined;this.m_messageDate=undefined;this.m_parentMessage=undefined;this.m_displayDate=undefined;this.m_broadcast=true;this.m_type=undefined;this.init()}ChatMessage.prototype.init=function(){if(!isValid(this.m_xmlNode)){return}try{this.m_fromUserId=getXMLNodeValue(this.m_xmlNode,"creator_id")}catch(b){}try{this.m_messageId=getXMLNodeValue(this.m_xmlNode,"id")}catch(b){}try{this.m_messageText=getXMLEncodedStringNodeValue(this.m_xmlNode,"message_html")}catch(b){}try{this.m_displayDate=getXMLEncodedStringNodeValue(this.m_xmlNode,"time_ago")}catch(b){}try{this.m_toUserId=getXMLNodeValue(this.m_xmlNode,"id")}catch(b){}try{this.m_type=getXMLNodeValue(this.m_xmlNode,"type")}catch(b){}if(isValid(this.m_type)&&this.m_type!="MOB"){this.m_broadcast=false}try{this.m_fromUserPix=getXMLEncodedStringNodeValue(this.m_xmlNode,"userpix")}catch(b){}try{this.m_fromUserName=getXMLEncodedStringNodeValue(this.m_xmlNode,"creator_name")}catch(b){}try{var a=this.m_xmlNode.getElementsByTagName("parent_message");if(a.length>0){var c=a[0].getElementsByTagName("entry");if(c.length>0){this.m_parentMessage=new ChatMessage(c[0])}}}catch(b){}};ChatMessage.prototype.setFromUserId=function(a){this.m_fromUserId=a};ChatMessage.prototype.setToUserId=function(a){this.m_toUserId=a};ChatMessage.prototype.setMessageId=function(a){this.m_messageId=a};ChatMessage.prototype.setMessageText=function(a){this.m_messageText=a};ChatMessage.prototype.setFromUserPix=function(a){this.m_fromUserPix=a};ChatMessage.prototype.setFromUserName=function(a){this.m_fromUserName=a};ChatMessage.prototype.setMessageDate=function(a){this.m_messageDate=a};ChatMessage.prototype.setDisplayDate=function(a){this.m_displayDate=a};ChatMessage.prototype.setParentMessage=function(a){this.m_parentMessage=a};ChatMessage.prototype.setBroadcast=function(a){this.m_broadcast=a};ChatMessage.prototype.setType=function(a){this.m_type=a};ChatMessage.prototype.getFromUserId=function(){return this.m_fromUserId};ChatMessage.prototype.getToUserId=function(){return this.m_toUserId};ChatMessage.prototype.getMessageId=function(){return this.m_messageId};ChatMessage.prototype.getMessageText=function(){if(document.all){return this.m_messageText.unescapeHtml()}else{return this.m_messageText}};ChatMessage.prototype.getFromUserPix=function(){return this.m_fromUserPix};ChatMessage.prototype.getFromUserName=function(){return this.m_fromUserName};ChatMessage.prototype.getMessageDate=function(){return this.m_messageDate};ChatMessage.prototype.getDisplayDate=function(){return this.m_displayDate};ChatMessage.prototype.getParentMessage=function(){return this.m_parentMessage};ChatMessage.prototype.isBroadcast=function(){return this.m_broadcast};ChatMessage.prototype.getType=function(){return this.m_type};function ChatMessageParser(d){var c=getGadgetResponseData(d);var a=new Array();if(isValid(c)){try{var b=c.getElementsByTagName("entry");for(var f=0;f<b.length;f++){a.push(new ChatMessage(b[f]))}}catch(g){outputAlert(g)}}return a}function NewsFeedEntry(a){this.m_xmlNode=a;this.m_id=undefined;this.m_timeAgo=undefined;this.m_messageHTML=undefined;this.m_broadcast=undefined;this.fillFromXML()}NewsFeedEntry.prototype.fillFromXML=function(){if(!isValid(this.m_xmlNode)){return}try{this.m_id=getXMLNodeValue(this.m_xmlNode,"id")}catch(a){}try{this.m_timeAgo=getXMLEncodedStringNodeValue(this.m_xmlNode,"time_ago")}catch(a){}try{this.m_messageHTML=getXMLEncodedStringNodeValue(this.m_xmlNode,"message_html")}catch(a){}try{this.m_broadcast=getXMLEncodedStringNodeValue(this.m_xmlNode,"broadcast")}catch(a){}};NewsFeedEntry.prototype.getId=function(){return this.m_id};NewsFeedEntry.prototype.getTimeAgo=function(){return this.m_timeAgo};NewsFeedEntry.prototype.getMessageHTML=function(){return this.m_messageHTML};NewsFeedEntry.prototype.getBroadcast=function(){return this.m_broadcast};function CategorizedNewsFeedDiv(a){this.m_parentDiv=a;this.m_containerDiv=undefined;this.m_resultDiv=undefined;this.m_refreshDiv=undefined;this.m_sendCommandText="Broadcast a message to your mob for ";this.m_groupName="mob";this.m_all_entries=undefined;this.m_news_entries=undefined;this.m_broadcast_entries=undefined;this.m_chatWidget=undefined;this.m_startedFetch=false;this.m_doneFetch=false;this.m_enabledTabs=undefined;this.initialize();this.createDiv()}CategorizedNewsFeedDiv.prototype.initialize=function(){};CategorizedNewsFeedDiv.prototype.getTabValues=function(){var a=new Array();a.push({tabName:"Complete",filterKey:"ALL"});a.push({tabName:"Energy",filterKey:"ENRG"});a.push({tabName:"Combat",filterKey:"CMBT"});a.push({tabName:"Social",filterKey:"SOCL"});a.push({tabName:"Finance",filterKey:"FINC"});return a};CategorizedNewsFeedDiv.prototype.postBulletinMessage=function(a){postToBulletin(GBL.MAIN_DATA.getViewer(),"A broadcast to my Mob Family!",a+"<br><br>------------------------------------------------------<br><a href='"+GBL.APP_CANVAS_URL+"track=command'>This message sent from: Mobsters. Start a Mob with your friends. Rise from a petty thief to Mafia Don. Rule MySpace!</a>",function(b){})};CategorizedNewsFeedDiv.prototype.createDiv=function(){this.m_containerDiv=makeElementId("div",this.m_parentDiv,"mainNewsFeedDiv");this.m_containerDiv.style.margin="20px";this.m_containerDiv.style.padding="10px";this.m_containerDiv.style.border="solid 1px #AAAAAA";if(isValid(this.m_sendCommandText)){if(!GBL.LIVE_NEWSFEED){this.createCommentInputDiv()}}this.m_refreshDiv=document.createElement("div");this.m_containerDiv.appendChild(this.m_refreshDiv);if(!GBL.LIVE_NEWSFEED){this.m_refreshDiv.style.marginTop="20px";this.m_refreshDiv.style.paddingTop="10px"}this.refresh()};CategorizedNewsFeedDiv.prototype.createCommentInputDiv=function(){var a=makeElement("div",this.m_containerDiv);createTitleDiv(a,"Send Broadcast");var d=document.createElement("div");this.m_containerDiv.appendChild(d);d.style.marginTop="10px";var b=makeElementClass("div",d,"sendBroadcastInstructions");d.appendChild(b);b.innerHTML=this.m_sendCommandText+" $"+formatNumberWithCommas(25*GBL.MAIN_DATA.getViewer().getMobSize());var g=new TextBoxDiv(d);g.getTextArea().style.width="400px";g.getTextArea().rows=4;var c=this;var f=new DivButton(d,"Send Broadcast & Bulletin",function(){if(g.getText().length<=0){c.m_resultDiv.showMessage(undefined,"Please type a message.");return}if(g.getText().length>300){c.m_resultDiv.showMessage(undefined,"Sorry, the maximum length limit is 300 characters.");return}c.m_resultDiv.showMessage(undefined,"Sending...");var h={};h.user_id=GBL.MAIN_DATA.getViewer().getUserId();h.message=customEncoding(g.getText());h.cost=(25*GBL.MAIN_DATA.getViewer().getMobSize());c.postBulletinMessage(g.getText());makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/broadcast",function(j){handleResult(j,c.m_resultDiv,function(){c.refresh()})},h,0)});f.getButtonDiv().style.marginTop="5px";this.m_resultDiv=new ResultDiv(d)};CategorizedNewsFeedDiv.prototype.refresh=function(){this.m_refreshDiv.style.display="none";this.m_refreshDiv.innerHTML="";this.m_startedFetch=false;this.m_doneFetch=false;this.createUI()};CategorizedNewsFeedDiv.prototype.createUI=function(){var k=this;this.m_chatWidget=null;this.m_refreshDiv.style.display="block";var d=makeElement("div",this.m_refreshDiv);if(!GBL.LIVE_NEWSFEED){createTitleDiv(d,"News Feeds and Broadcasts")}else{createTitleDiv(d,"Live News Feeds and Broadcasts")}var a=makeElementClass("div",this.m_refreshDiv,"newsFeedDeleteAllLink");var l=makeElementClass("a",a,"standardLink");l.href="javascript:void(0);";l.innerHTML="(delete all newsfeeds and broadcasts)";if(GBL.LIVE_NEWSFEED){this.m_resultDiv=new ResultDiv(this.m_refreshDiv)}addEvent(l,"click",function(){if(k.m_chatWidget){k.m_chatWidget.deleteAllMessages()}else{var m={};m.user_id=GBL.MAIN_DATA.getViewer().getUserId();makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/delete_all_newsfeeds",function(n){},m)}return false});var g=this.getTabValues();function c(m){return m}var h=new Array();var b=new Array();var j=this.m_resultDiv;for(var f=0;f<g.length;f++){if(f==0){h.push(c(g[f].tabName));b.push(function(m){m.innerHTML="";if(!isValid(k.m_chatWidget)){k.m_chatWidget=new ChatWidget(m,j,k.m_groupName,k.postBulletinMessage)}else{k.m_chatWidget.reattachDiv();k.m_chatWidget.requestData(g[0].filterKey)}})}else{h.push(c(g[f].tabName));b.push(this.getTabCallbacks(g[f].filterKey))}}this.l_categoryTabsDiv=null;this.l_categoryTabsDiv=new SubTabDiv(this.m_refreshDiv,h,b,null,null,4000,null,null,0);this.l_categoryTabsDiv.selectTab(0)};CategorizedNewsFeedDiv.prototype.selectTab=function(a){this.l_categoryTabsDiv.selectTab(a)};CategorizedNewsFeedDiv.prototype.getTabCallbacks=function(a){var b=this;return function(c){b.m_chatWidget.requestData(a)}};function BaseXMLObject(a){this.m_xmlNode=a;this.m_data={};this.m_bypass={}}BaseXMLObject.prototype.lookupData=function(c,b,a){if(!isValid(this.m_data[c])){this.parseData(c,b,a)}return this.m_data[c]};BaseXMLObject.prototype.lookupUncachedData=function(c,b,a){if(isValid(this.m_bypass[c])){return this.m_bypass[c]}this.parseData(c,b,a);return this.m_data[c]};BaseXMLObject.prototype.clearCache=function(){this.m_data=null;this.m_data={};this.m_bypass=null;this.m_bypass={}};BaseXMLObject.prototype.updateNode=function(a){this.m_xmlNode=a};BaseXMLObject.prototype.parseData=function(c,b,a){try{this.m_data[c]=(isValid(b))?b(this.m_xmlNode,c):getXMLNodeValue(this.m_xmlNode,c)}catch(d){this.m_data[c]=a}};function makeCrateInfo(a){return isValid(a)?new CrateInfo(a):undefined}function CrateInfo(a){this.m_xmlDoc=a;this.m_data=new Object();this.fillFromXML()}CrateInfo.prototype.getData=function(){return this.m_data};CrateInfo.prototype.fillFromXML=function(){if(!isValid(this.m_xmlDoc)){return}try{this.m_data.crateUnit=checkValid(getXMLNodeValue(this.m_xmlDoc,"crate_unit"),"Exclusive Item")}catch(a){}try{this.m_data.crateItems=getXMLList(getXMLFirstNode(this.m_xmlDoc,"crate_item_info"),"crate_item",makeRPGItem)}catch(a){}};function Job(a){this.m_xmlNode=a;this.m_jobId=undefined;this.m_titleDiv=undefined;this.m_type=undefined;this.m_sector=undefined;this.m_featured=false;this.m_newReleased=false;this.m_reward=undefined;this.m_requirement=undefined;this.m_mastery=undefined;this.m_flavorText=undefined;this.m_jobCompletionPending=undefined;this.fillFromXML()}Job.prototype.fillFromXML=function(){if(!isValid(this.m_xmlNode)){return}try{this.m_jobId=getXMLNodeValue(this.m_xmlNode,"id")}catch(a){}try{this.m_titleDiv=getXMLEncodedStringNodeValue(this.m_xmlNode,"title")}catch(a){}try{this.m_type=getXMLEncodedStringNodeValue(this.m_xmlNode,"mission_type")}catch(a){}try{this.m_sector=getXMLEncodedStringNodeValue(this.m_xmlNode,"sector")}catch(a){}try{this.m_featured=isValid(getXMLNodeValue(this.m_xmlNode,"featured"))}catch(a){}try{this.m_newReleased=isValid(getXMLNodeValue(this.m_xmlNode,"new_released"))}catch(a){}try{this.m_reward=new JobReward(getXMLFirstNode(this.m_xmlNode,"reward"))}catch(a){}try{this.m_requirement=new JobRequirement(getXMLFirstNode(this.m_xmlNode,"requirement"))}catch(a){}try{var b=getXMLFirstNode(this.m_xmlNode,"mastery");if(isValid(b)){this.m_mastery=new JobMastery(b);this.m_reward.getData().mastery=this.m_mastery}}catch(a){}try{this.m_flavorText=getXMLEncodedStringNodeValue(this.m_xmlNode,"flavor_text")}catch(a){}try{this.m_swfContent=getXMLEncodedStringNodeValue(this.m_xmlNode,"swf_content")}catch(a){}try{this.m_doingContent=getXMLEncodedStringNodeValue(this.m_xmlNode,"doing_content")}catch(a){}try{this.m_delayMillis=parseInt(getXMLNodeValue(this.m_xmlNode,"delay_millis"))}catch(a){this.m_delayMillis=undefined}try{this.m_jobCompletionPending=parseBoolean(getXMLNodeValue(this.m_xmlNode,"job_completion_pending"))}catch(a){}};Job.prototype.fillFromJSON=function(a){if(!isValid(a)){return}if(isValid(a.id)){this.m_jobId=a.id}if(isValid(a.title)){this.m_titleDiv=a.title}if(isValid(a.sector)){this.m_sector=a.sector}if(isValid(a.featured)){this.m_featured=a.featured}if(isValid(a.reward)){this.m_reward=new JobReward();this.m_reward.fillFromJSON(a.reward)}if(isValid(a.requirement)){this.m_requirement=new JobRequirement();this.m_requirement.fillFromJSON(a.requirement)}if(isValid(a.flavor_text)){this.m_flavorText=a.flavor_text}if(isValid(a.doing_content)){this.m_doingContent=a.doing_content}if(isValid(a.delay_millis)){this.m_delayMillis=a.delay_millis}};Job.prototype.getFlavorText=function(){return this.m_flavorText};Job.prototype.getJobId=function(){return this.m_jobId};Job.prototype.getTitle=function(){return this.m_titleDiv};Job.prototype.getSector=function(){return this.m_sector};Job.prototype.getFeatured=function(){return this.m_featured};Job.prototype.getNewReleased=function(){return this.m_newReleased};Job.prototype.getReward=function(){return this.m_reward};Job.prototype.getRequirement=function(){return this.m_requirement};Job.prototype.getMastery=function(){return this.m_mastery};Job.prototype.getSwfContent=function(){return this.m_swfContent};Job.prototype.getDoingContent=function(){return this.m_doingContent};Job.prototype.getDelayMillis=function(){return this.m_delayMillis};Job.prototype.getMissionType=function(){return this.m_type};Job.prototype.getJobCompletionPending=function(){return this.m_jobCompletionPending};var MISSION_TYPES={};MISSION_TYPES.REGULAR="regular";MISSION_TYPES.MOVEMENT="movement";MISSION_TYPES.ONE_TIME_ONLY="one_time_only";MISSION_TYPES.SECRET="secret";function JobSector(a){this.m_xmlNode=a;this.m_data=new Object();this.fillFromXML()}JobSector.prototype.fillFromXML=function(){try{this.m_data.name=getXMLNodeValue(this.m_xmlNode,"name")}catch(a){outputDebug(a)}try{this.m_data.image_unselected_URL=getXMLNodeValue(this.m_xmlNode,"image_unselected_URL")}catch(a){outputDebug(a)}try{this.m_data.image_selected_URL=getXMLNodeValue(this.m_xmlNode,"image_selected_URL")}catch(a){outputDebug(a)}try{this.m_data.unlock_message=getXMLNodeValue(this.m_xmlNode,"unlock_message")}catch(a){outputDebug(a)}};JobSector.prototype.getData=function(){return this.m_data};function JobRequirement(a){this.m_xmlNode=a;this.m_data=new Object();this.fillFromXML()}JobRequirement.prototype.fillFromXML=function(){if(!isValid(this.m_xmlNode)){return}try{this.m_data.level=getXMLNodeValue(this.m_xmlNode,"level")}catch(g){}try{this.m_data.energy=getXMLNodeValue(this.m_xmlNode,"energy")}catch(g){}try{this.m_data.mobster=getXMLNodeValue(this.m_xmlNode,"mobster")}catch(g){}try{this.m_data.cash=getXMLNodeValue(this.m_xmlNode,"cash")}catch(g){}try{this.m_data.totalTerritories=getXMLNodeValue(this.m_xmlNode,"territories")}catch(g){}try{this.m_data.attack=getXMLNodeValue(this.m_xmlNode,"attack")}catch(g){}try{this.m_data.defense=getXMLNodeValue(this.m_xmlNode,"defense")}catch(g){}try{this.m_data.missionsCompleted=getXMLNodeValue(this.m_xmlNode,"missions_completed")}catch(g){}try{this.m_data.fightsWon=getXMLNodeValue(this.m_xmlNode,"fights_won")}catch(g){}try{this.m_data.totalItems=getXMLNodeValue(this.m_xmlNode,"number_of_items")}catch(g){}try{this.m_data.hitlistKills=getXMLNodeValue(this.m_xmlNode,"hitlist_kills")}catch(g){}try{this.m_data.kills=getXMLNodeValue(this.m_xmlNode,"kills")}catch(g){}try{this.m_data.newMobster=getXMLNodeValue(this.m_xmlNode,"new_mobster")}catch(g){}try{this.m_data.healthRange=getXMLNodeValue(this.m_xmlNode,"health_range")}catch(g){}try{this.m_data.favorPoints=getXMLEncodedStringNodeValue(this.m_xmlNode,"favor_points")}catch(g){}try{this.m_data.additionalInfo=getXMLEncodedStringNodeValue(this.m_xmlNode,"additional_info")}catch(g){}if(isValid(this.m_data.cash)){this.m_data.cash=parseInt(this.m_data.cash)}try{var a=this.m_xmlNode.getElementsByTagName("item");if(isValid(a)&&a.length>0){this.m_data.items=new Array();for(var d=0;d<a.length;d++){var b=new Object();b.number=getXMLNodeValue(a[d],"number");b.type=getXMLNodeValue(a[d],"type");b.image_url=getXMLEncodedStringNodeValue(a[d],"image_url");b.small_image_url=getXMLEncodedStringNodeValue(a[d],"small_image_url");b.name=getXMLEncodedStringNodeValue(a[d],"name");this.m_data.items.push(b)}}}catch(g){}try{var c=this.m_xmlNode.getElementsByTagName("class");if(isValid(c)&&c.length>0){this.m_data.classes=new Array();for(d=0;d<c.length;d++){var f=getXMLNodeValue(c[d],"name");this.m_data.classes.push(f)}}}catch(g){}try{var h=this.m_xmlNode.getElementsByTagName("items_of_category");if(isValid(h)&&h.length>0){var j=h[0];this.m_data.itemCategoryNumber=getXMLNodeValue(j,"number");this.m_data.itemCategoryCategory=getXMLNodeValue(j,"category")}}catch(g){}};JobRequirement.prototype.fillFromJSON=function(b){if(!isValid(b)){return}if(isValid(b.level)){this.m_data.level=b.level}if(isValid(b.energy)){this.m_data.energy=b.energy}if(isValid(b.mobster)){this.m_data.mobster=b.mobster}if(isValid(b.cash)){this.m_data.cash=parseInt(b.cash)}if(isValid(b.new_mobster)){this.m_data.newMobster=b.new_mobster}if(isValid(b.health_range)){this.m_data.healthRange=b.health_range}if(isValid(b.favor_points)){this.m_data.favorPoints=b.favor_points}if(isValid(b.additional_info)){this.m_data.additionalInfo=b.additional_info}if(isValid(b.items)&&isValid(b.items.length)&&b.items.length>0){this.m_data.items=new Array();for(var c=0;c<b.items.length;++c){var a=new Object();if(isValid(b.items[c].number)){a.number=b.items[c].number}if(isValid(b.items[c].type)){a.type=b.items[c].type}if(isValid(b.items[c].image_url)){a.image_url=b.items[c].image_url}if(isValid(b.items[c].small_image_url)){a.small_image_url=b.items[c].small_image_url}if(isValid(b.items[c].name)){a.name=b.items[c].name}this.m_data.items.push(a)}}};JobRequirement.prototype.getData=function(){return this.m_data};function JobReward(a){this.m_xmlNode=a;this.m_data=new Object();this.fillFromXML()}JobReward.prototype.fillFromXML=function(){if(!isValid(this.m_xmlNode)){return}try{this.m_data.min=parseInt(getXMLNodeValue(this.m_xmlNode,"min"))}catch(h){}try{this.m_data.max=parseInt(getXMLNodeValue(this.m_xmlNode,"max"))}catch(h){}try{this.m_data.experience=parseInt(getXMLNodeValue(this.m_xmlNode,"experience"))}catch(h){}try{this.m_data.min_skill=parseInt(getXMLNodeValue(this.m_xmlNode,"min_skill"))}catch(h){}try{this.m_data.max_skill=parseInt(getXMLNodeValue(this.m_xmlNode,"max_skill"))}catch(h){}try{this.m_data.min_favor=parseInt(getXMLNodeValue(this.m_xmlNode,"min_favor"))}catch(h){}try{this.m_data.max_favor=parseInt(getXMLNodeValue(this.m_xmlNode,"max_favor"))}catch(h){}try{this.m_data.min_hired=parseInt(getXMLNodeValue(this.m_xmlNode,"min_hired"))}catch(h){}try{this.m_data.max_hired=parseInt(getXMLNodeValue(this.m_xmlNode,"max_hired"))}catch(h){}try{this.m_data.favorPoints=getXMLEncodedStringNodeValue(this.m_xmlNode,"favor_points")}catch(h){}try{this.m_data.additionalInfo=getXMLEncodedStringNodeValue(this.m_xmlNode,"additional_info")}catch(h){}try{this.m_data.isCrateReward=parseBoolean(getXMLNodeValue(this.m_xmlNode,"is_crate_reward"))}catch(h){}try{this.m_data.crateInfo=makeCrateInfo(getXMLFirstNode(this.m_xmlNode,"crate_info"))}catch(h){}var c=this.m_xmlNode.getElementsByTagName("item");if(isValid(c)&&c.length>0){this.m_data.items=new Array();for(var g=0;g<c.length;g++){var b=false;try{b=getBooleanValue(getXMLNodeValue(c[g],"is_avatar"))}catch(h){}try{var f=new Object();f.number=getXMLNodeValue(c[g],"number");f.image_url=getXMLEncodedStringNodeValue(c[g],"image_url");f.name=getXMLEncodedStringNodeValue(c[g],"name");if(b){f.name+="<br><span class='avatarOnlyTag'>(Avatar Item)</span>"}f.description=getXMLEncodedStringNodeValue(c[g],"description");this.m_data.items.push(f)}catch(h){outputDebug(h)}}}var j=getXMLFirstNode(this.m_xmlNode,"rotating_images");if(isValid(j)){var a=j.getElementsByTagName("url");if(isValid(a)&&a.length>0){this.m_data.rotatingImageUrls=new Array();this.m_data.rotatingImageDelays=new Array();for(g=0;g<a.length;g++){try{this.m_data.rotatingImageUrls.push(a[g].firstChild.nodeValue);this.m_data.rotatingImageDelays.push(300)}catch(h){outputDebug(h)}}}this.m_data.useRewardImageFlipper=true;try{var d=getXMLNodeValue(j,"use_reward_image_flipper");if(isValid(d)){this.m_data.useRewardImageFlipper=getBooleanValue(d)}}catch(h){}this.m_data.useSlotAnimation=true;try{this.m_data.useSlotAnimation=getBooleanValue(getXMLNodeValue(j,"use_slot_animation"))}catch(h){}}try{this.m_data.lootDescription=getXMLEncodedStringNodeValue(this.m_xmlNode,"loot_description")}catch(h){}};JobReward.prototype.fillFromJSON=function(b){if(!isValid(b)){return}if(isValid(b.min)){this.m_data.min=parseInt(b.min)}if(isValid(b.max)){this.m_data.max=parseInt(b.max)}if(isValid(b.experience)){this.m_data.experience=parseInt(b.experience)}if(isValid(b.favor_points)){this.m_data.favorPoints=parseInt(b.favor_points)}if(isValid(b.additional_info)){this.m_data.additionalInfo=b.additional_info}if(isValid(b.loot_description)){this.m_data.lootDescription=b.loot_description}if(isValid(b.items)&&isValid(b.items.length)&&b.items.length>0){this.m_data.items=new Array();for(var c=0;c<b.items.length;++c){var a=new Object();if(isValid(b.items[c].number)){a.number=b.items[c].number}if(isValid(b.items[c].image_url)){a.image_url=b.items[c].image_url}if(isValid(b.items[c].name)){a.name=b.items[c].name}if(isValid(b.items[c].description)){a.description=b.items[c].description}this.m_data.items.push(a)}}};JobReward.prototype.getData=function(){return this.m_data};JobReward.prototype.hasRotatingImages=function(){return isValid(this.m_data.rotatingImageUrls)&&isValid(this.m_data.rotatingImageDelays)};JobReward.prototype.useSlotAnimation=function(){return isValid(this.m_data.useSlotAnimation)&&this.m_data.useSlotAnimation&&this.hasRotatingImages()&&isSupportedImageFlipperBrowser()};function JobMastery(a){this.m_xmlNode=a;this.m_data=new Object();this.fillFromXML()}JobMastery.prototype.fillFromXML=function(){if(!isValid(this.m_xmlNode)){return}try{this.m_data.level=getXMLNodeValue(this.m_xmlNode,"level")}catch(b){}try{this.m_data.current=parseInt(getXMLNodeValue(this.m_xmlNode,"current"))}catch(b){}try{this.m_data.min=parseInt(getXMLNodeValue(this.m_xmlNode,"min"))}catch(b){}try{this.m_data.max=parseInt(getXMLNodeValue(this.m_xmlNode,"max"))}catch(b){}try{var a=getXMLFirstNode(this.m_xmlNode,"reward");if(isValid(a)){this.m_data.reward=new JobReward(a)}}catch(b){}};JobMastery.prototype.getData=function(){return this.m_data};JobMastery.IMAGE_MAP={BRONZE:"http://cdn0.mobwarsapp.com/rpg_images/opensocial/mob/ui/mastery/mastery_b.gif",SILVER:"http://cdn0.mobwarsapp.com/rpg_images/opensocial/mob/ui/mastery/mastery_s.gif",GOLD:"http://cdn0.mobwarsapp.com/rpg_images/opensocial/mob/ui/mastery/mastery_g.gif",PLATINUM:"http://cdn0.mobwarsapp.com/rpg_images/opensocial/mob/ui/mastery/mastery_p.gif",DIAMOND:"http://cdn0.mobwarsapp.com/rpg_images/opensocial/mob/ui/mastery/mastery_d.gif"};function JobInventoryDiv(a){this.m_parentDiv=a;this.m_containerDiv=undefined;this.m_resultDiv=undefined;this.m_refreshDiv=undefined;this.m_mobInventoryDiv=undefined;this.m_mobJobListDiv=undefined;this.m_mobInventoryConstructor=InventoryDiv;this.m_mobJobListConstructor=JobListDiv;this.initialize();this.createDiv(this.m_parentDiv)}JobInventoryDiv.prototype.initialize=function(a){};JobInventoryDiv.prototype.createDiv=function(a){this.m_parentDiv=a;this.m_containerDiv=document.createElement("div");this.m_parentDiv.appendChild(this.m_containerDiv);this.m_containerDiv.style.padding="15px";this.m_containerDiv.style.textAlign="center";this.m_resultDiv=new ResultDiv(this.m_containerDiv);this.m_refreshDiv=document.createElement("div");this.m_containerDiv.appendChild(this.m_refreshDiv);this.m_refreshDiv.style.textAlign="center";this.refresh()};JobInventoryDiv.prototype.refresh=function(){var a=this;this.m_refreshDiv.innerHTML="";this.m_mobInventoryDiv=new this.m_mobInventoryConstructor(this.m_refreshDiv,this.m_resultDiv,function(){a.refresh()});this.m_mobJobListDiv=new this.m_mobJobListConstructor(this.m_refreshDiv,this.m_resultDiv,function(){a.refresh()});this.m_mobJobListDiv.setOnGetJobListCallback(function(b){this.onGetJobInventory(b)}.bind(this))};JobInventoryDiv.prototype.onGetJobInventory=function(c){if(isValid(c)){try{var a=getXMLFirstNode(c,"inventory");this.m_mobInventoryDiv.fillFromXML(a)}catch(b){outputDebug("onGetJobInventoryList "+b)}}this.m_mobJobListDiv.m_loading=false};function JobListDiv(a,b){this.m_refreshCallback=undefined;this.m_parentDiv=a;this.m_containerDiv=undefined;this.m_resultDiv=b;this.m_tableDiv=undefined;this.m_nextLevelDiv=undefined;this.m_onGetJobListCallback=undefined;this.m_requestDestinationCDN=true;this.m_requestDestinationURI="get_job_list";this.m_titleDiv=undefined;this.m_rewardHeader=undefined;this.m_requirementHeader=undefined;this.m_actionHeader=undefined;this.m_nextLevelText=undefined;this.m_doButtonText=undefined;this.m_doingText=undefined;this.m_repeatText=undefined;this.m_rewardPayoutLabel="Payout";this.m_rewardExperienceLabel="Experience";this.m_favorPointsLabel="Favor Points";this.m_rewardLootLabel="Loot";this.m_authKey=undefined;this.m_version=3;this.m_imageFlipperGalleryOptions={backgroundColors:"#000000,#222222",backgroundAlpha:"0.2"};this.m_imageFlipperSlotOptions={backgroundColors:"#000000,#333333",backgroundAlpha:"0.5"};this.m_swfsDir=FLASH_DESTINATION_URL+"/../common";this.initialize();this.createDiv(this.m_parentDiv)}JobListDiv.prototype.setOnGetJobListCallback=function(a){this.m_onGetJobListCallback=a};JobListDiv.prototype.setRefreshCallback=function(a){this.m_refreshCallback=a};JobListDiv.prototype.initialize=function(){};JobListDiv.prototype.createDiv=function(b){outputDebug("createDiv");this.m_parentDiv=b;this.m_containerDiv=document.createElement("div");this.m_parentDiv.appendChild(this.m_containerDiv);this.m_containerDiv.style.padding="15px";this.m_containerDiv.style.textAlign="center";if(!isValid(this.m_resultDiv)){this.m_resultDiv=new ResultDiv(this.m_containerDiv)}var a=document.createElement("div");this.m_containerDiv.appendChild(a);createTitleDiv(a,this.m_titleDiv);this.m_nextLevelDiv=document.createElement("div");this.m_containerDiv.appendChild(this.m_nextLevelDiv);this.m_tableDiv=document.createElement("div");this.m_containerDiv.appendChild(this.m_tableDiv);this.m_tableDiv.style.textAlign="center";this.m_tableDiv.style.paddingTop="5px";this.refresh()};JobListDiv.prototype.refresh=function(){if(isValidFunction(this.m_refreshCallback)){this.m_refreshCallback()}this.m_tableDiv.innerHTML="";var f=document.createElement("table");this.m_tableDiv.appendChild(f);f.style.marginLeft="auto";f.style.marginRight="auto";f.style.cellSpacing="0px";f.style.borderCollapse="collapse";var a=document.createElement("tbody");f.appendChild(a);var b=document.createElement("tr");a.appendChild(b);var j=document.createElement("td");b.appendChild(j);addHeaderStyleWithInnerDiv(j,this.m_rewardHeader,"250px");j=document.createElement("td");b.appendChild(j);addHeaderStyleWithInnerDiv(j,this.m_requirementHeader,"450px");j=document.createElement("td");b.appendChild(j);addHeaderStyleWithInnerDiv(j,this.m_actionHeader,"150px");var h=document.createElement("div");this.m_containerDiv.appendChild(h);h.style.padding="10px";h.innerHTML=getLoadingMessageHTML();var g="";var d={};d.level=GBL.MAIN_DATA.getViewer().getLevel();g=REQUEST_DESTINATION_URL+"/"+this.m_requestDestinationURI;d.user_id=GBL.MAIN_DATA.getViewer().getUserId();d.version=this.m_version;d.favor_points=true;outputDebug("m_requestDestinationCDN "+this.m_requestDestinationCDN);var c=this;makeXMLNotCachedRequest(g,function(k){h.style.display="none";c.onGetJobList(k,a)},d)};JobListDiv.prototype.claimIfPendingJob=function(d){if(d.getJobCompletionPending()){var c=REQUEST_DESTINATION_URL+"/complete_pending_job";var b={};b.user_id=GBL.MAIN_DATA.getViewer().getUserId();b.job_id=d.getJobId();var a=this;makeXMLNotCachedRequest(c,function(h){var f=getGadgetResponseXML(h);if(!isValid(f)){return}try{var j=getBooleanValue(getXMLFirstChildValue(f,"success"))}catch(g){}if(!j){return}HandleJobResult(a,h,d)},b)}};JobListDiv.prototype.onGetJobList=function(d,h){var c=getGadgetResponseData(d);if(isValid(c)){try{this.m_authKey=getXMLEncodedStringNodeValue(c,"auth_key")}catch(g){}try{var a=c.getElementsByTagName("job");for(var f=0;f<a.length;f++){var j=new Job(a[f]);h.appendChild(this.createJobTr(j))}var b=getXMLNodeValue(c,"next_level");if(isValid(b)){this.m_nextLevelDiv.style.padding="10px";this.m_nextLevelDiv.innerHTML="<span class='nextLevelMissionsDiv'>  "+this.m_nextLevelText+" "+b+" ..."}else{this.m_nextLevelDiv.style.padding="0px";this.m_nextLevelDiv.innerHTML=""}}catch(g){outputAlert("onGetJobList "+g)}if(isValidFunction(this.m_onGetJobListCallback)){this.m_onGetJobListCallback(c)}}};JobListDiv.prototype.createJobTr=function(c){var b=document.createElement("tr");var f=document.createElement("td");b.appendChild(f);f.style.padding="5px 20px 5px 10px";f.style.borderBottom="solid 1px #505050";f.style.verticalAlign="top";var d=createWhiteDiv(f);d.style.fontSize="14px";d.style.fontWeight="bold";d.innerHTML=c.getTitle();f.appendChild(this.getRewardDiv(c.getReward()));f=document.createElement("td");b.appendChild(f);f.style.padding="5px 10px 5px 10px";f.style.borderBottom="solid 1px #505050";f.style.verticalAlign="top";f.appendChild(this.getRequirementDiv(c.getRequirement()));f=document.createElement("td");b.appendChild(f);f.style.padding="5px 15px 5px 15px";f.style.borderBottom="solid 1px #505050";var a=this;new DivButton(f,this.m_doButtonText,function(g){gaTrackEvent("jobs","click",c.getTitle());a.doJob(c)});return b};JobListDiv.prototype.getAuthKey=function(){return this.m_authKey};JobListDiv.prototype.showCustomSWFContent=function(c){if(isValid(c.getSwfContent())){var b=isValid(GBL.MAIN_DATA.getViewer().getAuthKey())?GBL.MAIN_DATA.getViewer().getAuthKey():this.getAuthKey();consoleLog("Show custom content");var a=createSWFContent(c.getSwfContent(),b,700,400,GBL.BACKGROUND_COLOR,null);this.m_resultDiv.showCustomContent(undefined,a);consoleLog("Done showing custom content")}};JobListDiv.prototype.doJob=function(d){var b=this;var f=d.getRequirement();if(isValid(f)){var c=f.getData().favorPoints;if(isValid(c)&&c>0){GBL.FAVOR_POINTS_CHANGED=true}}goToPageTop();if(isValid(d.getSwfContent())){this.showCustomSWFContent(d);return}if(d.getReward().useSlotAnimation()){var a=document.createElement("div");this.m_resultDiv.showCustomContent(undefined,a);this.addDoingContentImageFlipper(a,d.getReward().getData())}else{if(isValid(d.getDoingContent())&&!isSafariLTE3()&&!isOpera()){a=document.createElement("div");a.innerHTML=d.getDoingContent();this.m_resultDiv.showCustomContent(undefined,a)}else{this.m_resultDiv.showMessage(undefined,this.m_doingText)}}this.doJobCall(d)};var slotStarted=function(){};var slotStopped=function(){};JobListDiv.prototype.doJobCall=function(c){var b={};b.user_id=GBL.MAIN_DATA.getViewer().getUserId();b.job_id=c.getJobId();var a=this;makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/do_job",function(d){HandleJobResult(a,d,c)},b,1)};function HandleJobResult(l,d,k){var a=undefined;var b=undefined;if(isValid(l.m_repeatText)){b=document.createElement("p");var h=document.createElement("a");b.appendChild(h);h.className="standardLink";h.href="#";h.appendChild(document.createTextNode(l.m_repeatText));addEventWithParameter(h,"click",function(){l.doJob(k);gaTrackEvent("jobs","click","do_again")});GBL.LAST_REPEATABLE_JOB_LINK=document.createElement("p");h=document.createElement("a");GBL.LAST_REPEATABLE_JOB_LINK.appendChild(h);h.className="standardLink";h.href="#";h.appendChild(document.createTextNode(l.m_repeatText));addEventWithParameter(h,"click",function(){l.doJob(k);gaTrackEvent("jobs","click","do_again")})}try{a=getGadgetResponseData(d)}catch(c){}try{m=getXMLEncodedStringNodeValue(a,"on_completion_redirect_url")}catch(c){}if(isValid(a)&&m){var m=m+(m.indexOf("?")>-1?"&":"?")+"uid="+GBL.MAIN_DATA.getViewer().getUserId();window.open(m,"","resizable")}var j=function(){GBL.MAIN_TABS.invalidateTabs();l.refresh()};var g=function(){var o=undefined;var n=undefined;var q=undefined;try{n=getGadgetResponseData(d)}catch(p){}try{q=getBooleanValue(getXMLNodeValue(n,"success"))}catch(p){}try{o=getXMLEncodedStringNodeValue(n,"image_url")}catch(p){}if(!isValid(n)||!q||!isValid(o)){outputDebug("setStopImage: Validity check FAILED");return false}try{document.getElementById("imageflipperslot").setStopImageURL(o);return true}catch(p){outputDebug("setStopImage: Flash Call FAILED");return false}};var f=function(){var n=delayCallback(function(){handleResult(d,l.m_resultDiv,j,b)});if(k.getReward().useSlotAnimation()&&g()){slotStopped=n}else{n()}};if(k&&k.getReward().useSlotAnimation()){window.setTimeout(f,2*1000)}else{if(isValid(k.getDelayMillis())&&k.getDelayMillis()>100&&!isSafariLTE3()&&!isOpera()){window.setTimeout(f,k.getDelayMillis())}else{f()}}}JobListDiv.prototype.getRewardDiv=function(c){var g=c.getData();var b=document.createElement("div");var a=undefined;var f=undefined;if(g.min>0||g.max>0){f=createWhiteDiv(b);f.innerHTML=this.m_rewardPayoutLabel+": <span class='rewardPayoutLabel'>$"+formatNumberWithCommas(g.min)+" - $"+formatNumberWithCommas(g.max)+" </span>"}if(g.experience>0){f=createWhiteDiv(b);f.innerHTML=this.m_rewardExperienceLabel+": +"+g.experience}if(isValid(g.favorPoints)){f=createWhiteDiv(b);f.style.color="#CD7F32";f.innerHTML=this.m_favorPointsLabel+": "+g.favorPoints}if(isValid(g.additionalInfo)){f=createWhiteDiv(b);f.innerHTML=g.additionalInfo}if(isValid(g.rotatingImageUrls)&&g.useRewardImageFlipper){this.addRewardImageFlipper(b,g)}else{if(isValid(g.lootDescription)||(isValid(g.items)&&g.items.length>0)){a=f=createWhiteDiv(b);var d=this.m_rewardLootLabel+":";if(isValid(g.lootDescription)){d+=" "+g.lootDescription}f.innerHTML=d;if(isValid(g.items)&&g.items.length>0){createItemsListDiv(b,g.items,1)}}}return b};JobListDiv.prototype.addRewardImageFlipper=function(b,h){var f=new SideBySideCells(b,false);var d={urls:h.rotatingImageUrls.join(","),delays:h.rotatingImageDelays.join(","),moveDuration:"600"};if(isValid(this.m_imageFlipperGalleryOptions)){for(var a in this.m_imageFlipperGalleryOptions){d[a]=encodeURIComponent(this.m_imageFlipperGalleryOptions[a])}}var g="";if(h.useSlotAnimation){g=this.m_swfsDir+"/ImageFlipper/ImageFlipperGallery.swf"}else{g=this.m_swfsDir+"/ImageFlipper/ImageFlipper.swf"}var c=createGalaSWFContent(g,this.getAuthKey(),125,75,"#000000",d,{wmode:"transparent"});$(f.getTable()).css({"border-spacing":"0px","border-collapse":"collapse"});f.getLeftCell().innerHTML='<span style="float:left;">'+this.m_rewardLootLabel+": </span>";$(f.getLeftCell()).css({"vertical-align":"top"});f.getRightCell().appendChild(c)};JobListDiv.prototype.addDoingContentImageFlipper=function(b,g){b.innerHTML+="<span style='color:#CD7F32; font-weight:bold; font-size:14px'> Your gift is being chosen: </span> <br>";var d=document.createElement("div");b.appendChild(d);var c={urls:g.rotatingImageUrls.join(","),delays:g.rotatingImageDelays.join(",")};if(isValid(this.m_imageFlipperSlotOptions)){for(var a in this.m_imageFlipperSlotOptions){c[a]=encodeURIComponent(this.m_imageFlipperSlotOptions[a])}}var f=this.m_swfsDir+"/ImageFlipper/ImageFlipperSlot.swf";createGalaSWFContent(f,this.getAuthKey(),125*3,75,"#000000",c,{wmode:"transparent"},"imageflipperslot",d)};JobListDiv.prototype.getRequirementDiv=function(f){var d=f.getData();var c=document.createElement("div");var a=new SideBySideCells(c,false);var g=a.getLeftCell();g.style.verticalAlign="top";var h=createWhiteDiv(g);h.style.fontWeight="bold";h.style.fontStyle="italic";h.innerHTML="Requires...";if(d.energy>0){h=createWhiteDiv(g);h.innerHTML="Energy: "+d.energy}if(isValid(d.totalTerritories)&&d.totalTerritories>0){h=createWhiteDiv(g);h.innerHTML="Territories: "+d.totalTerritories}if(isValid(d.attack)&&d.attack>0){h=createWhiteDiv(g);h.innerHTML="Attack: "+d.attack}if(isValid(d.defense)&&d.defense>0){h=createWhiteDiv(g);h.innerHTML="Defense: "+d.defense}if(isValid(d.missionsCompleted)&&d.missionsCompleted>0){h=createWhiteDiv(g);h.innerHTML="Missions completed: "+d.missionsCompleted}if(isValid(d.fightsWon)&&d.fightsWon>0){h=createWhiteDiv(g);h.innerHTML="Fights Won: "+d.fightsWon}if(isValid(d.itemCategoryCategory)&&isValid(d.itemCategoryNumber)&&d.itemCategoryNumber>0){h=createWhiteDiv(g);h.innerHTML=d.itemCategoryCategory+": "+d.itemCategoryNumber}if(d.mobster>0){h=createWhiteDiv(g);h.innerHTML="Mobsters: "+d.mobster}if(isValid(d.newMobster)&&d.newMobster>0){h=createWhiteDiv(g);h.innerHTML="New Mobsters: "+d.newMobster+" <span class='missionsViewMobstersConsumed'>(consumed)</span>"}if(isValid(d.cash)&&d.cash>0){h=createWhiteDiv(g);h.innerHTML="Cash: $"+d.cash}if(isValid(d.favorPoints)){h=createWhiteDiv(g);h.style.color="#CD7F32";h.innerHTML=this.m_favorPointsLabel+": "+d.favorPoints}if(isValid(d.additionalInfo)){h=createWhiteDiv(g);h.innerHTML=d.additionalInfo}var b=a.getRightCell();createItemsListDiv(b,d.items,2,true);return c};GBL.backendJobSectorTab=undefined;GBL.userJobSectorTab=undefined;function SectorJobListDiv(a,b){this.m_descriptionHeader=undefined;this.m_sectorList=undefined;this.m_sectorToJobList=undefined;this.m_featuredJobList=undefined;this.m_jobList=undefined;this.m_nextLevel=undefined;this.m_spacerImage=undefined;this.m_version=4;this.m_oneTimeOnlyLabel=undefined;this.m_newMissionLabel=" (New!)";this.m_rewardLabel=undefined;this.m_requirementLabel=undefined;this.m_energyLabel=undefined;this.m_totalTerritoriesLabel=undefined;this.m_attackLabel=undefined;this.m_defenseLabel=undefined;this.m_missionsCompletedLabel=undefined;this.m_fightsWonLabel=undefined;this.m_totalItemsLabel=undefined;this.m_hitlistKillsLabel=undefined;this.m_killsLabel=undefined;this.m_itemCategoryLabel=undefined;this.m_mobLabel=undefined;this.m_newMobLabel=undefined;this.m_cashLabel=undefined;this.m_favorPointsLabel=undefined;this.m_useTable=undefined;SectorJobListDiv.baseConstructor.call(this,a,b)}extendClass(SectorJobListDiv,JobListDiv);SectorJobListDiv.prototype.createCustomJobTr=function(a){};SectorJobListDiv.prototype.onGetCustomJobSpecs=function(b,a,c){};SectorJobListDiv.prototype.getCustomRewardDiv=function(a){};SectorJobListDiv.prototype.getCustomRequirementDiv=function(){};SectorJobListDiv.prototype.createDiv=function(a){this.m_parentDiv=a;this.m_containerDiv=makeElementClass("div",this.m_parentDiv,"mission_container");if(!isValid(this.m_resultDiv)){this.m_resultDiv=new ResultDiv(this.m_containerDiv)}this.m_nextLevelDiv=makeElement("div",this.m_containerDiv);this.m_tableDiv=makeElement("div",this.m_containerDiv,{textAlign:"center",paddingTop:"5px"});this.refresh()};SectorJobListDiv.prototype.initialize=function(){this.m_titleDiv="Missions:";this.m_descriptionHeader="Description";this.m_rewardHeader="Payout";this.m_requirementHeader="Mission Requires";this.m_actionHeader="Do Mission";this.m_nextLevelText="You can unlock more missions after you get to level";this.m_doButtonText="Start";this.m_doingText="Doing mission... ";this.m_repeatText="Do this mission again!";this.m_requestDestinationCDN=false;this.m_oneTimeOnlyLabel=" (One Time Only)";this.m_newMissionLabel=" (New!)";this.m_rewardLabel="Rewards...";this.m_rewardExperienceLabel="experience";this.m_requirementLabel="Needs...";this.m_energyLabel="energy";this.m_totalTerritoriesLabel="territories owned";this.m_attackLabel="attack";this.m_defenseLabel="defense";this.m_missionsCompletedLabel="missions completed";this.m_fightsWonLabel="fights won";this.m_hitlistKillsLabel="hitlist kills";this.m_totalItemsLabel="items";this.m_killsLabel="kills";this.m_mobLabel="mob";this.m_newMobLabel="new mobsters";this.m_cashLabel="cash";this.m_favorPointsLabel="favor point(s)";this.m_spacerImage="url(http://cdn0.mobwarsapp.com/rpg_images/opensocial/mob/ui/sector_tabs/spacer.gif)"};SectorJobListDiv.prototype.refresh=function(){if(isValidFunction(this.m_refreshCallback)){this.m_refreshCallback()}this.m_tableDiv.innerHTML="";var d=makeElement("div",this.m_containerDiv,{padding:"10px"});d.innerHTML=getLoadingMessageHTML();var c="";var b={};b.level=GBL.MAIN_DATA.getViewer().getLevel();c=REQUEST_DESTINATION_URL+"/"+this.m_requestDestinationURI;b.user_id=GBL.MAIN_DATA.getViewer().getUserId();b.favor_points=true;b.version=this.m_version;var a=this;makeXMLNotCachedRequest(c,function(f){d.style.display="none";a.onGetJobList(f,a.m_tableDiv)},b)};SectorJobListDiv.prototype.createJobDiv=function(k){var j=document.createElement("div");$(j).css({paddingTop:"10px"});var d=createWhiteDiv(j,{fontWeight:"bold",backgroundColor:"rgb(70,28,28)",color:"rgb(255,255,255)",fontSize:"15px",paddingLeft:"5px",paddingTop:"2px",paddingBottom:"2px"});$(d).append(k.getTitle());if(k.getNewReleased()){d.innerHTML+="<span style='color:#FFFFFF;'>"+this.m_newMissionLabel+"</span>"}if(k.getMissionType()==MISSION_TYPES.ONE_TIME_ONLY){d.style.color="#FFFFFF";d.innerHTML+="<span style='color:#FFFFFF; font-weight:normal; font-size:12px'>"+this.m_oneTimeOnlyLabel+"</span>";$(d).css({backgroundColor:"rgb(28,55,110)"})}if(k.getFeatured()){d.style.color="#FFFFFF";$(d).css({backgroundColor:"rgb(28,55,110)"})}if(isValid(k.getFlavorText())){var f=makeElementClass("div",j,"job_flavor_text");f.innerHTML=k.getFlavorText()}var c=makeElement("table",j,{marginLeft:"auto",marginRight:"auto",cellSpacing:"auto",borderCollapse:"collapse"});var a=makeElement("tbody",c);var b=makeElement("tr",a,{borderBottom:"solid 1px rgb(0,0,0)"});var g=makeElement("td",b,{width:"240px",paddingLeft:"15px",paddingTop:"0px",verticalAlign:"top"});g.appendChild(this.getRewardDiv(k.getReward()));g=makeElement("td",b,{paddingLeft:"8px",width:"420px",verticalAlign:"top",borderLeft:"1px solid rgb(50, 50, 50)"});g.appendChild(this.getRequirementDiv(k.getRequirement()));g=makeElement("td",b,{width:"100px",paddingTop:"5px"});var h=this;new DivButton(g,this.m_doButtonText,function(){gaTrackEvent("jobs","click",k.getTitle());h.doJob(k)});return j};SectorJobListDiv.prototype.createJobTable=function(c){var d=makeElement("table",c,{marginLeft:"auto",marginRight:"auto",cellSpacing:"auto",borderCollapse:"collapse"});var a=makeElement("tbody",d);var b=makeElement("tr",a);var f=makeElement("td",b);addHeaderStyleWithInnerDiv(f,this.m_descriptionHeader,"300px");f=makeElement("td",b);addHeaderStyleWithInnerDiv(f,this.m_requirementHeader,"400px");f=makeElement("td",b);addHeaderStyleWithInnerDiv(f,this.m_actionHeader,"100px");return d};SectorJobListDiv.prototype.createJobsDiv=function(k){$(k).html("");var j=makeElement("div",k,{paddingTop:"5px",paddingDown:"5px"});var p=makeElement("div",j);var r=makeElement("div",j,{paddingTop:"10px"});var h=[];for(var c=0;c<this.m_sectorList.length;++c){var f=this.m_sectorList[c];var d=f.getData().name;if(d=="None"){continue}var g=makeElementClass("div",r,"MissionTabContent");if(this.m_sectorToJobList[d].length==0){if(isValid(f.getData().unlock_message)){var m=makeElement("div",g,{padding:"10px"});var b=makeElementClass("span",m,"nextLevelTabsDiv");b.style.fontSize="14px";b.innerHTML=f.getData().unlock_message}}else{if(isValid(this.m_nextLevel)){var a=makeElementClass("div",g);a.style.padding="10px";var o=makeElementClass("span",a,"nextLevelMissionsDiv");o.style.fontSize="14px";o.style.fontWeight="normal";o.innerHTML=this.m_nextLevelText+" "+this.m_nextLevel+" ..."}}var q=undefined;if(this.m_useTable&&this.m_sectorToJobList[d].length!=0){q=this.createJobTable(g)}else{q=makeElement("div",g)}if(this.m_sectorToJobList[d].length!=0){var n=this;jQuery.each(this.m_featuredJobList,function(s,t){if(n.m_useTable){$(q).children("tbody").append(n.createJobTr(t))}else{q.appendChild(n.createJobDiv(t))}});jQuery.each(this.m_sectorToJobList[d],function(s,t){if(n.m_useTable){$(q).children("tbody").append(n.createJobTr(t))}else{q.appendChild(n.createJobDiv(t))}})}h.push(new CustomTab(d,CustomTabDiv.imageTabDomFunc(f.getData().image_selected_URL,f.getData().image_unselected_URL),CustomTabDiv.showTabContentFunc(g,"MissionTabContent"),CustomTabDiv.tabSelectedFunc(d,"userJobSectorTab"),CustomTabDiv.tabUnselectedFunc()))}$(".MissionTabContent").hide();var l=new CustomTabDiv(p,h);$(l.getTabTable()).css({backgroundImage:this.m_spacerImage});if(isValid(GBL.userJobSectorTab)){l.selectTabByName(GBL.userJobSectorTab)}else{l.selectTab(0)}};SectorJobListDiv.prototype.onGetJobList=function(a,l){this.m_sectorList=new Array();this.m_sectorToJobList=new Object();this.m_jobList=new Array();this.m_featuredJobList=new Array();var c=getGadgetResponseData(a);if(!isValid(c)){return}try{this.m_authKey=getXMLEncodedStringNodeValue(c,"auth_key")}catch(g){outputDebug("onGetJobList "+g)}try{var d=getXMLEncodedStringNodeValue(c,"latest_sector");if(isValid(d)&&d!=GBL.backendJobSectorTab){GBL.backendJobSectorTab=d;GBL.userJobSectorTab=d}}catch(g){outputDebug("onGetJobList "+g)}var b=undefined;try{var f=c.getElementsByTagName("sector");for(b=0;b<f.length;++b){var j=new JobSector(f[b]);var h=j.getData().name;if(isValid(h)&&!isValid(this.m_sectorToJobList[h])){this.m_sectorList.push(j);this.m_sectorToJobList[h]=[]}}this.m_sectorToJobList.None=[]}catch(g){outputDebug("onGetJobList "+g)}try{var k=c.getElementsByTagName("job");for(b=0;b<k.length;b++){var m=new Job(k[b]);this.m_jobList.push(m);if(m.getJobCompletionPending()){this.claimIfPendingJob(m);continue}if(m.getFeatured()){this.m_featuredJobList.push(m);continue}if(isValid(m.getSector())&&isValid(this.m_sectorToJobList[m.getSector()])){this.m_sectorToJobList[m.getSector()].push(m)}else{this.m_sectorToJobList.None.push(m)}}}catch(g){outputDebug("onGetJobList "+g)}try{this.m_nextLevel=getXMLNodeValue(c,"next_level")}catch(g){outputDebug("onGetJobList "+g)}try{this.createJobsDiv(l)}catch(g){outputDebug("onGetJobList "+g)}if(isValidFunction(this.m_onGetJobListCallback)){this.m_onGetJobListCallback(c)}};SectorJobListDiv.prototype.getRewardDiv=function(c){var f=c.getData();var k=document.createElement("div");var j=undefined;if(isValid(f.mastery)){$(k).append(this.getMasteryTitleDiv(f.mastery))}var d=new SideBySideCells(k);var a=d.getLeftCell();var b=d.getRightCell();var g=d.getTable();setStyle(d.getTable(),{width:"100%",marginTop:"4px",borderCollapse:"collapse"});g.setAttribute("cellpadding",0);g.setAttribute("cellspacing",0);setStyle(a,{verticalAlign:"top"});setStyle(b,{verticalAlign:"top"});if(isValid(f.mastery)){$(a).append(this.getMasteryPercentDiv(f.mastery))}if(isValid(f.items)&&f.items.length>0){createSmallItemsListDiv(b,f.items,1)}var l=makeElementClass("div",a,"mission_reward",{fontWeight:"bold",fontSize:"14px",color:"#dddddd"});setInnerHTML(l,this.m_rewardLabel);if(f.min>0||f.max>0){l=makeElementClass("div",a,"mission_reward");setInnerHTML(l,"<span class='rewardPayoutLabel'>$"+formatNumberWithAbbreviation(f.min)+" - $"+formatNumberWithAbbreviation(f.max)+" </span> <span class='mission_reward_unit'>"+this.m_cashLabel+"</span>")}if(f.experience>0){l=makeElementClass("div",a,"mission_reward");setInnerHTML(l,"+"+f.experience+" <span class='mission_reward_unit'>"+this.m_rewardExperienceLabel+"</span>")}if(isValid(f.favorPoints)){l=makeElementClass("div",a,"mission_reward");setInnerHTML(l,this.m_favorPointsLabel+": "+f.favorPoints);$(l).css("color","#CD7F32")}if(isValid(f.additionalInfo)){l=makeElementClass("div",a,"mission_reward");setInnerHTML(l,f.additionalInfo)}if(isValid(f.rotatingImageUrls)&&f.useRewardImageFlipper){this.addRewardImageFlipper(k,f);$(k).find("span").addClass("coloredDiv")}else{if(isValid(f.lootDescription)){j=l=makeElementClass("div",a,"mission_reward");var h=this.m_rewardLootLabel+": "+f.lootDescription;setInnerHTML(l,h)}}return k};SectorJobListDiv.prototype.getRequirementDiv=function(f){var d=f.getData();var c=document.createElement("div");var a=new SideBySideCells(c,false);var g=a.getLeftCell();$(g).css("verticalAlign","top");var h=makeElementClass("div",g,"mission_requirement",{fontWeight:"bold",fontSize:"14px",color:"#dddddd"});setInnerHTML(h,this.m_requirementLabel);if(d.energy>0){h=makeElementClass("div",g,"mission_requirement");setInnerHTML(h,d.energy+" <span class='mission_requirement_unit'>"+this.m_energyLabel+"</span>")}if(isValid(d.totalTerritories)&&d.totalTerritories>0){h=makeElementClass("div",g,"mission_requirement");setInnerHTML(h,d.totalTerritories+" <span class='mission_requirement_unit'>"+this.m_totalTerritoriesLabel+"</span>")}if(isValid(d.attack)&&d.attack>0){h=makeElementClass("div",g,"mission_requirement");setInnerHTML(h,d.attack+" <span class='mission_requirement_unit'>"+this.m_attackLabel+"</span>")}if(isValid(d.defense)&&d.defense>0){h=makeElementClass("div",g,"mission_requirement");setInnerHTML(h,d.defense+" <span class='mission_requirement_unit'>"+this.m_defenseLabel+"</span>")}if(isValid(d.missionsCompleted)&&d.missionsCompleted>0){h=makeElementClass("div",g,"mission_requirement");setInnerHTML(h,d.missionsCompleted+" <span class='mission_requirement_unit'>"+this.m_missionsCompletedLabel+"</span>")}if(isValid(d.fightsWon)&&d.fightsWon>0){h=makeElementClass("div",g,"mission_requirement");setInnerHTML(h,d.fightsWon+" <span class='mission_requirement_unit'>"+this.m_fightsWonLabel+"</span>")}if(isValid(d.totalItems)&&d.totalItems>0){h=makeElementClass("div",g,"mission_requirement");setInnerHTML(h,d.totalItems+" <span class='mission_requirement_unit'>"+this.m_totalItemsLabel+"</span>")}if(isValid(d.hitlistKills)&&d.hitlistKills>0){h=makeElementClass("div",g,"mission_requirement");setInnerHTML(h,d.hitlistKills+" <span class='mission_requirement_unit'>"+this.m_hitlistKillsLabel+"</span>")}if(isValid(d.kills)&&d.kills>0){h=makeElementClass("div",g,"mission_requirement");setInnerHTML(h,d.kills+" <span class='mission_requirement_unit'>"+this.m_killsLabel+"</span>")}if(isValid(d.itemCategoryCategory)&&isValid(d.itemCategoryNumber)&&d.itemCategoryNumber>0){h=makeElementClass("div",g,"mission_requirement");setInnerHTML(h,d.itemCategoryNumber+" <span class='mission_requirement_unit'>"+d.itemCategoryCategory+"</span>")}if(isValid(d.classes)){h=makeElementClass("div",g,"mission_requirement");setInnerHTML(h," <span class='mission_requirement_unit'>"+getOrSeparatedListString(d.classes)+" class</span>")}if(d.mobster>0){h=makeElementClass("div",g,"mission_requirement");setInnerHTML(h,d.mobster+" <span class='mission_requirement_unit'>"+this.m_mobLabel+"</span>")}if(isValid(d.newMobster)&&d.newMobster>0){h=makeElementClass("div",g,"mission_requirement");setInnerHTML(h,d.newMobster+" <span class='mission_requirement_unit'>"+this.m_newMobLabel+"</span>")}if(isValid(d.cash)&&d.cash>0){h=makeElementClass("div",g,"mission_requirement");setInnerHTML(h,d.cash+" <span class='mission_requirement_unit'>"+this.m_cashLabel+"</span>")}if(isValid(d.favorPoints)){h=makeElementClass("div",g,"mission_requirement");setInnerHTML(h,d.favorPoints+" <span class='mission_requirement_unit'>"+this.m_favorPointsLabel+"</span>");$(h).css("color","#CD7F32");$(h).children().css("color","#CD7F32")}if(isValid(d.additionalInfo)){h=makeElementClass("div",g,"mission_requirement");setInnerHTML(h,d.additionalInfo)}var b=a.getRightCell();createSmallItemsListDiv(b,d.items,3,true);setStyle(b,{paddingLeft:"30px"});return c};SectorJobListDiv.prototype.getMasteryTitleDiv=function(a){var d=document.createElement("div");var g=a.getData().current-a.getData().min;var c=a.getData().max-a.getData().min;if(g>c){var b=makeElementClass("div",d,"mastery_level");var f=makeElement("img",b,{verticalAlign:"middle"});f.src=JobMastery.IMAGE_MAP[a.getData().level];$(b).append("<span>&nbsp;&nbsp;Mastery Achieved</span>")}else{b=makeElementClass("div",d,"mastery_level");$(b).html("Mastery: ");f=makeElement("img",b,{verticalAlign:"middle"});f.src=JobMastery.IMAGE_MAP[a.getData().level]}return d};SectorJobListDiv.prototype.getMasteryPercentDiv=function(a){var c=document.createElement("div");var f=a.getData().current-a.getData().min;var b=a.getData().max-a.getData().min;if(f>b){}else{var d=makeElement("div",c,{verticalAlign:"top",paddingTop:"5px",paddingBottom:"2px"});new ProgressBar(d).setVal(f,b)}return c};function BankDiv(a){this.m_parentDiv=a;this.m_containerDiv=undefined;this.m_backgroundURL=undefined;this.m_titleDiv=undefined;this.m_resultDiv=undefined;this.m_maxExplanationDiv=undefined;this.m_tableDiv=undefined;this.m_bankName=undefined;this.m_depositTaxExplanation=undefined;this.m_withdrawExplanation="Withdrawing money to cash is free.";this.initialize();this.createDiv()}BankDiv.prototype.initialize=function(){this.m_bankName="Bank";this.m_backgroundURL="http://cdn0.mobwarsapp.com/rpg_images/opensocial/mob/ingame/bank.jpg";this.m_depositTaxExplanation="A 10% money laundering fee will be taken out of all incoming funds."};BankDiv.prototype.addBackground=function(){if(isValid(this.m_backgroundURL)){this.m_containerDiv.style.backgroundImage="url("+this.m_backgroundURL+")";this.m_containerDiv.style.backgroundRepeat="no-repeat";this.m_containerDiv.style.backgroundPosition="0 30"}};BankDiv.prototype.getMaxDepositExplanation=function(){var d=GBL.MAIN_DATA.getViewer().getLevel();var c=GBL.MAIN_DATA.getMaxDepositScale();var b=GBL.MAIN_DATA.getMaxDepositOffset();var a=b+d*c;if(a>0){return"Based on your experience, the bank can insure your account up to $"+formatNumberWithCommas(a)+"."}else{return""}};BankDiv.prototype.createDiv=function(){this.m_containerDiv=makeElementClass("div",this.m_parentDiv,"bankTabDiv");this.m_containerDiv.style.padding="15px";this.m_containerDiv.style.textAlign="center";this.m_containerDiv.style.height="2000px";this.addBackground();this.m_titleDiv=document.createElement("div");this.m_containerDiv.appendChild(this.m_titleDiv);this.m_resultDiv=new ResultDiv(this.m_containerDiv);this.m_maxExplanationDiv=makeElementClass("div",this.m_containerDiv,"bankExplanationDiv");this.m_maxExplanationDiv.innerHTML=this.getMaxDepositExplanation();this.m_tableDiv=document.createElement("div");this.m_containerDiv.appendChild(this.m_tableDiv);this.m_tableDiv.style.textAlign="center";this.refresh()};BankDiv.prototype.refresh=function(){this.m_tableDiv.innerHTML="";if(!isValid(GBL.MAIN_DATA.getViewer().getCashInBank())||GBL.MAIN_DATA.getViewer().getCashInBank()<=0){this.createOpenAccountInterface()}else{this.createAccountInterface()}};BankDiv.prototype.createOpenAccountInterface=function(){createTitleDiv(this.m_titleDiv,"The "+this.m_bankName+" (Open an Account)");if(GBL.MAIN_DATA.getViewer().getCashInBank()<=0&&GBL.MAIN_DATA.getViewer().getCash()<10000){this.m_resultDiv.showMessage(undefined,"Sorry, you need at least $10,000 to open an account!");return}var f=document.createElement("table");this.m_tableDiv.appendChild(f);f.style.marginLeft="auto";f.style.marginRight="auto";f.style.borderSpacing="6px";var a=document.createElement("tbody");f.appendChild(a);var g=document.createElement("tr");a.appendChild(g);var h=makeElementClass("td",g,"bankViewOpenAccount");h.innerHTML="Open an account with: ";h=document.createElement("td");g.appendChild(h);var d=undefined;try{d=document.createElement("<input type='text'/>")}catch(b){d=document.createElement("input");d.type="text"}d.value=GBL.MAIN_DATA.getViewer().getCash();h.appendChild(d);h=document.createElement("td");g.appendChild(h);var c=this;new DivButton(h,"Open Account",function(){if(!validateAmount(d.value)){c.m_resultDiv.showMessage(undefined,"Please specify a valid amount to open your account with!");return}try{if(parseInt(d.value)<10000){c.m_resultDiv.showMessage(false,"Sorry, you need at least $10,000 to open an account!");return}}catch(k){}var j={};j.user_id=GBL.MAIN_DATA.getViewer().getUserId();j.amount=d.value.replace(/,/g,"");makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/deposit",function(l){handleResult(l,c.m_resultDiv,function(){c.refresh()})},j,1)})};BankDiv.prototype.createAccountInterface=function(){createTitleDiv(this.m_titleDiv,"The "+this.m_bankName+" (Account Balance: $"+formatNumberWithCommas(GBL.MAIN_DATA.getViewer().getCashInBank())+")");var c=makeElementClass("table",this.m_tableDiv,"dataTable",{marginLeft:"auto",marginRight:"auto",borderSpacing:"6px"});var a=makeElement("tbody",c);var b=makeElement("tr",a);var f=makeElementClass("td",b,"dataTableHeader",{width:"350px"});f.innerHTML="Withdraw";f=makeElementClass("td",b,"dataTableHeader",{width:"400px"});f.innerHTML="Deposit";var d=document.createElement("tr");a.appendChild(d);d.appendChild(this.createInterfaceTd(true));d.appendChild(this.createInterfaceTd(false))};BankDiv.prototype.createInterfaceTd=function(h){var j=document.createElement("td");j.style.verticalAlign="top";var c=new SideBySideCells(j,true);setStyle(c.getLeftCell(),{verticalAlign:"top",width:"160px"});if(h){c.getLeftCell().className="bankViewInputLabel";c.getLeftCell().innerHTML="Withdrawal Amount: "}else{c.getLeftCell().className="bankViewInputLabel";c.getLeftCell().innerHTML="Deposit Amount: "}if(h){setStyle(c.getRightCell(),{width:"200px"})}else{setStyle(c.getRightCell(),{width:"250px"})}var g=undefined;try{g=document.createElement("<input type='text'/>")}catch(d){g=document.createElement("input");g.type="text"}if(h){g.value=""+Math.min(1000,GBL.MAIN_DATA.getViewer().getCashInBank())}else{g.value=GBL.MAIN_DATA.getViewer().getCash()}c.getRightCell().appendChild(g);var a=undefined;var f=this;if(h){a=new DivButton(c.getRightCell(),"Withdraw",function(){if(!validateAmount(g.value)){f.m_resultDiv.showMessage(undefined,"Please specify a valid amount to withdraw!");return}var k={};k.user_id=GBL.MAIN_DATA.getViewer().getUserId();k.amount=-(g.value.replace(/,/g,""));makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/deposit",function(l){handleResult(l,f.m_resultDiv,function(){f.refresh()})},k,1)})}else{a=new DivButton(c.getRightCell(),"Deposit",function(){if(!validateAmount(g.value.replace(/,/g,""))){f.m_resultDiv.showMessage(undefined,"Please specify a valid amount to deposit!");return}var k={};k.user_id=GBL.MAIN_DATA.getViewer().getUserId();k.amount=g.value.replace(/,/g,"");makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/deposit",function(l){handleResult(l,f.m_resultDiv,function(){f.refresh()})},k,1)})}a.getButtonDiv().style.marginTop="10px";a.getButtonDiv().style.width="100px";var b=makeElementClass("div",c.getRightCell(),"bankViewActionExplanation",{paddingTop:"5px"});if(h){b.innerHTML=this.m_withdrawExplanation}else{b.innerHTML=this.m_depositTaxExplanation}return j};function GodfatherShowSuperRewards(a){return a%103==56||a%103<=15||a%97==69||a%97<=15}function GodfatherDiv(a){this.m_parentDiv=a;this.m_containerDiv=undefined;this.m_resultDiv=undefined;this.m_refreshDiv=undefined;this.m_titleDiv=undefined;this.m_explanationText=undefined;this.m_offerHeadingText=undefined;this.m_offerer=undefined;this.m_offerCurrency=undefined;this.m_offerKeys=undefined;this.m_offerDescriptions=undefined;this.m_offerCosts=undefined;this.m_offerAmounts=undefined;this.m_offerRequests=undefined;this.m_offerKeysArray=undefined;this.m_offerPrefixArray=undefined;this.m_offerDescriptionArray=undefined;this.m_offerSuffixArray=undefined;this.m_offerCostArray=undefined;this.m_useSuperReward=false;this.m_offerpalConstructor=undefined;this.m_hasSpecialOffers=false;this.m_monetizationIframeUrl=undefined;var b=GBL.MAIN_DATA.getViewer().getUserId();this.m_abFlag=b%10==0;this.initialize();this.createDiv()}GodfatherDiv.prototype.initialize=function(){this.m_offerHeadingText="Godfather's Offers";this.m_explanationText=(GBL.HIDE_OFFER_TITLES?"":"Complete offers below to earn favor points from The Godfather. ")+"In return for favor points, The Godfather offers you various powerful rewards. <font size='1'>(Favor points are NOT necessary for game play or game advancement)</font>";this.m_offerer="The Godfather";this.m_offerCurrency="favor points";this.m_offerKeys=new Array();this.m_offerDescriptions=new Array();this.m_offerCosts=new Array();this.m_offerHighlight=new Array();this.m_offerAmounts=new Array();this.m_offerRequests=new Array();var a=10000*GBL.MAIN_DATA.getViewer().getLevel();this.m_offerKeys.push("cash");this.m_offerDescriptions.push("The Godfather offers you <span class='favorOfferItem'>$"+formatNumberWithCommas(a)+"</span> for 10 favor points.");this.m_offerCosts.push(10);this.m_offerHighlight.push(true);this.m_offerAmounts.push(a);this.m_offerRequests.push(null);this.m_offerKeys.push("hire");this.m_offerDescriptions.push("The Godfather offers you <span class='favorOfferItem'>1 mob member</span> (hired gun) for 20 favor points.");this.m_offerCosts.push(20);this.m_offerHighlight.push(false);this.m_offerAmounts.push(1);this.m_offerRequests.push(null);this.m_offerKeysArray=new Array();this.m_offerPrefixArray=new Array();this.m_offerDescriptionArray=new Array();this.m_offerSuffixArray=new Array();this.m_offerCostArray=new Array();this.m_offerKeysArray.push("pick_full_energy");this.m_offerPrefixArray.push("The Godfather offers you");this.m_offerDescriptionArray.push("full energy refill");this.m_offerSuffixArray.push("for 10 favor points.");this.m_offerCostArray.push(10);this.m_offerKeysArray.push("pick_full_stamina");this.m_offerPrefixArray.push("The Godfather offers you");this.m_offerDescriptionArray.push("full stamina refill");this.m_offerSuffixArray.push("for 10 favor points.");this.m_offerCostArray.push(10);this.m_offerKeysArray.push("pick_full_health");this.m_offerPrefixArray.push("The Godfather offers you");this.m_offerDescriptionArray.push("full health");this.m_offerSuffixArray.push("for 10 favor points.");this.m_offerCostArray.push(10);this.m_hasSpecialOffers=true;if(GBL.MAIN_DATA.getShowOfferNetwork()==SuperRewardDiv.prototype.getOfferNetworkKey()){this.m_offerpalConstructor=SuperRewardDiv}else{if(GBL.MAIN_DATA.getShowOfferNetwork()==OfferPalDiv.prototype.getOfferNetworkKey()){this.m_offerpalConstructor=OfferPalDiv}else{if(GBL.MAIN_DATA.getShowOfferNetwork()==GambitDiv.prototype.getOfferNetworkKey()){this.m_offerpalConstructor=GambitDiv}else{this.m_offerpalConstructor=OfferPalDiv}}}this.initMonetizationIframeUrl("mob","myspace","fp","main")};GodfatherDiv.prototype.initMonetizationIframeUrl=function(h,f,d,c){var g=(isDebugging())?"http://74.86.60.46":"http://offer-dynamic-lb.playdom.com";this.m_monetizationIframeUrl=g+"/show?app="+h+"&network="+f+"&currency="+d+"&zone="+c+"&userId="+GBL.MAIN_DATA.getViewer().getUserId()+(isOffSite()?"&client=dest":"");var b=GBL.MAIN_DATA.getViewer().getAge();var a=GBL.MAIN_DATA.getViewer().getGender();if(isValid(b)){this.m_monetizationIframeUrl+="&age="+b}if(isValid(a)){this.m_monetizationIframeUrl+="&gender="+a.getDisplayValue()}};GodfatherDiv.prototype.createTitle=function(b){var a=GBL.MAIN_DATA.getViewer().getUserId()*3+1;var c="<span onclick='switchTabs(12); location.href=\"#missingoffers\"; return false;' class='offerpalSubtitle'> Missing Favor Points, click here! </span>";c="";createTitleDiv(b,"<span class='theGodfatherTitle'>The Godfather:</span> <span class='theGodfatherSubtitle'>(You have "+GBL.MAIN_DATA.getViewer().getFavorPoints()+" favor points) </span> "+c)};GodfatherDiv.prototype.getButtonText=function(a){return"Accept for "+a+" points!"};GodfatherDiv.prototype.createDiv=function(){this.m_containerDiv=document.createElement("div");this.m_parentDiv.appendChild(this.m_containerDiv);this.m_containerDiv.style.padding="10px";this.m_containerDiv.style.textAlign="center";this.m_titleDiv=document.createElement("div");this.m_containerDiv.appendChild(this.m_titleDiv);this.createTitle(this.m_titleDiv);var b=makeElementClass("div",this.m_containerDiv,"sectionInstructions");b.innerHTML=this.m_explanationText;this.m_resultDiv=new ResultDiv(this.m_containerDiv);this.m_refreshDiv=document.createElement("div");this.m_containerDiv.appendChild(this.m_refreshDiv);this.m_refreshDiv.style.textAlign="center";if(GBL.MAIN_DATA.useMonetizationIframe()&&isValid(this.m_monetizationIframeUrl)){var a=document.createElement("div");this.m_containerDiv.appendChild(a);a.innerHTML="<iframe style='width: 850px; height: 2300px; margin-left:auto; margin-right:auto; overflow:auto; border:none;' frameBorder=0  allowTransparency=true src='"+this.m_monetizationIframeUrl+"'>"}else{if(GBL.MAIN_DATA.getShowCCBill()){CCBillDiv(this.m_containerDiv)}new this.m_offerpalConstructor(this.m_containerDiv)}this.refresh()};GodfatherDiv.prototype.refresh=function(){outputDebug("refresh");this.m_refreshDiv.innerHTML="";this.createTitle(this.m_titleDiv);var h=document.createElement("table");this.m_refreshDiv.appendChild(h);h.style.marginLeft="auto";h.style.marginRight="auto";h.style.borderSpacing="6px";var a=document.createElement("tbody");h.appendChild(a);for(var f=0;f<this.m_offerKeys.length;f++){var b=undefined;if(isValid(this.m_offerHighlight)&&isValid(this.m_offerHighlight[f])){b=this.m_offerHighlight[f]}var j=undefined;if(isValid(this.m_offerAmounts)&&isValid(this.m_offerAmounts[f])){j=this.m_offerHighlight[f]}var d=this.createContentElement(this.m_offerKeys[f],this.m_offerDescriptions[f],this.m_offerCosts[f],b,j,isValid(this.m_offerRequests)?this.m_offerRequests[f]:null);a.appendChild(d)}if(isValid(this.m_offerKeysArray)){d=this.createPickableElement(false,this.m_offerKeysArray,this.m_offerPrefixArray,this.m_offerDescriptionArray,this.m_offerSuffixArray,this.m_offerCostArray);a.appendChild(d)}if(this.m_hasSpecialOffers){var g={};var c=this;g.user_id=GBL.MAIN_DATA.getViewer().getUserId();makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/get_offers",function(k){c.onGetSpecialOffers(k,a)},g)}};GodfatherDiv.prototype.onGetSpecialOffers=function(k,r){var p=getGadgetResponseData(k);if(isValid(p)){try{var d=p.getElementsByTagName("offer");for(var s=0;s<d.length;s++){try{var o=d[s];var q=getXMLNodeValue(o,"key");var j=getXMLEncodedStringNodeValue(o,"product");var l=getXMLNodeValue(o,"amount");var m=getXMLNodeValue(o,"cost");var h=getBooleanValue(getXMLNodeValue(o,"highlight"));var c=undefined;try{c=getXMLEncodedStringNodeValue(o,"description")}catch(a){c=undefined}var n=undefined;try{n=getXMLNodeValue(o,"remaining")}catch(a){n=undefined}var b=undefined;try{b=getXMLNodeValue(o,"image_url")}catch(a){b=undefined}var f=undefined;try{f=getXMLNodeValue(o,"max_per_user")}catch(a){f=undefined}var g=this.m_offerer+" offers you <b class='favorOfferItem'>"+j+" </b>";if(isValid(n)){g+=" for a limited time!";g+="<table><tr>";if(isValid(b)){g+="<td><img src='"+b+"'/></td>"}g+="<td class='favorOfferDescription'>"+c+"<br/>Cost: "+m+" "+this.m_offerCurrency+"<br/>";if(n>0){g+="Less than <b class='favorOfferQtyRemaining'>"+n+"</b> left!";if(isValid(f)){g+="<span class='favorOfferQtyLimits'>  (Limited to "+f+" per mobster) </span>"}}else{g+="<b class='favorOfferSoldOut'>SOLD OUT!</b>"}g+="</td></tr></table>"}else{g+=" for "+m+" favor points."}var t=this.createContentElement(q,g,m,h,l);r.appendChild(t)}catch(a){outputDebug("offerDecoding "+a)}}}catch(a){outputDebug("onGetOffers "+a)}}};GodfatherDiv.prototype.createContentElement=function(j,c,b,l,f,g){var a=document.createElement("tr");var h=makeElementClass("td",a,"favorOfferUnhighlighted");h.innerHTML=c;if(isValid(l)&&l){h.className="favorOfferHighlighted"}else{h.className="favorOfferUnhighlighted"}h=document.createElement("td");a.appendChild(h);h.style.verticalAlign="middle";var k=this;var d=function(){k.m_resultDiv.showMessage(undefined,"Checking.....");gaTrackEvent("godfather","click",j);var n={};n.user_id=GBL.MAIN_DATA.getViewer().getUserId();n.reward=j;if(isValid(f)){n.amount=f}if(isValid(g)){n.request=g}makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/accept_godfather",function(o){k.onAcceptGodfather(o)},n,0)};var m=new DivButton(h,this.getButtonText(b),d);m.getButtonDiv().style.fontSize="14px";m.getButtonDiv().style.width="200px";return a};GodfatherDiv.prototype.createPickableElement=function(l,q,v,h,f,o){var p=document.createElement("tr");var c=0;var w=makeElementClass("td",p,"favorOfferUnhighlighted");var k=document.createElement("table");w.appendChild(k);var s=document.createElement("tbody");k.appendChild(s);var j=document.createElement("tr");s.appendChild(j);var g=document.createElement("td");j.appendChild(g);var b=document.createElement("td");j.appendChild(b);var n=document.createElement("td");j.appendChild(n);if(isValid(l)&&l){g.className="favorOfferHighlighted";b.className="favorOfferHighlighted";n.className="favorOfferHighlighted"}else{g.className="favorOfferUnhighlighted";b.className="favorOfferUnhighlighted";n.className="favorOfferUnhighlighted"}var d=undefined;var m=this;g.innerHTML=v[c];n.innerHTML=f[c];var t=document.createElement("select");b.appendChild(t);for(var u=0;u<q.length;u++){var r=this.createOption(h[u],u,u==0);t.appendChild(r)}addEvent(t,"change",function(){c=t.selectedIndex;g.innerHTML=v[c];n.innerHTML=f[c];d.setString(m.getButtonText(o[c]))});w=document.createElement("td");p.appendChild(w);w.style.verticalAlign="middle";var a=function(){m.m_resultDiv.showMessage(undefined,"Checking.....");var x={};x.user_id=GBL.MAIN_DATA.getViewer().getUserId();x.reward=q[c];makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/accept_godfather",function(y){m.onAcceptGodfather(y)},x,0)};d=new DivButton(w,this.getButtonText(o[c]),a);d.getButtonDiv().style.fontSize="14px";d.getButtonDiv().style.width="200px";return p};GodfatherDiv.prototype.createOption=function(a,b,d){var c=document.createElement("OPTION");c.innerHTML=a;c.value=b;c.selected=d;return c};GodfatherDiv.prototype.onAcceptGodfather=function(d){var c=getGadgetResponseData(d);if(isValid(c)){try{var a=getXMLNodeValue(c,"favor_points");if(isValid(a)){GBL.MAIN_DATA.getViewer().m_favorPoints=a}}catch(f){outputDebug("onAcceptGodfather "+f)}}var b=this;handleResult(d,b.m_resultDiv,function(){b.refresh()})};function MultiRewardDiv(a){this.m_parentDiv=a;this.m_containerDiv=undefined;this.m_explanationText=undefined;this.m_titleText="Earn Favor Points";this.initialize();this.createDiv()}MultiRewardDiv.prototype.initialize=function(){this.m_titleText="Earn Favor Points";this.m_explanationText=""};MultiRewardDiv.prototype.createDiv=function(){this.m_containerDiv=document.createElement("div");this.m_parentDiv.appendChild(this.m_containerDiv);this.m_containerDiv.style.textAlign="center";if(!GBL.HIDE_OFFER_TITLES){var g=document.createElement("div");this.m_containerDiv.appendChild(g);createTitleDiv(g,"<span class='favorPointsSectionTitle'>"+this.m_titleText+"</span> <span  class='favorPointsSectionSubtitle'>and help sponsor this application by completing offers!</span>")}var f=createWhiteDiv(this.m_containerDiv);f.innerHTML=this.m_explanationText;var b=this;var c=new Array();c.push("Super Rewards");c.push("My OfferPal");var a=new Array();a.push(function(h){b.createSuperRewardDiv(h)});a.push(function(h){b.createOfferPalDiv(h)});var d=new VerticalSubTabDiv(this.m_containerDiv,c,a,"2500px",5);d.selectTab(0)};MultiRewardDiv.prototype.createSuperRewardDiv=function(a){a.innerHTML="";var b=makeElement("div",a);b.innerHTML="<iframe style='width:650px; height: 2600px; margin-left:auto; margin-right:auto; overflow:auto; border:none;' scrolling='no' src='"+SuperRewardDiv.prototype.getSuperRewardIframeLink(GBL.MAIN_DATA.getViewer())+"'>"};MultiRewardDiv.prototype.createOfferPalDiv=function(a){a.innerHTML="";var b=makeElement("div",a);b.innerHTML="<iframe style='width:650px; height: 2300px; margin-left:auto; margin-right:auto; overflow:auto; border:none;' src='"+OfferPalDiv.prototype.getOfferpalIframeLink(GBL.MAIN_DATA.getViewer())+"'>"};function SuperRewardDiv(a){this.m_parentDiv=a;this.m_containerDiv=undefined;this.m_explanationText=undefined;this.m_titleText="Earn Favor Points";this.initialize();this.createDiv()}SuperRewardDiv.prototype.getOfferNetworkKey=function(){return"superreward"};SuperRewardDiv.prototype.getSuperRewardIframeLink=function(a){var b="http://super.kitnmedia.com/super/offers?h=mxdngp.432338189121&";b+="uid="+a.getUserId();if(isValid(a.getGender())){b+="&gender="+a.getGender()}if(isValid(a.getAge())){b+="&age="+a.getAge()}return b};SuperRewardDiv.prototype.initialize=function(){this.m_titleText="Earn Favor Points";this.m_explanationText=""};SuperRewardDiv.prototype.createDiv=function(){this.m_containerDiv=document.createElement("div");this.m_parentDiv.appendChild(this.m_containerDiv);this.m_containerDiv.style.textAlign="center";if(!GBL.HIDE_OFFER_TITLES){var c=document.createElement("div");this.m_containerDiv.appendChild(c);createTitleDiv(c,"<span class='favorPointsSectionTitle'>"+this.m_titleText+"</span> <span class='favorPointsSectionSubtitle'>and help sponsor this application by completing offers!</span>")}var b=createWhiteDiv(this.m_containerDiv);b.innerHTML=this.m_explanationText;var a=document.createElement("div");this.m_containerDiv.appendChild(a);var d=840;a.innerHTML="<iframe style='width:"+d+"px; height: 2600px; margin-left:auto; margin-right:auto; overflow:auto; border:none;' scrolling='no' frameBorder=0 src='"+this.getSuperRewardIframeLink(GBL.MAIN_DATA.getViewer())+"'>"};function OfferPalDiv(a){this.m_parentDiv=a;this.m_containerDiv=undefined;this.m_explanationText=undefined;this.m_titleText="Earn Favor Points";this.m_offerPalLink=undefined;var b=GBL.MAIN_DATA.getViewer().getUserId();this.m_abFlag=b%10==0;this.initialize();this.createDiv()}OfferPalDiv.prototype.getOfferNetworkKey=function(){return"offerpal"};OfferPalDiv.prototype.getOfferpalCSLink=function(a){return"http://pub.myofferpal.com/063057b2427ed90b4c55b0caaf920539/userstatus.action?snuid="+(a.getUserId()*3+1)};OfferPalDiv.prototype.getOfferpalIframeBaseLink=function(a){var b="http://pub.myofferpal.com/063057b2427ed90b4c55b0caaf920539/showoffers.action?";return b};OfferPalDiv.prototype.getOfferpalIframeLink=function(b){var d=this.getOfferpalIframeBaseLink(b);d+="snuid="+(b.getUserId()*3+1);if(isValid(b.getAge())){var a=undefined;try{a=parseInt(b.getAge())}catch(c){a=undefined}if(isValid(a)){d+="&dob=01-Jan-"+(2008-a)}}if(isValid(b.getGender())){d+="&gender="+b.getGender()}if(isValid(b.getAge())){d+="&age="+b.getAge()}try{d+="&pts="+b.getFavorPoints();d+="&level="+b.getLevel()}catch(c){}return d};OfferPalDiv.prototype.initialize=function(){this.m_explanationText=""};OfferPalDiv.prototype.createDiv=function(){this.m_containerDiv=document.createElement("div");this.m_parentDiv.appendChild(this.m_containerDiv);this.m_containerDiv.style.textAlign="center";if(!GBL.HIDE_OFFER_TITLES){var b=document.createElement("div");this.m_containerDiv.appendChild(b);createTitleDiv(b,"<span class='favorPointsSectionTitle'>"+this.m_titleText+"</span> <span class='favorPointsSectionSubtitle'>and help sponsor this application by completing offers!</span>")}var a=document.createElement("div");this.m_containerDiv.appendChild(a);var c=840;a.innerHTML="<iframe style='width:"+c+"px; height: 2300px; margin-left:auto; margin-right:auto; overflow:auto; border:none;' frameBorder=0  src='"+this.getOfferpalIframeLink(GBL.MAIN_DATA.getViewer())+"'>"};function GambitDiv(a){this.m_parentDiv=a;this.m_containerDiv=undefined;this.m_explanationText=undefined;this.m_titleText="Earn Favor Points";this.initialize();this.createDiv()}GambitDiv.prototype.getOfferNetworkKey=function(){return"gambit"};GambitDiv.prototype.getGambitIframeLink=function(a){var b="http://getgambit.com/panel?k=dc9a38a5dac46607d464af8bdd8e01c7&";b+="uid="+a.getUserId();if(isValid(a.getGender())){b+="&gender="+a.getGender()}if(isValid(a.getAge())){b+="&age="+a.getAge()}return b};GambitDiv.prototype.initialize=function(){this.m_titleText="Earn Favor Points";this.m_explanationText=""};GambitDiv.prototype.createDiv=function(){this.m_containerDiv=document.createElement("div");this.m_parentDiv.appendChild(this.m_containerDiv);this.m_containerDiv.style.textAlign="center";var c=document.createElement("div");this.m_containerDiv.appendChild(c);createTitleDiv(c,"<span class='favorPointsSectionTitle'>"+this.m_titleText+"</span> <span class='favorPointsSectionSubtitle'>and help sponsor this application by completing offers!</span>");var b=createWhiteDiv(this.m_containerDiv);b.innerHTML=this.m_explanationText;var a=document.createElement("div");this.m_containerDiv.appendChild(a);var d=840;a.innerHTML="<iframe allowtransparency='true' style='width:"+d+"px; height: 2000px; margin-left:auto; margin-right:auto; overflow:auto; border:none;' frameBorder=0 src='"+this.getGambitIframeLink(GBL.MAIN_DATA.getViewer())+"'>"};function CCBillDiv(b){var f=document.createElement("div");$(f).addClass("CCBillMainDiv");f.style.position="relative";f.style.textAlign="left";f.style.marginLeft="3px";f.style.marginTop=IE?"0px":"10px";f.style.paddingTop="8px";f.style.borderTop="1px dotted #222222";var c="40px";if(isValid(GBL.CCBill.right)){c=GBL.CCBill.right}var d=makeElementClass("form",f,"CCBillForm");d.setAttribute("target","_blank");d.setAttribute("action","https://bill.ccbill.com/jpost/signup.cgi");d.setAttribute("method","POST");d.innerHTML="<span class='CCBillTitleSpan'>Buy "+GBL.CCBill.points+"! &nbsp; </span><img src='http://cdn0.mobwarsapp.com/rpg_images/opensocial/mob/ui/ccpix20.gif' class='CCBillCardImage'><span class='CCBillInstantCreditSpan'> &nbsp; Instant credit! &nbsp;</span><input type=hidden name=clientAccnum value='937796'><input type=hidden name=clientSubacc value='"+GBL.CCBill.subaccount+"'><input type=hidden name=formName value='113cc'><input type=hidden name=language value='English'><input type=hidden name=user_network value='M'><input type=hidden name=user_id value='"+GBL.MAIN_DATA.getViewer().getUserId()+"'><select class='CCBillSelect' name=subscriptionTypeId><option value='0000004024:840'>21 "+GBL.CCBill.points+" for $5</option><option value='0000004535:840'>42 "+GBL.CCBill.points+" for $10</option><option value='0000002232:840'>85 "+GBL.CCBill.points+" for $20</option><option value='0000002236:840'>170 "+GBL.CCBill.points+" for $40</option><option value='0000002898:840'>215 "+GBL.CCBill.points+" for $50</option><option value='0000003152:840'>440 "+GBL.CCBill.points+" for $100</option><option value='0000003725:840'>700 "+GBL.CCBill.points+" for $150</option></select> &nbsp; ";b.appendChild(f);var a=new DivButton(d,"Buy Now",function(){d.submit()});a.getButtonDiv().style.position="absolute";a.getButtonDiv().style.right=c;a.getButtonDiv().style.top="10px"}function FightListDiv(a){this.m_parentDiv=a;this.m_containerDiv=undefined;this.m_titleDiv=undefined;this.m_resultDiv=undefined;this.m_tableDiv=undefined;this.m_titleString=undefined;this.m_mobNameLabel=undefined;this.m_mobSizeLabel=undefined;this.m_mobActionLabel=undefined;this.m_emptyMessage=undefined;this.m_repeatText=undefined;this.initialize();this.createDiv()}FightListDiv.prototype.initialize=function(){this.m_titleString="Attack Rival Mobsters!";this.m_mobNameLabel="Mobster";this.m_mobSizeLabel="Mob Size";this.m_mobActionLabel="Attack Mob";this.m_emptyMessage="There are no other mobsters around your level to fight. You should check the streets again in a couple minutes. Why not <a class='standardLink' href='#' onclick='switchTabs(1);return false;'>complete some missions</a> in the meantime?";this.m_repeatText="Fight them again!"};FightListDiv.prototype.createDiv=function(){this.m_containerDiv=document.createElement("div");this.m_parentDiv.appendChild(this.m_containerDiv);this.m_containerDiv.style.padding="15px";this.m_containerDiv.style.textAlign="center";this.m_titleDiv=document.createElement("div");this.m_containerDiv.appendChild(this.m_titleDiv);createTitleDiv(this.m_titleDiv,this.getTitleString());this.m_resultDiv=new ResultDiv(this.m_containerDiv);this.m_tableDiv=document.createElement("div");this.m_containerDiv.appendChild(this.m_tableDiv);this.m_tableDiv.style.textAlign="center";this.refresh()};FightListDiv.prototype.getTitleString=function(){return this.m_titleString};FightListDiv.prototype.refresh=function(){this.m_tableDiv.innerHTML="";this.m_titleDiv.innerHTML="";createTitleDiv(this.m_titleDiv,this.getTitleString());var f=makeElementClass("table",this.m_tableDiv,"dataTable",{marginLeft:"auto",marginRight:"auto",borderSpacing:"6px"});var a=makeElement("tbody",f);var b=makeElement("tr",a);var h=makeElementClass("td",b,"dataTableHeader");h.style.width="550px";h.innerHTML=this.m_mobNameLabel;h=makeElementClass("td",b,"dataTableHeader");h.style.width="100px";h.innerHTML=this.m_mobSizeLabel;h=makeElementClass("td",b,"dataTableHeader");h.style.width="100px";h.innerHTML=this.m_mobActionLabel;var g=document.createElement("div");this.m_containerDiv.appendChild(g);g.style.padding="10px";g.innerHTML=getLoadingMessageHTML();var d={};d.user_id=GBL.MAIN_DATA.getViewer().getUserId();var c=this;makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/get_fight_list",function(j){g.style.display="none";c.onGetFightList(j,a)},d)};FightListDiv.prototype.onGetFightList=function(a,j){var d=getGadgetResponseData(a);var k=undefined;if(isValid(d)){try{k=parseInt(getXMLNodeValue(d,"num_targets"));var h=d.getElementsByTagName("user");for(var c=0;c<h.length;c++){var g=new User(undefined);g.createXMLUser(h[c]);j.appendChild(this.createContentElement(g))}}catch(f){outputAlert("onGetJobList "+f)}}if(!isValid(k)||k<=0){var b=createWhiteDiv(this.m_tableDiv);b.style.textAlign="center";b.innerHTML=this.m_emptyMessage}};FightListDiv.prototype.createContentElement=function(b){var c=document.createElement("tr");var d=makeElementClass("td",c,"fightListCell");d.innerHTML="<span class='fightListMobName'> "+b.getMobName()+" </span>, Level "+b.getLevel()+" "+b.getMobClass()+"</span>";addEvent(d,"click",function(){showUserStats(b.getUserId())});d=makeElementClass("td",c,"fightListCell");d.innerHTML=b.getMobSize();d=document.createElement("td");c.appendChild(d);d.style.padding="0px 10px 0px 10px";var a=this;new DivButton(d,"Attack",function(){gaTrackEvent("fight","click","attack");a.attack(b)});return c};FightListDiv.prototype.attack=function(c){this.m_resultDiv.showMessage(undefined,"Attacking "+c.getMobName()+" ...");goToPageTop();var b=this;var a=undefined;if(isValid(this.m_repeatText)){a=document.createElement("a");a.className="standardLink";a.href="#";a.appendChild(document.createTextNode(this.m_repeatText));addEventWithParameter(a,"click",function(){b.attack(c)})}var d={};d.user_id=GBL.MAIN_DATA.getViewer().getUserId();d.target_id=c.getUserId();d.level=GBL.MAIN_DATA.getViewer().getLevel();makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/attack",function(f){handleResult(f,b.m_resultDiv,function(){b.refresh()},a)},d,1)};function RivalryListDiv(a){this.m_parentDiv=a;this.m_containerDiv=undefined;this.m_titleDiv=undefined;this.m_resultDiv=undefined;this.m_tableDiv=undefined;this.m_titleString=undefined;this.m_mobNameLabel=undefined;this.m_mobSizeLabel=undefined;this.m_mobWinLabel=undefined;this.m_mobRaidWinLabel=undefined;this.m_mobLostLabel=undefined;this.m_mobActionLabel=undefined;this.m_mobRaidLabel=undefined;this.m_emptyMessage=undefined;this.m_repeatText=undefined;this.m_mobRaidEnabled=undefined;this.m_explanationText=undefined;this.initialize();this.createDiv()}RivalryListDiv.prototype.initialize=function(){this.m_titleString="Attack Rival Mobsters!";this.m_mobNameLabel="Mobster";this.m_mobSizeLabel="Mob Size";this.m_mobWinLabel="Times Won";this.m_mobRaidWinLabel="Raids Won";this.m_mobLostLabel="Times Lost";this.m_mobActionLabel="Attack Mob";this.m_mobRaidLabel="Raid Mob";this.m_emptyMessage="There are no mobsters who have attacked you yet. You should check the streets again in a couple minutes. Why not <a class='standardLink' href='#' onclick='switchTabs(1);return false;'>complete some missions</a> in the meantime?";this.m_repeatText="Attack them again!";this.m_mobRaidEnabled=false;this.m_explanationText="<span style='display: none;' id='moreExplanationText'>This is your personal black list, showing all players who have killed you, placed you on the Hit List, or attacked you and won. If these players are at your level or above, you can retaliate as many times as you like. If these players are at a lower level than you, there is a limit on the number of times you can retaliate. <br><br>Revenge will be so sweet... <a class='standardLink' href='#' onclick='$(\"#moreExplanationText\").hide(0); $(\"#lessExplanationText\").slideDown(500);'>Hide</a></span><span id='lessExplanationText'>This is your personal black list. <a class='standardLink' href='#' onclick='$(\"#moreExplanationText\").slideDown(500); $(\"#lessExplanationText\").hide(0);'>More</a></span>"};RivalryListDiv.prototype.createDiv=function(){this.m_containerDiv=document.createElement("div");this.m_parentDiv.appendChild(this.m_containerDiv);this.m_containerDiv.style.padding="15px";this.m_containerDiv.style.textAlign="center";this.m_titleDiv=document.createElement("div");this.m_containerDiv.appendChild(this.m_titleDiv);createTitleDiv(this.m_titleDiv,this.getTitleString());var a=createWhiteDiv(this.m_containerDiv);a.style.padding="6px";a.innerHTML=this.m_explanationText;this.m_resultDiv=new ResultDiv(this.m_containerDiv);this.m_tableDiv=document.createElement("div");this.m_containerDiv.appendChild(this.m_tableDiv);this.m_tableDiv.style.textAlign="center";this.refresh()};RivalryListDiv.prototype.getTitleString=function(){return this.m_titleString};RivalryListDiv.prototype.getTagLine=function(){return this.m_tagLine};RivalryListDiv.prototype.refresh=function(){this.m_tableDiv.innerHTML="";this.m_titleDiv.innerHTML="";createTitleDiv(this.m_titleDiv,this.getTitleString());var d=document.createElement("div");var g=makeElementClass("table",this.m_tableDiv,"dataTable",{marginLeft:"auto",marginRight:"auto",borderSpacing:"6px"});var a=document.createElement("tbody");g.appendChild(a);var b=document.createElement("tr");a.appendChild(b);var j=document.createElement("td");b.appendChild(j);addHeaderStyle(j);j.style.width="550px";j.innerHTML=this.m_mobNameLabel;j=document.createElement("td");b.appendChild(j);addHeaderStyle(j);j.style.width="100px";j.innerHTML=this.m_mobSizeLabel;j=document.createElement("td");b.appendChild(j);addHeaderStyle(j);j.style.width="100px";j.innerHTML=this.m_mobWinLabel;j=document.createElement("td");b.appendChild(j);addHeaderStyle(j);j.style.width="100px";j.innerHTML=this.m_mobActionLabel;if(this.m_mobRaidEnabled&&GBL.MAIN_DATA.getViewer().getLevel()>=20){j=document.createElement("td");b.appendChild(j);addHeaderStyle(j);j.style.width="100px";j.innerHTML=this.m_mobRaidWinLabel;j=document.createElement("td");b.appendChild(j);addHeaderStyle(j);j.style.width="100px";j.innerHTML=this.m_mobRaidLabel}var h=document.createElement("div");this.m_containerDiv.appendChild(h);h.style.padding="10px";h.innerHTML=getLoadingMessageHTML();var f={};f.user_id=GBL.MAIN_DATA.getViewer().getUserId();var c=this;makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/get_rivalry_list",function(k){h.style.display="none";GBL.MAIN_TABS.invalidateTabs();c.onGetRivalryList(k,a)},f)};RivalryListDiv.prototype.onGetRivalryList=function(a,j){var d=getGadgetResponseData(a);var k=undefined;if(isValid(d)){try{k=parseInt(getXMLNodeValue(d,"num_targets"));var h=d.getElementsByTagName("attacker");for(var c=0;c<h.length;c++){var g=new User(undefined);g.createXMLUser(h[c]);j.appendChild(this.createContentElement(g))}}catch(f){outputAlert("onGetRivalryList "+f)}}if(!isValid(k)||k<=0){var b=createWhiteDiv(this.m_tableDiv);b.style.textAlign="center";b.innerHTML=this.m_emptyMessage}};RivalryListDiv.prototype.createContentElement=function(c){var f=document.createElement("tr");var g=makeElementClass("td",f,"fightListCell");g.innerHTML="<img style='vertical-align: middle; margin-left:auto; margin-right:auto;' height='30' width='30' src='"+c.getThumbnailUrl()+"'/><span class='fightListMobName'> "+c.getMobName()+" </span><span>, Level "+c.getLevel()+" "+c.getMobClass()+"</span>";addEvent(g,"click",function(){showUserStats(c.getUserId())});g=makeElementClass("td",f,"fightListCell");g.innerHTML=c.getMobSize();g=makeElementClass("td",f,"fightListCell");g.innerHTML=c.getTotalWin();g=document.createElement("td");f.appendChild(g);g.style.padding="0px 10px 0px 10px";var b=this;new DivButton(g,"Attack",function(){gaTrackEvent("rivalry","click","attack");b.attack(c)});if(this.m_mobRaidEnabled&&GBL.MAIN_DATA.getViewer().getLevel()>=20){g=makeElementClass("td",f,"fightListCell");g.innerHTML=c.getTotalRaidWin();var d=document.createElement("td");f.appendChild(d);d.style.padding="0px 10px 0px 10px";var a=undefined;if(c.isRaidDisabled()){a="gray"}new DivButton(d,"Raid",function(){gaTrackEvent("rivalry","click","raid");b.raid(c)},undefined,undefined,a)}return f};RivalryListDiv.prototype.attack=function(c){this.m_resultDiv.showMessage(undefined,"Attacking "+c.getMobName()+" ...");goToPageTop();var b=this;var a=undefined;if(isValid(this.m_repeatText)){a=document.createElement("a");a.className="standardLink";a.href="#";a.appendChild(document.createTextNode(this.m_repeatText));addEventWithParameter(a,"click",function(){b.attack(c)})}var d={};d.user_id=GBL.MAIN_DATA.getViewer().getUserId();d.target_id=c.getUserId();d.level=GBL.MAIN_DATA.getViewer().getLevel();makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/attack",function(f){handleResult(f,b.m_resultDiv,function(){b.refresh()},a)},d,1)};RivalryListDiv.prototype.raid=function(c){this.m_resultDiv.showMessage(undefined,"Raid "+c.getMobName()+" ...");goToPageTop();var b=this;var a=undefined;if(isValid(this.m_repeatText)){a=document.createElement("a");a.className="standardLink";a.href="#";a.appendChild(document.createTextNode(this.m_repeatText));addEventWithParameter(a,"click",function(){b.raid(c)})}var d={};d.user_id=GBL.MAIN_DATA.getViewer().getUserId();d.target_id=c.getUserId();d.level=GBL.MAIN_DATA.getViewer().getLevel();makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/raid",function(f){handleResult(f,b.m_resultDiv,function(){b.refresh()},a)},d,1)};function HitListBountyDiv(b,c,a){this.m_parentDiv=b;this.m_targetUser=a;this.m_containerDiv=undefined;this.m_title=undefined;this.m_resultDiv=undefined;this.m_refreshDiv=undefined;this.m_explanationText=undefined;this.m_hitListAmountText="Hit List Bounty Amount: ";this.m_hitListName="hit list";this.initialize();this.createDiv()}HitListBountyDiv.prototype.initialize=function(){this.m_explanationText="Once your bounty is posted, this user will be publicly listed for attack by any mobster out there. The reward will be given to whoever accomplishes the task. <b> It costs 1 stamina point to place a user on the hitlist.</b>"};HitListBountyDiv.prototype.createDiv=function(){this.m_containerDiv=document.createElement("div");this.m_parentDiv.appendChild(this.m_containerDiv);this.m_containerDiv.style.padding="15px";this.m_containerDiv.style.textAlign="center";this.m_title=document.createElement("div");this.m_containerDiv.appendChild(this.m_title);createTitleDiv(this.m_title,"Place Bounty on &quot;"+this.m_targetUser.getMobName()+"&quot;"+getLoadingMessageHTML());var c=createWhiteDiv(this.m_containerDiv);c.style.padding="6px";c.innerHTML=this.m_explanationText;this.m_resultDiv=new ResultDiv(this.m_containerDiv);this.m_refreshDiv=document.createElement("div");this.m_containerDiv.appendChild(this.m_refreshDiv);this.m_refreshDiv.style.textAlign="center";var b={};b.user_id=GBL.MAIN_DATA.getViewer().getUserId();b.target_id=this.m_targetUser.getUserId();var a=this;makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/get_min_hit_list_bounty",function(d){a.createBountyInterface(d,true)},b)};HitListBountyDiv.prototype.refresh=function(){this.m_refreshDiv.innerHTML="";var b={};b.user_id=GBL.MAIN_DATA.getViewer().getUserId();b.target_id=this.m_targetUser.getUserId();var a=this;makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/get_min_hit_list_bounty",function(c){a.createBountyInterface(c,false)},b)};HitListBountyDiv.prototype.createBountyInterface=function(h,n){var c=getGadgetResponseData(h);var o=undefined;try{o=getXMLNodeValue(c,"min_cost")}catch(f){}if(!isValid(o)){this.m_resultDiv.showMessage(undefined,"Sorry, there was an error, please refresh");return}o=parseInt(o);createTitleDiv(this.m_title,"Place Bounty on &quot;"+this.m_targetUser.getMobName()+"&quot; <span style='font-size:14px;'> (Minimum of $"+formatNumberWithCommas(o)+")</span>");if(n){var d=GBL.MAIN_DATA.getViewer().getCash()+GBL.MAIN_DATA.getViewer().getCashInBank();if(o>d){this.m_resultDiv.showMessage(undefined,"Sorry, you need at least $"+formatNumberWithCommas(o)+" to put "+this.m_targetUser.getMobName()+" on the "+this.m_hitListName+".");return}}var j=document.createElement("table");this.m_refreshDiv.appendChild(j);j.style.marginLeft="auto";j.style.marginRight="auto";j.style.borderSpacing="6px";var g=document.createElement("tbody");j.appendChild(g);var b=document.createElement("tr");g.appendChild(b);var l=makeElementClass("td",b,"createBountyAmount");l.innerHTML=this.m_hitListAmountText;l=document.createElement("td");b.appendChild(l);var a=undefined;try{a=document.createElement("<input type='text'/>")}catch(k){a=document.createElement("input");a.type="text"}a.value=o;l.appendChild(a);l=document.createElement("td");b.appendChild(l);var m=this;new DivButton(l,"Set Bounty",function(){if(!validateAmount(a.value)){m.m_resultDiv.showMessage(undefined,"Please specify a valid amount!");return}var p={};p.user_id=GBL.MAIN_DATA.getViewer().getUserId();p.target_id=m.m_targetUser.getUserId();p.bounty=a.value;makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/add_hit_list",function(q){handleResult(q,m.m_resultDiv,function(){m.refresh()})},p,1)})};function HitListDiv(a){this.m_parentDiv=a;this.m_containerDiv=undefined;this.m_titleDiv=undefined;this.m_resultDiv=undefined;this.m_tableDiv=undefined;this.m_titleText=undefined;this.m_explanationText=undefined;this.m_emptyMessage=undefined;this.m_targetLabel=undefined;this.m_markedLabel="Marked By";this.m_bountyLabel="Bounty";this.m_actionLabel=undefined;this.initialize();this.createDiv()}HitListDiv.prototype.initialize=function(){this.m_titleText="The Hit List";this.m_explanationText="Make a hit on a mobster listed below to collect the bounty put out on them!<br/>Or, if you've got a rival you need taken out, you can add that mobster to the hit list below by clicking &quot;Add To Hit List&quot; on their mobster profile page.";this.m_emptyMessage="The hit list is currently empty. Check back often for marked men that you can earn a bounty on!";this.m_targetLabel="The Mark";this.m_actionLabel="Attack Mob"};HitListDiv.prototype.createDiv=function(){this.m_containerDiv=document.createElement("div");this.m_parentDiv.appendChild(this.m_containerDiv);this.m_containerDiv.style.padding="15px";this.m_containerDiv.style.textAlign="center";this.m_titleDiv=document.createElement("div");this.m_containerDiv.appendChild(this.m_titleDiv);createTitleDiv(this.m_titleDiv,this.getTitleString());var a=createWhiteDiv(this.m_containerDiv);a.style.padding="6px";a.innerHTML=this.m_explanationText;this.m_resultDiv=new ResultDiv(this.m_containerDiv);this.m_tableDiv=document.createElement("div");this.m_containerDiv.appendChild(this.m_tableDiv);this.m_tableDiv.style.textAlign="center";this.refresh()};HitListDiv.prototype.getTitleString=function(){return this.m_titleText};HitListDiv.prototype.refresh=function(){outputDebug("refresh");this.m_tableDiv.innerHTML="";this.m_titleDiv.innerHTML="";createTitleDiv(this.m_titleDiv,this.getTitleString());var f=makeElementClass("table",this.m_tableDiv,"dataTable",{marginLeft:"auto",marginRight:"auto",borderSpacing:"6px"});var a=document.createElement("tbody");f.appendChild(a);var b=makeElementClass("tr",a,"dataTableHeaderTR");var h=document.createElement("td");b.appendChild(h);addHeaderStyle(h);h.style.width="225px";h.innerHTML=this.m_targetLabel;h=document.createElement("td");b.appendChild(h);addHeaderStyle(h);h.style.width="225px";h.innerHTML=this.m_markedLabel;h=document.createElement("td");b.appendChild(h);addHeaderStyle(h);h.style.width="150px";h.innerHTML=this.m_bountyLabel;h=document.createElement("td");b.appendChild(h);addHeaderStyle(h);h.style.width="100px";h.innerHTML="When";h=document.createElement("td");b.appendChild(h);addHeaderStyle(h);h.style.width="100px";h.innerHTML=this.m_actionLabel;var g=document.createElement("div");this.m_containerDiv.appendChild(g);g.style.padding="10px";g.innerHTML=getLoadingMessageHTML();var d={};d.user_id=GBL.MAIN_DATA.getViewer().getUserId();d.level=GBL.MAIN_DATA.getViewer().getLevel();var c=this;makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/get_hit_list",function(j){g.style.display="none";c.onGetFightList(j,a)},d)};HitListDiv.prototype.onGetFightList=function(a,l){var p=undefined;var d=getGadgetResponseData(a);if(isValid(d)){try{p=parseInt(getXMLNodeValue(d,"num_targets"));var n=d.getElementsByTagName("entry");for(var c=0;c<n.length;c++){var h=getXMLFirstNode(n[c],"target_user");var j=new User(undefined);j.createXMLUser(h);var o=getXMLFirstNode(n[c],"paid_user");var f=new User(undefined);f.createXMLUser(o);var m=getXMLNodeValue(n[c],"amount");var k=getXMLNodeValue(n[c],"placed_time_ago");l.appendChild(this.createContentElement(j,f,m,k))}}catch(g){outputAlert("onGetJobList "+g)}}if(!isValid(p)||p<=0){var b=createWhiteDiv(this.m_tableDiv);b.style.textAlign="center";b.innerHTML=this.m_emptyMessage}};HitListDiv.prototype.createContentElement=function(c,f,d,a){outputDebug("createContentElement");var g=document.createElement("tr");var h;h=makeElementClass("td",g,"hitListClickableCell");h.innerHTML="<span class='fightListMobName'> "+c.getMobName()+" </span>";addEvent(h,"click",function(){showUserStats(c.getUserId())});h=makeElementClass("td",g,"hitListClickableCell");h.innerHTML="<span class='fightListMobName'> "+f.getMobName()+" </span>";addEvent(h,"click",function(){showUserStats(f.getUserId())});h=makeElementClass("td",g,"hitListCell");h.innerHTML="<span class='hitListBountyNum'>$"+formatNumberWithCommas(d)+"</span>";h=makeElementClass("td",g,"hitListCell");h.innerHTML=a;h=makeElementClass("td",g,"hitListCell");var b=this;new DivButton(h,"Attack",function(){gaTrackEvent("hit_list","click","attack");b.m_resultDiv.showMessage(undefined,"Attacking "+c.getMobName()+" ...");var j={};j.user_id=GBL.MAIN_DATA.getViewer().getUserId();j.target_id=c.getUserId();makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/attack_hitlist",function(k){handleResult(k,b.m_resultDiv,function(){b.refresh()})},j,1)});return g};function makeRPGItem(a){return new RPGItem(a)}function makeCachedRPGItem(a){return function(b){try{var d=getXMLIntValue(b,"id")}catch(c){outputDebug("makeCachedRPGItem"+c);return undefined}if(isValid(a[d])){a[d].updateNode(b)}else{a[d]=new RPGItem(b)}return a[d]}}function makeRPGItem(a){return isValid(a)?new RPGItem(a):undefined}function RPGItem(a){this.m_xmlNode=a;this.m_data={};this.m_bypass={}}RPGItem.prototype.lookupData=function(c,b,a){if(!isValid(this.m_data[c])){this.parseData(c,b,a)}return this.m_data[c]};RPGItem.prototype.lookupUncachedData=function(c,b,a){if(isValid(this.m_bypass[c])){return this.m_bypass[c]}this.parseData(c,b,a);return this.m_data[c]};RPGItem.prototype.clearCache=function(){this.m_data=null;this.m_data={};this.m_bypass=null;this.m_bypass={}};RPGItem.prototype.updateNode=function(a){this.m_xmlNode=a};RPGItem.prototype.parseData=function(c,b,a){try{this.m_data[c]=(isValid(b))?b(this.m_xmlNode,c):getXMLNodeValue(this.m_xmlNode,c)}catch(d){this.m_data[c]=a}};RPGItem.prototype.getId=function(){return this.lookupData("id",getXMLIntValue)};RPGItem.prototype.getName=function(){return this.lookupData("name",getXMLEncodedStringNodeValue)};RPGItem.prototype.getPluralName=function(){return this.lookupData("plural_name",getXMLEncodedStringNodeValue)};RPGItem.prototype.getPluralizedName=function(a){return a==1?this.getName():this.getPluralName()};RPGItem.prototype.getImageURL=function(){return this.lookupData("image_url",getXMLEncodedStringNodeValue)};RPGItem.prototype.getSmallImageURL=function(){return this.lookupData("small_image_url",getXMLEncodedStringNodeValue)};RPGItem.prototype.getUpkeep=function(){return this.lookupData("upkeep",getXMLIntValue)};RPGItem.prototype.getAttack=function(){return this.lookupData("attack",getXMLIntValue)};RPGItem.prototype.getDefense=function(){return this.lookupData("defense",getXMLIntValue)};RPGItem.prototype.getDetailsHTML=function(){return this.lookupData("details",getXMLEncodedStringNodeValue)};RPGItem.prototype.getCost=function(){return this.lookupData("cost")};RPGItem.prototype.getFavorPoints=function(){return this.lookupData("favor_points")};RPGItem.prototype.getNumOwned=function(){return this.lookupUncachedData("num_owned",getXMLIntValue)};RPGItem.prototype.getCategory=function(){return this.lookupData("category",getXMLEncodedStringNodeValue)};RPGItem.prototype.getSubCategory=function(){return this.lookupData("sub_category",getXMLEncodedStringNodeValue)};RPGItem.prototype.getItemLimit=function(){return this.lookupData("item_limit",getXMLIntValue)};RPGItem.prototype.getType=function(){return this.lookupData("type",getXMLEncodedStringNodeValue)};RPGItem.prototype.getItemRemaining=function(){return this.lookupData("item_remaining",getXMLIntValue)};RPGItem.prototype.isPurchasable=function(){return this.lookupData("purchasable",getXMLEncodedStringNodeValue)};RPGItem.prototype.isSoldOut=function(){return this.lookupData("sold_out",getXMLEncodedStringNodeValue)};RPGItem.prototype.isLimitedEdition=function(){return isValid(this.getFavorPoints())&&this.getFavorPoints()>0};RPGItem.prototype.getWearablePart=function(){return this.lookupData("wearable_part",getXMLEncodedStringNodeValue)};RPGItem.prototype.getFavorPoints=function(){return this.lookupData("favor_points")};RPGItem.prototype.getDescription=function(){return this.lookupData("description",getXMLEncodedStringNodeValue)};RPGItem.prototype.getBuyLabel=function(){return this.lookupData("buy_label",getXMLEncodedStringNodeValue)};RPGItem.prototype.getUseButtonLabel=function(){return this.lookupData("use_label",getXMLEncodedStringNodeValue)};RPGItem.prototype.isUsable=function(){return isValid(this.getUseButtonLabel())&&this.getUseButtonLabel()!=""};RPGItem.prototype.isMastery=function(){return this.lookupData("is_mastery",getXMLEncodedStringNodeValue)};RPGItem.prototype.isPlatinumMastery=function(){return this.lookupData("is_platinum_mastery",getXMLEncodedStringNodeValue)};RPGItem.prototype.isDiamondMastery=function(){return this.lookupData("is_diamond_mastery",getXMLEncodedStringNodeValue)};RPGItem.prototype.isAvatar=function(){return this.lookupData("is_avatar",getXMLBooleanValue)};RPGItem.prototype.getAvatarGender=function(){return this.lookupData("avatar_gender",getXMLIntValue)};RPGItem.prototype.isJackpot=function(){return this.lookupData("is_jackpot",getXMLEncodedStringNodeValue)};RPGItem.prototype.isGala=function(){return this.lookupData("is_gala",getXMLEncodedStringNodeValue)};RPGItem.prototype.isMissionOnly=function(){return this.lookupData("is_mission_only",getXMLEncodedStringNodeValue)};RPGItem.prototype.isGiftable=function(){return this.lookupData("giftable",getXMLBooleanValue)};RPGItem.prototype.isWishlistable=function(){return this.lookupData("wishlistable",getXMLBooleanValue)};RPGItem.prototype.getStatModifier=function(){return this.lookupData("stat_mod",getXMLEncodedStringNodeValue)};RPGItem.prototype.getSecondsRemaining=function(){return this.lookupData("seconds_remaining",getXMLEncodedStringNodeValue)};RPGItem.prototype.getNumberRequired=function(){return this.lookupUncachedData("number_required",getXMLIntValue)};RPGItem.prototype.isWearable=function(){return !((this.getSubCategory()=="rides")||(this.getSubCategory()=="extras")||(this.getSubCategory()=="boyfriends"))};RPGItem.prototype.getEnhancementList=function(){return this.lookupEnhancementList()};RPGItem.prototype.getAvatarEnhancementList=function(){return this.lookupAvatarEnhancementList()};RPGItem.prototype.setNumberRequired=function(a){this.m_bypass.number_required=parseInt(a)};RPGItem.prototype.setNumOwned=function(a){this.m_bypass.num_owned=parseInt(a)};RPGItem.prototype.lookupEnhancementList=function(){if(!isValid(this.m_data.enhancementList)){this.parseEnhancementList()}return this.m_data.enhancementList};RPGItem.prototype.lookupAvatarEnhancementList=function(){if(!isValid(this.m_data.avatarEnhancementList)){this.parseAvatarEnhancementList()}return this.m_data.avatarEnhancementList};RPGItem.prototype.parseEnhancementList=function(){var a=function(f){var d=new Object();d.prefix=isValid(getXMLEncodedStringNodeValue(f,"prefix"))?getXMLEncodedStringNodeValue(f,"prefix"):"";d.suffix=isValid(getXMLEncodedStringNodeValue(f,"suffix"))?getXMLEncodedStringNodeValue(f,"suffix"):"";d.value=isValid(getXMLEncodedStringNodeValue(f,"value"))?getXMLEncodedStringNodeValue(f,"value"):"";d.readableString=d.prefix+d.value+" "+d.suffix;return d};try{var c=getXMLFirstNode(this.m_xmlNode,"enhancements");this.m_data.enhancementList=getXMLList(c,"enhancement",a)}catch(b){}};RPGItem.prototype.parseAvatarEnhancementList=function(){var a=function(f){var d=new Object();d.prefix=isValid(getXMLEncodedStringNodeValue(f,"prefix"))?getXMLEncodedStringNodeValue(f,"prefix"):"";d.suffix=isValid(getXMLEncodedStringNodeValue(f,"suffix"))?getXMLEncodedStringNodeValue(f,"suffix"):"";d.value=isValid(getXMLEncodedStringNodeValue(f,"value"))?getXMLEncodedStringNodeValue(f,"value"):"";d.readableString=d.prefix+d.value+" "+d.suffix;return d};try{var b=getXMLFirstNode(this.m_xmlNode,"avatar_enhancements");this.m_data.avatarEnhancementList=getXMLList(b,"enhancement",a)}catch(c){}};function StockPileDiv(a){this.m_parentDiv=a;this.m_containerDiv=undefined;this.m_resultDiv=undefined;this.m_refreshDiv=undefined;this.m_mobInventoryDiv=undefined;this.m_mobItemsDiv=undefined;this.m_mobInventoryConstructor=InventoryDiv;this.m_mobItemsConstructor=ItemsDiv;this.initialize();this.createDiv(this.m_parentDiv)}StockPileDiv.prototype.initialize=function(a){};StockPileDiv.prototype.createDiv=function(a){this.m_parentDiv=a;this.m_containerDiv=document.createElement("div");this.m_parentDiv.appendChild(this.m_containerDiv);this.m_containerDiv.style.padding="15px";this.m_containerDiv.style.textAlign="center";this.m_resultDiv=new ResultDiv(this.m_containerDiv);this.m_refreshDiv=document.createElement("div");this.m_containerDiv.appendChild(this.m_refreshDiv);this.m_refreshDiv.style.textAlign="center";this.refresh()};StockPileDiv.prototype.refresh=function(){var a=this;this.m_refreshDiv.innerHTML="";this.m_mobInventoryDiv=new this.m_mobInventoryConstructor(this.m_refreshDiv,this.m_resultDiv,function(){a.refresh()});this.m_mobItemsDiv=new this.m_mobItemsConstructor(this.m_refreshDiv,this.m_resultDiv,function(){a.refresh()});var b={};b.user_id=GBL.MAIN_DATA.getViewer().getUserId();if(isValid(GBL.MAIN_DATA.getHasWardrobeOnly())){b.show_wardrobe=GBL.MAIN_DATA.getHasWardrobeOnly()}this.m_mobItemsDiv.m_loading=true;makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/get_item_list",function(c){a.onGetStockpile(c)},b)};StockPileDiv.prototype.onGetStockpile=function(c){var b=getGadgetResponseData(c);if(isValid(b)){try{var a=getXMLFirstNode(b,"inventory");this.m_mobInventoryDiv.fillFromXML(a);var f=getXMLFirstNode(b,"stockpile");this.m_mobItemsDiv.fillFromXML(f)}catch(d){outputDebug("onGetStockpileList "+d)}}this.m_mobItemsDiv.m_loading=false;this.updateHighlight()};StockPileDiv.prototype.updateHighlight=function(){this.m_mobItemsDiv.updateHighlight()};function ItemsDiv(b,c,a){this.m_parentDiv=b;this.m_resultDiv=c;this.m_refreshCallback=a;this.m_containerDiv=undefined;this.m_missionHolder=undefined;this.m_weaponsTBody=undefined;this.m_raidTBody=undefined;this.m_armorTBody=undefined;this.m_vehicleTBody=undefined;this.m_loadingDiv=undefined;this.m_loading=false;this.m_unlockLevelDiv=undefined;this.m_titleText="Your Equipment";this.m_missionTitle="Mission Item";this.m_neededTitle="Needed";this.m_weaponsTitle="Weapons";this.m_raidTitle="Raid Weapons";this.m_armorTitle="Armor";this.m_vehiclesTitle="Vehicles";this.m_favorPointsText="favor points";this.m_explanationText="You'll need equipment for certain missions.      Also, the more equipment you have, the better      <a href='#' class='standardLink' onclick='switchTabsByName(\"My Mob\"); return false;'>your mob</a> will perform when you attack others      ... or when other mobs attack you.<br>     Buy or sell equipment by clicking on the proper tab below.";this.m_leveMoreText="You can unlock more equipment after you reach level";this.m_blackMarketExplanationText="The black market is a place where you can get a second opportunity to pick up RARE items that are no longer available.      		<span style='color:#ffdd00'/>We've got a steady stream of smuggled goods comin' in so check back often!</span><br/>";this.m_items={};this.initialize();this.createDiv(this.m_parentDiv)}ItemsDiv.prototype.initialize=function(a){};ItemsDiv.prototype.createDiv=function(c){outputDebug("createDiv");this.m_parentDiv=c;this.m_containerDiv=document.createElement("div");this.m_parentDiv.appendChild(this.m_containerDiv);this.m_containerDiv.style.padding="15px";this.m_containerDiv.style.textAlign="center";var a=document.createElement("div");this.m_containerDiv.appendChild(a);createTitleDiv(a,this.m_titleText+": <span style='font-size:14px'> (Upkeep <span class='expensesTitleText'>$"+formatNumberWithCommas(GBL.MAIN_DATA.getViewer().getUpkeep())+"</span>)</span>");if(isValid(this.m_explanationText)){var b=createWhiteDiv(this.m_containerDiv);b.style.padding="5px";b.innerHTML=this.m_explanationText}this.m_missionHolder=makeElement("div",this.m_containerDiv);this.m_weaponsTBody=this.createTable(this.m_containerDiv,this.m_weaponsTitle);this.m_armorTBody=this.createTable(this.m_containerDiv,this.m_armorTitle);this.m_vehicleTBody=this.createTable(this.m_containerDiv,this.m_vehiclesTitle);if(GBL.MAIN_DATA.getViewer().getLevel()>=20){this.m_raidTBody=this.createTable(this.m_containerDiv,this.m_raidTitle);$(this.m_raidTBody).hide()}this.m_loadingDiv=document.createElement("div");this.m_containerDiv.appendChild(this.m_loadingDiv);this.m_loadingDiv.style.padding="10px";this.m_loadingDiv.innerHTML=getLoadingMessageHTML();this.m_unlockLevelDiv=makeElement("div",this.m_containerDiv,{padding:"10px",display:"none"})};ItemsDiv.prototype.createTable=function(d,c,g,j){var f=document.createElement("table");if(d){d.appendChild(f)}f.style.marginLeft="auto";f.style.marginRight="auto";f.style.marginTop="5px";f.style.marginBottom="15px";f.style.cellSpacing="0px";f.style.borderCollapse="collapse";var a=document.createElement("tbody");f.appendChild(a);if(!j){var b=document.createElement("tr");a.appendChild(b);var h=undefined;if(isValid(g)){h=makeElement("td",b);addHeaderStyleWithInnerDiv(h,c,"400");h=makeElement("td",b);addHeaderStyleWithInnerDiv(h,g,"100")}else{h=makeElement("td",b);addHeaderStyleWithInnerDiv(h,c,"500px")}h=document.createElement("td");b.appendChild(h);addHeaderStyleWithInnerDiv(h,"Buy / Sell","300px")}return a};ItemsDiv.prototype.fillCategory=function(a,g,f){if(!isListValid(a,g,f)){return false}var c=getXMLFirstNode(a,g);if(!isValid(c)){return false}var b=c.getElementsByTagName("item");if(b.length==0){return false}var d=this;jQuery.each(b,function(h,k){var j=new RPGItem(k);d.m_items[j.getId()]=j;d.handleNormalItems(f,j)});return b.length>0};ItemsDiv.prototype.fillCategoriesFromXML=function(a){this.fillCategory(a,"weapon",this.m_weaponsTBody);this.fillCategory(a,"armor",this.m_armorTBody);this.fillCategory(a,"vehicle",this.m_vehicleTBody);if(isValid(this.m_raidTBody)){if(this.fillCategory(a,"raid_weapon",this.m_raidTBody)){$(this.m_raidTBody).show()}else{$(this.m_raidTBody).hide()}}var g=getXMLFirstNode(a,"featured_items");if(isValid(g)){var c=new Array();var b=g.getElementsByTagName("item");for(var d=0;d<b.length;d++){var f=new RPGItem(b[d]);c.push(f)}this.handleFeaturedItems(c)}};ItemsDiv.prototype.fillFromXML=function(a){this.m_loadingDiv.style.display="none";if(isValid(a)){try{var c=+(new Date());this.m_items={};this.fillCategoriesFromXML(a);var f=getXMLNodeValue(a,"next_level");if(isValid(f)){if(isValid(this.m_unlockLevelDiv)){$(this.m_unlockLevelDiv).show();$(this.m_unlockLevelDiv).html("<span class='equipmentUnlockMessage'>"+this.m_leveMoreText+" "+f+" ...")}else{var d=document.createElement("div");this.m_containerDiv.appendChild(d);d.style.padding="10px";d.innerHTML="<span class='equipmentUnlockMessage'>"+this.m_leveMoreText+" "+f+" ..."}}var b=+(new Date())-c;consoleLog("Adding items took {time}msec".supplant({time:b}))}catch(g){outputDebug("onGetStockpileList "+g);consoleLog("onGetStockpileList "+g)}}};ItemsDiv.prototype.handleNormalItems=function(a,b){a.appendChild(this.createContentElement(b))};ItemsDiv.prototype.handleFeaturedItems=function(a){};ItemsDiv.prototype.createContentElement=function(h,f){var p=document.createElement("tr");$(p).addClass("stockpileItem").addClass("item_"+h.getId());var t=makeElementClass("td",p,"itemCell");var b=new SideBySideCells(t,false);var n=h.getCategory()=="BOOST";var o=b.getLeftCell();o.style.width="150px";o.innerHTML="<img style='margin-left:auto; margin-right:auto;' src='"+h.getImageURL()+"'/>";var r=b.getRightCell();r.style.width="300px";r.style.paddingLeft="10px";r.style.verticalAlign="top";if(n){r.innerHTML="<div class='itemTitle' style='font-weight: bold;'>"+h.getName()+"</div><div class='itemAttack'>"+h.getDescription()+"</div>";r.style.verticalAlign="middle"}else{r.innerHTML=h.getDetailsHTML()}if(isValid(f)){t=makeElementClass("td",p,"itemNeededCount");var q=f-h.getNumOwned();if(q>0){t.innerHTML=q+" more"}else{t.innerHTML="0 more"}}t=makeElementClass("td",p,"itemTxnCell");var g=new SideBySideCells(t,false);g.getLeftCell().style.width="110px";var j=h.getFavorPoints();if(!j){j=0}if(h.isSoldOut()){g.getLeftCell().innerHTML="<span class='itemSoldOut'>Sold Out</span>"}else{if(j>0){g.getLeftCell().innerHTML="<span class='itemFavorPrice'> "+formatNumberWithCommas(j)+" "+this.m_favorPointsText+"</span>"}else{if(!n){g.getLeftCell().innerHTML="<span class='itemPrice'> $"+formatNumberWithCommas(h.getCost())+"</span>"}}}if(h.getNumOwned()>0){g.getRightCell().innerHTML="<span class='itemNumOwned'> Owned: "+h.getNumOwned()+"</span>"}var l=this;var a=new SideBySideCells(t,false);var k=a.getLeftCell();if(n){if(!h.isSoldOut()){var d="Buy";if(isValid(h.getBuyLabel())){d=h.getBuyLabel()}var c=new DivButton(k,d,function(){l.doBuy(h.getId(),1)})}}else{k.style.width="115px";if(!h.isSoldOut()&&!(isValid(h.getItemLimit())&&h.getItemLimit()<=h.getNumOwned())){new NumberSelectActionDiv(k,10,"Buy",function(u){l.doBuy(h.getId(),u)},"blue",[100])}if(h.getNumOwned()>0&&h.getCost()>0&&j==0){var m=a.getRightCell();m.style.width="115px";var s=[];if(h.getNumOwned()>=100){s=[100]}new NumberSelectActionDiv(m,Math.min(10,h.getNumOwned()),"Sell",function(u){l.doSell(h.getId(),u)},"gray",s)}}return p};ItemsDiv.prototype.clearMissionRequirements=function(a){$("tr.stockpileItem").css("backgroundColor","");$(this.m_missionHolder).html("")};ItemsDiv.prototype.highlightItem=function(b,c){if(!isValid(this.m_items[b])){return}this.m_missionTBody.appendChild(this.createContentElement(this.m_items[b],c));var a=$(".item_"+b);$(a).addClass("neededForMissionHighlight")};ItemsDiv.prototype.updateHighlight=function(){if(this.m_loading){var f=this;setTimeout(function(){f.updateHighlight()},500)}this.clearMissionRequirements();if(isValid(GBL.REQUIRED_ITEMS)&&GBL.REQUIRED_ITEMS.length>0){var b=false;for(var d=0;d<GBL.REQUIRED_ITEMS.length;++d){var c=GBL.REQUIRED_ITEMS[d];if(isValid(this.m_items[c.id])){b=true}}if(!b){return}this.m_missionTBody=this.createTable(this.m_missionHolder,this.m_missionTitle,this.m_neededTitle);for(d=0;d<GBL.REQUIRED_ITEMS.length;d++){var a=GBL.REQUIRED_ITEMS[d];this.highlightItem(a.id,a.min)}}};ItemsDiv.prototype.doBuy=function(f,d){var b=this;var a=createCallbackLink("Buy more!",function(){b.doBuy(f,d);gaTrackEvent("items","click","do_again")});gaTrackEvent("stockpile","click","buy/"+f,d);b.m_resultDiv.showMessage(undefined,"Buying ... ");goToPageTop();var c={};c.user_id=GBL.MAIN_DATA.getViewer().getUserId();c.item_id=f;c.amount=d;makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/buy_item",function(j){var l=handleResult(j,b.m_resultDiv,function(){b.m_refreshCallback()},a);if(l&&b.m_items[f].isLimitedEdition()){var h=GBL.MAIN_DATA.getViewer();try{GBL.pageTracker._addTrans(h.getUserId()+"_"+ +new Date(),h.getLevel(),b.m_items[f].getFavorPoints(),h.getCash(),h.getCashInBank(),h.m_city,h.m_region);var g=b.m_items[f].getDetailsHTML().split(">")[1].split("<")[0];GBL.pageTracker._addItem(f,f,g,"",b.m_items[f].getFavorPoints(),d);GBL.pageTracker._trackTrans()}catch(k){outputDebug(k)}}},c,0)};ItemsDiv.prototype.doSell=function(g,f){var b=this;consoleLog(this.m_items[g].getNumOwned());var d=Math.min(f,(this.m_items[g].getNumOwned()-f));var a=undefined;a=createCallbackLink("Sell more!",function(){b.doSell(g,f);gaTrackEvent("items","click","do_again")});gaTrackEvent("stockpile","click","sell/"+g,f);b.m_resultDiv.showMessage(undefined,"Selling ... ");goToPageTop();var c={};c.user_id=GBL.MAIN_DATA.getViewer().getUserId();c.item_id=g;c.amount=-f;makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/buy_item",function(h){handleResult(h,b.m_resultDiv,function(){b.m_refreshCallback()},a)},c,0)};function InventoryDiv(b,c,a){this.m_title="Your Loot:";this.m_parentDiv=b;this.m_resultDiv=c;this.m_refreshCallback=a;this.m_containerDiv=undefined;if(this.m_parentDiv!=undefined){this.createDiv(this.m_parentDiv)}}InventoryDiv.prototype.createDiv=function(a){this.m_parentDiv=a;this.m_containerDiv=makeElement("div",this.m_parentDiv,{padding:"15px",textAlign:"center",display:"none"})};InventoryDiv.prototype.fillFromXML=function(c){var j=undefined;if(isValid(c)){try{var f=c.getElementsByTagName("item");if(isValid(f)&&f.length>0){j=new Array();for(var b=0;b<f.length;b++){var h=new RPGItem(f[b]);if(h.getNumOwned()>0){var a=new Object();a.number=h.getNumOwned();a.type=h.getType();a.image_url=h.getImageURL();a.name=h.getDetailsHTML();j.push(a)}}}}catch(d){outputDebug("fillFromXML "+d)}}if(!isValid(j)||j.length==0){return}this.m_containerDiv.style.display="block";$(this.m_containerDiv).html("");var g=document.createElement("div");this.m_containerDiv.appendChild(g);createTitleDiv(g,this.m_title);var k=document.createElement("div");this.m_containerDiv.appendChild(k);createItemsListDiv(k,j,5)};InventoryDiv.prototype.refresh=function(){consoleLog("Refreshing inventory div");var b={};b.user_id=GBL.MAIN_DATA.getViewer().getUserId();var a=this;makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/get_item_list",function(f){var d=getGadgetResponseData(f);if(isValid(d)){try{var c=getXMLFirstNode(d,"inventory");a.fillFromXML(c)}catch(g){outputAlert("onGetStockpileList "+g)}}},b)};function HospitalDiv(a){this.m_parentDiv=a;this.m_containerDiv=undefined;this.m_title=undefined;this.m_resultDiv=undefined;this.m_refreshDiv=undefined;this.m_titleText=undefined;this.m_explanationMsg=undefined;this.m_cantHealText=undefined;this.m_healPrefix=undefined;this.m_healProcessText=undefined;this.m_backgroundURL=undefined;this.initialize();this.createDiv()}HospitalDiv.prototype.initialize=function(){this.m_titleText="Hospital";this.m_explanationMsg="You can pay to be patched up here, but the hospital doesn't take dirty money - you must pay using the <span class='incomeTitleText'>$"+formatNumberWithCommas(GBL.MAIN_DATA.getViewer().getCashInBank())+"</span> you have in your <a href='#' class='standardLink' onclick='switchTabs(3); return false;'> bank account</a>.";this.m_cantHealText="The hospital cannot heal you beyond 67% of your total health.";this.m_healPrefix="Heal for";this.m_healProcessText="Healing"};HospitalDiv.prototype.addBackground=function(){if(isValid(this.m_backgroundURL)){this.m_containerDiv.style.backgroundImage="url("+this.m_backgroundURL+")";this.m_containerDiv.style.backgroundRepeat="no-repeat";this.m_containerDiv.style.backgroundPosition="0 30";this.m_containerDiv.style.backgroundColor="#000000"}};HospitalDiv.prototype.createDiv=function(){this.m_containerDiv=makeElementClass("div",this.m_parentDiv,"hospitalTabDiv");this.m_containerDiv.style.padding="15px";this.m_containerDiv.style.textAlign="center";this.m_containerDiv.style.height="2000px";this.addBackground();this.m_title=document.createElement("div");this.m_containerDiv.appendChild(this.m_title);createTitleDiv(this.m_title,this.m_titleText);this.m_resultDiv=new ResultDiv(this.m_containerDiv);this.m_refreshDiv=makeElementClass("div",this.m_containerDiv,"hospitalRefreshDiv");this.refresh()};HospitalDiv.prototype.getCost=function(){return GBL.MAIN_DATA.getViewer().getLevel()*250};HospitalDiv.prototype.refresh=function(){this.initialize();this.m_refreshDiv.innerHTML="";var f=GBL.MAIN_DATA.getViewer();var c=this.getCost();if(f.getHealth()>=0.67*f.getMaxHealth()||f.getSecondsToHeal()>0){this.m_refreshDiv.textAlign="left";this.m_refreshDiv.innerHTML=this.m_cantHealText}else{this.m_refreshDiv.innerHTML=this.m_explanationMsg;var b=document.createElement("div");this.m_refreshDiv.appendChild(b);b.style.padding="10px";var d=this;var a=new DivButton(b,this.m_healPrefix+" $"+formatNumberWithCommas(c),function(){d.m_resultDiv.showMessage(undefined,d.m_healProcessText+" ... ");var g={};g.user_id=GBL.MAIN_DATA.getViewer().getUserId();g.level=GBL.MAIN_DATA.getViewer().getLevel();makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/heal",function(h){handleResult(h,d.m_resultDiv,function(){GBL.MAIN_TABS.invalidateTabs();d.refresh()})},g,1)},true);a.getButtonDiv().style.marginLeft="300px"}};GBL.STA_TOTAL_CAN_TRY_USERS=0;GBL.STA_LAST_INVITED=0;GBL.STA_CONTINUE_INVITING_TEXT="Continue Inviting Friends";function sendToAllNonAppUsersV2(l,h,g){if(GBL.ALL_USERS_CACHE.getCachedUsers().length==0){h.showMessage(false,"Error: 0 friends invited");return}var a=GBL.ALL_USERS_CACHE.getCachedUsers();var k=Math.floor(Math.random()*GBL.ALL_USERS_CACHE.getCachedUsers().length-1);var c={};var m=0;var j=[];var n=[];var f=[];goToPageTop();b(g);function b(o){if(m>=a.length){var r="You finished inviting <span class='invitationsViewNumFriends'>"+j.length+"</span> friends to join your "+o;h.showMessage(true,r);d();return}var s=[];if(a.length<InviteUtil.MULTI_INVITE_BUCKET){jQuery.each(a,function(u,t){s.push(t.getUserId());c[t.getUserId()]=true;++m})}else{for(var q=0;q<InviteUtil.MULTI_INVITE_BUCKET;++q){var p=a[k];if(isValid(p)){if(!isValid(c[p.getUserId()])){c[p.getUserId()]=true;++m;s.push(p.getUserId());k=(k+1)%a.length}else{break}}else{break}}}if(s.length==0){return}sendMultipleInvite(s,l(),function(v){if(v==0||((new Date()).getTime()-GBL.APP_LOAD_TIME)>15*60*1000){var w=document.createElement("div");var u=createWhiteDiv(w);u.innerHTML="You have invited <span class='invitationsViewNumFriends'>"+j.length+"</span> friends to join your "+o+" so far. Continue?";var t=new SideBySideCells(w);t.getLeftCell().style.padding="10px";new DivButton(t.getLeftCell(),GBL.STA_CONTINUE_INVITING_TEXT,function(){b(o)});t.getRightCell().style.padding="10px";new DivButton(t.getRightCell(),"Cancel",function(){if(j.length>0){h.showMessage(true,"You finished inviting <span class='invitationsViewNumFriends'>"+j.length+"</span> friends to join your "+o)}else{h.showMessage(false,"You didn't send any invites!")}d()});h.showCustomContent(j.length>0,w)}else{if(v>0){jQuery.each(s,function(x,y){j.push(y)});d();w=document.createElement("div");u=createWhiteDiv(w);u.innerHTML="You have invited <span class='invitationsViewNumFriends'>"+j.length+"</span> friends to join your "+o+" so far. Continue?";t=new SideBySideCells(w);t.getLeftCell().style.padding="10px";new DivButton(t.getLeftCell(),GBL.STA_CONTINUE_INVITING_TEXT,function(){b(o)});t.getRightCell().style.padding="10px";new DivButton(t.getRightCell(),"Cancel",function(){if(j.length>0){h.showMessage(true,"You finished inviting <span class='invitationsViewNumFriends'>"+j.length+"</span> friends to join your "+o)}else{h.showMessage(false,"You didn't send any invites!")}d()});h.showCustomContent(j.length>0,w)}else{jQuery.each(s,function(x,y){n.push(y)});w=document.createElement("div");u=createWhiteDiv(w);u.innerHTML="You have invited <span class='invitationsViewNumFriends'>"+j.length+"</span> friends to join your "+o+" so far. Continue?";t=new SideBySideCells(w);t.getLeftCell().style.padding="10px";new DivButton(t.getLeftCell(),GBL.STA_CONTINUE_INVITING_TEXT,function(){b(o)});t.getRightCell().style.padding="10px";new DivButton(t.getRightCell(),"Cancel",function(){if(j.length>0){h.showMessage(true,"You finished inviting <span class='invitationsViewNumFriends'>"+j.length+"</span> friends to join your "+o)}else{h.showMessage(false,"You didn't send any invites!")}d()});h.showCustomContent(j.length>0,w)}}})}function d(){consoleLog(j);if(j.length>0||n.length>0){var p={};p.user_id=GBL.MAIN_DATA.getViewer().getUserId();p.to_user_ids=j.join(",");p.blocked_user_ids=n.join(",");var o=this;makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/send_requests",function(q){outputDebug("finished sending one chunk")},p)}}}function HotTipDiv(a){this.m_parentDiv=a;this.m_containerDiv=undefined;this.m_contentDiv=undefined;this.m_resultDiv=undefined;this.m_sentFriends=undefined;this.m_blockedFriends=undefined;this.m_inviteTipText="A bigger mob is a more powerful mob!";this.m_inviteNotPartText="is not part of your mob";this.m_hotTipNameCellWidth=undefined;this.m_groupName="mob";this.m_inviteOtherFriendsTabIndex=9;this.m_inviteNameMaxLength=11;this.m_sendInvite=true;this.initialize();this.createDiv()}HotTipDiv.prototype.initialize=function(){this.m_sendInvite=true};HotTipDiv.prototype.createDiv=function(){this.m_containerDiv=makeElementClass("div",this.m_parentDiv,"hotTipContainer");this.showPokerPalace(this.m_containerDiv);var a=makeElementClass("div",this.m_containerDiv,"hotTipSectionTitle");a.innerHTML="Hot Tip: <span id='hotTipSubtitle'></span>";this.m_contentDiv=makeElementClass("div",this.m_containerDiv,"hotTipContentDiv");if(GBL.HOT_TIP_FRIENDS_LOADED){this.showDefaultHotTip(this.m_contentDiv)}else{this.showLoadingMessage(this.m_contentDiv)}};HotTipDiv.prototype.showLoadingMessage=function(a){a.innerHTML=getCenteredLoadingMessageHTML()};HotTipDiv.prototype.showPokerPalace=function(b){if(!GBL.MAIN_DATA.getIsViewerPPUser()){return}var a=makeElementClass("div",b,"hotTipPokerPalace");a.innerHTML="Looking for <img style='vertical-align:middle;' src='http://cdn0.pokerpartyapp.com/prod_poker/img/js/PokerPalaceLogo2.gif'/>? Click Here!";addEvent(a,"click",function(){try{window.open("http://profile.myspace.com/Modules/Applications/Pages/Canvas.aspx?appId=109588")}catch(c){}})};HotTipDiv.prototype.showDefaultHotTip=function(a){var c=undefined;var b=Math.random();if(b<=0.5){c="<span class='tipTitle'> The Bigger the Family, the better! </span> <br>A bigger mob family will make you more <b>powerful in fights</b> and give you access to <b>more lucrative missions</b>. <a href='#' class='standardLink' onclick='switchTabs(9); return false;'>Click here to invite more friends</a> to join your mob family!"}else{if(b<0.8){c="<span class='tipTitle'> Dust yourself off and try again. </span> <br>Want to try again with a different Mobster class? With our new save/load game feature you can create up to 3 mobster characters under one MySpace account which will share favor points and mob members. <a href='#' class='standardLink' onclick='switchTabs(10); return false;'>Click here</a> to check it out!"}else{c="<span class='linkableTipTitle' onclick='window.open(\"http://profile.myspace.com/Modules/Applications/Pages/Canvas.aspx?appId=123192&track=mobsters_hottip\");return false;'> Feel the rush, live the dream! </span> <br>Take your criminal activities to the racetrack. In Mobsters: Overdrive, you have one goal: to build your reputation as the fastest racer on the midnight streets. <a onclick='window.open(\"http://profile.myspace.com/Modules/Applications/Pages/Canvas.aspx?appId=123192&track=mobsters_hottip\");return false;' href='#' class='standardLink'>Click here</a> to play Overdrive!"}}a.innerHTML="<ul class='hotTipUL'><li>"+c+"</li></ul>"};HotTipDiv.prototype.onLoadedOSFriends=function(){var f=GBL.ALL_USERS_CACHE.getCachedUsers();var g=Math.floor(Math.random()*Math.max(f.length-30,0));var a=0;var d={};d.user_id=GBL.MAIN_DATA.getViewer().getUserId();d.query_ids="";for(var c=g;c<Math.min(g+40,f.length);c++){if(!GBL.APP_USERS_CACHE.hasUser(f[c].getUserId())){d.query_ids+=f[c].getUserId()+",";a+=1}}var b=this;makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/get_app_users_for_invite",function(h){b.onGetInviteUsers(h)},d)};HotTipDiv.prototype.onGetInviteUsers=function(d){var o=new Array();GBL.HOT_TIP_FRIENDS_LOADED=true;try{var g=getGadgetResponseData(d);if(g!=undefined){var j=g.getElementsByTagName("invite_id");if(isValid(j)&&j.length>0){for(var f=0;f<j.length;f++){var p=j[f].firstChild.nodeValue;o.push(GBL.ALL_USERS_CACHE.getUserById(p))}}}}catch(k){outputDebug("HotTip error: "+k)}if(o.length<=0){this.showDefaultHotTip(this.m_contentDiv);return}this.m_contentDiv.innerHTML="";$("#hotTipSubtitle").html("<span class='hotTipInviteTipText'> "+this.m_inviteTipText+" </span>");var a=Math.min(Math.floor(Math.random()*o.length),o.length-1);var r=o[a];var q=this;var s=function(){var t=new Array();t.push(r);q.m_sentFriends=new Array();q.m_blockedFriends=new Array();q.sendInvite(t,0)};this.m_resultDiv=new ResultDiv(this.m_contentDiv);var c=new SideBySideCells(this.m_contentDiv);c.getContainerDiv().style.padding="0px";var b=c.getLeftCell();b.style.textAlign="center";if(isValid(this.m_hotTipNameCellWidth)){b.style.width=this.m_hotTipNameCellWidth}var h=new ImageDiv(b,r.getThumbnailUrl(),"70px","70px");h.getContainerDiv().style.marginLeft="auto";h.getContainerDiv().style.marginRight="auto";h.getContainerDiv().style.cursor="pointer";addEvent(h.getContainerDiv(),"click",s);var m=makeElement("div",b,{textAlign:"center",cursor:"pointer"});m.innerHTML="<span class='invitationsViewShortName'>"+r.getShortName()+"</span><br/><span class='invitationsViewInviteNotPartText'> "+this.m_inviteNotPartText+" </span>";addEvent(m,"click",s);var l=c.getRightCell();var n=new DivButton(l,"Invite "+shortenedStringKeepEscapedCharacters(r.getName(),this.m_inviteNameMaxLength),s,undefined,false);setStyle(n.getButtonDiv(),{marginLeft:"5px",marginTop:"3px"});outputDebug("num invitable friends: "+o.length);n=new DivButton(l,"Invite "+InviteUtil.MULTI_INVITE_BUCKET+" Friends",function(){var t=new Array();var v=getRandomNumbers(o.length-1,InviteUtil.MULTI_INVITE_BUCKET);for(var u=0;u<v.length;u++){t.push(o[v[u]])}q.m_sentFriends=new Array();q.m_blockedFriends=new Array();q.sendMultipleInvites(t,0,function(){q.finishSending(t)})},undefined,false);n.getButtonDiv().style.margin="5px";n=new DivButton(l,"Invite All Friends",function(){sendToAllNonAppUsersV2(q.generateInvite,q.m_resultDiv,q.m_groupName)},undefined,false);n.getButtonDiv().style.margin="5px"};HotTipDiv.prototype.generateInvite=function(){return GBL.MAIN_DATA.getViewer().getName()+' wants you to join their mob in Mobsters, a Mafia-style combat game played with you friends on MySpace. Click "Add Mobsters" to play!'};HotTipDiv.prototype.sendInvite=function(f,a){var d=f[a];var c=this;var b=function(g){if(g>0){d.setRequestedByUser(true);c.m_sentFriends.push(d)}else{if(g==-1){c.m_blockedFriends.push(d)}}var h=a+1;if(h<f.length){c.sendInvite(f,h)}else{c.finishSending(f)}};sendInvite(d,this.generateInvite(d),b)};HotTipDiv.prototype.sendMultipleInvites=function(f,b,h){if(f.length==0){if(isValidFunction(h)){h()}}else{var a=new Array();var c=new Array();jQuery.each(f.slice(b,b+InviteUtil.MULTI_INVITE_BUCKET),function(k,j){a.push(j.getUserId());c.push(j)});var d=this;var g=function(j){jQuery.each(c,function(m,l){if(j>0){l.setRequestedByUser(true);d.m_sentFriends.push(l)}else{if(j==-1){d.m_blockedFriends.push(l)}}});var k=b+InviteUtil.MULTI_INVITE_BUCKET;if(k<f.length){setTimeout(function(){d.sendMultipleInvites(f,k,h)},800)}else{if(isValidFunction(h)){h()}}};if(isValid(this.m_sendInvite)&&this.m_sendInvite){sendMultipleInvite(a,this.generateInvite(),g)}}};HotTipDiv.prototype.finishSending=function(f){if(f.length==this.m_blockedFriends.length){this.m_resultDiv.showMessage(undefined,"No requests were sent. Sometimes refreshing the page will address this error.");return}if(this.m_sentFriends.length>0){this.m_resultDiv.showMessage(true,"You have sent requests to "+this.m_sentFriends.length+" friends!")}else{this.m_resultDiv.showMessage(false,"You didn't send any invites!")}var a="";for(var c=0;c<this.m_sentFriends.length;c++){if(c>0){a+=","}a+=this.m_sentFriends[c].getUserId()}var g="";for(c=0;c<this.m_blockedFriends.length;c++){if(c>0){g+=","}g+=this.m_blockedFriends[c].getUserId()}var d={};d.user_id=GBL.MAIN_DATA.getViewer().getUserId();d.to_user_ids=a;d.blocked_user_ids=g;var b=this;makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/send_requests",function(h){handleResult(h,b.m_resultDiv,function(){})},d);this.onLoadedOSFriends()};function InviteDiv(a){this.m_parentDiv=a;this.m_containerDiv=undefined;this.m_resultDiv=undefined;this.m_friendPickerParentDiv=undefined;this.m_friendPicker=undefined;this.m_sentFriends=undefined;this.m_blockedFriends=undefined;this.m_sendInvite=false;this.m_sendMessages=false;this.m_explanationMsg=undefined;this.initialize();this.createDiv()}InviteDiv.prototype.initialize=function(){this.m_sendInvite=true;this.m_sendMessages=true;this.m_explanationMsg='Select your friends below to recruit them. <b>The larger your mob family, the more powerful your mob will be when attacking and completing missions!</b> To build a successful family you should choose all friends below who are most likely to join, then click "Send Invites!"'};InviteDiv.prototype.generateComment=function(){var a=Math.random();if(a<0.8){return"<a href='"+GBL.APP_CANVAS_URL+"&track=comment_img_v3'><img src='http://cdn0.mobwarsapp.com/rpg_images/opensocial/mob/promotional/mobsters_comment.png'/></a><br/><br/>"+GBL.MAIN_DATA.getViewer().getName()+" wants you to join their mob in <a href='"+GBL.APP_CANVAS_URL+"&track=comment_link1_v1'>Mobsters</a>, a Mafia-style combat game played on MySpace. Start out as a petty thief and work your way up to become a Mob Don!<br/><br/><a href='"+GBL.APP_CANVAS_URL+"&track=comment_link2_v1''>Join "+GBL.MAIN_DATA.getViewer().getName()+"'s Mob!</a>"}else{return"<a href='"+GBL.APP_CANVAS_URL+"&track=comment_img_v4'><img src='http://cdn0.mobwarsapp.com/rpg_images/opensocial/mob/promotional/mobsters_comment_3.jpg'/></a><br/><br/>"+GBL.MAIN_DATA.getViewer().getName()+" wants you to join their mob in <a href='"+GBL.APP_CANVAS_URL+"&track=comment_link1_v2'>Mobsters</a>, a Mafia-style combat game played on MySpace. Start out as a petty thief and work your way up to become a Mob Don!<br/><br/><a href='"+GBL.APP_CANVAS_URL+"&track=comment_link2_v2''>Join "+GBL.MAIN_DATA.getViewer().getName()+"'s Mob!</a>"}};InviteDiv.prototype.generateInvite=function(){return GBL.MAIN_DATA.getViewer().getName()+' wants you to join their mob in Mobsters, a Mafia-style combat game played with you friends on MySpace. Click "Add Mobsters" to play!'};InviteDiv.prototype.generateMessage=function(){return{subject:"let's cause some trouble",content:"You should join my Mob in <a href='"+GBL.APP_CANVAS_URL+'&appParams={"rsrc":"inviteMessage/link1"}\'>Mobsters</a>, a Mafia-style combat game played on MySpace. Start out as a petty thief and work your way up to become a Mob Don!<br/><br/><a href=\''+GBL.APP_CANVAS_URL+'&appParams={"rsrc":"inviteMessage/link2"}\'>Join '+GBL.MAIN_DATA.getViewer().getName()+"'s Mob!</a>"}};InviteDiv.prototype.createDiv=function(){this.m_containerDiv=document.createElement("div");this.m_parentDiv.appendChild(this.m_containerDiv);this.m_containerDiv.style.paddingTop="10px";this.m_containerDiv.style.textAlign="center";this.m_resultDiv=new ResultDiv(this.m_containerDiv);var d=createWhiteDiv(this.m_containerDiv);d.innerHTML=this.m_explanationMsg;var c=this;var b=document.createElement("div");this.m_containerDiv.appendChild(b);b.style.padding="10px";var a=new DivButton(b,"Send Invites!",function(){gaTrackEvent("my_mob","click","send_invites/top");c.send()},true);a.getButtonDiv().style.marginLeft="330px";this.m_friendPickerParentDiv=document.createElement("div");this.m_containerDiv.appendChild(this.m_friendPickerParentDiv);this.m_friendPicker=new FriendPicker(this.m_friendPickerParentDiv,GBL.MAIN_DATA.getViewerFriends(),function(){c.send()});b=document.createElement("div");this.m_containerDiv.appendChild(b);b.style.padding="10px";a=new DivButton(b,"Send Invites!",function(){gaTrackEvent("my_mob","click","send_invites/bottom");c.send()});a.getButtonDiv().style.marginLeft="330px"};InviteDiv.prototype.send=function(){var b=this.m_friendPicker.getSelectedFriends();if(!isValid(b)||b.length==0){this.m_resultDiv.showMessage(false,"Please select at least one friend to invite");return}this.m_resultDiv.showMessage(undefined,"Sending...");this.m_sentFriends=new Array();this.m_blockedFriends=new Array();var d=this;var a=new Array();var c=new Array();jQuery.each(b,function(g,f){if(GBL.APP_USERS_CACHE.hasUser(f.getUserId())){a.push(f);f.setRequestedByUser(true);d.m_sentFriends.push(f)}else{c.push(f)}});goToPageTop();this.sendInvites(c,0,function(){var f=function(){d.sendComment(a,0,function(){consoleLog("Finishing sending comments.");d.finishSending(b)})};if(c.length==0){f()}else{setTimeout(f,1000)}})};InviteDiv.prototype.sendInvites=function(f,b,h){if(f.length==0){if(isValidFunction(h)){h()}}else{var a=new Array();var c=new Array();jQuery.each(f.slice(b,b+InviteUtil.MULTI_INVITE_BUCKET),function(k,j){a.push(j.getUserId());c.push(j)});var d=this;var g=function(j){jQuery.each(c,function(m,l){if(j>0){l.setRequestedByUser(true);d.m_sentFriends.push(l)}else{if(j==-1){d.m_blockedFriends.push(l)}}});var k=b+InviteUtil.MULTI_INVITE_BUCKET;if(k<f.length){setTimeout(function(){d.sendInvites(f,k,h)},800)}else{if(isValidFunction(h)){h()}}};if(isValid(this.m_sendInvite)&&this.m_sendInvite){sendMultipleInvite(a,this.generateInvite(),g)}}};InviteDiv.prototype.generateNotificationText=function(){return"You should join my Mob in Mobsters, a Mafia-style combat game played on MySpace. Start out as a petty thief and work your way up to become a Mob Don!"};InviteDiv.prototype.generateNotificationButtonList=function(a){var c=new NotificationButton(null);var b=new NotificationButton(null);c.m_buttonText="Join "+a.getName()+"'s Mob!";b.m_buttonText="See "+a.getName()+"'s Profile";c.m_appParams={};b.m_appParams={};c.m_appParams.invite_tab="true";b.m_appParams.show_user_id=""+a.getUserId();c.m_appParams.rsrc="not_invite_accept";b.m_appParams.rsrc="not_invite_profile";c.getAppParams=function(){return c.m_appParams};b.getAppParams=function(){return b.m_appParams};c.getButtonText=function(){return c.m_buttonText};b.getButtonText=function(){return b.m_buttonText};var d=[];d.push(c);d.push(b);return d};InviteDiv.prototype.sendComment=function(g,a,j){if(g.length==0){j()}else{var f=[];var h=this.generateNotificationText();var d=this.generateNotificationButtonList(GBL.MAIN_DATA.getViewer());for(var c=0;c<g.length;c++){var b=g[c];if(isValid(b)){f.push(b.m_userId)}}if(f.length>0){sendNotification(f,h,d)}this.sendCommentPostNotification(g,a,j)}};InviteDiv.prototype.sendCommentPostNotification=function(f,a,h){if(f.length==0){h()}else{var d=f[a];var c=this;if(isValid(d)){var b=function(j){if(j>0){d.setRequestedByUser(true);c.m_sentFriends.push(d)}else{if(j==-1){c.m_blockedFriends.push(d)}}var k=a+1;if(k<f.length){setTimeout(function(){c.sendCommentPostNotification(f,k,h)},400)}else{h()}};if(isValid(this.m_sendMessages)&&this.m_sendMessages&&GBL.APP_USERS_CACHE.hasUser(d.getUserId())){var g=this.generateMessage();sendMessage(d,g.subject,g.content,b)}else{sendCommentWOGoToPageTop(d,this.generateComment(),b)}}}};InviteDiv.prototype.finishSending=function(f){if(f.length==this.m_blockedFriends.length){this.m_resultDiv.showMessage(undefined,"No requests were sent. Sometimes refreshing the page will address this error.");return}if(this.m_sentFriends.length>0){this.m_resultDiv.showMessage(true,"You have sent requests to "+this.m_sentFriends.length+" friends!")}else{this.m_resultDiv.showMessage(false,"You didn't send any invites!")}this.m_friendPicker.unselectFriends();var d="";for(var b=0;b<this.m_sentFriends.length;b++){if(b>0){d+=","}d+=this.m_sentFriends[b].getUserId()}var g="";for(b=0;b<this.m_blockedFriends.length;b++){if(b>0){g+=","}g+=this.m_blockedFriends[b].getUserId()}var c={};c.user_id=GBL.MAIN_DATA.getViewer().getUserId();c.to_user_ids=d;c.blocked_user_ids=g;var a=this;makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/send_requests",function(h){handleResult(h,a.m_resultDiv,function(){})},c)};function FriendPicker(r,s,o){var b=r;var p=s;var m=o;var u=undefined;var t=new Object();var j=undefined;var l=undefined;var k=undefined;h(b);this.getSelectedFriends=d;this.unselectFriends=f;function h(w){b=w;u=makeElementClass("div",b,"invitationsView");u.innerHTML=getLoadingMessageHTML();p.getNumUsers(c)}function c(w){outputDebug("FriendPicker: onGottenNumUsers: "+w);j=w;a(1)}function a(w){l=w;u.innerHTML="";n(u);if(!isValid(j)||j==0){var x=makeElementClass("div",u,"invitationsViewEmptyPage");x.innerHTML="Sorry, this shouldn't be empty, the technical team has been notified."}else{q(u);k=new FriendPickerContentDiv(u,p,l,t,g(),m);q(u)}}function g(){var w=0;for(var x in t){if(isValid(t[x])){w+=1}}return w}function n(y){var A=document.createElement("div");y.appendChild(A);A.style.textAlign="center";var w=makeElementClass("span",A,"invitationsViewSelectRandomTen");w.innerHTML="Select Random "+InviteUtil.MULTI_INVITE_BUCKET;addEvent(w,"click",function(){gaTrackEvent("my_mob","click","select_random_10");v();if(isValid(k)){k.selectRandom()}});var z=makeElementClass("span",A,"pipeDivider");z.innerHTML="|";var x=makeElementClass("span",A,"invitationsViewClearSelected");x.innerHTML="Clear Selected";addEvent(x,"click",function(){v();if(isValid(k)){k.unselectFriends()}})}function q(x){var w=Math.ceil(j/40);new PaginationDiv(x,a,w,l,20)}function d(){var w=new Array();for(var x in t){if(isValid(t[x])){w.push(p.getUserById(x))}}return w}function f(){t=new Object();a(l)}function v(){for(var w in t){t[w]=undefined}}}function FriendPickerContentDiv(y,w,x,o,u,s){var c=y;var b=w;var f=u;var m=x;var z=o;var r=s;var A=undefined;var k=undefined;var n=new Array();var p=new Array();this.getSelectedFriendIds=v;this.unselectFriends=d;this.selectRandom=j;if(isValid(c)){h(c)}function h(B){c=B;A=document.createElement("div");A.style.height="auto";A.style.overflow="auto";A.style.textAlign="center";A.innerHTML="Loading Users...";c.appendChild(A);b.getUsers((m-1)*40,40,a)}function a(D){var C=D;A.innerHTML="";k=document.createElement("form");A.appendChild(k);var F=document.createElement("table");F.style.borderSpacing="2px";F.style.border="none";F.style.marginLeft="auto";F.style.marginRight="auto";k.appendChild(F);var I=document.createElement("tbody");F.appendChild(I);var H=document.createElement("tr");I.appendChild(H);var G=0;for(var E=0;E<C.length;E++){var B=C[E];if(G>=5){H=document.createElement("tr");I.appendChild(H);G=0}if(B.getpartOfViewerMob()){H.appendChild(t(B))}else{H.appendChild(q(B))}G+=1}}function t(D){var G=document.createElement("td");G.className="invitationsViewUnpickableCell";if(D.getpartOfViewerMob()){var E=document.createElement("div");G.appendChild(E);E.innerHTML="<span class='invitationsViewFriendStatusMember'> Member</span>"}else{if(D.getRequestedByUser()){E=document.createElement("div");G.appendChild(E);E.innerHTML="<span class='invitationsViewFriendStatus'> Requested </span>"}else{if(D.getInviteBlocked()){E=document.createElement("div");G.appendChild(E);E.innerHTML="<span class='invitationsViewFriendStatus'> Blocking Invites </span>"}}}var C=document.createElement("div");G.appendChild(C);var F=D.getThumbnailUrl();C.style.backgroundImage="url('"+F+"')";C.style.backgroundPosition="center center";C.style.backgroundRepeat="no-repeat";C.style.width="70px";C.style.height="70px";var B=document.createElement("div");G.appendChild(B);B.innerHTML=shortenedStringKeepEscapedCharacters(D.getName(),16);return G}function q(F,L){var M=document.createElement("td");M.className="invitationsViewPickableCell";M.selected=false;M.onmouseover=function(){if(!M.selected){M.style.backgroundColor="#bdc7d8"}};M.onmouseout=function(){if(!M.selected){M.style.backgroundColor="#ffffff"}};if(F.getpartOfViewerMob()){var C=document.createElement("div");M.appendChild(C);if(isValid(GBL.TOP_MOB)&&GBL.TOP_MOB.isTopMob(F.getUserId())){C.innerHTML="<span class='invitationsViewFriendStatusMember'> Top Mob! </span>"}else{if(isValid(GBL.TOP_MOB)){C.innerHTML="<span class='invitationsViewFriendStatusMember'> Member <a style='cursor: pointer;' onclick='GBL.TOP_MOB.add("+F.getUserId()+")'>[promote]</a></span>"}else{C.innerHTML="<span class='invitationsViewFriendStatusMember'> Member </span>"}}}else{if(F.getInviteBlocked()){C=document.createElement("div");M.appendChild(C);C.innerHTML="<span class='invitationsViewFriendStatus'> Blocking Invites </span>"}else{if(F.getRequestedByUser()){C=document.createElement("div");M.appendChild(C);C.innerHTML="<span class='invitationsViewFriendStatus'> Requested </span>"}}}var O=document.createElement("table");O.style.border="none";O.align="CENTER";M.appendChild(O);var I=document.createElement("tbody");O.appendChild(I);var G=document.createElement("tr");I.appendChild(G);var E=document.createElement("td");G.appendChild(E);var D=document.createElement("div");E.appendChild(D);var N=F.getThumbnailUrl();D.style.backgroundImage="url('"+N+"')";D.style.backgroundPosition="center center";D.style.backgroundRepeat="no-repeat";D.style.width="70px";D.style.height="70px";var B=document.createElement("td");G.appendChild(B);var H=undefined;try{H=document.createElement("<input type='CHECKBOX' name='pickFriend' value='"+F.getUserId()+"'/>")}catch(K){H=document.createElement("input");H.type="checkbox";H.name="pickFriend";H.value=F.getUserId()}if(isValid(z[F.getUserId()])){H.checked=true;B.style.backgroundColor="#3b5998";B.style.color="white"}B.appendChild(H);var J=document.createElement("div");M.appendChild(J);if(isValid(F)){J.innerHTML=shortenedStringKeepEscapedCharacters(F.getName(),16)}addEvent(M,"click",function(P){l(H,M)});n.push(M);p.push(H);return M}function l(B,C){g(C);B.checked=!C.selected;if(B.checked){B.checked=false;z[B.value]=undefined;f--}else{B.checked=true;z[B.value]=B.value;f++;if(f>=InviteUtil.MULTI_INVITE_BUCKET){r()}}return false}function g(B){B.selected=!B.selected;if(B.selected){B.style.backgroundColor="#3b5998";B.style.color="white"}else{B.style.backgroundColor="white";B.style.color="black"}}function v(){var C=new Array();for(var B=0;B<k.pickFriend.length;B++){if(k.pickFriend[B].checked){C.push(k.pickFriend[B].value)}}return C}function d(){for(var B=0;B<n.length;B++){n[B].checked=false;n[B].selected=false;n[B].style.backgroundColor="white";n[B].style.color="black"}for(B=0;B<p.length;B++){p[B].checked=false;f=0}}function j(){d();var D=getRandomNumbers(n.length-1,InviteUtil.MULTI_INVITE_BUCKET);f=D.length;for(var C=0;C<D.length;C++){var E=D[C];var B=p[E].value;n[E].checked=true;n[E].selected=true;n[E].style.backgroundColor="#3b5998";n[E].style.color="white";p[E].checked=true;z[B]=B}if(f>=InviteUtil.MULTI_INVITE_BUCKET){r()}}}function ViewerMobDiv(b,a){this.m_parentDiv=b;this.m_showTitle=!a;this.m_containerDiv=undefined;this.m_resultDiv=undefined;this.m_refreshDiv=undefined;this.m_inviteDiv=undefined;this.m_titleString=undefined;this.m_maxExplanation=undefined;this.m_mobMembersDiv=undefined;this.m_mobRequestsDiv=undefined;this.m_mobInviteDiv=undefined;this.m_groupName="mob";this.initialize();this.createDiv()}ViewerMobDiv.prototype.initialize=function(){this.m_titleString="Your Mob:";this.m_maxExplanation="Note: Your current max mob family size limit is: <b>500</b>";this.m_mobMembersDiv=MobMembersDiv;this.m_mobRequestsDiv=MobRequestsDiv;this.m_mobInviteDiv=InviteDiv};ViewerMobDiv.prototype.createDiv=function(){this.m_containerDiv=document.createElement("div");this.m_parentDiv.appendChild(this.m_containerDiv);this.m_containerDiv.style.padding="15px";this.m_containerDiv.style.textAlign="center";this.m_page_view=0;if(this.m_showTitle){var b=new Array();b.push("View "+GBL.MAIN_DATA.getViewer().getMobSize()+" Members");var d=new Array();var c=this;d.push(function(){GBL.MAIN_TABS.switchToDynamicTab(function(g){g.innerHTML="";c.m_page_view=1;new c.m_mobMembersDiv(g)})});var a=document.createElement("div");this.m_containerDiv.appendChild(a);createTitleDiv(a,this.m_titleString,b,d,true);try{GBL.TOP_MOB.registerObserver(this)}catch(f){}}this.m_resultDiv=new ResultDiv(this.m_containerDiv);this.m_refreshDiv=document.createElement("div");this.m_containerDiv.appendChild(this.m_refreshDiv);this.m_refreshDiv.style.textAlign="center";this.refresh()};ViewerMobDiv.prototype.refresh=function(){this.m_refreshDiv.innerHTML="";var b=createWhiteDiv(this.m_refreshDiv);b.style.padding="8px";b.innerHTML=this.m_maxExplanation;var a=this;a.m_page_view=0;new this.m_mobRequestsDiv(this.m_refreshDiv,this.m_resultDiv,function(){a.refresh()});if(isOffSite()){this.createOffSiteMessage(this.m_refreshDiv)}else{this.createBulletin(this.m_refreshDiv);this.m_inviteDiv=new this.m_mobInviteDiv(this.m_refreshDiv)}};ViewerMobDiv.prototype.createOffSiteMessage=function(a){$(makeElementClass("div",a,"offsiteMessage")).html("<a class='standardLink' target='_blank' href='"+GBL.APP_CANVAS_URL+"'>Return to Myspace</a> to invite some friends to your "+this.m_groupName+".").css({textAlign:"left",color:GBL.STYLES.text["color"],paddingRight:"30px"})};ViewerMobDiv.prototype.createBulletin=function(d){var b=new SideBySideCells(d);b.getContainerDiv().style.paddingTop="5px";b.getContainerDiv().style.paddingBottom="5px";var f=b.getLeftCell();f.style.textAlign="left";f.style.color=GBL.STYLES.text["color"];f.style.paddingRight="30px";f.innerHTML="Invite ALL your friends to join your Mob!";var g=b.getRightCell();var c=this;var a=new DivButton(g,"Invite All Your Friends!",function(){gaTrackEvent("my_mob","click","invite_all_your_friends");sendToAllNonAppUsersV2(c.m_inviteDiv.generateInvite,c.m_resultDiv,c.m_groupName)})};function MobRequestsDiv(b,c,a){this.m_parentDiv=b;this.m_resultDiv=c;this.m_refreshCallback=a;this.m_containerDiv=undefined;this.m_explanationMsg=undefined;this.initialize();this.createDiv()}MobRequestsDiv.prototype.initialize=function(){this.m_explanationMsg="The following people have requested that you join their mob. If you accept, they will also become a member of your mob and you will be able to pull off more difficult missions, as well as become more powerful when attacking other mobs."};MobRequestsDiv.prototype.createDiv=function(){this.m_containerDiv=document.createElement("div");this.m_containerDiv.setAttribute("id","mob_request_div_id");this.m_parentDiv.appendChild(this.m_containerDiv);this.m_containerDiv.style.padding="15px";this.m_containerDiv.style.textAlign="center";this.m_containerDiv.style.border="solid 1px #888888";this.m_containerDiv.style.display="none";var a=this;GBL.MAIN_DATA.getCachedUsers(CachedUserList.MY_REQUESTS).getNumUsers(function(b){a.onGottenNumUsers(b)})};MobRequestsDiv.prototype.onGottenNumUsers=function(d){if(d>0){this.m_containerDiv.style.display="block";var f=createWhiteDiv(this.m_containerDiv);f.innerHTML=this.m_explanationMsg;var a=createWhiteDiv(this.m_containerDiv);a.style.width="100%";a.style.textAlign="center";a.style.paddingTop="15px";var c=this;var b=new DivButton(a,"Accept All!",function(){var g={};g.user_id=GBL.MAIN_DATA.getViewer().getUserId();c.m_resultDiv.showMessage(undefined,"Accepting all requests, please wait a moment...");makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/accept_all_mob_requests",function(h){GBL.MAIN_DATA.getCachedUsers(CachedUserList.MY_REQUESTS).invalidateCache();handleResult(h,c.m_resultDiv,function(){c.m_refreshCallback()})},g,0)},null,true);new UserTableParentDiv(this.m_containerDiv,GBL.MAIN_DATA.getCachedUsers(CachedUserList.MY_REQUESTS),4,12,function(g){return c.canAcceptRejectTdCreater(g)},null,false)}};MobRequestsDiv.prototype.canAcceptRejectTdCreater=function(l){var k=this;var j=document.createElement("td");j.style.textAlign="center";j.style.width="145px";j.style.padding="5px";j.style.border="solid 1px #555555";var f=makeElementClass("div",j,"requestNameDiv");f.innerHTML=l.getMobName();addEvent(f,"click",function(){showUserStats(l.getUserId())});var a=new SideBySideCells(j,true);var c=a.getLeftCell();var d=new ImageDiv(c,l.getThumbnailUrl(),"60px","60px");d.getContainerDiv().style.cursor="pointer";addEvent(d.getContainerDiv(),"click",function(){showUserStats(l.getUserId())});var b=a.getRightCell();var g=makeElementClass("div",b,"requestAcceptDiv");g.innerHTML="<span style='font-weight:bold;'>Accept</span>";addEvent(g,"click",function(){k.m_resultDiv.showMessage(undefined,"Accepting ... ");goToPageTop();var m={};m.user_id=GBL.MAIN_DATA.getViewer().getUserId();m.accept_user_id=l.getUserId();makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/accept_mob_request",function(n){GBL.MAIN_DATA.getCachedUsers(CachedUserList.MY_REQUESTS).invalidateCache();handleResult(n,k.m_resultDiv,function(){k.m_refreshCallback()})},m)});var h=makeElementClass("div",b,"requestRejectDiv");h.innerHTML="Reject";addEvent(h,"click",function(){k.m_resultDiv.showMessage(undefined,"Rejecting ... ");goToPageTop();var m={};m.user_id=GBL.MAIN_DATA.getViewer().getUserId();m.reject_user_id=l.getUserId();makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/reject_mob_request",function(n){GBL.MAIN_DATA.getCachedUsers(CachedUserList.MY_REQUESTS).invalidateCache();handleResult(n,k.m_resultDiv,function(){k.m_refreshCallback()})},m)});return j};function MobMembersDiv(a,b){this.m_parentDiv=a;this.m_titleFontSize=!!b?16:null;this.m_containerDiv=undefined;this.m_title=undefined;this.m_resultDiv=undefined;this.m_refreshDiv=undefined;this.m_titleString=undefined;this.m_textColor="#88BBEE";this.m_userTable=undefined;this.initialize();this.createDiv()}MobMembersDiv.prototype.initialize=function(){this.m_titleString="Your Mob Members:"};MobMembersDiv.prototype.createDiv=function(){this.m_containerDiv=document.createElement("div");this.m_parentDiv.appendChild(this.m_containerDiv);this.m_containerDiv.style.padding="15px";this.m_containerDiv.style.textAlign="center";try{new TopMobDiv(this.m_containerDiv,false);var a=document.createElement("div");a.style.height=20;this.m_containerDiv.appendChild(a);GBL.TOP_MOB.registerObserver(this)}catch(b){}this.m_title=document.createElement("div");this.m_containerDiv.appendChild(this.m_title);createTitleDiv(this.m_title,this.m_titleString,null,null,null,this.m_titleFontSize);this.m_resultDiv=new ResultDiv(this.m_containerDiv);this.m_refreshDiv=document.createElement("div");this.m_containerDiv.appendChild(this.m_refreshDiv);this.m_refreshDiv.style.textAlign="center";this.m_refreshDiv.style.color=GBL.STYLES.text["color"];this.refresh()};MobMembersDiv.prototype.refresh=function(){this.m_refreshDiv.innerHTML=getLoadingMessageHTML();var a=this;GBL.MAIN_DATA.getCachedUsers(CachedUserList.MY_MOB).getNumUsers(function(b){a.onGottenNumUsers(b)})};MobMembersDiv.prototype.onGottenNumUsers=function(d){this.m_refreshDiv.innerHTML="";var j=GBL.MAIN_DATA.getViewer().getMobSize();var c=j-1;var h=GBL.MAIN_DATA.getViewer().getTopMobsActive();if(!isValid(h)){h=0}var g=GBL.MAIN_DATA.getViewer().getNumHiredGuns();if(!isValid(g)){g=c-d}var f=c-g-h;if(d<=500){createTitleDiv(this.m_title,"Your "+c+" Mob Members: <span style='font-size:15px'> ("+g+" hired guns + "+h+" active top mob) </span>",null,null,null,this.m_titleFontSize)}else{createTitleDiv(this.m_title,"Your "+c+" Mob Members: <span style='font-size:15px'> ("+g+" hired guns + "+h+" active top mob) </span> <span class='myMobNumMembers''> (500 Active) </span>",null,null,null,this.m_titleFontSize)}var b=this;var a=undefined;if(this.m_userTable&&this.m_userTable.getCurrentPage()){a=this.m_userTable.getCurrentPage()}this.m_userTable=new UserTableParentDiv(this.m_refreshDiv,GBL.MAIN_DATA.getCachedUsers(CachedUserList.MY_MOB),5,40,function(k){return b.canRemoveTdCreater(k)},"Your mob is empty! The more friends in your mob the stronger you are, so you should <a href='#' class='standardLink' onclick='switchTabs(9);return false;'>invite some friends</a> to be part of your mob!",true,a)};MobMembersDiv.prototype.canRemoveTdCreater=function(d){var h=document.createElement("td");h.style.textAlign="center";h.style.width="120px";h.style.padding="5px";h.style.border="solid 1px #555555";if(isValid(GBL.TOP_MOB)){var g=document.createElement("div");g.style.color="#448844";g.style.fontSize="10px";g.style.fontWeight="bold";g.style.textAlign="center";g.style.padding="3px";g.style.cursor="pointer";g.style.marginTop=-4;if(GBL.TOP_MOB.isTopMob(d.getUserId())){g.innerHTML="Top Mob!"}else{g.innerHTML="[promote]"}h.appendChild(g);addEvent(g,"click",function(){GBL.TOP_MOB.add(d.getUserId())})}var b=document.createElement("div");h.appendChild(b);b.style.color=this.m_textColor;b.style.fontSize="12px";b.style.fontWeight="bold";b.style.textAlign="center";b.style.padding="3px";b.innerHTML=d.getMobName();b.style.cursor="pointer";addEvent(b,"click",function(){showUserStats(d.getUserId())});var a=new ImageDiv(h,d.getThumbnailUrl(),"60px","60px");a.getContainerDiv().style.cursor="pointer";a.getContainerDiv().style.marginLeft="auto";a.getContainerDiv().style.marginRight="auto";addEvent(a.getContainerDiv(),"click",function(){showUserStats(d.getUserId())});var f=document.createElement("div");h.appendChild(f);f.style.color=this.m_textColor;f.style.fontSize="11px";f.style.textAlign="center";f.innerHTML="[x]Remove";f.style.cursor="pointer";var c=this;addEvent(f,"click",function(){c.m_resultDiv.showMessage(undefined,"Removing ... ");goToPageTop();var j={};j.user_id=GBL.MAIN_DATA.getViewer().getUserId();j.remove_user_id=d.getUserId();makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/remove_mob_member",function(k){GBL.MAIN_DATA.getCachedUsers(CachedUserList.MY_MOB).invalidateCache();try{GBL.TOP_MOB.refresh()}catch(l){}handleResult(k,c.m_resultDiv,function(){c.refresh()})},j)});return h};function UserTableParentDiv(v,g,z,k,m,w,s,r){var c=v;var f=g;var h=z;var t=k;var b=m;var q=w;var y=undefined;var x=undefined;this.getCurrentPage=o;var n=undefined;var p=1;if(r){p=r}var j=s;if(c!=undefined){l(c)}function o(){return p}function l(A){outputDebug("createDiv");c=A;y=document.createElement("div");c.appendChild(y);y.style.padding="15px";y.style.textAlign="center";x=document.createElement("div");y.appendChild(x);x.style.textAlign="center";x.style.color=GBL.STYLES.text["color"];x.innerHTML="Loading number ...";f.getNumUsers(d)}function d(A){n=A;if(n==0){if(!isValid(q)){y.style.display="none"}else{x.innerHTML=q}return}outputDebug("UserTableParentDiv: onGottenNumUsers: "+A);a(p)}function a(A){outputDebug("UserTableParentDiv: jumpToPage "+A);p=A;x.innerHTML="";u(x);new UserListTableDiv(x,f,p,h,t,b,j);u(x)}function u(C,B){var A=Math.ceil(n/t);new PaginationDiv(C,a,A,p,30)}}function UserListTableDiv(s,m,g,j,q,r,d){var o=s;var f=m;var a=g;var h=j;var k=q;var c=r;var l=(g-1)*q;var b=null;this.createDiv=n;this.onGetUsers=p;if(o!=undefined&&o!=null){n(o)}function n(t){o=t;outputDebug("UserListTableDiv: createDiv ");b=document.createElement("div");o.appendChild(b);b.style.textAlign="center";b.innerHTML="<br><font color='red'><b>[Loading Users... Please wait.]</b></font>";f.getUsers(l,k,p)}function p(y){outputDebug("UserListTableDiv: onGetUsers");b.innerHTML="";var x=document.createElement("table");b.appendChild(x);x.style.marginLeft="auto";x.style.marginRight="auto";var u=document.createElement("tbody");x.appendChild(u);var t=Math.min(y.length,l+k);var w=undefined;for(var v=l;v<t;v++){if((v-l)%h==0){w=document.createElement("tr");u.appendChild(w)}if(isValid(y[v])){w.appendChild(c(y[v]))}}}}function SearchableViewerMobDiv(b,a){SearchableViewerMobDiv.baseConstructor.call(this,b,a)}extendClass(SearchableViewerMobDiv,ViewerMobDiv);SearchableViewerMobDiv.prototype.initialize=function(){this.m_titleString="Your Mob:";this.m_maxExplanation="Note: Your current max mob family size limit is: <b>500</b>";this.m_mobMembersDiv=SearchableMobMembersDiv;this.m_mobRequestsDiv=SearchableMobRequestsDiv;this.m_mobInviteDiv=InviteDiv};function SearchableMobRequestsDiv(b,c,a){SearchableMobRequestsDiv.baseConstructor.call(this,b,c,a)}extendClass(SearchableMobRequestsDiv,MobRequestsDiv);SearchableMobRequestsDiv.prototype.onGottenNumUsers=function(d){if(d>0){this.m_containerDiv.style.display="block";var f=createWhiteDiv(this.m_containerDiv);f.innerHTML=this.m_explanationMsg;var a=createWhiteDiv(this.m_containerDiv);a.style.width="100%";a.style.textAlign="center";a.style.paddingTop="15px";var c=this;var b=new DivButton(a,"Accept All!",function(){var g={};g.user_id=GBL.MAIN_DATA.getViewer().getUserId();c.m_resultDiv.showMessage(undefined,"Accepting all requests, please wait a moment...");makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/accept_all_mob_requests",function(h){GBL.MAIN_DATA.getCachedUsers(CachedUserList.MY_REQUESTS).invalidateCache();handleResult(h,c.m_resultDiv,function(){c.m_refreshCallback()})},g,0)},null,true);new SearchableUserTableParentDiv(this.m_containerDiv,GBL.MAIN_DATA.getCachedUsers(CachedUserList.MY_REQUESTS),4,12,function(g){return c.canAcceptRejectTdCreater(g)},null,false)}};function SearchableMobMembersDiv(a,b){SearchableMobMembersDiv.baseConstructor.call(this,a,b)}extendClass(SearchableMobMembersDiv,MobMembersDiv);SearchableMobMembersDiv.prototype.onGottenNumUsers=function(d){this.m_refreshDiv.innerHTML="";var j=GBL.MAIN_DATA.getViewer().getMobSize();var c=j-1;var h=GBL.MAIN_DATA.getViewer().getTopMobsActive();if(!isValid(h)){h=0}var g=GBL.MAIN_DATA.getViewer().getNumHiredGuns();if(!isValid(g)){g=c-d}var f=c-g-h;if(d<=500){createTitleDiv(this.m_title,"Your "+c+" Mob Members: <span style='font-size:15px'> ("+g+" hired guns + "+h+" active top mob) </span>",null,null,null,this.m_titleFontSize)}else{createTitleDiv(this.m_title,"Your "+c+" Mob Members: <span style='font-size:15px'> ("+g+" hired guns + "+h+" active top mob) </span> <span class='myMobNumMembers''> (500 Active) </span>",null,null,null,this.m_titleFontSize)}var b=this;var a=undefined;if(this.m_userTable&&this.m_userTable.getCurrentPage()){a=this.m_userTable.getCurrentPage()}this.m_userTable=new SearchableUserTableParentDiv(this.m_refreshDiv,GBL.MAIN_DATA.getCachedUsers(CachedUserList.MY_MOB),5,40,function(k){return b.canRemoveTdCreater(k)},"Your mob is empty! The more friends in your mob the stronger you are, so you should <a href='#' class='standardLink' onclick='switchTabs(9);return false;'>invite some friends</a> to be part of your mob!",true,a)};function SearchableUserTableParentDiv(u,f,d,p,o,l,h,t){var k=this;this.m_filterDiv=null;this.m_startIndex=null;this.m_userTableDiv=null;this.m_userArray=null;this.m_searchInput=null;this.m_currentLoadedNumUsers=0;this.m_incrementAmount=200;this.m_incrementWait=250;this.m_helpMessage="Search by character name...";this.m_parentDiv=u;this.m_userList=f;this.m_numPerRow=d;this.m_numUsersPerPage=p;this.m_userTdCreater=o;this.m_emptyMessage=l;this.m_containerDiv=undefined;this.m_outerTableDiv=undefined;this.m_innerTableDiv=undefined;this.m_loadingTableDiv=undefined;this.m_totalNumUsers=undefined;this.m_currentNumUsers=undefined;this.m_startPage=1;this.getCurrentPage=j;if(t){k.m_startPage=t}if(k.m_parentDiv!=undefined){s(k.m_parentDiv)}function s(w){k.m_parentDiv=w;k.m_containerDiv=document.createElement("div");k.m_parentDiv.appendChild(k.m_containerDiv);k.m_containerDiv.style.padding="15px";k.m_containerDiv.style.textAlign="center";k.m_outerTableDiv=document.createElement("div");k.m_containerDiv.appendChild(k.m_outerTableDiv);k.m_outerTableDiv.style.textAlign="center";k.m_outerTableDiv.style.color=GBL.STYLES.text["color"];k.m_outerTableDiv.innerHTML="";k.m_filterDiv=makeElementClass("div",k.m_outerTableDiv,"friend_filter");makeElement("div",k.m_filterDiv).innerHTML="<font color='green'>Mob Member Search (BETA)</font><br>&nbsp;";k.m_searchInput=new HelpfulInput(k.m_filterDiv,k.m_helpMessage);$(k.m_searchInput.getInput()).keyup(n.bind(k));k.m_innerTableDiv=document.createElement("div");k.m_outerTableDiv.appendChild(k.m_innerTableDiv);k.m_innerTableDiv.style.textAlign="center";k.m_innerTableDiv.style.color=GBL.STYLES.text["color"];k.m_innerTableDiv.innerHTML="Loading number ...";k.m_userList.getNumUsers(b)}function b(w){k.m_totalNumUsers=w;k.m_currentNumUsers=w;if(k.m_totalNumUsers==0){if(!isValid(k.m_emptyMessage)){k.m_containerDiv.style.display="none"}else{k.m_outerTableDiv.innerHTML=k.m_emptyMessage}return}a(k.m_startPage,0,1)}function a(x,w,y){k.m_startPage=x;k.m_innerTableDiv.innerHTML="";if(isValid(k.m_userArray)){q(y)}if(k.m_currentLoadedNumUsers<k.m_totalNumUsers){v()}if(w==0){c(1);r(k.m_innerTableDiv);k.m_startIndex=(k.m_startPage-1)*k.m_numUsersPerPage;k.m_userTableDiv=null;k.m_userArray=null;k.innerCreateDiv=m;k.onGetUsers=g;if(k.m_innerTableDiv!=undefined&&k.m_innerTableDiv!=null){m(k.m_innerTableDiv)}r(k.m_innerTableDiv)}else{r(k.m_innerTableDiv);k.m_startIndex=(k.m_startPage-1)*k.m_numUsersPerPage;k.m_userTableDiv=document.createElement("div");k.m_innerTableDiv.appendChild(k.m_userTableDiv);k.m_userTableDiv.style.textAlign="center";k.m_userTableDiv.innerHTML="<br><font color='red'><b>[Loading Users... Please wait.]</b></font>";n(1,y);r(k.m_innerTableDiv)}}function m(w){k.m_innerTableDiv=w;k.m_userTableDiv=document.createElement("div");k.m_innerTableDiv.appendChild(k.m_userTableDiv);k.m_userTableDiv.style.textAlign="center";k.m_userTableDiv.innerHTML="<br><font color='red'><b>[Loading Users... Please wait.]</b></font>"}function r(x){var w=Math.ceil(Math.min(k.m_currentNumUsers,k.m_currentLoadedNumUsers)/k.m_numUsersPerPage);new PaginationDiv(x,a,w,k.m_startPage,30)}function v(){if(k.m_currentLoadedNumUsers!=0){k.m_loadingTableDiv=document.createElement("div");k.m_innerTableDiv.appendChild(k.m_loadingTableDiv);k.m_loadingTableDiv.style.textAlign="center";k.m_loadingTableDiv.innerHTML="<br><font color='red'><b>[Currently loaded "+k.m_currentLoadedNumUsers+"/"+k.m_totalNumUsers+" users.]</b></font>"}}function j(){return k.m_startPage}function g(w){k.m_userArray=w.slice();if(k.m_currentLoadedNumUsers<k.m_totalNumUsers){setTimeout(c,k.m_incrementWait)}else{a(j(),1,1)}}function c(w){k.m_userList.getUsers(k.m_currentLoadedNumUsers,k.m_incrementAmount,g);k.m_currentLoadedNumUsers=Math.min(k.m_currentLoadedNumUsers+k.m_incrementAmount,k.m_totalNumUsers);if(w!=1){a(j(),1,1)}}function n(y,C){var D=q(C);k.m_userTableDiv.innerHTML="";var B=document.createElement("table");k.m_userTableDiv.appendChild(B);B.style.marginLeft="auto";B.style.marginRight="auto";var x=document.createElement("tbody");B.appendChild(x);var w=Math.min(D.length,k.m_startIndex+k.m_numUsersPerPage);var A=undefined;for(var z=k.m_startIndex;z<w;z++){if((z-k.m_startIndex)%k.m_numPerRow==0){A=document.createElement("tr");x.appendChild(A)}if(isValid(D[z])){A.appendChild(k.m_userTdCreater(D[z]))}}if(isValid(y)){if(y!=1){a(k.m_startPage,1,C)}}}function q(y){if(isValid(k.m_userArray)){var z=k.m_userArray.slice();var x=k.m_searchInput.getValue().trim().toLowerCase();if(isValid(x)){if(x!=k.m_helpMessage&&x!=""){for(var w=(z.length-1);w>=0;w--){if(isValid(z[w])&&isValid(z[w].getMobName())){if((z[w].getMobName().toLowerCase()).indexOf(x)==-1){z.splice(w,1)}}}}}if(k.m_currentNumUsers!=(z.length-1)){if(isValid(y)){if(y!=1){k.m_startPage=1}}else{k.m_startPage=1}k.m_currentNumUsers=z.length-1}if(k.m_currentNumUsers==0){z=k.m_userArray.slice();k.m_currentNumUsers=z.length-1}return z}else{return new Array(0)}}}function CommentEntry(a){this.m_xmlNode=a;this.m_id=undefined;this.m_fromUser=undefined;this.m_timeAgo=undefined;this.m_message=undefined;this.fillFromXML()}CommentEntry.prototype.fillFromXML=function(){if(!isValid(this.m_xmlNode)){return}this.m_fromUser=new User(undefined);this.m_fromUser.createXMLUser(getXMLFirstNode(this.m_xmlNode,"from_user"));try{this.m_id=getXMLNodeValue(this.m_xmlNode,"id")}catch(a){}try{this.m_timeAgo=getXMLEncodedStringNodeValue(this.m_xmlNode,"time_ago")}catch(a){}try{this.m_message=getXMLEncodedStringNodeValue(this.m_xmlNode,"message")}catch(a){}};CommentEntry.prototype.getFromUser=function(){return this.m_fromUser};CommentEntry.prototype.getId=function(){return this.m_id};CommentEntry.prototype.getTimeAgo=function(){return this.m_timeAgo};CommentEntry.prototype.getMessage=function(){if(document.all){return this.m_message.unescapeHtml()}else{return this.m_message}};function CommentDiv(a,b){this.m_parentDiv=a;this.m_targetUserId=b;this.m_containerDiv=undefined;this.m_resultDiv=undefined;this.m_tableDiv=undefined;this.m_explanationDiv=undefined;this.createDiv()}CommentDiv.prototype.createDiv=function(){this.m_containerDiv=document.createElement("div");this.m_parentDiv.appendChild(this.m_containerDiv);this.m_containerDiv.style.margin="5px";this.m_containerDiv.style.padding="5px";this.m_containerDiv.style.border="solid 1px #AAAAAA";var a=document.createElement("div");this.m_containerDiv.appendChild(a);a.innerHTML="<span class='commentsSectionTitle'> Comments: </span>";this.m_explanationDiv=createWhiteDiv(this.m_containerDiv);this.m_explanationDiv.style.paddingLeft="15px";this.createCommentInputDiv();this.m_tableDiv=document.createElement("div");this.m_containerDiv.appendChild(this.m_tableDiv);this.m_tableDiv.style.marginTop="15px";this.refresh()};CommentDiv.prototype.createCommentInputDiv=function(){var c=document.createElement("div");this.m_containerDiv.appendChild(c);c.style.marginTop="10px";this.m_resultDiv=new ResultDiv(c);var d=new TextBoxDiv(c);d.getTextArea().style.width="320px";var a=this;var b=new DivButton(c,"Add Comment",function(){if(d.getText().length<=0){a.m_resultDiv.showMessage(undefined,"Please type a message.");return}if(d.getText().length>300){a.m_resultDiv.showMessage(undefined,"Sorry, the maximum length limit is 300 characters.");return}a.m_resultDiv.showMessage(undefined,"Sending...");var f={};f.user_id=GBL.MAIN_DATA.getViewer().getUserId();f.target_id=a.m_targetUserId;f.message=customEncoding(d.getText());if(isValid(GBL.MAIN_DATA.getViewer().getThumbnailUrl())){f.thumbnail_url=GBL.MAIN_DATA.getViewer().getThumbnailUrl()}makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/save_comment",function(g){handleResult(g,a.m_resultDiv,function(){a.refresh()})},f,1)});b.getButtonDiv().style.marginTop="5px";b.getButtonDiv().style.marginLeft="10px";b.getButtonDiv().style.width="150px";b.getButtonDiv().style.fontSize="11px"};CommentDiv.prototype.refresh=function(){this.m_tableDiv.innerHTML=getLoadingMessageHTML();var b={};b.user_id=GBL.MAIN_DATA.getViewer().getUserId();b.target_id=this.m_targetUserId;var a=this;makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/get_comments",function(c){a.onGetComments(c)},b)};CommentDiv.prototype.onGetComments=function(g){this.m_tableDiv.innerHTML="";var f=getGadgetResponseData(g);if(isValid(f)){var b=getXMLNodeValue(f,"hide_comments_div");if(isValid(b)&&b){this.m_containerDiv.style.display="none"}}try{var d=getXMLNodeValue(f,"comment_cost");if(isValid(d)){if(parseInt(d)>0){this.m_explanationDiv.innerHTML="Each comment costs $"+d}}else{this.m_explanationDiv.innerHTML=""}}catch(j){this.m_explanationDiv.innerHTML=""}var a=new Array();if(isValid(f)){try{var c=f.getElementsByTagName("entry");for(var h=0;h<c.length;h++){a.push(new CommentEntry(c[h]))}}catch(j){outputAlert(j)}}if(a.length<=0){return}this.m_tableDiv.innerHTML="";this.m_tableDiv.style.height="500px";this.m_tableDiv.style.overflow="auto";for(h=0;h<a.length;h++){this.m_tableDiv.appendChild(this.createEntryDiv(a[h]))}};CommentDiv.prototype.createEntryDiv=function(d){var k=document.createElement("div");k.style.margin="5px";var l=new SideBySideCells(k);var a=l.getLeftCell();a.style.verticalAlign="top";a.style.width="53px";new ImageDiv(a,d.getFromUser().getThumbnailUrl(),"50px","60px");var m=l.getRightCell();m.style.verticalAlign="top";m.style.paddingLeft="5px";m.style.width="230px";var f=document.createElement("div");m.appendChild(f);f.style.borderTop="1px solid #888888";var b=new SideBySideCells(f);b.getTable().style.borderCollapse="collapse";var c=b.getLeftCell();c.style.width="210px";$(c).css({textAlign:"left"});c.innerHTML="<span class='commentsCommentAuthor'> "+d.getFromUser().getMobName()+"</span><span class='commentsCommentTimeAgo'>"+d.getTimeAgo()+"</span>";if(this.m_targetUserId==GBL.MAIN_DATA.getViewer().getUserId()){var j=b.getRightCell();j.innerHTML="<span class='commentsCommentDelete'>X</span>";j.style.cursor="pointer";var g=this;addEvent(j,"click",function(){var n={};n.user_id=GBL.MAIN_DATA.getViewer().getUserId();n.delete_entry_id=d.getId();makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/delete_comment_entry",function(){g.refresh()},n)})}if(this.m_targetUserId==GBL.MAIN_DATA.getViewer().getUserId()&&d.getFromUser().getUserId()!=GBL.MAIN_DATA.getViewer().getUserId()){m.appendChild(this.createBlockDiv(d.getFromUser()))}var h=createWhiteDiv(m);h.style.width="230px";h.style.overflow="hidden";h.style.fontSize="11px";h.style.fontFamily="lucida grande,tahoma,verdana,arial,sans-serif";h.innerHTML=d.getMessage();a.style.cursor="pointer";addEvent(a,"click",function(){showUserStats(d.getFromUser().getUserId())});f.style.cursor="pointer";addEvent(c,"click",function(){showUserStats(d.getFromUser().getUserId())});return k};CommentDiv.prototype.createBlockDiv=function(j){var b=document.createElement("div");var k=document.createElement("div");b.appendChild(k);k.style.textAlign="right";var f=makeElementClass("span",k,"commentsCommentBlock");f.innerHTML="block";var c=makeElementClass("div",b,"commentsConfirmBlock");c.innerHTML="Are you sure you want to block "+j.getShortMobName()+" permanently from now on?";var h=new SideBySideCells(c,true);var g=h.getLeftCell();var l=new DivButton(g,"Yes",function(){c.innerHTML="Blocking "+j.getShortMobName()+"...";var m={};m.user_id=GBL.MAIN_DATA.getViewer().getUserId();m.target_id=j.getUserId();makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/block_user",function(){c.innerHTML=j.getShortMobName()+" has been blocked from now on."},m)});l.getButtonDiv().style.fontSize="11px";var a=h.getRightCell();var d=new DivButton(a,"Cancel",function(){c.style.display="none"});d.getButtonDiv().style.fontSize="11px";d.getButtonDiv().style.backgroundColor="#777777";addEvent(f,"click",function(){c.style.display="block"});return b};function CommentInputDiv(a,c,b){this.m_parentDiv=a;this.m_targetUserId=c;this.m_dismissFunc=b;this.m_resultDiv=undefined;this.m_tableDiv=undefined;this.m_explanationDiv=undefined;this.createDiv()}CommentInputDiv.prototype.createDiv=function(){var c=document.createElement("div");this.m_parentDiv.appendChild(c);c.style.marginTop="10px";this.m_resultDiv=new ResultDiv(c);var d=new TextBoxDiv(c);d.getTextArea().style.width="320px";var a=this;var b=new DivButton(c,"Add Comment",function(){if(d.getText().length<=0){a.m_resultDiv.showMessage(undefined,"Please type a message.");return}if(d.getText().length>300){a.m_resultDiv.showMessage(undefined,"Sorry, the maximum length limit is 300 characters.");return}a.m_resultDiv.showMessage(undefined,"Sending...");var f={};f.user_id=GBL.MAIN_DATA.getViewer().getUserId();f.target_id=a.m_targetUserId;f.message=customEncoding(d.getText());if(isValid(GBL.MAIN_DATA.getViewer().getThumbnailUrl())){f.thumbnail_url=GBL.MAIN_DATA.getViewer().getThumbnailUrl()}makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/save_comment",function(g){a.m_dismissFunc()},f,1)});b.getButtonDiv().style.marginTop="5px";b.getButtonDiv().style.marginLeft="10px";b.getButtonDiv().style.width="150px";b.getButtonDiv().style.fontSize="11px"};function BossDiv(a){this.m_parentDiv=a;this.m_containerDiv=undefined;this.m_resultDiv=undefined;this.m_refreshDiv=undefined;this.m_titleString=undefined;this.m_attributeArray=undefined;this.m_attributeValueCallbackArray=undefined;this.m_attributeKeyArray=undefined;this.m_attributeDescriptionArray=undefined;this.m_characterChooserDiv=undefined;this.initialize();this.createDiv()}BossDiv.prototype.initialize=function(){this.m_titleString="Your Mobster";this.m_attributeArray=new Array();this.m_attributeValueCallbackArray=new Array();this.m_attributeKeyArray=new Array();this.m_attributeDescriptionArray=new Array();this.m_attributeKeyArray.push("attack_strength");this.m_attributeArray.push("Attack Strength");this.m_attributeValueCallbackArray.push(function(){return GBL.MAIN_DATA.getViewer().getAttackStrength()});this.m_attributeDescriptionArray.push("Higher attack strength makes you more successful when attacking other mobsters.");this.m_attributeKeyArray.push("defense_strength");this.m_attributeArray.push("Defense Power");this.m_attributeValueCallbackArray.push(function(){return GBL.MAIN_DATA.getViewer().getDefenseStrength()});this.m_attributeDescriptionArray.push("Higher defense power makes you less vulnerable to the attacks of other mobsters.");this.m_attributeKeyArray.push("max_energy");this.m_attributeArray.push("Max Energy");this.m_attributeValueCallbackArray.push(function(){return GBL.MAIN_DATA.getViewer().getMaxEnergy()});this.m_attributeDescriptionArray.push("Higher maximum energy lets you complete more missions more quickly.");this.m_attributeKeyArray.push("max_health");this.m_attributeArray.push("Max Health");this.m_attributeValueCallbackArray.push(function(){return GBL.MAIN_DATA.getViewer().getMaxHealth()});this.m_attributeDescriptionArray.push("Higher maximum health lets you stay in fights longer, whether you are attacking or are being attacked. <span class='myCharacterAttributeDescriptionNote'>[It takes <b>1</b> skill point to boost your max health by <b>10</b>.]</span>");this.m_attributeKeyArray.push("max_stamina");this.m_attributeArray.push("Max Stamina");this.m_attributeValueCallbackArray.push(function(){return GBL.MAIN_DATA.getViewer().getMaxStamina()});this.m_attributeDescriptionArray.push("Higher maximum stamina lets you attack more mobsters more quickly - on the hit list and taking revenge on rivals. <span class='myCharacterAttributeDescriptionNote'>[It takes <b>2</b> skill points to boost your max stamina by <b>1</b>.]</span>");this.m_characterChooserDiv=CharacterChooserDiv};BossDiv.prototype.createDiv=function(){this.m_containerDiv=makeElementClass("div",this.m_parentDiv,"myCharacterData");this.m_containerDiv.style.padding="15px";this.m_containerDiv.style.textAlign="center";var b=new Array();b.push("Stats");var c=new Array();c.push(function(){showUserStats(GBL.MAIN_DATA.getViewer().getUserId())});var a=document.createElement("div");this.m_containerDiv.appendChild(a);createTitleDiv(a,this.m_titleString,b,c,true);this.m_resultDiv=new ResultDiv(this.m_containerDiv);this.m_refreshDiv=document.createElement("div");this.m_containerDiv.appendChild(this.m_refreshDiv);this.m_refreshDiv.style.textAlign="center";if(isValid(this.m_characterChooserDiv)){new this.m_characterChooserDiv(this.m_containerDiv)}this.refresh()};BossDiv.prototype.showSkillPointsToNextLevel=function(){var a=makeElementClass("div",this.m_refreshDiv,"myCharacterSkillPoints");if(GBL.MAIN_DATA.getViewer().getSkillPoints()>0){a.innerHTML="You have <b>"+GBL.MAIN_DATA.getViewer().getSkillPoints()+"</b> skill points to spend on the stats listed below."}else{if(GBL.MAIN_DATA.getViewer().getExpPointsToNextLevel()==1){a.innerHTML="You need <b>"+GBL.MAIN_DATA.getViewer().getExpPointsToNextLevel()+"</b> more experience point to gain another level."}else{a.innerHTML="You need <b>"+GBL.MAIN_DATA.getViewer().getExpPointsToNextLevel()+"</b> more experience points to gain another level."}}};BossDiv.prototype.refresh=function(){this.m_refreshDiv.innerHTML="";this.showSkillPointsToNextLevel();var d=makeElementClass("table",this.m_refreshDiv,"myCharacterAttributesTable");var a=document.createElement("tbody");d.appendChild(a);var b=document.createElement("tr");a.appendChild(b);var f=document.createElement("td");b.appendChild(f);addHeaderStyle(f);f.style.width="150px";f.innerHTML="Stat";f=document.createElement("td");b.appendChild(f);addHeaderStyle(f);f.style.width="80px";f.innerHTML="Score";f=document.createElement("td");b.appendChild(f);addHeaderStyle(f);f.style.width="150px";f.innerHTML="Action";f=document.createElement("td");b.appendChild(f);addHeaderStyle(f);f.style.width="400px";f.innerHTML="Explanation";for(var c=0;c<this.m_attributeArray.length;c++){a.appendChild(this.createInterfaceTr(this.m_attributeArray[c],this.m_attributeValueCallbackArray[c](),this.m_attributeKeyArray[c],this.m_attributeDescriptionArray[c]))}};BossDiv.prototype.createInterfaceTr=function(h,a,b,d){var f=document.createElement("tr");var g=makeElementClass("td",f,"myCharacterAttributeName");g.innerHTML=h;g=makeElementClass("td",f,"myCharacterAttributeScore");g.innerHTML=a;g=makeElement("td",f);var c=this;if(GBL.MAIN_DATA.getViewer().getSkillPoints()>0){new DivButton(g,"Increase",function(){gaTrackEvent("my_character","click","increase_attribute_"+h);c.m_resultDiv.showMessage(undefined,"Increasing ... ");var j={};j.user_id=GBL.MAIN_DATA.getViewer().getUserId();j.attribute=b;makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/increase_attribute",function(k){handleResult(k,c.m_resultDiv,function(){c.refresh()})},j,0)})}else{g.style.textAlign="center";g.innerHTML="<span class='myCharacterInsufficientSkillPoints'> Insufficient skill points </span>"}g=makeElementClass("td",f,"myCharacterAttributeDescription");g.innerHTML=d;return f};function SavedGame(a){this.m_xmlNode=a;this.m_id=undefined;this.m_mobName=undefined;this.m_class=undefined;this.m_level=undefined;this.fillFromXML()}SavedGame.prototype.fillFromXML=function(){if(!isValid(this.m_xmlNode)){return}try{this.m_id=getXMLNodeValue(this.m_xmlNode,"save_id")}catch(a){}try{this.m_mobName=getXMLEncodedStringNodeValue(this.m_xmlNode,"mob_name")}catch(a){}try{this.m_class=getXMLEncodedStringNodeValue(this.m_xmlNode,"class")}catch(a){}try{this.m_level=parseInt(getXMLNodeValue(this.m_xmlNode,"level"))}catch(a){}};SavedGame.prototype.getHTML=function(){return"<span class='savedGameMobName'>"+this.m_mobName+"</span> <span class='savedGameMobLevel'> Level "+this.m_level+" "+this.m_class+"</span> "};SavedGame.prototype.getId=function(){return this.m_id};SavedGame.prototype.getMobName=function(){return this.m_mobName};SavedGame.prototype.getClass=function(){return this.m_class};SavedGame.prototype.getLevel=function(){return this.m_level};function CharacterChooserDiv(a){this.m_parentDiv=a;this.m_containerDiv=undefined;this.m_resultDiv=undefined;this.m_refreshDiv=undefined;this.m_savedGames=undefined;this.m_titleText="Switch Mobsters/Start New Mobster (beta)";this.m_explanationText="I've been getting a lot of requests from you guys to change your name and/or restart with a new character. Here's the answer to those requests! You can now create up to 3 Mobsters under the same account for free. Each of these Mobsters will share: favor points, mob members, and achievements. Inactive (saved) characters do not regenerate or make money, but also cannot be attacked. You can switch characters once every 60 minutes. Let me know if you have any questions/concerns regarding this feature. Thanks!";this.m_loadConfirmationText="Are you sure you want to load this game? Your current game will be saved, but your current mobster will not regenerate or make money while it is inactive.";this.m_newGameConfirmationText="Are you sure you want to start a new game? Your current game will be saved, but your current mobster will not regenerate or make money while it is inactive.";this.initialize();this.createDiv()}CharacterChooserDiv.prototype.initialize=function(){};CharacterChooserDiv.prototype.createDiv=function(){this.m_containerDiv=makeElementClass("div",this.m_parentDiv,"myCharacterChooserDiv");var a=document.createElement("div");this.m_containerDiv.appendChild(a);createTitleDiv(this.m_containerDiv,this.m_titleText);var b=createWhiteDiv(this.m_containerDiv);b.style.padding="8px";b.innerHTML=this.m_explanationText;this.m_resultDiv=new ResultDiv(this.m_containerDiv);this.m_refreshDiv=document.createElement("div");this.m_containerDiv.appendChild(this.m_refreshDiv);this.m_refreshDiv.style.textAlign="center";this.refresh()};CharacterChooserDiv.prototype.refresh=function(){this.m_refreshDiv.innerHTML="";var a=document.createElement("div");this.m_refreshDiv.appendChild(a);addHeaderStyleWithInnerDiv(a,"Saved Games","800px");var d=document.createElement("div");this.m_refreshDiv.appendChild(d);var f=document.createElement("div");this.m_containerDiv.appendChild(f);f.style.padding="10px";f.innerHTML=getLoadingMessageHTML();var c={};c.user_id=GBL.MAIN_DATA.getViewer().getUserId();var b=this;makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/get_save_game_list",function(g){f.style.display="none";b.onGetSavedGames(g,d)},c)};CharacterChooserDiv.prototype.onGetSavedGames=function(c,f){this.m_savedGames=new Array();var b=getGadgetResponseData(c);if(isValid(b)){try{var a=b.getElementsByTagName("savegame");for(var d=0;d<a.length;d++){this.m_savedGames.push(new SavedGame(a[d]))}}catch(g){outputAlert("onGetSavedGames "+g)}}for(d=0;d<this.m_savedGames.length;d++){f.appendChild(this.createSavedGameDiv(this.m_savedGames[d]))}f.appendChild(this.createNewGameDiv())};CharacterChooserDiv.prototype.createSavedGameDiv=function(g){var h=document.createElement("div");var c=new SideBySideCells(h);var f=this;var d=this.createConfirmationDiv(this.m_loadConfirmationText,"Do it!",function(){gaTrackEvent("my_character","click","load_game");f.m_resultDiv.showMessage(undefined,"Checking...");var j={};j.user_id=GBL.MAIN_DATA.getViewer().getUserId();j.save_id=g.getId();makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/load_game",function(k){f.handleGameResponse(k)},j,1)});h.appendChild(d);d.style.display="none";var b=c.getLeftCell();b.style.width="600px";b.style.padding="5px 0px 5px 20px";b.style.verticalAlign="top";b.innerHTML=g.getHTML();var a=c.getRightCell();a.style.width="200px";a.style.padding="5px 15px 5px 15px";new DivButton(a,"Load Game",function(){d.style.display="block"});return h};CharacterChooserDiv.prototype.createNewGameDiv=function(){var g=document.createElement("div");var c=new SideBySideCells(g);var f=this;var d=this.createConfirmationDiv(this.m_newGameConfirmationText,"Do It!",function(){f.m_resultDiv.showMessage(undefined,"Checking...");var h={};h.user_id=GBL.MAIN_DATA.getViewer().getUserId();makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/start_new_game",function(j){f.handleGameResponse(j)},h,1)});g.appendChild(d);d.style.display="none";var b=c.getLeftCell();b.style.width="600px";b.style.padding="5px 0px 5px 20px";b.style.verticalAlign="top";b.innerHTML="<span class='saveGameStartNewGame'> Start new game...</span>";var a=c.getRightCell();a.style.width="200px";a.style.padding="5px 15px 5px 15px";new DivButton(a,"Start New Game",function(){gaTrackEvent("my_character","click","start_new_game");d.style.display="block"});return g};CharacterChooserDiv.prototype.createConfirmationDiv=function(b,g,f){var h=document.createElement("div");h.style.margin="10px";h.style.border="1px solid #888888";h.style.padding="5px 5px 5px 20px";var c=new SideBySideCells(h);var d=c.getLeftCell();d.className="myCharacterLoadGameMessage";d.innerHTML=b;var a=c.getRightCell();a.style.width="150px";new DivButton(a,g,f);return h};CharacterChooserDiv.prototype.handleGameResponse=function(c){var a=undefined;try{a=getGadgetResponseData(c)}catch(b){a=undefined}if(!isValid(a)){this.m_resultDiv.showMessage(undefined,"Sorry, there was an unexpected error. Please refresh and try again.");return}var d=getBooleanValue(getXMLNodeValue(a,"success"));if(!d){handleResult(c,this.m_resultDiv,function(){this.refresh()});return}startGame()};function Achievement(a){this.m_xmlNode=a;this.m_id=undefined;this.m_imageURL=undefined;this.m_cur_text=undefined;this.fillFromXML()}Achievement.prototype.fillFromXML=function(){if(!isValid(this.m_xmlNode)){return}try{this.m_id=getXMLNodeValue(this.m_xmlNode,"id")}catch(a){}try{this.m_imageURL=getXMLEncodedStringNodeValue(this.m_xmlNode,"image_url")}catch(a){}try{this.m_cur_text=getXMLEncodedStringNodeValue(this.m_xmlNode,"cur_text")}catch(a){}try{this.m_next_text=getXMLEncodedStringNodeValue(this.m_xmlNode,"next_text")}catch(a){}};Achievement.prototype.getId=function(){return this.m_id};Achievement.prototype.getImageURL=function(){return this.m_imageURL};Achievement.prototype.getCurText=function(){return this.m_cur_text};Achievement.prototype.getNextText=function(){return this.m_next_text};function StatsData(a){this.m_statsData={};this.createStatsFromXML(a)}StatsData.prototype.createStatsFromXML=function(a){if(!isValid(a)){return}var m=getXMLFirstNode(a,"target");this.m_statsData.user=new User(undefined);this.m_statsData.user.createXMLUser(m);try{var f=getXMLFirstNode(a,"weapon_urls");if(isValid(f)){this.m_statsData.weaponURLsArray=new Array();var q=f.getElementsByTagName("image_url");for(var c=0;c<q.length;c++){this.m_statsData.weaponURLsArray.push(decodeEncodedStringValue(q[c].firstChild.nodeValue))}}}catch(h){outputDebug(h)}try{var r=getXMLFirstNode(a,"armor_urls");if(isValid(r)){this.m_statsData.armorURLsArray=new Array();var l=r.getElementsByTagName("image_url");for(c=0;c<l.length;c++){this.m_statsData.armorURLsArray.push(decodeEncodedStringValue(l[c].firstChild.nodeValue))}}}catch(h){outputDebug(h)}try{var d=getXMLFirstNode(a,"vehicle_urls");if(isValid(d)){this.m_statsData.vehicleURLsArray=new Array();var p=d.getElementsByTagName("image_url");for(c=0;c<p.length;c++){this.m_statsData.vehicleURLsArray.push(decodeEncodedStringValue(p[c].firstChild.nodeValue))}}}catch(h){}try{var n=getXMLFirstNode(a,"henchmen_urls");if(isValid(n)){this.m_statsData.henchmenURLsArray=new Array();var j=n.getElementsByTagName("image_url");for(c=0;c<j.length;c++){this.m_statsData.henchmenURLsArray.push(decodeEncodedStringValue(j[c].firstChild.nodeValue))}}}catch(h){}try{var g=getXMLFirstNode(a,"land_urls");if(isValid(g)){this.m_statsData.propertyURLsArray=new Array();var b=g.getElementsByTagName("image_url");for(c=0;c<b.length;c++){this.m_statsData.propertyURLsArray.push(decodeEncodedStringValue(b[c].firstChild.nodeValue))}}}catch(h){}try{var k=getXMLFirstNode(a,"achievements");if(isValid(k)){this.m_statsData.achievementsArray=new Array();var o=k.getElementsByTagName("achievement");for(c=0;c<o.length;c++){this.m_statsData.achievementsArray.push(new Achievement(o[c]))}}}catch(h){}try{this.m_statsData.partOfViewerMob=getXMLNodeValue(a,"part_of_viewer_mob")}catch(h){}try{this.m_statsData.jobsCompleted=getXMLNodeValue(a,"jobs_completed")}catch(h){}try{this.m_statsData.jailed=getXMLNodeValue(a,"jailed")}catch(h){}try{this.m_statsData.escaped=getXMLNodeValue(a,"escaped_count")}catch(h){}try{this.m_statsData.bountyKills=getXMLNodeValue(a,"bounty_kills")}catch(h){}try{this.m_statsData.fightsWon=getXMLNodeValue(a,"fights_won")}catch(h){}try{this.m_statsData.fightsLost=getXMLNodeValue(a,"fights_lost")}catch(h){}try{this.m_statsData.deathCount=getXMLNodeValue(a,"death_count")}catch(h){}try{this.m_statsData.killCount=getXMLNodeValue(a,"kill_count")}catch(h){}try{this.m_statsData.recentVoteCount=getXMLNodeValue(a,"num_recent_vote")}catch(h){}try{this.m_statsData.darkness=getXMLNodeValue(a,"darkness")}catch(h){}};StatsData.prototype.getData=function(){return this.m_statsData};function StatsDiv(a,b){this.m_parentDiv=a;this.m_containerDiv=undefined;this.m_userId=b;this.m_targetUser=undefined;this.m_titleDiv=undefined;this.m_resultDiv=undefined;this.m_refreshDiv=undefined;this.m_attackOptionText="Attack";this.m_punchActionText="Punch in Face";this.m_addHitListActionText="Add to Hit List";this.m_inMobLabel=undefined;this.m_notInMobLabel=undefined;this.m_weaponsTitle=undefined;this.m_armorsTitle=undefined;this.m_vehiclesTitle=undefined;this.m_henchmenTitle=undefined;this.m_propertiesTitle=undefined;this.m_jobsCompletedLabel=undefined;this.m_jailedLabel=undefined;this.m_escapedLabel=undefined;this.m_bountyKillsLabel=undefined;this.m_fightsWonLabel=undefined;this.m_fightsLostLabel=undefined;this.m_deathCountLabel=undefined;this.m_killCountLabel=undefined;this.m_punchActionPrefix="Punching";this.m_punchActionSuffix="in the face";this.m_achievementsConstructor=AchievementDiv;this.m_hitListDiv=undefined;this.initialize();this.createDiv()}StatsDiv.prototype.initialize=function(){this.m_inMobLabel="This person is in your mob.";this.m_notInMobLabel="This person is NOT in your mob.";this.m_weaponsTitle="Weapons";this.m_armorsTitle="Armor";this.m_vehiclesTitle="Vehicles";this.m_henchmenTitle="Henchmen";this.m_propertiesTitle="Properties";this.m_jobsCompletedLabel="Missions Completed";this.m_jailedLabel=undefined;this.m_escapedLabel=undefined;this.m_bountyKillsLabel="Bounties Collected";this.m_fightsWonLabel="Fights Won";this.m_fightsLostLabel="Fights Lost";this.m_deathCountLabel="Death";this.m_killCountLabel="Mobsters Whacked";this.m_hitListDiv=HitListBountyDiv};StatsDiv.prototype.createDiv=function(){this.m_containerDiv=document.createElement("div");this.m_parentDiv.appendChild(this.m_containerDiv);this.m_containerDiv.style.padding="15px";this.m_containerDiv.style.textAlign="center";this.m_titleDiv=document.createElement("div");this.m_containerDiv.appendChild(this.m_titleDiv);createTitleDiv(this.m_titleDiv,getLoadingMessageHTML());this.m_resultDiv=new ResultDiv(this.m_containerDiv);this.m_refreshDiv=document.createElement("div");this.m_containerDiv.appendChild(this.m_refreshDiv);this.refresh()};StatsDiv.prototype.createTitleReportDiv=function(p,l,o){this.m_titleDiv.innerHTML="";var k=makeElement("div",this.m_titleDiv,{borderBottom:"solid 1px #777777",textAlign:"left"});var n=makeElement("table",k);var m=makeElement("tbody",n);var d=makeElement("tr",m);var q=makeElementClass("td",d,"myStatsTitle");q.innerHTML=p;var b=makeElement("div",this.m_titleDiv,{textAlign:"left",borderBottom:"solid 1px #777777"});var j=makeElement("table",b);var f=makeElement("tbody",j);d=makeElement("tr",f);for(var c=0;c<l.length;c++){q=makeElementClass("td",d,"myStatsSubtitle");q.innerHTML=l[c];if(isValidFunction(o[c])){q.className="myStatsSubtitleLink";addEvent(q,"click",o[c])}if(c>0){q.style.borderLeft="solid 2px #FFFFFF"}}var a="500px";var g=makeElement("td",d,{width:a,textAlign:"right"});var h=makeElementClass("span",g,"myStatsReportInappropriateName");h.innerHTML="Report Inappropriate Name";var r=this;addEvent(h,"click",function(){var u={};u.user_id=GBL.MAIN_DATA.getViewer().getUserId();u.offensive_id=r.m_targetUser.getUserId();u.offensive_name=customEncoding(r.m_targetUser.getMobName());var s=document.createElement("div");var v=new SideBySideCells(s);$(v.getLeftCell()).text("You successfully reported this user.");$(v.getLeftCell()).addClass("myStatsReportInappropriateNameSuccess");var t=new DivButton(v.getRightCell(),"OK",function(){$(r.m_resultDiv.getContainerDiv()).hide()});makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/report_offensive_name",function(w){r.m_resultDiv.showMessage(undefined,"You successfully reported this user.");r.m_resultDiv.showCustomContent(undefined,s)},u);h.innerHTML="Reported";h.style.cursor="auto"})};StatsDiv.prototype.refresh=function(){var b={};b.user_id=GBL.MAIN_DATA.getViewer().getUserId();b.target_id=this.m_userId;var a=this;makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/get_stats",function(c){a.OnGetStats(c)},b)};StatsDiv.prototype.OnGetStats=function(f){var b=getGadgetResponseData(f);var j=new StatsData(b);this.m_refreshDiv.innerHTML="";var d=j.getData().user;this.m_targetUser=d;var g=new Array();var l=new Array();g.push(this.m_attackOptionText);var k=this;l.push(function(){k.m_resultDiv.showMessage(undefined,"Attacking "+d.getMobName()+" ...");goToPageTop();var m={};m.user_id=GBL.MAIN_DATA.getViewer().getUserId();m.target_id=d.getUserId();makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/attack",function(n){handleResult(n,k.m_resultDiv,function(){k.refresh()})},m,1)});g.push(this.m_punchActionText);l.push(function(){k.m_resultDiv.showMessage(undefined,k.m_punchActionPrefix+" "+d.getMobName()+" "+k.m_punchActionSuffix+"...");goToPageTop();var m={};m.user_id=GBL.MAIN_DATA.getViewer().getUserId();m.target_id=d.getUserId();m.punch_in_face=true;makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/attack",function(n){handleResult(n,k.m_resultDiv,function(){k.refresh()})},m,1)});if(isValid(this.m_addHitListActionText)){g.push(this.m_addHitListActionText);l.push(function(){GBL.MAIN_TABS.switchToDynamicTab(function(n,m,o){new k.m_hitListDiv(n,m,o)},d)})}this.createTitleReportDiv("&quot;"+d.getMobName()+"&quot;, Level "+d.getLevel()+" "+d.getMobClass()+"<span style='font-size:12px'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"+(j.getData().partOfViewerMob?this.m_inMobLabel:this.m_notInMobLabel)+"</span>",g,l);var h=new SideBySideCells(this.m_refreshDiv,true);var a=h.getLeftCell();var c=h.getRightCell();a.style.width="350px";a.style.verticalAlign="top";this.createStatsDiv(a,j.getData());new CommentDiv(a,this.m_userId);this.createRightColumn(c,d,j)};StatsDiv.prototype.createRightColumn=function(c,b,a){c.style.width="450px";c.style.verticalAlign="top";if(isValid(this.m_achievementsConstructor)){new this.m_achievementsConstructor(c,a.getData().achievementsArray)}this.createPictureList(c,this.m_weaponsTitle,a.getData().weaponURLsArray);this.createPictureList(c,this.m_armorsTitle,a.getData().armorURLsArray);this.createPictureList(c,this.m_vehiclesTitle,a.getData().vehicleURLsArray);this.createPictureList(c,this.m_henchmenTitle,a.getData().henchmenURLsArray);this.createPictureList(c,this.m_propertiesTitle,a.getData().propertyURLsArray)};StatsDiv.prototype.additionalCareerStats=function(a){};StatsDiv.prototype.createStatsDiv=function(l,j){var g=document.createElement("div");l.appendChild(g);createTitleDiv(g,"Stats");var d=new SideBySideCells(l,true);var f=d.getLeftCell();var c=d.getRightCell();var h=makeElementClass("table",f,"dataTable stats",{marginLeft:"auto",marginRight:"auto",borderSpacing:"6px"});var b=document.createElement("tbody");h.appendChild(b);var a=document.createElement("tr");b.appendChild(a);var k=document.createElement("td");a.appendChild(k);addHeaderStyle(k);k.style.width="180px";k.innerHTML="Career Stats";k=document.createElement("td");a.appendChild(k);addHeaderStyle(k);k.style.width="50px";k.innerHTML="Value";this.additionalCareerStats(b);b.appendChild(this.createStatTr(this.m_jobsCompletedLabel,j.jobsCompleted));if(isValid(this.m_jailedLabel)){b.appendChild(this.createStatTr(this.m_jailedLabel,j.jailed))}if(isValid(this.m_escapedLabel)){b.appendChild(this.createStatTr(this.m_escapedLabel,j.escaped))}b.appendChild(this.createStatTr(this.m_bountyKillsLabel,j.bountyKills));a=document.createElement("tr");b.appendChild(a);k=document.createElement("td");a.appendChild(k);addHeaderStyle(k);k.style.width="250px";k.innerHTML="Fight Stats";k=document.createElement("td");a.appendChild(k);addHeaderStyle(k);k.style.width="50px";k.innerHTML="Value";b.appendChild(this.createStatTr(this.m_fightsWonLabel,j.fightsWon));b.appendChild(this.createStatTr(this.m_fightsLostLabel,j.fightsLost));b.appendChild(this.createStatTr(this.m_deathCountLabel,j.deathCount));b.appendChild(this.createStatTr(this.m_killCountLabel,j.killCount))};StatsDiv.prototype.createStatTr=function(d,a){var b=document.createElement("tr");var c=makeElementClass("td",b,"myStatsStatTitle");c.innerHTML=d;c=makeElementClass("td",b,"myStatsStatValue");c.innerHTML=a;return b};StatsDiv.prototype.createPictureList=function(f,d,c){if(!isValid(c)||c.length<=0){return}var h=document.createElement("div");f.appendChild(h);createTitleDiv(h,d);var b=document.createElement("div");f.appendChild(b);b.style.textAlign="left";b.style.paddingLeft="30px";for(var g=0;g<c.length;g++){var a=document.createElement("img");b.appendChild(a);a.src=c[g];a.style.margin="8px"}};function AchievementDiv(a,b){this.m_parentDiv=a;this.m_containerDiv=undefined;this.m_achievements=b;this.m_achievementTDs=undefined;this.m_textDiv=undefined;this.m_leftTextDiv=undefined;this.m_rightTextDiv=undefined;this.m_curSelectedIndex=undefined;this.createDiv()}AchievementDiv.prototype.createDiv=function(){if(!isValid(this.m_achievements)||this.m_achievements.length==0){return}this.m_containerDiv=document.createElement("div");this.m_parentDiv.appendChild(this.m_containerDiv);this.m_containerDiv.style.padding="15px";this.m_containerDiv.style.textAlign="center";var a=document.createElement("div");this.m_containerDiv.appendChild(a);createTitleDiv(a,"Your Achievements:");var g=document.createElement("div");this.m_containerDiv.appendChild(g);g.style.paddingLeft="10px";var f=document.createElement("table");g.appendChild(f);var b=document.createElement("tbody");f.appendChild(b);this.m_textDiv=makeElementClass("div",this.m_containerDiv,"myStatsAchievementReason");this.m_textDiv.style.height="50px";this.m_leftTextDiv=document.createElement("div");this.m_textDiv.appendChild(this.m_leftTextDiv);this.m_leftTextDiv.style.cssFloat="left";this.m_leftTextDiv.style.styleFloat="left";this.m_leftTextDiv.style.width="175px";this.m_leftTextDiv.style.height="50px";this.m_leftTextDiv.style.padding="0px 5px";this.m_rightTextDiv=document.createElement("div");this.m_textDiv.appendChild(this.m_rightTextDiv);this.m_rightTextDiv.style.height="50px";this.m_achievementTDs=new Array();var d=undefined;for(var c=0;c<this.m_achievements.length;c++){if(c%7==0){d=document.createElement("tr");b.appendChild(d)}d.appendChild(this.createEntry(c))}this.selectEntry(0)};AchievementDiv.prototype.createEntry=function(b){var d=document.createElement("td");d.style.width="50px";d.style.border="1px solid #000000";var a=new ImageDiv(d,this.m_achievements[b].getImageURL(),"50px","50px",true);if(this.m_achievements[b].getCurText()==undefined){d.style.opacity=0.5;d.style.filter="alpha(opacity=50)"}var c=this;addEvent(d,"mouseover",function(){c.selectEntry(b)});this.m_achievementTDs.push(d);return d};AchievementDiv.prototype.selectEntry=function(a){if(isValid(this.m_curSelectedIndex)){if(this.m_curSelectedIndex==a){return}this.m_achievementTDs[this.m_curSelectedIndex].style.border="1px solid #000000"}this.m_curSelectedIndex=a;this.m_achievementTDs[this.m_curSelectedIndex].style.border="1px solid #FFA500";if(this.m_achievements[this.m_curSelectedIndex].getCurText()==undefined){this.m_leftTextDiv.innerHTML=this.m_achievements[this.m_curSelectedIndex].getNextText();this.m_rightTextDiv.innerHTML=""}else{if(this.m_achievements[this.m_curSelectedIndex].getNextText()==undefined){this.m_leftTextDiv.innerHTML=this.m_achievements[this.m_curSelectedIndex].getCurText();this.m_rightTextDiv.innerHTML=""}else{this.m_leftTextDiv.innerHTML=this.m_achievements[this.m_curSelectedIndex].getCurText();this.m_rightTextDiv.innerHTML=this.m_achievements[this.m_curSelectedIndex].getNextText()}}};var DefaultStatusMessageArray=["Feeling lucky, punk?","Bring it on!","Got my finger on the trigger...","Waiting for a challenge","What you got?","You got nothin'!","Better bring some friends","Bring the heat!","You think you can take me?!","Feelin' mean","Let's do this!","Wanna rumble?","Gettin' my fight on","You are weak!"];var DefaultWinMessageArray=["Hah!  Serves you right!","Get down, and stay down!","Sucker!","You got served!","Is that the best you can do?","Is that all you got?","You got nothin'!","I knew you couldn't do it"];var DefaultLoseMessageArray=["I'll have my revenge...","I'll get you back","Just you wait","You got lucky.","Lucky shot.","Next time I'll be ready","This ain't over...","Stay out of dark alleys...","Better watch your back"];function ReadOnlyUserStatusMessageDiv(a,b){this.m_parentDiv=a;this.m_userStatusMessage=b;this.m_statusMessageSpan=undefined;this.initialize();if(!isValid(this.m_userStatusMessage)){this.m_userStatusMessage=new UserStatusMessage()}this.createUI()}ReadOnlyUserStatusMessageDiv.prototype.initialize=function(){};ReadOnlyUserStatusMessageDiv.prototype.createUI=function(){this.m_statusMessageSpan=makeElement("span",this.m_parentDiv);$(this.m_statusMessageSpan).addClass("user_status_message_one_line");var a=makeElement("span",this.m_statusMessageSpan);$(a).addClass("message_span");if(isValid(this.m_userStatusMessage.getStatusMessage())){$(a).text(this.m_userStatusMessage.getStatusMessage())}};function UserStatusMessageDiv(a,b){this.m_parentDiv=a;this.m_userStatusMessage=b;this.m_titleDiv=undefined;this.m_containerDiv=undefined;this.m_statusMessageSpan=undefined;this.m_defaultStatusMessageArray=undefined;this.m_defaultWinMessageArray=undefined;this.m_defaultLoseMessageArray=undefined;this.m_currentStatusMessage=undefined;this.m_currentWinMessage=undefined;this.m_currentLoseMessage=undefined;this.initialize();if(!isValid(this.m_userStatusMessage)){this.m_userStatusMessage=new UserStatusMessage()}this.createUI()}UserStatusMessageDiv.prototype.initialize=function(){this.m_defaultStatusMessageArray=DefaultStatusMessageArray;this.m_defaultWinMessageArray=DefaultWinMessageArray;this.m_defaultLoseMessageArray=DefaultLoseMessageArray};UserStatusMessageDiv.prototype.createUI=function(){this.m_statusMessageSpan=makeElement("span",this.m_parentDiv);$(this.m_statusMessageSpan).addClass("user_status_message_one_line");var f=makeElement("table",this.m_statusMessageSpan,{display:"inline"});var c=makeElement("tbody",f);var d=makeElement("tr",c);var a=makeElement("td",d);$(a).addClass("message_span");if(isValid(this.m_userStatusMessage.getStatusMessage())){$(a).text(this.m_userStatusMessage.getStatusMessage())}var b=makeElement("td",d);$(b).addClass("change_status_button");if(this.m_userStatusMessage.isEmpty()){$(b).text("   set status")}else{$(b).text("   change status")}$(b).click(function(){this.showControl()}.bind(this))};UserStatusMessageDiv.prototype.showControl=function(){if(!isValid(this.m_userStatusMessage.getStatusMessage())){this.m_userStatusMessage.setStatusMessage(getRandomElement(this.m_defaultStatusMessageArray))}if(!isValid(this.m_userStatusMessage.getWinMessage())){this.m_userStatusMessage.setWinMessage(getRandomElement(this.m_defaultWinMessageArray))}if(!isValid(this.m_userStatusMessage.getLoseMessage())){this.m_userStatusMessage.setLoseMessage(getRandomElement(this.m_defaultLoseMessageArray))}this.m_titleDiv=document.createElement("div");this.m_containerDiv=document.createElement("div");$(this.m_containerDiv).addClass("user_status_message_control");var g=makeElement("div",this.m_containerDiv);$(g).css({fontSize:"20px",fontWeight:"bold",paddingTop:"10px"}).text("Status Messages");$(makeElement("hr",this.m_containerDiv)).css({margin:"2px"});$(makeElement("div",this.m_containerDiv)).css({textAlign:"center",margin:"auto"}).html("Write a message that players will see after fights! (50 character limit)<br/><b>Please be tasteful</b>");var h=makeElement("div",this.m_containerDiv);$(h).css({textAlign:"center",margin:"auto"});var f=makeElement("table",h);var d=makeElement("tbody",f);var j=makeElement("tr",d);var a=makeElement("td",j);$(a).text("Status Message:");a=makeElement("td",j);hugeQuote(a);this.m_currentStatusMessage=new HelpfulInput(a,this.m_userStatusMessage.getStatusMessage(),true);hugeQuote(a);j=makeElement("tr",d);a=makeElement("td",j);$(a).text("When you win a fight:");a=makeElement("td",j);hugeQuote(a);this.m_currentWinMessage=new HelpfulInput(a,this.m_userStatusMessage.getWinMessage(),true);hugeQuote(a);j=makeElement("tr",d);a=makeElement("td",j);$(a).text("When you lose a fight:");a=makeElement("td",j);hugeQuote(a);this.m_currentLoseMessage=new HelpfulInput(a,this.m_userStatusMessage.getLoseMessage(),true);hugeQuote(a);var c=new DivButton(this.m_containerDiv,"Save Messages",function(){this.saveMessages()}.bind(this),undefined,true);var b=new PDDialog(this.m_titleDiv,this.m_containerDiv,600,300,{backgroundColor:"black"},undefined);b.showDialog();b.setBorderColor("#222222")};UserStatusMessageDiv.prototype.saveMessages=function(){this.m_userStatusMessage.setStatusMessage(this.m_currentStatusMessage.getValueIncludeDefault().substr(0,GBL.STATUS_MESSAGE_LIMIT-1));this.m_userStatusMessage.setWinMessage(this.m_currentWinMessage.getValueIncludeDefault().substr(0,GBL.STATUS_MESSAGE_LIMIT-1));this.m_userStatusMessage.setLoseMessage(this.m_currentLoseMessage.getValueIncludeDefault().substr(0,GBL.STATUS_MESSAGE_LIMIT-1));if(this.m_userStatusMessage.getStatusMessage().trim()==""){this.m_userStatusMessage.setStatusMessage(getRandomElement(this.m_defaultStatusMessageArray))}if(this.m_userStatusMessage.getWinMessage().trim()==""){this.m_userStatusMessage.setWinMessage(getRandomElement(this.m_defaultWinMessageArray))}if(this.m_userStatusMessage.getLoseMessage().trim()==""){this.m_userStatusMessage.setLoseMessage(getRandomElement(this.m_defaultLoseMessageArray))}consoleLog("Saving status messages!");var a={};a.user_id=GBL.MAIN_DATA.getViewer().getUserId();a.status_message=customEncoding(this.m_userStatusMessage.getStatusMessage());a.win_message=customEncoding(this.m_userStatusMessage.getWinMessage());a.lose_message=customEncoding(this.m_userStatusMessage.getLoseMessage());makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/save_user_status_message",function(b){hideALLPDDialog();this.m_userStatusMessage.updateFromXML(getGadgetResponseData(b));$(this.m_statusMessageSpan).find(".message_span").text(this.m_userStatusMessage.getStatusMessage())}.bind(this),a)};function MadeMenDiv(a){this.m_parentDiv=a;this.m_containerDiv=undefined;this.m_mostDeadlyRankingDiv=undefined;this.m_topFightersRankingDiv=undefined;this.m_topBountyHuntersRankingDiv=undefined;this.m_topTycoonsRankingDiv=undefined;this.m_titleString=undefined;this.initialize();this.createDiv()}MadeMenDiv.prototype.initialize=function(){this.m_titleString="Made Men of MySpace"};MadeMenDiv.prototype.createRankingDivs=function(a){var b=document.createElement("tr");a.appendChild(b);var c=document.createElement("td");b.appendChild(c);c.style.width="390px";c.style.verticalAlign="top";this.m_topFightersRankingDiv=new MobRankingDiv(c,"Top Fighters","Wins");c=document.createElement("td");b.appendChild(c);c.style.width="390px";c.style.verticalAlign="top";this.m_topTycoonsRankingDiv=new MobRankingDiv(c,"Wealthiest","Bank Funds");b=document.createElement("tr");a.appendChild(b);c=document.createElement("td");b.appendChild(c);c.style.width="390px";c.style.verticalAlign="top";this.m_mostDeadlyRankingDiv=new MobRankingDiv(c,"Deadliest Foes","Whacks");c=document.createElement("td");b.appendChild(c);c.style.width="390px";c.style.verticalAlign="top";this.m_topBountyHuntersRankingDiv=new MobRankingDiv(c,"Top Bounty Hunters","Head Count")};MadeMenDiv.prototype.createDiv=function(){this.m_containerDiv=makeElementId("div",this.m_parentDiv,"madeMenDiv");this.m_containerDiv.style.padding="15px";this.m_containerDiv.style.textAlign="center";if(isValid(this.m_titleString)){var b=document.createElement("div");this.m_containerDiv.appendChild(b);createTitleDiv(b,this.m_titleString)}var f=makeElementClass("table",this.m_containerDiv,"dataTable",{marginLeft:"auto",marginRight:"auto",borderSpacing:"1px"});var a=document.createElement("tbody");f.appendChild(a);this.createRankingDivs(a);var d={};d.user_id=GBL.MAIN_DATA.getViewer().getUserId();var c=this;makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/get_made_men",function(g){c.onGetMadeMen(g)},d)};MadeMenDiv.prototype.onGetMadeMen=function(c){var b=getGadgetResponseData(c);if(isValid(b)){try{var g=getXMLFirstNode(b,"most_deadly");this.m_mostDeadlyRankingDiv.fillFromXML(g);var a=getXMLFirstNode(b,"top_fighters");this.m_topFightersRankingDiv.fillFromXML(a);var h=getXMLFirstNode(b,"top_bounty_hunters");this.m_topBountyHuntersRankingDiv.fillFromXML(h);var f=getXMLFirstNode(b,"top_tycoons");this.m_topTycoonsRankingDiv.fillFromXML(f)}catch(d){outputDebug("onGetMadeMen "+d)}}};function RegionizedLeaderboardDiv(a){this.m_parentDiv=a;this.m_containerDiv=undefined;this.m_titleString=undefined;this.m_leaderBoardConstructor=RegionalLeaderBoardDiv;this.m_regionsDiv=undefined;this.m_leaderBoardDiv=undefined;this.initialize();this.createDiv()}RegionizedLeaderboardDiv.prototype.initialize=function(){this.m_titleString="Made Men of MySpace"};RegionizedLeaderboardDiv.prototype.createDiv=function(f){this.m_containerDiv=makeElement("div",this.m_parentDiv,{padding:"15px"});var a=new SideBySideCells(this.m_containerDiv);var b=this;var g=a.getLeftCell();setStyle(g,{width:"200px",verticalAlign:"top"});this.m_regionsDiv=new RegionsDiv(g,function(h){b.onChangeSelectedRegion(h)});var c=a.getRightCell();setStyle(c,{verticalAlign:"top"});this.m_leaderBoardDiv=new this.m_leaderBoardConstructor(c);var d={};d.user_id=GBL.MAIN_DATA.getViewer().getUserId();b=this;makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/get_made_men",function(h){b.onGetData(h)},d)};RegionizedLeaderboardDiv.prototype.onChangeSelectedRegion=function(a){this.m_leaderBoardDiv.loadingMadeMen();var c={};c.user_id=GBL.MAIN_DATA.getViewer().getUserId();c.region_id=a;var b=this;makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/get_regional_made_men",function(d){b.onGetData(d)},c)};RegionizedLeaderboardDiv.prototype.onGetData=function(c){try{var b=getGadgetResponseData(c);var a=getXMLFirstNode(b,"regions");if(isValid(a)){this.m_regionsDiv.onGetRegions(a)}this.m_leaderBoardDiv.onGetMadeMen(b)}catch(d){outputAlert(d)}};function RegionsDiv(b,a){this.m_parentDiv=b;this.m_containerDiv=undefined;this.m_regionsDiv=undefined;this.m_onChangeSelectionListener=a;this.m_curSelectedRegionId=undefined;this.m_regionIdRegionDivMap={};this.initialize();this.createDiv()}RegionsDiv.prototype.initialize=function(){};RegionsDiv.prototype.createDiv=function(){this.m_containerDiv=makeElement("div",this.m_parentDiv,{overflow:"auto",marginTop:"20px",border:"solid 1px #555555",padding:"5px"});this.m_containerDiv.innerHTML=getLoadingMessageHTML()};RegionsDiv.prototype.onGetRegions=function(g){this.m_containerDiv.innerHTML="";this.createRegionDiv("Everyone","everyone",this.m_containerDiv,true);this.createRegionDiv("My Region ("+GBL.MAIN_DATA.getViewer().getShortRegion()+")","my_region",this.m_containerDiv,false);this.m_regionsDiv=makeElement("div",this.m_containerDiv,{paddingTop:"5px",marginTop:"5px",borderTop:"solid 2px #555555",height:"1500px",overflow:"auto"});try{var c=g.getElementsByTagName("region");for(var d=0;d<c.length;d++){var b=getXMLEncodedStringNodeValue(c[d],"name",false);var a=getXMLEncodedStringNodeValue(c[d],"id",false);this.createRegionDiv(b,a,this.m_regionsDiv,false)}}catch(f){outputAlert(f)}};RegionsDiv.prototype.createRegionDiv=function(g,a,d,f){var b=makeElementClass("div",d,"madeMenRegionUnhighlighted");b.innerHTML=g;var c=this;addEvent(b,"click",function(){c.selectRegion(a)});this.m_regionIdRegionDivMap[a]=b;if(f){this.m_curSelectedRegionId=a;this.highLightRegionDiv(a)}else{this.unHighLightRegionDiv(a)}};RegionsDiv.prototype.selectRegion=function(a){if(isValid(this.m_curSelectedRegionId)){if(this.m_curSelectedRegionId==a){return}this.unHighLightRegionDiv(this.m_curSelectedRegionId)}this.m_curSelectedRegionId=a;this.highLightRegionDiv(this.m_curSelectedRegionId);this.m_onChangeSelectionListener(this.m_curSelectedRegionId)};RegionsDiv.prototype.highLightRegionDiv=function(a){var b=this.m_regionIdRegionDivMap[a];if(!isValid(b)){return}b.className="madeMenRegionHighlighted"};RegionsDiv.prototype.unHighLightRegionDiv=function(a){var b=this.m_regionIdRegionDivMap[a];if(!isValid(b)){return}b.className="madeMenRegionUnhighlighted"};function RegionalLeaderBoardDiv(a){this.m_parentDiv=a;this.m_containerDiv=undefined;this.m_messageDiv=undefined;this.m_rankingsDiv=undefined;this.m_mostDeadlyRankingDiv=undefined;this.m_topFightersRankingDiv=undefined;this.m_topBountyHuntersRankingDiv=undefined;this.m_topTycoonsRankingDiv=undefined;this.initialize();this.createDiv()}RegionalLeaderBoardDiv.prototype.initialize=function(){};RegionalLeaderBoardDiv.prototype.createRankingDivs=function(a){var b=document.createElement("tr");a.appendChild(b);var c=document.createElement("td");b.appendChild(c);c.style.width="330px";c.style.verticalAlign="top";c.style.paddingBottom="20px";this.m_topFightersRankingDiv=new MobRankingDiv(c,"Top Fighters","Wins");c=document.createElement("td");b.appendChild(c);c.style.width="330px";c.style.verticalAlign="top";c.style.paddingBottom="20px";this.m_topTycoonsRankingDiv=new MobRankingDiv(c,"Wealthiest","Bank Funds");b=document.createElement("tr");a.appendChild(b);c=document.createElement("td");b.appendChild(c);c.style.width="330px";c.style.verticalAlign="top";c.style.paddingBottom="20px";this.m_mostDeadlyRankingDiv=new MobRankingDiv(c,"Deadliest Foes","Whacks");c=document.createElement("td");b.appendChild(c);c.style.width="330px";c.style.verticalAlign="top";c.style.paddingBottom="20px";this.m_topBountyHuntersRankingDiv=new MobRankingDiv(c,"Top Hit-men","Body Count")};RegionalLeaderBoardDiv.prototype.createDiv=function(){this.m_containerDiv=makeElement("div",this.m_parentDiv,{padding:"5px",textAlign:"center"});this.m_messageDiv=makeElement("div",this.m_containerDiv,{padding:"20px",display:"none"});this.m_rankingsDiv=makeElement("div",this.m_containerDiv);var b=makeElementClass("div",this.m_rankingsDiv,"madeMenUpdatesMsg");b.innerHTML="* Regional rankings are updated once every 24 hours.";var c=makeElementClass("table",this.m_rankingsDiv,"dataTable",{marginLeft:"auto",marginRight:"auto",borderSpacing:"1px"});var a=document.createElement("tbody");c.appendChild(a);this.createRankingDivs(a);this.loadingMadeMen()};RegionalLeaderBoardDiv.prototype.loadingMadeMen=function(){this.m_messageDiv.style.display="block";this.m_rankingsDiv.style.display="none";this.m_messageDiv.innerHTML=getLoadingMessageHTML()};RegionalLeaderBoardDiv.prototype.onGetMadeMen=function(g){this.m_messageDiv.style.display="none";this.m_rankingsDiv.style.display="block";var f=true;if(isValid(g)){try{var d=getXMLFirstNode(g,"most_deadly");var a=getXMLFirstNode(g,"top_fighters");var h=getXMLFirstNode(g,"top_bounty_hunters");var c=getXMLFirstNode(g,"top_tycoons");if(isValid(d)||isValid(a)||isValid(h)||isValid(c)){this.m_mostDeadlyRankingDiv.fillFromXML(d);this.m_topFightersRankingDiv.fillFromXML(a);this.m_topBountyHuntersRankingDiv.fillFromXML(h);this.m_topTycoonsRankingDiv.fillFromXML(c)}else{f=false}}catch(b){outputDebug("onGetMadeMen "+b)}}else{f=false}if(!f){this.m_messageDiv.style.display="block";this.m_rankingsDiv.style.display="none";this.m_messageDiv.innerHTML="<span class='madeMenInsufficientPlayers'> Unfortunately there are not enough players in this region.. </span>"}};function MobRankingDiv(m,a,f){var k=m;var n=a;var b=f;var g=undefined;var d=undefined;var l=undefined;this.fillFromXML=j;if(k!=undefined){h(k)}function h(o){outputDebug("createDiv");k=o;g=document.createElement("div");k.appendChild(g);g.style.padding="0px";g.style.textAlign="center";l=document.createElement("div");g.appendChild(l);l.style.padding="10px";l.innerHTML=getLoadingMessageHTML()}function j(u){g.innerHTML="";var t=makeElementClass("table",g,"dataTable",{marginLeft:"auto",marginRight:"auto",borderSpacing:"1px"});d=document.createElement("tbody");t.appendChild(d);var r=makeElementClass("tr",d,"dataTableHeaderTR");var v=document.createElement("td");r.appendChild(v);addHeaderStyle(v);v.style.width="200px";v.innerHTML=n;v.style.paddingTop="2px";v.style.paddingBottom="2px";v=document.createElement("td");r.appendChild(v);addHeaderStyle(v);v.style.width="100px";v.style.paddingTop="2px";v.style.paddingBottom="2px";v.innerHTML=f;if(isValid(u)){try{var w=u.getElementsByTagName("entry");for(var p=0;p<w.length;p++){var q=new User(undefined);q.createXMLUser(getXMLFirstNode(w[p],"user"));var o=getXMLNodeValue(w[p],"count");d.appendChild(c(q,o))}}catch(s){outputAlert("fillFromXML "+s)}}}function c(p,o){outputDebug("createContentElement");var q=document.createElement("tr");var r=document.createElement("td");$(r).css({textAlign:"left"});q.appendChild(r);r.style.padding="0px 10px 0px 10px";r.innerHTML="<span class='madeMenMobName'> "+p.getMobName()+" </span>";r.style.paddingTop="2px";r.style.paddingBottom="2px";r.style.cursor="pointer";addEvent(r,"click",function(){showUserStats(p.getUserId())});r=makeElementClass("td",q,"madeMenStat");r.innerHTML=formatNumberWithCommas(o);return q}}function MadeMenWeeklyDiv(a){this.m_parentDiv=a;this.m_containerDiv=undefined;this.m_mostDeadlyRankingDiv=undefined;this.m_topFightersRankingDiv=undefined;this.m_topBountyHuntersRankingDiv=undefined;this.m_topTycoonsRankingDiv=undefined;this.m_titleString=undefined;this.initialize();this.createDiv()}MadeMenWeeklyDiv.prototype.initialize=function(){this.m_titleString="Made Men of MySpace"};MadeMenWeeklyDiv.prototype.createRankingDivs=function(a){var b=document.createElement("tr");a.appendChild(b);var c=document.createElement("td");b.appendChild(c);c.style.width="390px";c.style.verticalAlign="top";this.m_topFightersRankingDiv=new MobWeeklyRankingDiv(c,"Top Fighters","Wins");c=document.createElement("td");b.appendChild(c);c.style.width="390px";c.style.verticalAlign="top";this.m_topTycoonsRankingDiv=new MobWeeklyRankingDiv(c,"Wealthiest","Bank Funds");b=document.createElement("tr");a.appendChild(b);c=document.createElement("td");b.appendChild(c);c.style.width="390px";c.style.verticalAlign="top";this.m_mostDeadlyRankingDiv=new MobWeeklyRankingDiv(c,"Deadliest Foes","Whacks");c=document.createElement("td");b.appendChild(c);c.style.width="390px";c.style.verticalAlign="top";this.m_topBountyHuntersRankingDiv=new MobWeeklyRankingDiv(c,"Top Hit-men","Body Count")};MadeMenWeeklyDiv.prototype.createDiv=function(){this.m_containerDiv=makeElementId("div",this.m_parentDiv,"madeMenWeeklyDiv");this.m_containerDiv.style.padding="15px";this.m_containerDiv.style.textAlign="center";if(isValid(this.m_titleString)){var b=document.createElement("div");this.m_containerDiv.appendChild(b);createTitleDiv(b,this.m_titleString)}var f=makeElementClass("table",this.m_containerDiv,"dataTable",{marginLeft:"auto",marginRight:"auto",borderSpacing:"1px"});var a=document.createElement("tbody");f.appendChild(a);this.createRankingDivs(a);var d={};d.user_id=GBL.MAIN_DATA.getViewer().getUserId();var c=this;makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/get_weekly_made_men",function(g){c.onGetMadeMen(g)},d)};MadeMenWeeklyDiv.prototype.onGetMadeMen=function(c){var b=getGadgetResponseData(c);if(isValid(b)){try{var g=getXMLFirstNode(b,"most_deadly");this.m_mostDeadlyRankingDiv.fillFromXML(g);var a=getXMLFirstNode(b,"top_fighters");this.m_topFightersRankingDiv.fillFromXML(a);var h=getXMLFirstNode(b,"top_bounty_hunters");this.m_topBountyHuntersRankingDiv.fillFromXML(h);var f=getXMLFirstNode(b,"biggest_mob");this.m_topTycoonsRankingDiv.fillFromXML(f)}catch(d){outputDebug("onGetMadeWeeklyMen "+d)}}};function RegionizedWeeklyLeaderboardDiv(a){this.m_parentDiv=a;this.m_containerDiv=undefined;this.m_titleString=undefined;this.m_leaderBoardConstructor=RegionalWeeklyLeaderBoardDiv;this.m_regionsDiv=undefined;this.m_leaderBoardDiv=undefined;this.currentRegionId=undefined;this.l_currentWeekData=getLoadingMessageHTML();this.initialize();this.createDiv()}RegionizedWeeklyLeaderboardDiv.prototype.initialize=function(){this.m_titleString="Made Men of MySpace"};RegionizedWeeklyLeaderboardDiv.prototype.createDiv=function(g){this.m_containerDiv=makeElement("div",this.m_parentDiv,{padding:"15px"});var l=this;var h=document.createElement("div");h.className="madeMenWeeklyNav";var m=document.createElement("span");m.innerHTML="Week of: ";h.appendChild(m);var k=document.createElement("a");k.setAttribute("href","#");addEventWithParameter(k,"click",l.onPreviousWeekClick,l);k.innerHTML="&laquo; ";k.setAttribute("id","__made_men_prevLink");k.className="madeMenWeeklyNavLink";var b=document.createElement("a");b.setAttribute("href","#");addEventWithParameter(b,"click",l.onNextWeekClick,l);b.innerHTML=" &raquo;";b.setAttribute("id","__made_men_nextLink");b.className="madeMenWeeklyNavLink";var j=document.createElement("span");j.innerHTML=this.l_currentWeekData;j.setAttribute("id","__currentWeekData");h.appendChild(k);h.appendChild(j);h.appendChild(b);this.m_containerDiv.appendChild(h);var a=new SideBySideCells(this.m_containerDiv);var f=a.getLeftCell();setStyle(f,{width:"200px",verticalAlign:"top"});this.m_regionsDiv=new RegionsDiv(f,function(n){l.onChangeSelectedRegion(n)});var d=a.getRightCell();setStyle(d,{verticalAlign:"top"});this.m_leaderBoardDiv=new this.m_leaderBoardConstructor(d);var c={};c.user_id=GBL.MAIN_DATA.getViewer().getUserId();c.include_regions=true;l=this;makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/get_weekly_made_men",function(n){l.onGetData(n)},c)};RegionizedWeeklyLeaderboardDiv.prototype.onPreviousWeekClick=function(b){var a=b;var c={};b.m_leaderBoardDiv.loadingMadeMen();c.user_id=GBL.MAIN_DATA.getViewer().getUserId();c.currweek=document.getElementById("__currentWeekData").innerHTML;c.direction=0;c.region_id=a.currentRegionId;document.getElementById("__currentWeekData").innerHTML=getLoadingMessageHTML();makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/get_weekly_made_men",function(d){a.onGetData(d)},c)};RegionizedWeeklyLeaderboardDiv.prototype.onNextWeekClick=function(b){var a=b;var c={};b.m_leaderBoardDiv.loadingMadeMen();c.user_id=GBL.MAIN_DATA.getViewer().getUserId();c.currweek=document.getElementById("__currentWeekData").innerHTML;c.direction=1;c.region_id=a.currentRegionId;document.getElementById("__currentWeekData").innerHTML=getLoadingMessageHTML();makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/get_weekly_made_men",function(d){a.onGetData(d)},c)};RegionizedWeeklyLeaderboardDiv.prototype.onChangeSelectedRegion=function(a){this.currentRegionId=a;this.m_leaderBoardDiv.loadingMadeMen();var c={};c.user_id=GBL.MAIN_DATA.getViewer().getUserId();c.region_id=a;c.currweek=document.getElementById("__currentWeekData").innerHTML;var b=this;makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/get_weekly_made_men",function(d){b.onGetData(d)},c)};RegionizedWeeklyLeaderboardDiv.prototype.onGetData=function(c){try{var b=getGadgetResponseData(c);var a=getXMLFirstNode(b,"regions");if(isValid(a)){this.m_regionsDiv.onGetRegions(a)}this.m_leaderBoardDiv.onGetMadeMen(b)}catch(d){outputAlert(d)}};function RegionsWeeklyDiv(b,a){this.m_parentDiv=b;this.m_containerDiv=undefined;this.m_regionsDiv=undefined;this.m_onChangeSelectionListener=a;this.m_curSelectedRegionId=undefined;this.m_regionIdRegionDivMap={};this.initialize();this.createDiv()}RegionsWeeklyDiv.prototype.initialize=function(){};RegionsWeeklyDiv.prototype.createDiv=function(){this.m_containerDiv=makeElement("div",this.m_parentDiv,{overflow:"auto",marginTop:"20px",border:"solid 1px #555555",padding:"5px"});this.m_containerDiv.innerHTML=getLoadingMessageHTML()};RegionsWeeklyDiv.prototype.onGetRegions=function(g){this.m_containerDiv.innerHTML="";this.createRegionDiv("Everyone","everyone",this.m_containerDiv,true);this.createRegionDiv("My Region ("+GBL.MAIN_DATA.getViewer().getShortRegion()+")","my_region",this.m_containerDiv,false);this.m_regionsDiv=makeElement("div",this.m_containerDiv,{paddingTop:"5px",marginTop:"5px",borderTop:"solid 2px #555555",height:"1500px",overflow:"auto"});try{var c=g.getElementsByTagName("region");for(var d=0;d<c.length;d++){var b=getXMLEncodedStringNodeValue(c[d],"name",false);var a=getXMLEncodedStringNodeValue(c[d],"id",false);this.createRegionDiv(b,a,this.m_regionsDiv,false)}}catch(f){outputAlert(f)}};RegionsWeeklyDiv.prototype.createRegionDiv=function(g,a,d,f){var b=makeElementClass("div",d,"madeMenRegion");b.innerHTML=g;var c=this;addEvent(b,"click",function(){c.selectRegion(a)});this.m_regionIdRegionDivMap[a]=b;if(f){this.m_curSelectedRegionId=a;this.highLightRegionDiv(a)}else{this.unHighLightRegionDiv(a)}};RegionsWeeklyDiv.prototype.selectRegion=function(a){if(isValid(this.m_curSelectedRegionId)){if(this.m_curSelectedRegionId==a){return}this.unHighLightRegionDiv(this.m_curSelectedRegionId)}this.m_curSelectedRegionId=a;this.highLightRegionDiv(this.m_curSelectedRegionId);this.m_onChangeSelectionListener(this.m_curSelectedRegionId)};RegionsDiv.prototype.highLightRegionDiv=function(a){var b=this.m_regionIdRegionDivMap[a];if(!isValid(b)){return}b.className="madeMenRegionHighlighted"};RegionsDiv.prototype.unHighLightRegionDiv=function(a){var b=this.m_regionIdRegionDivMap[a];if(!isValid(b)){return}b.className="madeMenRegionUnhighlighted"};function RegionalWeeklyLeaderBoardDiv(a){this.m_parentDiv=a;this.m_containerDiv=undefined;this.m_messageDiv=undefined;this.m_rankingsDiv=undefined;this.m_mostDeadlyRankingDiv=undefined;this.m_topFightersRankingDiv=undefined;this.m_topBountyHuntersRankingDiv=undefined;this.m_topTycoonsRankingDiv=undefined;this.m_labelMap={fighter:["Top Fighters","Wins"],leader:["Mob Leaders","Mob Size"],killer:["Deadliest Foes","Whacks"],hitman:["Top Hit-men","Body Count"]};this.initialize();this.createDiv()}RegionalWeeklyLeaderBoardDiv.prototype.initialize=function(){};RegionalWeeklyLeaderBoardDiv.prototype.createRankingDivs=function(a){var b=document.createElement("tr");a.appendChild(b);var c=document.createElement("td");b.appendChild(c);c.style.width="330px";c.style.verticalAlign="top";c.style.paddingBottom="20px";this.m_topFightersRankingDiv=new MobWeeklyRankingDiv(c,this.m_labelMap.fighter[0],this.m_labelMap.fighter[1]);c=document.createElement("td");b.appendChild(c);c.style.width="330px";c.style.verticalAlign="top";c.style.paddingBottom="20px";this.m_topTycoonsRankingDiv=new MobWeeklyRankingDiv(c,this.m_labelMap.leader[0],this.m_labelMap.leader[1]);b=document.createElement("tr");a.appendChild(b);c=document.createElement("td");b.appendChild(c);c.style.width="330px";c.style.verticalAlign="top";c.style.paddingBottom="20px";this.m_mostDeadlyRankingDiv=new MobWeeklyRankingDiv(c,this.m_labelMap.killer[0],this.m_labelMap.killer[1]);c=document.createElement("td");b.appendChild(c);c.style.width="330px";c.style.verticalAlign="top";c.style.paddingBottom="20px";this.m_topBountyHuntersRankingDiv=new MobWeeklyRankingDiv(c,this.m_labelMap.hitman[0],this.m_labelMap.hitman[1])};RegionalWeeklyLeaderBoardDiv.prototype.createDiv=function(){this.m_containerDiv=makeElement("div",this.m_parentDiv,{padding:"5px",textAlign:"center"});this.m_messageDiv=makeElement("div",this.m_containerDiv,{padding:"20px",display:"none"});this.m_rankingsDiv=makeElement("div",this.m_containerDiv);var b=makeElementClass("div",this.m_rankingsDiv,"madeMenUpdatesMsg");b.innerHTML="* Regional weekly rankings are updated once every 24 hours.";var c=makeElementClass("table",this.m_rankingsDiv,"dataTable",{marginLeft:"auto",marginRight:"auto",borderSpacing:"1px"});var a=document.createElement("tbody");c.appendChild(a);this.createRankingDivs(a);this.loadingMadeMen()};RegionalWeeklyLeaderBoardDiv.prototype.loadingMadeMen=function(){this.m_messageDiv.style.display="block";this.m_rankingsDiv.style.display="none";this.m_messageDiv.innerHTML=getLoadingMessageHTML()};RegionalWeeklyLeaderBoardDiv.prototype.onGetMadeMen=function(l){this.m_messageDiv.style.display="none";this.m_rankingsDiv.style.display="block";var c=true;if(isValid(l)){try{var d=getXMLFirstNode(l,"most_deadly");var o=getXMLFirstNode(l,"top_fighters");var j=getXMLFirstNode(l,"top_bounty_hunters");var k=getXMLFirstNode(l,"biggest_mob");var a=getXMLFirstNode(l,"week");var m=getXMLFirstNode(l,"next_week_exists");var f=getXMLFirstNode(l,"previous_week_exists");if(isValid(d)||isValid(o)||isValid(j)||isValid(k)||isValid(a)){this.m_mostDeadlyRankingDiv.fillFromXML(d);this.m_topFightersRankingDiv.fillFromXML(o);this.m_topBountyHuntersRankingDiv.fillFromXML(j);this.m_topTycoonsRankingDiv.fillFromXML(k);var b=a.firstChild.nodeValue;document.getElementById("__currentWeekData").innerHTML=b;var n=f.firstChild.nodeValue;var h=m.firstChild.nodeValue;if(n=="false"){document.getElementById("__made_men_prevLink").style.visibility="hidden"}else{document.getElementById("__made_men_prevLink").style.visibility="visible"}if(h=="false"){document.getElementById("__made_men_nextLink").style.visibility="hidden"}else{document.getElementById("__made_men_nextLink").style.visibility="visible"}}else{c=false}}catch(g){outputDebug("onGetMadeMen "+g)}}else{c=false}if(!c){this.m_messageDiv.style.display="block";this.m_rankingsDiv.style.display="none";this.m_messageDiv.innerHTML="<span class='madeMenInsufficientPlayers'> Unfortunately there are not enough players in this region.. </span>"}};function MobWeeklyRankingDiv(m,a,f){var k=m;var n=a;var b=f;var g=undefined;var d=undefined;var l=undefined;this.fillFromXML=j;if(k!=undefined){h(k)}function h(o){outputDebug("createDiv");k=o;g=document.createElement("div");k.appendChild(g);g.style.padding="0px";g.style.textAlign="center";l=document.createElement("div");g.appendChild(l);l.style.padding="10px";l.innerHTML=getLoadingMessageHTML()}function j(u){g.innerHTML="";var t=makeElementClass("table",g,"dataTable",{marginLeft:"auto",marginRight:"auto",borderSpacing:"1px"});d=document.createElement("tbody");t.appendChild(d);var r=document.createElement("tr");d.appendChild(r);var v=document.createElement("td");r.appendChild(v);addHeaderStyle(v);v.style.width="200px";v.innerHTML=n;v.style.paddingTop="2px";v.style.paddingBottom="2px";v=document.createElement("td");r.appendChild(v);addHeaderStyle(v);v.style.width="100px";v.style.paddingTop="2px";v.style.paddingBottom="2px";v.innerHTML=f;if(isValid(u)){try{var w=u.getElementsByTagName("entry");for(var p=0;p<w.length;p++){var q=new User(undefined);q.createXMLUser(getXMLFirstNode(w[p],"user"));var o=getXMLNodeValue(w[p],"count");d.appendChild(c(q,o))}}catch(s){outputAlert("fillFromXML "+s)}}}function c(p,o){outputDebug("createContentElement");var q=document.createElement("tr");var r=makeElementClass("td",q);$(r).css({textAlign:"left"});r.style.padding="0px 10px 0px 10px";r.innerHTML="<span class='madeMenMobName'> "+p.getMobName()+" </span>";r.style.paddingTop="2px";r.style.paddingBottom="2px";r.style.cursor="pointer";addEvent(r,"click",function(){showUserStats(p.getUserId())});r=makeElementClass("td",q,"madeMenStat");r.innerHTML=formatNumberWithCommas(o);return q}}function MadeMenMobDiv(a){this.m_parentDiv=a;this.m_containerDiv=undefined;this.m_mostDeadlyRankingDiv=undefined;this.m_topFightersRankingDiv=undefined;this.m_topBountyHuntersRankingDiv=undefined;this.m_topTycoonsRankingDiv=undefined;this.m_titleString=undefined;this.initialize();this.createDiv()}MadeMenMobDiv.prototype.initialize=function(){};MadeMenMobDiv.prototype.createRankingDivs=function(a){var b=document.createElement("tr");a.appendChild(b);var c=document.createElement("td");b.appendChild(c);c.style.width="390px";c.style.verticalAlign="top";this.m_topFightersRankingDiv=new MobWeeklyRankingDiv(c,"Top Fighters","Wins");c=document.createElement("td");b.appendChild(c);c.style.width="390px";c.style.verticalAlign="top";this.m_topTycoonsRankingDiv=new MobWeeklyRankingDiv(c,"Wealthiest","Bank Funds");b=document.createElement("tr");a.appendChild(b);c=document.createElement("td");b.appendChild(c);c.style.width="390px";c.style.verticalAlign="top";this.m_mostDeadlyRankingDiv=new MobWeeklyRankingDiv(c,"Deadliest Foes","Whacks");c=document.createElement("td");b.appendChild(c);c.style.width="390px";c.style.verticalAlign="top";this.m_topBountyHuntersRankingDiv=new MobWeeklyRankingDiv(c,"Top Hit-men","Body Count")};MadeMenMobDiv.prototype.createDiv=function(){this.m_containerDiv=makeElementId("div",this.m_parentDiv,"madeMenWeeklyDiv");this.m_containerDiv.style.padding="15px";this.m_containerDiv.style.textAlign="center";if(isValid(this.m_titleString)){var c=document.createElement("div");this.m_containerDiv.appendChild(c);createTitleDiv(c,this.m_titleString)}var b=makeElementClass("div",this.m_containerDiv,"madeMenUpdatesMsg");b.innerHTML="* Mob rankings are updated once every 30 minutes";var g=makeElementClass("table",this.m_containerDiv,"dataTable",{marginLeft:"auto",marginRight:"auto",borderSpacing:"1px"});var a=document.createElement("tbody");g.appendChild(a);this.createRankingDivs(a);var f={};f.user_id=GBL.MAIN_DATA.getViewer().getUserId();var d=this;makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/get_user_mob_made_men",function(h){d.onGetMadeMen(h)},f)};MadeMenMobDiv.prototype.onGetMadeMen=function(c){var b=getGadgetResponseData(c);if(isValid(b)){try{var g=getXMLFirstNode(b,"most_deadly");this.m_mostDeadlyRankingDiv.fillFromXML(g);var a=getXMLFirstNode(b,"top_fighters");this.m_topFightersRankingDiv.fillFromXML(a);var h=getXMLFirstNode(b,"top_bounty_hunters");this.m_topBountyHuntersRankingDiv.fillFromXML(h);var f=getXMLFirstNode(b,"top_tycoons");this.m_topTycoonsRankingDiv.fillFromXML(f)}catch(d){outputDebug("onGetMadeWeeklyMen "+d)}}};addCSSRule(".clearall",{clear:"both"});addCSSRule(".chat_history_scrollable",{height:"3500px",width:"100%",overflowX:"hidden",overflowY:"auto","float":"left"});addCSSRule(".chat_wrapper",{width:"780px",padding:"20px",backgroundColor:"rgb(20,20,20)",border:"1px solid rgb(64,64,64)",color:"#ffffff"});addCSSRule(".chat_textarea",{border:"1px solid #666",width:"60%",height:"100px","float":"left",clear:"both"});addCSSRule(".chat_header_status",{width:"60%",fontSize:"12pt",paddingBottom:"2px","float":"left"});addCSSRule(".chat_header_reply_to",{"float":"left",fontSize:"18px",fontWeight:"bold"});addCSSRule(".chat_header_text_counter",{"float":"right",textAlign:"right",fontSize:"20px",color:"#cccccc",fontFamily:"Georgia, sans-serif",whiteSpace:"nowrap"});addCSSRule(".chat_submit_button",{backgroundColor:"#f4f4f4",color:"#999",border:"1px #ccc solid",width:"150px",height:"30px"});addCSSRule(".chat_footer_status",{textAlign:"right",width:"60%",marginTop:"5px","float":"left"});addCSSRule(".chat_history_wrapper",{width:"100%",borderBottom:"1px #ccc solid","float":"left"});addCSSRule(".chat_date_span",{color:"#999",fontSize:"11px",fontFamily:"Georgia, sans-serif"});addCSSRule(".chat_money_num",{color:"#32AF0A",fontWeight:"bold"});addCSSRule(".chat_damage_num",{color:"#ff0000",fontWeight:"bold"});addCSSRule(".chat_experience_num",{color:"#6500AF",fontWeight:"bold"});addCSSRule(".chat_health_num",{color:"#0B2BBF",fontWeight:"bold"});addCSSRule(".chatStandardLink",{textDecoration:"none",color:"#0084CB",fontSize:"12px"});addCSSRule(".chat_message_text",{fontFamily:"Georgia, sans-serif",color:"#ffffff"});addCSSRule(".chat_reset_div",{"float":"left",width:"200px",textAlign:"left"});addCSSRule(".chat_tr",{borderTop:"1px solid red"});addCSSRule(".chat_reply_td",{color:"#fff",borderTop:"1px #666666 dotted",fontSize:"11px"});var IE=document.all?true:false;var rule;var ruleName;var style;rule=addCSSRule("body");rule.style.fontFamily="tahoma, verdana, arial, sans-serif";rule=addCSSRule("#mainFrame");rule.style.position="relative";rule.style.left="0px";rule.style.top="0px";rule=addCSSRule("#xpromo");rule.style.height=31;rule=addCSSRule("#headerFrame");rule.style.position="relative";rule=addCSSRule("a.undecoratedLinked:link");rule.style.color="black";rule.style.textDecoration="none";rule.style.border="none";rule=addCSSRule("a.undecoratedLinked:visited");rule.style.color="black";rule.style.textDecoration="none";rule.style.border="none";rule=addCSSRule("a.undecoratedLinked:hover");rule.style.color="black";rule.style.textDecoration="none";rule.style.border="none";rule=addCSSRule("a.standardLink:link");rule.style.color="rgb( 77, 135, 216 )";rule.style.textDecoration="underline";rule=addCSSRule("a.standardLink:visited");rule.style.color="rgb( 77, 135, 216 )";rule.style.textDecoration="underline";rule=addCSSRule("a.standardLink:hover");rule.style.color="rgb( 88, 155, 226 )";rule.style.textDecoration="underline";rule=addCSSRule("a.blueLink:link");rule.style.color="#3299CC";rule.style.textDecoration="underline";rule=addCSSRule("a.blueLink:visited");rule.style.color="#3299CC";rule.style.textDecoration="underline";rule=addCSSRule("a.blueLink:hover");rule.style.color="#3299CC";rule.style.textDecoration="underline";rule=addCSSRule(".buttonBlueText");rule.style.color="white";rule=addCSSRule("span.blueButton");rule.style.backgroundColor="#3b5998";rule.style.margin="0px 5px 0px 5px";rule.style.padding="5px 10px 5px 10px";rule.style.color=GBL.STYLES.text["color"];rule.style.fontSize="12px";rule.style.fontWeight="bold";rule.style.textAlign="center";rule.style.borderRight="solid 1px #505050";rule.style.borderTop="solid 1px #505050";rule.style.borderRight="solid 2px #808080";rule.style.borderBottom="solid 2px #808080";rule=addCSSRule("a.blueButton:link");rule.style.color=GBL.STYLES.text["color"];rule.style.textDecoration="none";rule=addCSSRule("a.blueButton:visited");rule.style.color=GBL.STYLES.text["color"];rule.style.textDecoration="none";rule=addCSSRule("a.blueButton:hover");rule.style.color=GBL.STYLES.text["color"];rule.style.textDecoration="none";rule=addCSSRule("span.bigBlueButton");rule.style.backgroundColor="#3b5998";rule.style.margin="5px 5px 5px 5px";rule.style.padding="5px 5px 5px 5px";rule.style.color=GBL.STYLES.text["color"];rule.style.fontSize="36px";rule.style.fontWeight="800";rule.style.textAlign="center";rule.style.borderRightrule="solid";rule.style.borderRightWidth="2px";rule.style.borderRightColor="gray";rule.style.borderBottomrule="solid";rule.style.borderBottomWidth="2px";rule.style.borderBottomColor="gray";rule=addCSSRule("a.bigBlueButton:link");rule.style.color=GBL.STYLES.text["color"];rule.style.textDecoration="none";rule=addCSSRule("a.bigBlueButton:visited");rule.style.color=GBL.STYLES.text["color"];rule.style.textDecoration="none";rule=addCSSRule("a.bigBlueButton:hover");rule.style.color=GBL.STYLES.text["color"];rule.style.textDecoration="none";rule=addCSSRule("a.button");rule.style.color=GBL.STYLES.text["color"];rule.style.textDecoration="none";rule.style.outline="none";rule.style.display="block";rule.style.height="34px";rule.style.paddingRight="16px";rule.style.cursor="pointer";rule.style.fontWeight="bold";rule.style.textDecoration="none";rule=addCSSRule("a.button_blue");rule.style.backgroundColor="transparent";rule.style.backgroundImage="url(http://cdn0.mobwarsapp.com/rpg_images/opensocial/mob/ui/button/button_blue.png)";rule.style.backgroundRepeat="no-repeat";rule.style.backgroundPosition="top right";rule.style.backgroundAttachment="scroll";rule=addCSSRule("a.button_gray");rule.style.backgroundColor="transparent";rule.style.backgroundImage="url(http://cdn0.mobwarsapp.com/rpg_images/opensocial/mob/ui/button/button_gray.png)";rule.style.backgroundRepeat="no-repeat";rule.style.backgroundPosition="top right";rule.style.backgroundAttachment="scroll";rule=addCSSRule("a.tinybutton");rule.style.textAlign="center";rule.style.cursor="pointer";rule.style.fontSize=11;rule.style.border="1px solid #777";rule.style.color="#ddd";rule.style.background="#338";rule.style.padding="2px 5px";rule.style.marginTop=3;rule=addCSSRule("a.tinybutton:hover");rule.style.background="#449";rule.style.border="1px solid #888";rule.style.color="white";addCSSRule(".statusTableDiv",{textAlign:"center"});rule=addCSSRule(".statContentTD");rule.style.background="black";rule.style.paddingTop="3px";rule.style.paddingBottom="3px";rule.style.paddingLeft="6px";rule.style.paddingRight="6px";rule.style.fontSize="11px";rule=addCSSRule(".refreshButtonContentTD");rule.style.paddingLeft="10px";rule=addCSSRule(".statCell");rule.style.paddingLeft="4px";rule.style.paddingRight="4px";rule.style.color=GBL.STYLES.text["color"];rule.style.fontSize="11px";rule=addCSSRule(".statCellNew");rule.style.color=GBL.STYLES.text["color"];rule.style.fontSize="11px";rule=addCSSRule("#mobNameStatus .statsBarReloadTimer");rule.style.fontSize="15px";rule=addCSSRule(".nitro_refill_label");rule.style.fontSize="15px";rule=addCSSRule(".nitro_refill_counter");rule.style.fontSize="30px";rule=addCSSRule(".levelStatCell");rule.style.paddingLeft="4px";rule.style.paddingRight="4px";rule.style.color="#32CD32";rule.style.fontSize="11px";rule.style.textAlign="left";rule.style.fontWeight="bold";rule=addCSSRule(".barOutDiv");rule.style.height="3px";rule.style.overflow="hidden";rule=addCSSRule(".percentLevelDiv");rule.style.backgroundColor="#32CD32";rule.style.height="3px";rule=addCSSRule(".myStatsLink");rule.style.color="#70DBDB";rule.style.textDecoration="underline";rule.style.cursor="pointer";rule=addCSSRule(".refreshButtonDiv");rule.style.borderLeft="solid 1px #2F2F4F";rule.style.border="solid 1px #555555";rule.style.backgroundColor="#2F2F4F";rule.style.paddingTop="3px";rule.style.paddingBottom="3px";rule.style.paddingLeft="10px";rule.style.paddingRight="10px";rule.style.color=GBL.STYLES.text["color"];rule.style.fontSize="11px";rule.style.cursor="pointer";rule=addCSSRule("#tabsDiv");rule.style.marginLeft="30px";rule.style.marginRight="10px";addCSSRule("#tabsTable",{borderCollapse:"collapse",cellSpacing:"0px",margin:"0px"});addCSSRule("#tabTableLeftCell",{textAlign:"left",paddingTop:"10px",paddingBottom:"5px"});addCSSRule("#tabTableRightCell",{textAlign:"right",paddingTop:"10px",paddingBottom:"5px"});rule=addCSSRule("span.unSelectedTab");rule.style.backgroundColor="black";rule.style.backgroundImage="url(http://cdn0.mobwarsapp.com/rpg_images/opensocial/mob/ui/fibre4.png)";rule.style.backgroundRepeat="no-repeat";rule.style.backgroundAttachment="scroll";rule.style.padding="3px 4px 3px 4px";rule.style.margin="5px 2px 0px 2px";rule.style.color="#AAAAAA";rule.style.fontSize="12px";rule.style.fontWeight="bold";rule.style.textAlign="center";rule.style.fontVariant="small-caps";rule.style.border="1px solid rgb( 128, 128, 128 )";rule=addCSSRule("span.selectedTab");rule.style.backgroundColor="rgb( 113, 14, 14 )";rule.style.margin="5px 1px 0px 1px";rule.style.padding="5px 4px 3px 4px";rule.style.color=GBL.STYLES.text["color"];rule.style.fontSize="12px";rule.style.fontWeight="bold";rule.style.textAlign="center";rule.style.fontVariant="small-caps";rule.style.border="2px solid rgb( 165, 20, 20 )";rule=addCSSRule("span.highlightedTab");rule.style.color=GBL.STYLES.text["color"];rule=addCSSRule("a.tab:link");rule.style.color="black";rule.style.textDecoration="none";rule=addCSSRule("a.tab:visited");rule.style.color="black";rule.style.textDecoration="none";rule=addCSSRule("a.tab:hover");rule.style.color="black";rule.style.textDecoration="none";rule=addCSSRule("div.tabContentFrame");rule.style.margin="0px 0px 10px 0px";rule.style.padding="10px 10px 10px 10px";rule.style.fontSize="12px";rule.style.textAlign="left";rule.style.height="2200px";rule.style.overflow="auto";rule=addCSSRule(".mainContent");rule.style.clear="both";rule=addCSSRule(".initialViewChangeMobName");rule.style.color="#FF0000";rule.style.fontWeight="bold";rule=addCSSRule(".initialViewRefreshDiv");rule.style.color=GBL.STYLES.text["color"];rule=addCSSRule(".initialViewChooseNameCell");rule.style.color=GBL.STYLES.text["color"];rule=addCSSRule(".initialViewChooseMobClassCell");rule.style.color=GBL.STYLES.text["color"];rule=addCSSRule(".tipDiv");rule.style.margin="10px 0px 10px 0px";rule.style.padding="10px";rule.style.border="solid 1px #888888";rule.style.background="rgb( 20, 20, 20 )";rule.style.textAlign="left";rule.style.verticalAlign="top";rule=addCSSRule(".tipDivLeft");rule.style.width="450px";rule.style.verticalAlign="top";rule=addCSSRule(".tipDivMiddle");rule.style.width="10px";rule=addCSSRule(".tipDivRight");rule.style.width="320px";rule.style.verticalAlign="top";rule=addCSSRule(".hotTipContainer");rule.style.margin="5px 0px 10px 0px";rule.style.padding="0px 10px 5px 10px";rule.style.border="solid 1px #888888";rule.style.position="relative";rule.style.left="0px";rule.style.top="0px";rule=addCSSRule(".hotTipSectionTitle");rule.style.color="#CD7F32";rule.style.fontSize="16px";rule.style.fontWeight="bold";rule.style.textAlign="left";rule=addCSSRule(".hotTipContentDiv");rule.style.margin="2px";rule.style.padding="0px 8px 0px 20px";rule.style.fontSize="14px";rule.style.fontWeight="300";rule.style.color=GBL.STYLES.text["color"];rule.style.textAlign="left";rule=addCSSRule(".tipContainer");rule.style.paddingBottom="5px";rule=addCSSRule(".tipTitle");rule.style.fontSize="16px";rule.style.fontWeight="bold";rule.style.color="#cd7f32";rule=addCSSRule(".linkableTipTitle");rule.style.fontSize="16px";rule.style.fontWeight="bold";rule.style.color="#cd7f32";rule.style.cursor="pointer";rule=addCSSRule(".tipDivMessage");rule.style.paddingLeft="10px";rule.style.fontSize="14px";rule.style.fontWeight="300";rule.style.color=GBL.STYLES.text["color"];rule=addCSSRule(".hotTipPokerPalace");rule.style.color="#CFB52B";rule.style.fontSize="15px";rule.style.fontWeight="bold";rule.style.textAlign="left";rule.style.cursor="pointer";rule.style.paddingBottom="10px";rule=addCSSRule(".hotTipInviteTipText");rule.style.color="#CD7F32";rule.style.fontSize="14px";rule.style.fontWeight="bold";addCSSRule("#blockedComments .tipContainer .tipTitle",{color:"#FF0000"});addCSSRule("#blockedComments .tipContainer .tipDivMessage",{color:"#FF0000"});addCSSRule(".mainMenuDiv",{padding:"15px",textAlign:"center"});rule=addCSSRule(".mainMenuTr");rule.style.paddingBottom="5px";rule.style.cursor="pointer";rule=addCSSRule(".mainMenuTitle");rule.style.color="rgb( 77, 135, 216 )";rule.style.fontWeight="bold";rule=addCSSRule(".mainMenuDescription");rule.style.color=GBL.STYLES.text["color"];rule=addCSSRule(".mainMenuBullet");rule.style.fontSize="14px";rule.style.paddingBottom="4px";rule=addCSSRule(".mainMenuTitle");rule.style.fontSize="14px";rule.style.paddingBottom="4px";rule=addCSSRule(".mainMenuDescription");rule.style.fontSize="14px";rule.style.paddingBottom="4px";rule=addCSSRule("img.constrained");rule.style.height="200";rule=addCSSRule(".sendBroadcastInstructions");rule.style.color="#EEEEEE";rule.style.fontWeight="bold";rule.style.fontSize="12px";rule=addCSSRule(".newsFeedDeleteAllLink");rule.style.color="#88BBEE";rule.style.textAlign="right";rule=addCSSRule(".newsFeedLoadingIcon",{background:"transparent url(http://cdn0.mobwarsapp.com/rpg_images/opensocial/mob/ui/button/icon_loading.gif) no-repeat scroll center center",padding:"30px"});rule=addCSSRule(".newsFeedEntryTime");rule.style.color="#AAAAAA";rule.style.fontWeight="bold";rule=addCSSRule(".newsFeedEntryDelete");rule.style.color="#88BBEE";rule.style.cursor="pointer";rule=addCSSRule(".newsFeedEntryMessage");rule.style.color=GBL.STYLES.text["color"];rule.style.cursor="pointer";rule=addCSSRule(".newsFeedNoMessages");rule.style.padding="30px 0px 0px 30px";rule.style.color="#888888";rule.style.fontSize="14px";rule=addCSSRule(".nextLevelMissionsDiv");rule.style.color="#00FF00";rule.style.fontWeight="bold";rule=addCSSRule(".nextLevelTabsDiv");rule.style.color="#AAAAAA";rule=addCSSRule(".rewardPayoutLabel");rule.style.color=GBL.STYLES.text["money"]["color"];rule=addCSSRule("div.profileMessageBox");rule.style.margin="10px 10px 10px 10px";rule.style.padding="10px 10px 10px 10px";rule.style.backgroundColor="#f7f7f7";rule.style.fontSize="12px";rule.style.borderrule="solid";rule.style.borderWidth="1px";rule.style.borderColor="#7f93bc";rule=addCSSRule("div.installMessageBox");rule.style.margin="10px 10px 10px 10px";rule.style.padding="10px 10px 10px 10px";rule.style.backgroundColor="#f7f7f7";rule.style.fontSize="12px";rule.style.borderrule="solid";rule.style.borderWidth="1px";rule.style.borderColor="#7f93bc";rule=addCSSRule("missionsViewMobstersConsumed");rule.style.fontSize="11px";rule.style.color="#aaaaaa";rule=addCSSRule(".flavorTextTableCell");rule.style.fontSize="11px";rule.style.color="#9999cc";rule.style.padding="5px 20px 5px 10px";rule.style.borderBottom="solid 1px #505050";rule.style.verticalAlign="top";rule.style.colSpan="3";rule=addCSSRule(".flavorTextDiv");rule=addCSSRule(".incomeTitleText");rule.style.color=GBL.STYLES.text["money"]["color"];rule=addCSSRule(".expensesTitleText");rule.style.color="#FF0000";rule=addCSSRule(".landName");rule.style.color=GBL.STYLES.text["color"];rule.style.fontSize="18px";rule.style.fontWeight="bold";rule=addCSSRule(".landIncome");rule.style.color=GBL.STYLES.text["color"];rule=addCSSRule(".landLocation");rule.style.color=GBL.STYLES.text["color"];rule=addCSSRule(".landLocationIndividual");rule.style.color=GBL.STYLES.text["color"];rule.style.fontSize="10px";rule=addCSSRule(".landBuiltOn");rule.style.color=GBL.STYLES.text["color"];rule=addCSSRule(".landPrice");rule.style.color=GBL.STYLES.text["money"]["color"];rule.style.fontSize="18px";rule=addCSSRule(".landNumOwned");rule.style.color=GBL.STYLES.text["color"];rule.style.fontSize="14px";rule.style.fontWeight="bold";rule=addCSSRule(".landUnlockMore");rule.style.color="#00FF00";rule.style.fontWeight="bold";rule=addCSSRule(".landNeededNum");rule.style.padding="5px 10px 5px 10px";rule.style.textAlign="center";rule.style.verticalAlign="middle";rule.style.borderBottom="solid 1px #505050";rule.style.color=GBL.STYLES.text["color"];rule.style.fontWeight="bold";rule=addCSSRule(".neededForMissionHighlight",{backgroundColor:"rgb(32,32,32)"});addCSSRule(".bankExplanationDiv",{display:"block",paddingLeft:"33px",paddingTop:"2px",paddingBottom:"5px",textAlign:"left",color:"#FFFFFF",fontSize:"10px"});rule=addCSSRule(".bankViewInputLabel");rule.style.color=GBL.STYLES.text["color"];rule=addCSSRule(".bankViewActionExplanation");rule.style.color=GBL.STYLES.text["color"];rule.style.fontSize="10px";rule=addCSSRule(".bankViewOpenAccount");rule.style.color=GBL.STYLES.text["color"];rule=addCSSRule(".theGodfatherTitle");rule.style.color="#cccccc";rule=addCSSRule(".theGodfatherSubtitle");rule.style.color="#D9D919";rule.style.fontSize="14px";rule=addCSSRule(".offerpalSubtitle");rule.style.color="#EEEEEE";rule.style.textDecoration="underline";rule.style.cursor="pointer";rule.style.fontSize="11px";rule=addCSSRule(".favorPointsSectionTitle");rule.style.color=GBL.STYLES.text["color"];rule.style.fontSize="18px";rule=addCSSRule(".favorPointsSectionSubtitle");rule.style.color="#cccccc";rule.style.fontSize="14px";rule=addCSSRule(".sectionInstructions");rule.style.paddingLeft="8px";rule.style.paddingTop="2px";rule.style.paddingBottom="5px";rule.style.fontSize="14px";rule.style.color="#cccccc";rule.style.textAlign="left";rule=addCSSRule(".favorPointsSectionTitle");rule.style.color=GBL.STYLES.text["color"];rule.style.fontSize="18px";rule=addCSSRule(".favorPointsSectionSubtitle");rule.style.color="#cccccc";rule.style.fontSize="14px";rule=addCSSRule(".favorOfferItem");rule.style.color="rgb(165,20,20)";rule.style.fontWeight="bold";rule=addCSSRule(".favorOfferDescription");rule.style.color=GBL.STYLES.text["color"];rule.style.paddingLeft="15px";rule=addCSSRule(".favorOfferQtyRemaining");rule.style.color="rgb(165,20,20)";rule=addCSSRule(".favorOfferQtyLimit");rule.style.color="#aaaaaa";rule.style.fontSize="11px";rule=addCSSRule(".favorOfferSoldOut");rule.style.color="rgb(165,20,20)";rule.style.fontSize="11px";rule=addCSSRule(".favorOfferUnhighlighted");rule.style.verticalAlign="top";rule.style.verticalAlign="middle";rule.style.color=GBL.STYLES.text["color"];rule=addCSSRule(".favorOfferHighlighted");rule.style.color="rgb(255,255,192)";rule.style.fontWeight="bold";rule=addCSSRule(".favorOfferNote");rule.style.color="#aaaaaa";rule.style.fontSize="11px";rule=addCSSRule(".fightListCell");rule.style.color=GBL.STYLES.text["color"];rule.style.padding="0px 10px 0px 10px";rule.style.cursor="pointer";rule=addCSSRule(".fightListMobName");rule.style.color="#3E99C3";rule.style.fontWeight="bold";rule.style.cursor="pointer";rule=addCSSRule(".hitListCell");rule.style.color=GBL.STYLES.text["color"];rule.style.padding="5px 10px 5px 10px";rule=addCSSRule(".hitListClickableCell");rule.style.color=GBL.STYLES.text["color"];rule.style.padding="5px 10px 5px 10px";rule.style.cursor="pointer";rule=addCSSRule(".hitListBountyNum");rule.style.color="green";rule.style.fontWeight="bold";rule=addCSSRule(".createBountyAmount");rule.style.color=GBL.STYLES.text["color"];rule=addCSSRule(".itemCell");rule.style.padding="5px 10px 5px 10px";rule.style.textAlign="left";rule.style.borderBottom="solid 1px #505050";rule=addCSSRule(".itemTxnCell");rule.style.padding="5px 10px 5px 10px";rule.style.borderBottom="solid 1px #505050";rule.style.width="215px";rule.style.color=GBL.STYLES.text["color"];rule.style.fontWeight="bold";rule=addCSSRule(".itemSoldOut");rule.style.color=GBL.STYLES.text["color"];rule.style.fontWeight="bold";rule=addCSSRule(".itemTitle");rule.style.color=GBL.STYLES.text["color"];rule.style.fontSize="16px";rule=addCSSRule(".itemAttack");rule.style.color=GBL.STYLES.text["color"];rule=addCSSRule(".itemDefense");rule.style.color=GBL.STYLES.text["color"];rule=addCSSRule(".itemUpkeep");rule.style.color=GBL.STYLES.text["color"];rule=addCSSRule(".itemPurchaseStatus");rule.style.color="#FFD700";rule=addCSSRule(".itemMastery");rule.style.color="#00FF00";rule=addCSSRule(".itemGala");rule.style.color="#00FF00";rule=addCSSRule(".itemNeededCount");rule.style.color=GBL.STYLES.text["color"];rule.style.padding="5px 10px 5px 10px";rule.style.textAlign="center";rule.style.verticalAlign="middle";rule.style.borderBottom="solid 1px #505050";rule.style.fontWeight="bold";rule=addCSSRule(".itemPrice");rule.style.fontSize="18px";rule.style.color=GBL.STYLES.text["money"]["color"];rule=addCSSRule(".itemFavorPrice",{fontSize:"18px",fontWeight:"bold",color:GBL.STYLES.text["favorPoint"]["color"]});rule=addCSSRule(".itemNumOwned");rule.style.fontSize="14px";rule.style.color=GBL.STYLES.text["color"];rule.style.fontWeight="bold";rule=addCSSRule(".equipmentUnlockMessage");rule.style.color="#00FF00";rule.style.fontWeight="bold";rule=addCSSRule(".itemLimitedEdition");rule.style.color="#11F100";rule=addCSSRule(".itemNotBuyable");rule.style.color="#E7B10E";rule=addCSSRule(".smallLootItemTitle");rule.style.color=GBL.STYLES.text["color"];rule.style.fontSize="13px";addCSSRule(".landNotBuyableNotSellable",{color:"#E7B10E"});rule=addCSSRule(".hospitalRefreshDiv");rule.style.color=GBL.STYLES.text["color"];rule.style.textAlign="center";rule=addCSSRule("div.friendImage");rule.style.margin="0px 0px 0px 0px";rule.style.padding="8px 8px 8px 8px";rule.style.backgroundColor=GBL.STYLES.text["color"];rule.style.borderrule="solid";rule.style.borderWidth="1px";rule.style.borderColor="#AAAAAA";rule.style.borderRightrule="solid";rule.style.borderRightWidth="2px";rule.style.borderRightColor="#AAAAAA";rule.style.borderBottomrule="solid";rule.style.borderBottomWidth="2px";rule.style.borderBottomColor="#AAAAAA";rule=addCSSRule("div.inviteInstructionBox");rule.style.margin="5px 5px 5px 5px";rule.style.padding="10px 10px 10px 15px";rule.style.backgroundColor="#fff9d7";rule.style.fontSize="14px";rule.style.borderrule="solid";rule.style.borderWidth="1px";rule.style.borderColor="#e2c822";rule=addCSSRule("div.inviteLinkBox");rule.style.margin="10px 10px 10px 10px";rule.style.padding="10px 10px 10px 15px";rule.style.backgroundColor="#f7f7f7";rule.style.fontSize="12px";rule.style.borderrule="solid";rule.style.borderWidth="1px";rule.style.borderColor="#7f93bc";rule=addCSSRule("#mainInviteRequest");rule.style.cursor="pointer";rule=addCSSRule(".myMobNumUsers");rule.style.color="#FF0000";rule.style.fontStyle="italic";rule.style.fontSize="15px";rule=addCSSRule(".invitationsView");rule.style.color=GBL.STYLES.text["color"];rule=addCSSRule(".invitationsViewEmptyPage");rule.style.color="#AAAAAA";rule=addCSSRule(".invitationsViewNumFriends");rule.style.color="#00FF00";rule.style.fontWeight="bold";rule=addCSSRule(".invitationsViewPickableCell");rule.style.margin="0px 0px 0px 0px";rule.style.padding="8px 8px 8px 8px";rule.style.backgroundColor=GBL.STYLES.text["color"];rule.style.color="black";rule.style.fontSize="12px";rule.style.fontWeight="500";rule.style.verticalAlign="top";rule.style.textAlign="left";rule.style.borderrule="solid";rule.style.borderWidth="1px";rule.style.borderColor="#AAAAAA";rule.style.align="CENTER";rule.style.cursor="pointer";rule=addCSSRule(".invitationsViewUnpickableCell");rule.style.padding="8px";rule.style.color="#FFFFFF";rule.style.color="#FFFFFF";rule.style.fontSize="12px";rule.style.fontWeight="bold";rule.style.verticalAlign="top";rule.style.border="solid 1px #555555";rule.style.align="CENTER";rule=addCSSRule(".invitationsViewFriendStatus");rule.style.color="#555555";rule.style.fontStyle="italic";rule.style.fontWeight="bold";rule=addCSSRule(".invitationsViewFriendStatusMember");rule.style.color="#238E68";rule.style.fontWeight="bold";rule=addCSSRule(".invitationsViewShortName");rule.style.color="#FFFFFF";rule.style.fontWeight="bold";rule=addCSSRule(".invitationsViewInviteNotPartText");rule.style.color="#FFFFFF";rule=addCSSRule(".invitationsViewSelectRandomTen");rule.style.fontSize="12px";rule.style.textDecoration="underline";rule.style.color="#3b5998";rule.style.cursor="pointer";rule=addCSSRule(".invitationsViewClearSelected");rule.style.fontSize="12px";rule.style.textDecoration="underline";rule.style.color="#3b5998";rule.style.cursor="pointer";addCSSRule(".requestNameDiv",{color:"#88BBEE",textAlign:"center",fontSize:"12px",fontWeight:"bold",padding:"3px",cursor:"pointer"});addCSSRule(".requestAcceptDiv",{color:"#88BBEE",cursor:"pointer"});addCSSRule(".requestRejectDiv",{color:"#88BBEE",cursor:"pointer"});rule=addCSSRule(".faq");rule.style.padding="15px";rule.style.color=GBL.STYLES.text["color"];rule=addCSSRule(".myCharacterSkillPoints");rule.style.color=GBL.STYLES.text["color"];rule.style.margin="15px";rule.style.padding="5px";rule.style.border="solid 1px white";rule=addCSSRule(".myCharacterAttributesTable");rule.style.marginLeft="15px";rule.style.marginRight="15px";rule.style.borderSpacing="6px";rule=addCSSRule(".myCharacterChooserDiv");rule.style.padding="15px";rule.style.textAlign="center";rule=addCSSRule(".myCharacterAttributeName");rule.style.color=GBL.STYLES.text["color"];rule=addCSSRule(".myCharacterAttributeScore");rule.style.color=GBL.STYLES.text["color"];rule=addCSSRule(".myCharacterAttributeDescription");rule.style.color=GBL.STYLES.text["color"];rule=addCSSRule(".myCharacterAttributeDescriptionNote");rule.style.color="#ccc";rule=addCSSRule(".myCharacterInsufficientSkillPoints");rule.style.fontSize="12px";rule.style.color="#8C7853";rule=addCSSRule(".savedGameMobName");rule.style.color="#FFA500";rule.style.fontWeight="bold";rule=addCSSRule(".savedGameMobLevel");rule.style.color="#EEEEEE";rule.style.fontWeight="bold";rule=addCSSRule(".savedGameMobLevel");rule.style.color=GBL.STYLES.text["color"];rule=addCSSRule(".saveGameStartNewGame");rule.style.color="#eeeeee";rule.style.fontStyle="italic";rule.style.fontSize="12px";rule=addCSSRule(".myCharacterLoadGameMessage");rule.style.color="#EEEEEE";rule.style.fontSize="12px";rule.style.width="500px";rule=addCSSRule(".madeMenWeeklyNav");rule.style.textAlign="right";rule.style.width="100%";rule.style.marginTop="-16px";rule.style.fontSize="12px";rule.style.color=GBL.STYLES.text["color"];rule=addCSSRule(".madeMenWeeklyNavLink");rule.style.textDecoration="none";rule.style.color=GBL.STYLES.text["color"];rule=addCSSRule(".madeMenUpdatesMsg");rule.style.color="#888888";rule.style.padding="0px 0px 0px 0px";rule.style.fontSize="10px";rule.style.textAlign="right";rule=addCSSRule(".madeMenMobName");rule.style.color="#3E99C3";rule.style.fontWeight="bold";rule.style.fontSize="12px";rule=addCSSRule(".madeMenStat");rule.style.color=GBL.STYLES.text["color"];rule.style.padding="0px 10px 0px 10px";rule.style.fontSize="12px";rule.style.paddingTop="2px";rule.style.paddingBottom="2px";rule=addCSSRule(".madeMenRegionUnhighlighted");rule.style.color="#3E99C3";rule.style.fontSize="12px";rule.style.fontWeight="bold";rule.style.textAlign="left";rule.style.cursor="pointer";rule.style.backgroundColor="transparent";rule.style.border="none";rule.style.paddingLeft="0px";rule=addCSSRule(".madeMenRegionHighlighted");rule.style.color="#333333";rule.style.fontSize="14px";rule.style.fontWeight="bold";rule.style.textAlign="left";rule.style.cursor="pointer";rule.style.backgroundColor=GBL.STYLES.text["color"];rule.style.borderLeft="solid 1px #555555";rule.style.borderTop="solid 1px #555555";rule.style.borderBottom="solid 1px #555555";rule.style.paddingLeft="6px";rule=addCSSRule(".madeMenInsufficientPlayers");rule.style.color="#B5A642";rule.style.fontSize="12px";rule.style.fontWeight="bold";rule=addCSSRule(".subTabUnselected");rule.style.cursor="pointer";rule.style.padding="3px 10px 3px 10px";rule.style.backgroundColor="#000000";rule.style.color="#aaaaaa";rule.style.fontWeight="normal";rule.style.borderTop="solid 1px #555555";rule.style.borderLeft="solid 1px #555555";rule.style.borderRight="solid 1px #555555";rule.style.borderBottom="solid 1px #555555";rule=addCSSRule(".subTabSelected");rule.style.padding="3px 10px 3px 10px";rule.style.backgroundColor="#000000";rule.style.color="#CD7F32";rule.style.fontWeight="bold";rule.style.borderTop="solid 1px #555555";rule.style.borderLeft="solid 1px #555555";rule.style.borderRight="solid 1px #555555";rule.style.borderBottom="none";rule=addCSSRule(".myStatsTitle");rule.style.color="#FFFFFF";rule.style.marginLeft="50px";rule.style.textAlign="left";rule.style.fontSize="20px";rule.style.fontWeight="bold";rule=addCSSRule(".myStatsSubtitle");rule.style.fontSize="12px";rule.style.fontWeight="bold";rule.style.paddingLeft="5px";rule.style.paddingRight="5px";rule.style.verticalAlign="bottom";rule=addCSSRule(".myStatsSubtitleLink");rule.style.fontSize="12px";rule.style.fontWeight="bold";rule.style.paddingLeft="5px";rule.style.paddingRight="5px";rule.style.verticalAlign="bottom";rule.style.color="#88BBEE";rule.style.cursor="pointer";rule=addCSSRule(".myStatsReportInappropriateName");rule.style.color="#777777";rule.style.cursor="pointer";rule.style.fontSize="11px";rule.style.fontWeight="normal";rule=addCSSRule(".myStatsReportInappropriateNameSuccess");rule.style.color=GBL.STYLES.text["color"];rule.style.paddingRight="20px";rule=addCSSRule(".myStatsInMobStatus");rule.style.color=GBL.STYLES.text["color"];rule=addCSSRule(".myStatsStatTitle");rule.style.color=GBL.STYLES.text["color"];rule=addCSSRule(".myStatsStatValue");rule.style.color=GBL.STYLES.text["color"];rule=addCSSRule(".myStatsAchievementReason");rule.style.color=GBL.STYLES.text["color"];rule.style.textAlign="left";rule.style.padding="5px";rule.style.margin="8px";rule.style.border="1px solid #888888";rule.style.fontSize="11px";rule.style.fontFamily="lucida grande,tahoma,verdana,arial,sans-serif";rule=addCSSRule(".statsBarReloadTimer");rule.style.position="absolute";rule.style.left="5px";rule.style.width="70px";rule.style.bottom=IE?"25px":"21px";rule.style.fontSize="11px";rule.style.color="rgb(212,212,212)";rule.style.whiteSpace="nowrap";rule=addCSSRule(".commentsCommentBlock");rule.style.fontSize="9px";rule.style.color="rgb(255,00,00)";rule.style.cursor="pointer";rule=addCSSRule(".commentsSectionTitle");rule.style.color="#FFA500";rule.style.fontSize="14px";rule.style.fontWeight="bold";rule=addCSSRule(".commentsCommentAuthor");rule.style.color="#FFA500";rule.style.fontSize="14px";rule.style.fontWeight="bold";rule=addCSSRule(".commentsCommentTimeAgo");rule.style.color="#FFFFFF";rule.style.fontSize="11px";rule.style.fontWeight="bold";rule.style.paddingLeft="5px";rule=addCSSRule(".commentsCommentDelete");rule.style.color="#777777";rule.style.fontSize="14px";rule.style.fontWeight="bold";rule=addCSSRule(".commentsConfirmBlock");rule.style.color=GBL.STYLES.text["color"];rule.style.padding="5px";rule.style.display="none";rule.style.fontSize="11px";rule.style.border="1px solid #555555";rule=addCSSRule(".titleTableDiv");rule.style.borderBottom="solid 1px #777777";rule.style.textAlign="left";rule=addCSSRule(".titleTableTD");rule.style.textAlign="left";rule.style.fontSize="20px";rule.style.fontWeight="bold";rule.style.color=GBL.STYLES.text["color"];rule=addCSSRule(".subTitleTableDiv");rule.style.textAlign="left";rule.style.borderBottom="solid 1px #777777";rule=addCSSRule(".subTitle");rule.style.fontSize="14px";rule=addCSSRule(".titleDivOption");rule.style.color=GBL.STYLES.text["color"];rule.style.fontSize="12px";rule.style.fontWeight="bold";rule.style.paddingLeft="5px";rule.style.paddingRight="5px";rule.style.verticalAlign="bottom";rule=addCSSRule(".clickableTitleDivOption");rule.style.color="#88BBEE";rule.style.fontSize="12px";rule.style.fontWeight="bold";rule.style.paddingLeft="5px";rule.style.paddingRight="5px";rule.style.verticalAlign="bottom";rule.style.cursor="pointer";rule=addCSSRule("a.paginationProgressionLink:link");rule.style.margin="0px 2px 0px 2px";rule.style.color="#3b5998";rule.style.fontSize="11px";rule.style.textDecoration="underline";rule=addCSSRule("a.paginationProgressionLink:visited");rule.style.margin="0px 2px 0px 2px";rule.style.color="#3b5998";rule.style.fontSize="11px";rule.style.textDecoration="underline";rule=addCSSRule("a.paginationProgressionLink:hover");rule.style.margin="0px 2px 0px 2px";rule.style.color="#3b5998";rule.style.fontSize="11px";rule.style.textDecoration="underline";rule=addCSSRule("a.paginationPageNum:link");rule.style.margin="0px 2px 0px 2px";rule.style.color="#3b5998";rule.style.fontSize="11px";rule.style.textDecoration="underline";rule=addCSSRule("a.paginationPageNum:visited");rule.style.margin="0px 2px 0px 2px";rule.style.color="#3b5998";rule.style.fontSize="11px";rule.style.textDecoration="underline";rule=addCSSRule("a.paginationPageNum:hover");rule.style.margin="0px 2px 0px 2px";rule.style.color="#3b5998";rule.style.fontSize="11px";rule.style.textDecoration="underline";rule=addCSSRule("span.paginationCurPageNum");rule.style.margin="0px 2px 0px 2px";rule.style.color="#3b5998";rule.style.fontSize="11px";rule=addCSSRule(".dataTable");rule=addCSSRule(".dataTableHeader");rule.style.borderLeft="solid 1px #AAAAAA";rule.style.borderTop="solid 1px #AAAAAA";rule.style.borderRight="solid 2px #454545";rule.style.borderBottom="solid 2px #454545";rule.style.padding="6px";rule.style.color=GBL.STYLES.text["color"];rule.style.fontSize="11px";rule.style.fontWeight="bold";rule.style.textAlign="left";rule.style.fontVariant="small-caps";rule=addCSSRule(".coloredDiv");rule.style.color=GBL.STYLES.text["color"];rule.style.textAlign="left";addCSSRule(".mission_container",{padding:"15px",textAlign:"center"});addCSSRule(".mission_requirement",{color:GBL.STYLES.text["color"],textAlign:"left"});addCSSRule(".mission_requirement_unit",{fontSize:"12px",color:"rgb(204, 204, 204)"});addCSSRule(".mission_reward",{color:GBL.STYLES.text["color"],textAlign:"left"});addCSSRule(".mission_reward_unit",{fontSize:"12px",color:"rgb(204, 204, 204)"});rule=addCSSRule(".secondaryItemDiv");rule.style.color=GBL.STYLES.text["color"];rule.style.padding="3px";rule.style.textAlign="left";rule=addCSSRule("div.messageBox");rule.style.margin="20px 10px 10px 10px";rule.style.padding="10px 10px 10px 15px";rule.style.backgroundColor="#fff9d7";rule.style.fontSize="20px";rule.style.fontWeight="bold";rule.style.borderrule="solid";rule.style.borderWidth="1px";rule.style.borderColor="#e2c822";rule.style.overflow="auto";rule=addCSSRule(".itemListItemNum");rule.style.paddingLeft="11px";rule.style.color=GBL.STYLES.text["color"];rule.style.verticalAlign="middle";rule.style.fontWeight="bold";rule=addCSSRule(".itemListItemDesc");rule.style.color=GBL.STYLES.text["color"];rule.style.fontSize="11px";rule.style.textAlign="center";rule=addCSSRule(".loadingMessage");rule.style.color="#FF6F00";rule.style.fontWeight="bold";rule.style.fontSize="18px";rule=addCSSRule(".centeredLoadingMessage");rule.style.color="#FF6F00";rule.style.fontWeight="bold";rule.style.fontSize="18px";rule.style.textAlign="center";rule=addCSSRule(".subTabUnselected");rule.style.cursor="pointer";rule.style.padding="3px 10px 3px 10px";rule.style.backgroundColor="#000000";rule.style.color="#aaaaaa";rule.style.fontWeight="normal";rule.style.borderTop="solid 1px #555555";rule.style.borderLeft="solid 1px #555555";rule.style.borderRight="solid 1px #555555";rule.style.borderBottom="solid 1px #555555";rule=addCSSRule(".subTabSelected");rule.style.padding="3px 10px 3px 10px";rule.style.backgroundColor="#000000";rule.style.color="#CD7F32";rule.style.fontWeight="bold";rule.style.borderTop="solid 1px #555555";rule.style.borderLeft="solid 1px #555555";rule.style.borderRight="solid 1px #555555";rule.style.borderBottom="none";rule=addCSSRule(".centeredMessage");rule.style.backgroundColor="#f7f7f7";rule.style.marginLeft="auto";rule.style.marginRight="auto";rule.style.padding="5px 5px 5px 10px";rule.style.color="#333333";rule.style.borderStyle="solid";rule.style.borderWidth="1px";rule.style.borderColor="#7f93bc";rule=addCSSRule(".textMessage");rule.style.backgroundColor="#fff9d7";rule.style.margin="5px 10px 10px 10px";rule.style.padding="5px 5px 5px 10px";rule.style.color="#333333";rule.style.borderStyle="solid";rule.style.borderWidth="1px";rule.style.borderColor="#e2c822";rule=addCSSRule(".pipeDivider");rule.style.fontSize="15px";rule.style.color=GBL.STYLES.text["color"];rule.style.padding="0px 10px 0px 10px";addCSSRule(".job_flavor_text",{color:"rgb(227,227,227)",fontSize:"13px",paddingLeft:"5px",paddingTop:"2px",paddingBottom:"2px"});addCSSRule(".skill_point_val",{fontWeight:"bold",color:"#FF7F00"});addCSSRule(".favor_point_val",{fontWeight:"bold",color:"#FF7F00"});addCSSRule(".hired_gun_val",{fontWeight:"bold",color:"#FF7F00"});addCSSRule(".mastery_level",{position:"relative",color:"#DDDDDD",fontSize:"12px",fontWeight:"bold",fontStyle:"italic"});addCSSRule(".playdomPromo",{border:"0",position:"absolute",right:"10",top:"3"});addCSSRule(".click",{cursor:"pointer"});addCSSRule(".left",{"float":"left"});addCSSRule(".right",{"float":"right"});addCSSRule(".CCBillForm",{"text-align":"left",margin:IE?"6px 0px 0px 0px":"8px 0px 0px 0px"});addCSSRule(".CCBillTitleSpan",{"font-size":"18px","font-weight":"bold",color:((isValid(GBL.CCBill.color)&&isValid(GBL.CCBill.color))?GBL.CCBill.color:"white")});addCSSRule(".CCBillCardImage",{"vertical-align":"middle",width:"167px",height:"20px"});addCSSRule(".CCBillInstantCreditSpan",{color:((isValid(GBL.CCBill.color)&&isValid(GBL.CCBill.color))?GBL.CCBill.color:"white")});addCSSRule(".huge_quote",{fontStyle:"italic",fontWeight:"bold"});addCSSRule(".attackReportInappropriateStatus",{color:"#777777",cursor:"pointer",fontSize:"11px",fontWeight:"normal"});addCSSRule(".avatarOnlyTag",{color:"#ffd700"});rule=addCSSRule(".commentsCommentUnblock");rule.style.color="rgb(255,255,255)";rule.style.cursor="pointer";addCSSRule(".propertyGrid .header",{padding:"0px",clear:"both",fontSize:"22px",color:"white",fontFamily:"serif",fontVariant:"small-caps"});addCSSRule(".propertyGrid .city_list .city_info .landPermitAvailable",{color:"#FF7F00",fontSize:"16px",fontWeight:"bold"});addCSSRule(".featureContainer .propertyGrid .header",{backgroundColor:"#610E0E",fontSize:"16px",textAlign:"left",padding:"3px",paddingLeft:"10px"});addCSSRule(".featureContainer .propertyGrid .header hr",{display:"none"});addCSSRule(".vEvenSpacing",{margin:"10px 0px"});addCSSRule(".topSpacing",{margin:"10px 0px 0px 0px"});addCSSRule(".bottomSpacing",{margin:"0px 0px 10px 0px"});addCSSRule(".weaponContainer",{overflowY:"auto",overflowX:"hidden",height:"5000px"});var rule=addCSSRule(".hotTipContentDiv");rule.style.padding="0px";rule=addCSSRule(".landPrice");rule.style.fontSize="16px";addCSSRule("table.class_chooser",{margin:"auto",borderSpacing:"0px",cellSpacing:"0px",borderCollapse:IE?"collapse":""});addCSSRule("table.class_chooser td",{border:"1px solid #333333"});addCSSRule("span.gala_container",{color:"#FFFFFF"});rule=addCSSRule(".statContentTD");try{rule.style.background=(isIE6()?"black":"url(http://cdn0.mobwarsapp.com/rpg_images/opensocial/mob/ui/fade.png)")}catch(e){rule.style.background="black"}addCSSRule(".fightListCell",{color:GBL.STYLES.text["color"],padding:"15px 5px 15px 5px",cursor:"pointer"});addCSSRule(".fightListCellNew",{color:GBL.STYLES.text["color"],padding:"5px 15px 5px 15px",cursor:"pointer",borderBottom:"1px dotted #222"});addCSSRule(".fightListMobNameBig",{color:"#3E99C3",fontSize:"19px",cursor:"pointer"});addCSSRule(".fightListCellLevel",{color:GBL.STYLES.text["color"],width:"70px",fontSize:"12px",paddingLeft:"10px"});addCSSRule(".hitListCell",{color:GBL.STYLES.text["color"],padding:"6px 10px 6px 10px",fontSize:"12px"});addCSSRule(".hitListClickableCell",{color:GBL.STYLES.text["color"],padding:"6px 10px 6px 10px",cursor:"pointer",fontSize:"12px"});addCSSRule(".buttonBlueText",{fontSize:"14px"});addCSSRule("table.city_list",{borderSpacing:"0px",cellSpacing:"0px",borderCollapse:IE?"collapse":""});addCSSRule("table.city_list td.city_info",{textAlign:"center",width:"200px",border:"solid 1px #555555",borderBottom:"none"});addCSSRule("table.city_list td.city_info img",{margin:"5px 10px"});addCSSRule("table.city_list td.city_buy_sell",{width:"200px",border:"solid 1px #555555",borderTop:"none"});addCSSRule("table.dataTable",{borderSpacing:"0px",cellSpacing:"0px",borderCollapse:"collapse"});addCSSRule("td.dataTableHeader",{backgroundColor:"rgb(53,24,24)",borderLeft:"0px solid #AAAAAA",borderTop:"0px solid #AAAAAA",borderRight:"0px solid #AAAAAA",borderBottom:"0px solid #AAAAAA",padding:"6px",color:GBL.STYLES.text["color"],fontSize:"12px",fontWeight:"normal",textAlign:"left"});addCSSRule("table.stats td",{fontSize:"12px",paddingTop:"4px",paddingBottom:"6px"});addCSSRule("table.stats td.dataTableHeader",{fontSize:"14px",padding:"2px",paddingLeft:"0px"});addCSSRule(".statsBarReloadTimer",{position:"absolute",left:"35px",width:"100px",bottom:IE?"27px":"4px",fontSize:"11px",color:"rgb(212,212,212)"});addCSSRule(".myCharacterAttributeDescription",{color:GBL.STYLES.text["color"],fontSize:"12px"});addCSSRule(".myCharacterInsufficientSkillPoints",{fontSize:"12px",color:"#8C7853"});addCSSRule(".limitedEditionHighlight",{color:"#d0d040"});addCSSRule(".privacy_link",{fontSize:"11px",color:"#AAAAAA",cursor:"pointer",position:"absolute",left:"905px",top:"12px"});addCSSRule(".job_flavor_text",{color:"rgb(227,227,227)",fontSize:"13px",paddingLeft:"5px",paddingTop:"6px",paddingBottom:"6px",textAlign:"left"});addCSSRule("table.itemTable",{borderSpacing:"0px",cellSpacing:"0px",borderCollapse:IE?"collapse":"",paddingTop:"3px",paddingBottom:"3px",marginTop:"3px",marginBottom:"3px"});addCSSRule("td.gridItemCell",{width:"265px",margin:"0px",padding:"0px",textAlign:"center",border:"1px solid #222222",backgroundColor:"black"});addCSSRule(".favorOfferQtyRemaining",{color:"#AA0000"});addCSSRule(".itemRemaining",{color:"#FFFFFF"});addCSSRule(".itemFavorPrice",{fontSize:"14px"});addCSSRule("table.fightResultTable",{fontFamily:"tahoma,verdana,arial,sans-serif"});addCSSRule(".mastery_result_container",{paddingTop:"20px",paddingBottom:"0px"});addCSSRule(".statusTable",{left:"40px",top:"8px",borderCollapse:"separate",borderSpacing:"3px 3px",position:"absolute"});addCSSRule(".statCellCash",{width:"190"});addCSSRule(".AvatarIconContainer",{width:"55px",height:"120px",position:"absolute",right:"145px",zIndex:"5",backgroundColor:"#000000"});addCSSRule(".AvatarIcon",{width:"75px",height:"120px",zIndex:"4"});addCSSRule(".AvatarPortraitIcon",{width:"40",height:"42",backgroundRepeat:"no-repeat",backgroundPosition:"-20 5"});addCSSRule(".AvatarStatsIcon",{width:"80px",height:"180px"});addCSSRule(".AvatarImage",{width:"160px",height:"360px"});addCSSRule(".CloseAvatarImage",{color:"#ffffff",textAlign:"center",fontSize:"10pt"});addCSSRule(".avatarIntro",{padding:"10px 0px"});addCSSRule(".avatarPickerTitle",{padding:"0px 0px 10px 20px"});addCSSRule(".CCBill_container .CCBillCardImage",{"margin-bottom":"5px"});addCSSRule(".CCBill_container .CCBillTitleSpan",{color:"#ff7f00","font-weight":"bold"});addCSSRule(".CCBill_container .buttonDiv",{top:"20px"});if(IE){addCSSRule(".CCBill_container .CCBillSelect",{"font-family":"helvetica"})}addCSSRule(".SuggestedRequiredMission",{color:"#fbf484"});addCSSRule(".featuredItemContainer",{margin:"5px 0px"});addCSSRule(".featuredItemTitleContainer",{width:"210px"});addCSSRule(".featuredItemTitle",{color:"#ffffff",fontWeight:"bold",fontSize:"16px",marginTop:"10px"});addCSSRule(".featuredContainer",{borderWidth:"2px",borderColor:"#731910",borderStyle:"none solid solid solid"});addCSSRule(".blackMarketExplanation",{color:"white",textAlign:"left",backgroundColor:"#222222",padding:"10px"});addCSSRule(".huge_quote",{fontStyle:"italic",fontWeight:"bold",fontSize:"20px",paddingLeft:"0px",paddingRight:"10px"});addCSSRule(".myStatsTitle",{color:"#ffa500",marginLeft:"50px",textAlign:"left",fontSize:"20px",fontWeight:"bold"});addCSSRule(".fight_result_user_message",{color:"#ffface",fontStyle:"italic"});addCSSRule(".fightListMobStatusMessage",{color:"#ffface",fontStyle:"italic",padding:"2px",fontSize:"11px",whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden"});addCSSRule(".user_status_message_one_line .message_span",{color:"#FFFACE",fontSize:"12px",fontStyle:"italic",fontWeight:"normal",padding:"2px 5px 2px 5px"});addCSSRule(".user_status_message_one_line .change_status_button",{color:"#777777",cursor:"pointer",fontSize:"11px",fontWeight:"normal"});addCSSRule("div.user_status_message_control",{color:"white",backgroundColor:"black",padding:"10px"});addCSSRule("div.user_status_message_control table",{width:"100%",color:"white",padding:"5px"});addCSSRule("div.user_status_message_control table td",{paddingTop:"10px",paddingBottom:"10px"});addCSSRule("div.user_status_message_control table td:first-child",{color:"#88BBEE",textAlign:"right"});addCSSRule(".enhancementPrefix",{color:"#00FF00",fontStyle:"italic",fontSize:"14px"});addCSSRule(".enhancementValue",{color:"#00FF00",fontStyle:"italic",fontSize:"14px"});addCSSRule(".enhancementSuffix",{color:"#AAAAAA",marginLeft:"4px",fontSize:"12px"});addCSSRule(".gridEnhancementPrefix",{color:"#00FF00",fontStyle:"italic",fontSize:"14px"});addCSSRule(".gridEnhancementValue",{color:"#00FF00",fontStyle:"italic",fontSize:"14px"});addCSSRule(".gridEnhancementSuffix",{color:"#AAAAAA",marginLeft:"4px",fontSize:"12px"});addCSSRule(".privacySettingsText",{color:"white"});addCSSRule(".avatarItemEarned",{color:"#FFA500"});addCSSRule(".crate",{color:"white",textAlign:"left",fontWeight:"bold"});addCSSRule(".crate .title",{fontSize:"13px"});addCSSRule(".crate .text",{fontSize:"13px",marginLeft:"4px"});addCSSRule(".crate .none_so_far",{fontSize:"11px",fontWeight:"normal",padding:"10px",textAlign:"center"});addCSSRule(".crate .number_so_far",{fontSize:"11px",marginTop:"10px",textAlign:"center"});addCSSRule(".crate .number",{color:"#FF0033"});addCSSRule(".crate .crate_list",{textAlign:"center"});addCSSRule(".crate .crate_list img",{margin:"5px"});addCSSRule(".image_column",{textAlign:"center",paddingTop:"20px"});addCSSRule(".crates_column",{verticalAlign:"top",paddingTop:"10px"});addCSSRule(".crates_column img",{width:"120px"});addCSSRule(".image_column .crate_item",{backgroundColor:"white",border:"1px solid #aac6dc"});addCSSRule(".image_column .crate_item",{backgroundColor:"white",border:"1px solid #aac6dc"});addCSSRule(".message_column .opened",{backgroundColor:"white",border:"1px solid #aac6dc"});addCSSRule(".message_column .crate_list img",{marginTop:"10px",marginLeft:"2px",height:"35px"});addCSSRule(".message_column .crate_count",{color:"#FF0033"});function getUploadDestionationURL(){var a=""+GBL.MAIN_DATA.getViewer().getUserId()%10;return UPLOAD_DESTINATION_URL.replace("{0}",a)}function getCDNRequestDestinationURL(){if(isDebugging()){return REQUEST_DESTINATION_URL}else{return"http://cdn-mob-dynamic.mobwarsapp.com/mob"}}function showHospital(){var b=document.createElement("div");var c=document.createElement("div");new MobHospitalDiv(c);var a=new PDDialog(b,c,600,500,{backgroundColor:"#000000"},function(){});a.showDialog()}function ResultDiv(a){this.m_parentDiv=a;this.m_containerDiv=undefined;this.m_xmlDoc=undefined;this.createDiv()}ResultDiv.prototype.setXMLDoc=function(a){this.m_xmlDoc=a};ResultDiv.prototype.showSuccessFailMessage=function(b){if(isValid(b)){var a=makeElement("div",this.m_containerDiv,{color:"#FF7F00",fontSize:"14px",fontWeight:"bold",textAlign:"left"});a.innerHTML=b?"Eccellente!":"Insuccesso:"}};ResultDiv.prototype.getContainerDiv=function(){return this.m_containerDiv};ResultDiv.prototype.createDiv=function(){this.m_containerDiv=makeElementClass("div",this.m_parentDiv,"resultDiv");setStyle(this.m_containerDiv,{color:"white",padding:"10px 5px 5px 20px",border:"solid 1px #CCCCCC",display:"none",textAlign:"left"})};ResultDiv.prototype.hideMessage=function(){$(this.m_containerDiv).html("");$(this.m_containerDiv).css("display","block")};ResultDiv.prototype.showCustomContent=function(b,a){this.hideMessage();this.showSuccessFailMessage(b);this.m_containerDiv.appendChild(a)};ResultDiv.prototype.showMessage=function(D,h,t,j,s){var c=[];try{var u=parseBoolean(getXMLNodeValue(this.m_xmlDoc,"is_crate_reward"))}catch(k){}var g="http://cdn0.mobwarsapp.com/rpg_images/opensocial/mob/ui/crates/opencrate_lrg.png";if(u){c.splice(0,0,g)}this.hideMessage();this.showSuccessFailMessage(D);var a=new SideBySide3Cells(this.m_containerDiv);var b=a.getLeftCell();$(b).addClass("image_column");if(u){$(b).addClass("crates_column")}if(isValid(j)){var x=makeElement("img",b);if(u){$(x).addClass("crate_item")}x.src=j}for(var B=0;B<c.length;B++){var o=document.createElement("div");x=makeElement("img",o);b.appendChild(o);x.src=c[B]}var z=a.getMiddleCell();$(z).addClass("message_column");z.style.color="#FFFFFF";z.style.textAlign="left";z.style.padding="8px";setInnerHTML(z,h);if(u){var d=new CrateInfo(getXMLFirstNode(this.m_xmlDoc,"crate_info")).getData();var C="http://cdn0.mobwarsapp.com/rpg_images/opensocial/mob/ui/crates/large/";var m=makeElement("tr",makeElement("tbody",makeElement("table",makeElementClass("div",z,"crate_list"))));var l=makeElement("tr",makeElement("tbody",makeElement("table",makeElementClass("div",z,"crate_list"))));var w;var v=0;var n=4;jQuery.each(d.crateItems,function(H,G){w=(v<n)?m:l;v++;if(G.getNumOwned()>0){$(makeElementClass("img",makeElement("td",w),"opened left")).attr("src",G.getImageURL())}else{$(makeElementClass("img",makeElement("td",w),"closed left")).attr("src",C+(H+1)+".png")}})}try{var q=getXMLFirstNode(this.m_xmlDoc,"collectionCompleted");var f=getXMLList(getXMLFirstNode(q,"rewardItems"),"item",makeRPGItem);if(f.length>0){var p=makeElement("tr",makeElement("tbody",makeElement("table",makeElementClass("div",z,"crate_completed"))));$(makeElementClass("img",makeElement("td",p),"opened left")).attr("src",f[0].getImageURL());$(makeElementClass("div",makeElement("td",p),"left",{color:"white"})).html("<b>Congratulations!</b> You have collected all "+d.crateItems.length+" items!The Godfather is very impressed and awards you the "+f[0].getName()+" Bonus Item!")}}catch(A){}if(isValid(s)){makeElement("br",z);z.appendChild(s)}try{if(isValid(t)){var F=a.getRightCell();var r=getXMLEncodedStringNodeValue(t,"button_text");F.style.padding="0px";F.style.textAlign="right";F.style.width="290px";var E=getXMLEncodedStringNodeValue(t,"subject");var y=getXMLEncodedStringNodeValue(t,"body_html");new DivButton(F,r,function(){postToBulletin(GBL.MAIN_DATA.getViewer(),E,y,function(){})})}}catch(k){outputDebug("Result Div showMessage "+k)}};function MobHotTipDiv(a){MobHotTipDiv.baseConstructor.call(this,a)}extendClass(MobHotTipDiv,HotTipDiv);MobHotTipDiv.prototype.initialize=function(){this.m_inviteTipText="A bigger mob is a more powerful mob!";this.m_inviteNotPartText="is not part of your mob";this.m_hotTipNameCellWidth=undefined;this.m_groupName="mob";this.m_inviteOtherFriendsTabIndex=9;this.m_inviteNameMaxLength=8};MobHotTipDiv.prototype.createDiv=function(){this.m_containerDiv=makeElementClass("div",this.m_parentDiv,"hotTipContainer");this.showPokerPalace(this.m_containerDiv);var a=makeElementClass("div",this.m_containerDiv,"hotTipSectionTitle");a.innerHTML="<span id='hotTipSubtitle'></span>";this.m_contentDiv=makeElementClass("div",this.m_containerDiv,"hotTipContentDiv");this.showDefaultHotTip(this.m_contentDiv)};MobHotTipDiv.prototype.showPokerPalace=function(b){if(!GBL.MAIN_DATA.getIsViewerPPUser()){return}var a=makeElementClass("div",b,"hotTipPokerPalace");a.innerHTML="Looking for <img style='vertical-align:middle;' src='http://cdn0.pokerpartyapp.com/prod_poker/img/js/PokerPalaceLogo2.gif'/>? Click Here!";addEvent(a,"click",function(){try{window.open("http://profile.myspace.com/Modules/Applications/Pages/Canvas.aspx?appId=109588")}catch(c){}})};MobHotTipDiv.prototype.showDefaultHotTip=function(a){var c=undefined;var b=Math.random();if(b<=0.5){c="<span class='tipTitle'> TIP: The Bigger the Family, the better! </span> <div style='padding-left:10px;'> A bigger mob family will make you more <b>powerful in fights</b> and give you access to <b>more lucrative missions</b>. <a href='#' class='standardLink' onclick='switchTabs(9); return false;'>Click here to invite more friends</a> to join your mob family! </div>"}else{if(b<0.8){c="<span class='tipTitle'> TIP: Dust yourself off and try again. </span> <div style='padding-left:10px;'>Want to try again with a different Mobster class? With our new save/load game feature you can create up to 3 mobster characters under one MySpace account which will share favor points and mob members. <a href='#' class='standardLink' onclick='switchTabs(10); return false;'>Click here</a> to check it out!</div>"}else{c="<span class='linkableTipTitle' onclick='window.open(\"http://profile.myspace.com/Modules/Applications/Pages/Canvas.aspx?appId=123150&track=mobsters_hottip\");return false;'>Thirsty for blood...? Join the Cabal! </a> </span><br><div style='padding-left:10px;'>Victims await you in Nightfall: Bloodlines. Prey upon the innocent, develop your evil powers, and build your Clan to rule the underworld. <a onclick='window.open(\"http://profile.myspace.com/Modules/Applications/Pages/Canvas.aspx?appId=123150&track=mobsters_hottip\");return false;' href='#' class='standardLink'>Click here</a> to play Bloodlines!</div>"}}a.innerHTML=c};function MobInventoryDiv(a){MobInventoryDiv.baseConstructor.call(this,a)}extendClass(MobInventoryDiv,InventoryDiv);MobInventoryDiv.prototype.fillFromXML=function(c){var j=undefined;if(isValid(c)){try{var f=c.getElementsByTagName("item");if(isValid(f)&&f.length>0){j=new Array();for(var b=0;b<f.length;b++){var h=new RPGItem(f[b]);if(h.getNumOwned()>0){var a=new Object();a.number=h.getNumOwned();a.type=h.getType();a.image_url=h.getImageURL();a.small_image_url=h.getSmallImageURL();a.name=h.getDetailsHTML();a.item_name=h.getName();j.push(a)}}}}catch(d){outputDebug("fillFromXML "+d)}}if(!isValid(j)||j.length==0){return}this.m_containerDiv.style.display="block";$(this.m_containerDiv).html("");var g=document.createElement("div");this.m_containerDiv.appendChild(g);createTitleDiv(g,this.m_title);var k=document.createElement("div");this.m_containerDiv.appendChild(k);createToggleItemsListDiv(k,j,6,true)};function MobJobInventoryDiv(a){MobJobInventoryDiv.baseConstructor.call(this,a)}extendClass(MobJobInventoryDiv,JobInventoryDiv);MobJobInventoryDiv.prototype.initialize=function(a){this.m_mobInventoryConstructor=MobInventoryDiv;this.m_mobJobListConstructor=MobJobListDiv};function MobStockPileDiv(a){MobStockPileDiv.baseConstructor.call(this,a)}extendClass(MobStockPileDiv,StockPileDiv);MobStockPileDiv.prototype.initialize=function(a){this.m_mobInventoryConstructor=MobEquipmentInventoryDiv;this.m_mobItemsConstructor=MobItemsDiv};function MobEquipmentInventoryDiv(b,c,a){MobEquipmentInventoryDiv.baseConstructor.call(this,b,c,a)}extendClass(MobEquipmentInventoryDiv,InventoryDiv);MobEquipmentInventoryDiv.prototype.fillFromXML=function(a){};GBL.MobsterItemSelectedTab="Weapons";function MobItemsDiv(b,c,a){this.m_tabHolder=undefined;this.m_weaponsContainer=undefined;this.m_armorContainer=undefined;this.m_vehicleContainer=undefined;this.m_explosivesContainer=undefined;this.m_explosivesTitle=undefined;this.m_explosivesTBody=undefined;this.m_henchmenTitle=undefined;this.m_henchmenContainer=undefined;this.m_henchmenTBody=undefined;this.m_blackMarketContainer=undefined;this.m_blackMarketTBody=undefined;this.m_blackMarketTitle=undefined;this.m_featuredItemsContainer=undefined;MobItemsDiv.baseConstructor.call(this,b,c,a)}extendClass(MobItemsDiv,ItemsDiv);MobItemsDiv.prototype.initialize=function(a){this.m_henchmenTitle="Henchmen";this.m_explosivesTitle="Explosives"};MobItemsDiv.prototype.fillCategoriesFromXML=function(g){var b=false;this.parseWeaponsData(g);this.fillCategory(g,"armor",this.m_armorTBody);this.fillCategory(g,"vehicle",this.m_vehicleTBody);if(!this.fillCategory(g,"henchmen",this.m_henchmenTBody)){this.l_categoryTabsDiv.removeTab(this.m_henchmenTitle);$(this.l_categoryTabsDiv.getTabTable()).css({backgroundImage:"url(http://cdn0.mobwarsapp.com/rpg_images/opensocial/mob/ui/tab/spacer.gif)"})}var c=getXMLFirstNode(g,"featured_items");if(isValid(c)){var k=new Array();var d=c.getElementsByTagName("item");for(var a=0;a<d.length;a++){var j=new RPGItem(d[a]);k.push(j)}if(d.length==0){this.l_tab_div.removeTab("Featured")}else{b=true}this.handleFeaturedItems(k)}else{this.l_tab_div.removeTab("Featured")}var f=getXMLFirstNode(g,"black_market");if(isValid(f)){var h=new Array();var d=f.getElementsByTagName("item");for(var a=0;a<d.length;a++){var j=new RPGItem(d[a]);h.push(j)}this.handleBlackMarketItems(h);if(d.length==0){this.l_tab_div.removeTab("BlackMarket")}}else{this.l_tab_div.removeTab("BlackMarket")}$(this.m_tabHolder).show();if(b){$(this.m_featured_tab_container).show();$(this.l_tab_div.getTabTable()).css({backgroundImage:"url(http://cdn0.mobwarsapp.com/rpg_images/opensocial/mob/ui/tab/spacer.gif)",textAlign:"right"});$(this.l_tab_div.getTabDiv()).css({padding:"5px 0px 0px 0px"})}};MobItemsDiv.prototype.parseWeaponsData=function(a){var c=getXMLFirstNode(a,"weapon");if(!isValid(c)){return false}var g=new Array();try{var b=c.getElementsByTagName("item");if(isValid(b)){for(var f=0;f<b.length;f++){g.push(new RPGItem(b[f]))}}}catch(h){}if(g.length==0){return false}var d=this;jQuery.each(g,function(j,k){d.m_items[k.getId()]=k;if(isValid(k.getCategory())&&k.getCategory().toLowerCase()=="explosive"){d.handleNormalItems(d.m_explosivesTBody,k)}else{if(isValid(k.getCategory())){d.handleNormalItems(d.m_weaponsTBody,k)}}})};MobItemsDiv.prototype.createDiv=function(j){this.m_parentDiv=j;this.m_containerDiv=makeElement("div",this.m_parentDiv);this.m_containerDiv.style.padding="15px";this.m_containerDiv.style.textAlign="center";var c=makeElement("div",this.m_containerDiv);createTitleDiv(c,this.m_titleText+": <span style='font-size:14px'> (Upkeep <span class='expensesTitleText'>$"+formatNumberWithCommas(GBL.MAIN_DATA.getViewer().getUpkeep())+"</span>)</span>");if(isValid(this.m_explanationText)){var b=createWhiteDiv(this.m_containerDiv);b.style.padding="5px";b.innerHTML=this.m_explanationText}this.m_featured_tab_container=makeElement("div",this.m_containerDiv,{paddingBottom:"10px"});var g=makeElement("div",this.m_featured_tab_container);var h=makeElement("div",this.m_featured_tab_container);this.m_featuredItemsContainer=makeElementClass("div",h,"featuredContainer");this.m_blackMarketContainer=makeElementClass("div",h,"featuredContainer");var k=new Array();k.push(new CustomTab("Featured",CustomTabDiv.imageTabDomFunc("http://cdn0.mobwarsapp.com/rpg_images/opensocial/mob/ui/tab/featuredup.jpg","http://cdn0.mobwarsapp.com/rpg_images/opensocial/mob/ui/tab/featureddown.jpg"),CustomTabDiv.showTabContentFunc(this.m_featuredItemsContainer,"featuredContainer"),CustomTabDiv.tabSelectedFunc("Featured","MobsterFeaturedSelectedTab",this),CustomTabDiv.tabUnselectedFunc()));k.push(new CustomTab("BlackMarket",CustomTabDiv.imageTabDomFunc("http://cdn0.mobwarsapp.com/rpg_images/opensocial/mob/ui/tab/blackmarketup.jpg","http://cdn0.mobwarsapp.com/rpg_images/opensocial/mob/ui/tab/blackmarketdown.jpg"),CustomTabDiv.showTabContentFunc(this.m_blackMarketContainer,"featuredContainer"),CustomTabDiv.tabSelectedFunc("BlackMarket","MobsterFeaturedSelectedTab",this),CustomTabDiv.tabUnselectedFunc()));this.l_tab_div=new CustomTabDiv(g,k);$(this.l_tab_div.getTabTable()).css({backgroundImage:"url(http://cdn0.mobwarsapp.com/rpg_images/opensocial/mob/ui/tab/spacer.gif)",textAlign:"right"});$(this.l_tab_div.getTabDiv()).css({padding:"5px 0px 0px 0px"});$(".featuredContainer").hide();this.l_tab_div.selectTabByName("Featured");this.m_missionHolder=makeElement("div",this.m_containerDiv);this.m_tabHolder=makeElement("div",this.m_containerDiv);var l=makeElement("div",this.m_tabHolder);var m=makeElement("div",this.m_tabHolder);this.m_weaponsContainer=makeElementClass("div",m,"itemContainer weaponContainer");this.m_armorContainer=makeElementClass("div",m,"itemContainer weaponContainer");this.m_vehicleContainer=makeElementClass("div",m,"itemContainer weaponContainer");this.m_explosivesContainer=makeElementClass("div",m,"itemContainer weaponContainer");this.m_henchmenContainer=makeElementClass("div",m,"itemContainer weaponContainer");this.m_weaponsTBody=this.createTable(this.m_weaponsContainer,this.m_weaponsTitle,this.m_weaponsTitle,true);this.m_armorTBody=this.createTable(this.m_armorContainer,this.m_armorTitle,this.m_armorTitle,true);this.m_vehicleTBody=this.createTable(this.m_vehicleContainer,this.m_vehiclesTitle,this.m_vehiclesTitle,true);this.m_explosivesTBody=this.createTable(this.m_explosivesContainer,this.m_explosivesTitle,this.m_explosivesTitle,true);this.m_henchmenTBody=this.createTable(this.m_henchmenContainer,this.m_henchmenTitle,this.m_henchmenTitle,true);this.m_blackMarketTBody=this.createTable(this.m_blackMarketContainer,this.m_blackMarketTitle,this.m_blackMarketTitle,true);var d=(isIE6()?".gif":".png");var a=["http://cdn0.mobwarsapp.com/rpg_images/opensocial/mob/ui/tab/weapons"+d,"http://cdn0.mobwarsapp.com/rpg_images/opensocial/mob/ui/tab/explosive"+d,"http://cdn0.mobwarsapp.com/rpg_images/opensocial/mob/ui/tab/armor"+d,"http://cdn0.mobwarsapp.com/rpg_images/opensocial/mob/ui/tab/vehicles"+d,"http://cdn0.mobwarsapp.com/rpg_images/opensocial/mob/ui/tab/henchmen"+d,"http://cdn0.mobwarsapp.com/rpg_images/opensocial/mob/ui/tab/weapons_selected"+d,"http://cdn0.mobwarsapp.com/rpg_images/opensocial/mob/ui/tab/explosive_selected"+d,"http://cdn0.mobwarsapp.com/rpg_images/opensocial/mob/ui/tab/armor_selected"+d,"http://cdn0.mobwarsapp.com/rpg_images/opensocial/mob/ui/tab/vehicles_selected"+d,"http://cdn0.mobwarsapp.com/rpg_images/opensocial/mob/ui/tab/henchmen_selected"+d,"http://cdn0.mobwarsapp.com/rpg_images/opensocial/mob/ui/tab/spacer.gif"];jQuery.each(a,function(n,o){loadImage(o)});var f=new Array();f.push(new CustomTab("Weapons",CustomTabDiv.imageTabDomFunc("http://cdn0.mobwarsapp.com/rpg_images/opensocial/mob/ui/tab/weapons_selected"+d,"http://cdn0.mobwarsapp.com/rpg_images/opensocial/mob/ui/tab/weapons"+d),CustomTabDiv.showTabContentFunc(this.m_weaponsContainer,"itemContainer"),CustomTabDiv.tabSelectedFunc("Weapons","MobsterItemSelectedTab"),CustomTabDiv.tabUnselectedFunc()));if(GBL.MAIN_DATA.getViewer().getLevel()>=9){f.push(new CustomTab("Explosives",CustomTabDiv.imageTabDomFunc("http://cdn0.mobwarsapp.com/rpg_images/opensocial/mob/ui/tab/explosive_selected"+d,"http://cdn0.mobwarsapp.com/rpg_images/opensocial/mob/ui/tab/explosive"+d),CustomTabDiv.showTabContentFunc(this.m_explosivesContainer,"itemContainer"),CustomTabDiv.tabSelectedFunc("Explosives","MobsterItemSelectedTab"),CustomTabDiv.tabUnselectedFunc()))}f.push(new CustomTab("Armors",CustomTabDiv.imageTabDomFunc("http://cdn0.mobwarsapp.com/rpg_images/opensocial/mob/ui/tab/armor_selected"+d,"http://cdn0.mobwarsapp.com/rpg_images/opensocial/mob/ui/tab/armor"+d),CustomTabDiv.showTabContentFunc(this.m_armorContainer,"itemContainer"),CustomTabDiv.tabSelectedFunc("Armors","MobsterItemSelectedTab"),CustomTabDiv.tabUnselectedFunc()));f.push(new CustomTab("Vehicles",CustomTabDiv.imageTabDomFunc("http://cdn0.mobwarsapp.com/rpg_images/opensocial/mob/ui/tab/vehicles_selected"+d,"http://cdn0.mobwarsapp.com/rpg_images/opensocial/mob/ui/tab/vehicles"+d),CustomTabDiv.showTabContentFunc(this.m_vehicleContainer,"itemContainer"),CustomTabDiv.tabSelectedFunc("Vehicles","MobsterItemSelectedTab"),CustomTabDiv.tabUnselectedFunc()));f.push(new CustomTab("Henchmen",CustomTabDiv.imageTabDomFunc("http://cdn0.mobwarsapp.com/rpg_images/opensocial/mob/ui/tab/henchmen_selected"+d,"http://cdn0.mobwarsapp.com/rpg_images/opensocial/mob/ui/tab/henchmen"+d),CustomTabDiv.showTabContentFunc(this.m_henchmenContainer,"itemContainer"),CustomTabDiv.tabSelectedFunc("Henchmen","MobsterItemSelectedTab"),CustomTabDiv.tabUnselectedFunc()));this.l_categoryTabsDiv=new CustomTabDiv(l,f);$(this.l_categoryTabsDiv.getTabTable()).css({backgroundImage:"url(http://cdn0.mobwarsapp.com/rpg_images/opensocial/mob/ui/tab/spacer.gif)"});$(".itemContainer").hide();this.l_categoryTabsDiv.selectTabByName(GBL.MobsterItemSelectedTab);$(this.m_tabHolder).hide();$(this.m_featured_tab_container).hide();this.m_loadingDiv=makeElement("div",this.m_containerDiv,{padding:"10px"});this.m_loadingDiv.innerHTML=getLoadingMessageHTML()};MobItemsDiv.prototype.mobItemDisplay=function(b,f){$(b).addClass("gridItemCell");$(b).css({verticalAlign:"top",borderBottom:"none",color:"#FFFFFF",paddingBottom:"0px",marginBottom:"0px"});var g=makeElement("div",b,{width:"100%",height:"100%"});$(g).append("<div class='itemTitle'><b> "+f.getName()+"</b></div>");var d=makeElement("div",g,{margin:"auto",textAlign:"center"});d.innerHTML="<img style='margin-left:auto; margin-right:auto;' src='"+f.getImageURL()+"'/>";var c=[];if(f.getUpkeep()>0){c.push("<div class='itemUpkeep'>Upkeep: $"+f.getUpkeep()+"</div>")}c.push("<span class='itemAttack'>Attack: "+f.getAttack()+"</span>  |  ");c.push("<span class='itemDefense'>Defense: "+f.getDefense()+"</span><br>");if(!f.isSoldOut()&&f.getItemRemaining()>0){c.push("<div class='itemRemaining'>Less than <b class='favorOfferQtyRemaining'>"+f.getItemRemaining()+"</b> remaining!</div>")}if(f.isSoldOut()){c.push("<span class='itemSoldOut'><b class='favorOfferQtyRemaining'>Sold Out</b></span>")}else{if(f.getFavorPoints()>0){c.push("<span class='itemFavorPrice'> "+formatNumberWithCommas(f.getFavorPoints())+" favor points</span>")}else{c.push("<span class='itemPrice'> $"+formatNumberWithCommas(f.getCost())+"</span>")}}if(f.getNumOwned()>=0){c.push(" | <span class='itemNumOwned'> Owned: "+f.getNumOwned()+"</span>")}c.push("<br>");if(f.isAvatar()){var a="Avatar Item";switch(f.getAvatarGender()){case 1:a="Male Avatar Item";break;case 2:a="Female Avatar Item";break}c.push("<div class='itemAvatar' style='color:#FFD600; font-style: italic'>"+a+"</div>");jQuery.each(f.getAvatarEnhancementList(),function(h,j){c.push("<div class='gridEnhancementContainer'>                                     <span class='gridEnhancementPrefix'>{prefix}</span>                                    <span class='gridEnhancementValue'>{value}</span>                                    <span class='gridEnhancementSuffix'>{suffix}</span>                               </div>".supplant(j))})}else{if(f.isPurchasable()=="false"){c.push("<div class='itemPurchaseStatus'>Not purchasable, sells for half value</div>")}}jQuery.each(f.getEnhancementList(),function(h,j){c.push("<div class='gridEnhancementContainer'>                                     <span class='gridEnhancementPrefix'>{prefix}</span>                                    <span class='gridEnhancementValue'>{value}</span>                                    <span class='gridEnhancementSuffix'>{suffix}</span>                               </div>".supplant(j))});$(g).append(c.join(""))};MobItemsDiv.prototype.mobItemBuySell=function(h,f){$(h).addClass("gridItemCell");$(h).css({verticalAlign:"top",borderTop:"none"});var d=makeElement("div",h,{width:"100%",height:"100%",textAlign:"center"});var b=new SideBySide3ClassCells(d);$(b.getTable()).css({margin:"auto"});if(f.isSoldOut()){return}var a=b.getLeftCell();var c=new NumberSelectDiv(a,10,[100]);var j=c.getSelectionBox();var k=this;if(!f.isSoldOut()&&!(isValid(f.getItemLimit())&&f.getItemLimit()<=f.getNumOwned())){var l=new DivButton(b.getMiddleCell(),"Buy",function(){var m=c.getSelectedNumber();k.doBuy(f.getId(),m)})}if(f.getNumOwned()>0&&f.getCost()>0&&f.getFavorPoints()==0){var g=new DivButton(b.getRightCell(),"Sell",function(){var m=c.getSelectedNumber();k.doSell(f.getId(),m)});g.setColor("gray")}};MobItemsDiv.prototype.blackMarketItemDisplay=function(b,h){$(b).addClass("gridItemCell");$(b).css({verticalAlign:"top",borderBottom:"none",color:"#FFFFFF",paddingBottom:"0px",marginBottom:"0px",textAlign:"left"});var j=makeElement("div",b,{width:"100%",height:"100%"});var g=makeElementClass("div",j,"itemTitle");g.style.marginTop="5px";g.innerHTML="<b> "+h.getName()+"</b><br/><br/>";g.style.textAlign="center";var f=new SideBySideCells(j,false,"center");f.getTable().style.width="396px";var d=makeElement("div",f.getLeftCell(),{margin:"auto",textAlign:"center"});d.innerHTML="<img style='margin-left:auto; margin-right:10px;' src='"+h.getImageURL()+"'/>";var c=[];if(h.getUpkeep()>0){c.push("<div class='itemUpkeep'>Upkeep: $"+h.getUpkeep()+"</div>")}c.push("<span class='itemAttack'>Attack: "+h.getAttack()+"  |  </span>");c.push("<span class='itemDefense'>Defense: "+h.getDefense()+"</span><br>");if(!h.isSoldOut()&&h.getItemRemaining()>0){c.push("<div class='itemRemaining'>Less than <b class='favorOfferQtyRemaining'>"+h.getItemRemaining()+"</b> remaining!</div>")}if(h.isSoldOut()){c.push("<span class='itemSoldOut'><b class='favorOfferQtyRemaining'>Sold Out</b></span>")}else{if(h.getFavorPoints()>0){c.push("<span class='itemFavorPrice'> "+formatNumberWithCommas(h.getFavorPoints())+" favor points</span>")}else{c.push("<span class='itemPrice'> $"+formatNumberWithCommas(h.getCost())+"</span>")}}c.push("<br>");if(h.isAvatar()){var a="Avatar Item";switch(h.getAvatarGender()){case 1:a="Male Avatar Item";break;case 2:a="Female Avatar Item";break}c.push("<div class='itemAvatar' style='color:#FFD600; font-style: italic'>"+a+"</div>");jQuery.each(h.getAvatarEnhancementList(),function(k,l){c.push("<div class='gridEnhancementContainer'>                                     <span class='gridEnhancementPrefix'>{prefix}</span>                                    <span class='gridEnhancementValue'>{value}</span>                                    <span class='gridEnhancementSuffix'>{suffix}</span>                               </div>".supplant(l))})}else{if(h.isPurchasable()=="false"){c.push("<div class='itemPurchaseStatus'>Not purchasable, sells for half value</div>")}}jQuery.each(h.getEnhancementList(),function(k,l){c.push("<div class='gridEnhancementContainer'>                                     <span class='gridEnhancementPrefix'>{prefix}</span>                                    <span class='gridEnhancementValue'>{value}</span>                                    <span class='gridEnhancementSuffix'>{suffix}</span>                               </div>".supplant(l))});c.push("<br/>");$(f.getRightCell()).append(c.join(""))};MobItemsDiv.prototype.blackMarketItemBuySell=function(h,g){$(h).addClass("gridItemCell");$(h).css({verticalAlign:"top",borderTop:"none"});var f=makeElement("div",h,{width:"100%",height:"100%",textAlign:"center",marginBottom:"5px"});var b=new SideBySide3ClassCells(f);$(b.getTable()).css({margin:"auto"});if(g.getNumOwned()>=0){var c=makeElementClass("span",b.getLeftCell(),"itemNumOwned");c.innerHTML=" Owned: "+g.getNumOwned()}b.getLeftCell().style.width="150px";b.getLeftCell().style.textAlign="center";if(g.isSoldOut()){return}var a=b.getMiddleCell();var d=new NumberSelectDiv(a,10,[100]);var j=d.getSelectionBox();var k=this;if(!g.isSoldOut()&&!(isValid(g.getItemLimit())&&g.getItemLimit()<=g.getNumOwned())){var l=new DivButton(b.getRightCell(),"Buy",function(){var m=d.getSelectedNumber();k.doBuy(g.getId(),m)})}};MobItemsDiv.prototype.handleBlackMarketItems=function(d){if(d.length<=0){return}$(this.m_blackMarketContainer).html("");var b=this;var a=makeElementClass("div",this.m_blackMarketContainer,"blackMarketExplanation");a.innerHTML=this.m_blackMarketExplanationText;if(d.length<4){this.m_blackMarketTBody=this.createTable(this.m_blackMarketContainer,"Black Market",undefined,true);jQuery.each(d,function(g,h){b.m_blackMarketTBody.appendChild(b.createContentElement(h))})}else{var f=makeElement("div",this.m_blackMarketContainer);var c=handleItemsGrid(f,d,function(g,h){b.blackMarketItemDisplay(g,h)},function(g,h){b.blackMarketItemBuySell(g,h)},2);c.style.width="796px";c.style.margin="0px";c.style.padding="0px";$(c).addClass("itemTable")}};MobItemsDiv.prototype.handleFeaturedItems=function(a){if(a.length<=0){return}$(this.m_featuredItemsContainer).html("");var b=this;if(a.length<3){this.m_featuredItemsTBody=this.createTable(this.m_featuredItemsContainer,"Featured Items",undefined,true);jQuery.each(a,function(f,g){b.m_featuredItemsTBody.appendChild(b.createContentElement(g))});this.m_featuredItemsContainer.style.display="block"}else{var d=makeElement("div",this.m_featuredItemsContainer);var c=handleItemsGrid(d,a,function(f,g){b.mobItemDisplay(f,g)},function(f,g){b.mobItemBuySell(f,g)});c.style.margin="0px";c.style.padding="0px";$(c).addClass("itemTable");this.m_featuredItemsContainer.style.display="block"}};MobItemsDiv.prototype.createTable=function(d,c,g,j){var f=document.createElement("table");if(d){d.appendChild(f)}f.style.marginLeft="auto";f.style.marginRight="auto";f.style.marginTop="5px";f.style.marginBottom="15px";f.style.cellSpacing="0px";f.style.borderCollapse="collapse";var a=document.createElement("tbody");f.appendChild(a);if(!j){var b=document.createElement("tr");a.appendChild(b);var h=undefined;if(isValid(g)){h=makeElementClass("td",b,"dataTableHeader",{width:"400px"});h.innerHTML=c;h=makeElementClass("td",b,"dataTableHeader",{width:"100px"});h.innerHTML=g}else{h=makeElementClass("td",b,"dataTableHeader",{width:"500px"});h.innerHTML=c}h=makeElementClass("td",b,"dataTableHeader",{width:"300px"});h.innerHTML="Buy / Sell"}return a};MobItemsDiv.prototype.createContentElement=function(j,g){var c=document.createElement("tr");$(c).addClass("stockpileItem").addClass("item_"+j.getId());var n=makeElementClass("td",c,"itemCell");var r=new SideBySideCells(n,false);var d=r.getLeftCell();setStyle(d,{width:"180px"});if(isValid(j.m_isAvatar)&&j.m_isAvatar){$(d).addClass("avatarItemHighlight")}var o=makeElement("div",d,{textAlign:"center"});o.innerHTML="<img style='margin-left:auto; margin-right:auto;' src='"+j.getImageURL()+"'/>";var f=r.getRightCell();f.style.width="270px";f.style.paddingLeft="10px";f.style.verticalAlign="top";f.innerHTML=j.getDetailsHTML();if(isValid(g)){n=makeElementClass("td",c,"itemNeededCount");var a=g-j.getNumOwned();if(a>0){n.innerHTML=a+" more"}else{n.innerHTML="0 more"}}n=makeElementClass("td",c,"itemTxnCell",{verticalAlign:"top"});var l=new SideBySideCells(n,false);l.getLeftCell().style.width="110px";var q=j.getFavorPoints();if(!q){q=0}if(j.isSoldOut()){l.getLeftCell().innerHTML="<span class='itemSoldOut'>Sold Out</span>"}else{if(q>0){l.getLeftCell().innerHTML="<span class='itemFavorPrice'> "+formatNumberWithCommas(q)+" "+this.m_favorPointsText+"</span>"}else{l.getLeftCell().innerHTML="<span class='itemPrice'> $"+formatNumberWithCommas(j.getCost())+"</span>"}}if(j.getNumOwned()>0){l.getRightCell().innerHTML="<span class='itemNumOwned'> Owned: "+j.getNumOwned()+"</span>"}var p=this;var b=new SideBySideCells(n,false);var h=b.getLeftCell();h.style.width="115px";if(!j.isSoldOut()&&!(isValid(j.getItemLimit())&&j.getItemLimit()<=j.getNumOwned())){new NumberSelectActionDiv(h,10,"Buy",function(s){p.doBuy(j.getId(),s)},"blue",[100])}if(j.getNumOwned()>0&&j.getCost()>0&&q==0){var k=b.getRightCell();k.style.width="115px";var m=[];if(j.getNumOwned()>=100){m=[100]}new NumberSelectActionDiv(k,Math.min(10,j.getNumOwned()),"Sell",function(s){p.doSell(j.getId(),s)},"gray",m)}return c};GBL.backendJobSectorTab=undefined;GBL.userJobSectorTab=undefined;function MobJobListDiv(b,c,a){this.m_descriptionHeader=undefined;this.m_sectorList=undefined;this.m_sectorToJobList=undefined;this.m_featuredJobList=undefined;this.m_jobList=undefined;this.m_nextLevel=undefined;MobJobListDiv.baseConstructor.call(this,b,c);this.m_onGetJobListCallback=a}extendClass(MobJobListDiv,SectorJobListDiv);MobJobListDiv.prototype.initialize=function(){SectorJobListDiv.prototype.initialize.call(this);this.m_version=8};MobJobListDiv.prototype.getRewardDiv=function(f){var j=f.getData();var o=document.createElement("div");var m=undefined;if(isValid(j.mastery)){$(o).append(this.getMasteryTitleDiv(j.mastery))}var h=new SideBySideCells(o);var b=h.getLeftCell();var c=h.getRightCell();var k=h.getTable();setStyle(h.getTable(),{width:"100%",marginTop:"4px",borderCollapse:"collapse"});k.setAttribute("cellpadding",0);k.setAttribute("cellspacing",0);setStyle(b,{verticalAlign:"top"});setStyle(c,{verticalAlign:"top"});if(isValid(j.mastery)){$(b).append(this.getMasteryPercentDiv(j.mastery))}if(isValid(j.items)&&j.items.length>0){createSmallItemsListDiv(c,j.items,1)}var r=makeElementClass("div",b,"mission_reward",{fontWeight:"bold",fontSize:"14px",color:"#dddddd"});setInnerHTML(r,this.m_rewardLabel);if(j.min>0||j.max>0){r=makeElementClass("div",b,"mission_reward");setInnerHTML(r,"<span class='rewardPayoutLabel'>$"+formatNumberWithAbbreviation(j.min)+" - $"+formatNumberWithAbbreviation(j.max)+" </span> <span class='mission_reward_unit'>"+this.m_cashLabel+"</span>")}if(j.experience>0){r=makeElementClass("div",b,"mission_reward");setInnerHTML(r,"+"+j.experience+" <span class='mission_reward_unit'>"+this.m_rewardExperienceLabel+"</span>")}if(isValid(j.favorPoints)){r=makeElementClass("div",b,"mission_reward");setInnerHTML(r,this.m_favorPointsLabel+": "+j.favorPoints);$(r).css("color","#CD7F32")}if(isValid(j.additionalInfo)){r=makeElementClass("div",b,"mission_reward");setInnerHTML(r,j.additionalInfo)}if(isValid(j.isCrateReward)&&j.isCrateReward&&isValid(j.crateInfo)){var d=j.crateInfo.getData();var q=makeElementClass("div",o,"crate clearfix");var n=makeElementClass("div",q,"clearfix");$(makeElementClass("div",n,"title left")).text(this.m_rewardLootLabel+":");$(makeElementClass("div",n,"text left")).html(1+" "+d.crateUnit);var a=0;$(makeElementClass("div",q,"none_so_far")).html("Collect All "+d.crateItems.length+" Unique Items!<br>You can only get'em here!");var s=makeElementClass("div",q,"crate_list clearfix");var p="http://cdn0.mobwarsapp.com/rpg_images/opensocial/mob/ui/crates/small/closed_";var g="http://cdn0.mobwarsapp.com/rpg_images/opensocial/mob/ui/crates/small/open_";jQuery.each(d.crateItems,function(u,t){if(t.getNumOwned()>0){a++;$(makeElementClass("img",s,"opened")).attr("src",g+(u+1)+".png")}else{$(makeElementClass("img",s,"closed")).attr("src",p+(u+1)+".png")}if((u+1)%4==0){makeElementClass("div",s,"newLine")}});if(a!=0){$(makeElementClass("div",q,"number_so_far")).html("You've collected <span class='number'>"+a+" out of "+d.crateItems.length+"</span> unique items!")}}else{if(isValid(j.rotatingImageUrls)&&j.useRewardImageFlipper){this.addRewardImageFlipper(o,j);$(o).find("span").addClass("coloredDiv")}else{if(isValid(j.lootDescription)){m=r=makeElementClass("div",b,"mission_reward");var l=this.m_rewardLootLabel+": "+j.lootDescription;setInnerHTML(r,l)}}}return o};MobJobListDiv.prototype.createCustomJobTr=function(c){var b=this;var a={};a.user_id=GBL.MAIN_DATA.getViewer().getUserId();a.level=GBL.MAIN_DATA.getViewer().getLevel();makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/get_poker_offer",function(g){try{var f=getGadgetResponseData(g);if(!isValid(f)){return}var j=getXMLNodeValue(f,"show_poker_item");var d=getXMLNodeValue(f,"show_poker_payout");b.onGetCustomJobSpecs(c,isValid(j)&&j,isValid(d)&&d)}catch(h){outputDebug("createCustomJobTr "+h)}},a)};MobJobListDiv.prototype.onGetCustomJobSpecs=function(b,h,a){if(!h){return}var j=document.all;if(!j){b.style.display="table-row"}else{b.style.display="block"}outputDebug("onGetCustomJobSpecs");var l=makeElement("td",b,{padding:"5px 20px 5px 10px",borderBottom:"solid 1px #505050",verticalAlign:"top"});var o=createWhiteDiv(l);o.style.fontSize="14px";o.style.fontWeight="bold";o.innerHTML="Win Poker Tournament";l.appendChild(this.getCustomRewardDiv(a));l=makeElement("td",b,{padding:"5px 10px 5px 10px",borderBottom:"solid 1px #505050",verticalAlign:"top"});l.appendChild(this.getCustomRequirementDiv());l=makeElement("td",b,{padding:"5px 15px 5px 15px",borderBottom:"solid 1px #505050"});var m=this;var k=document.createElement("div");var n=createWhiteDiv(k);n.style.padding="5px";n.innerHTML="You've arrived at Lucky's <img style='vertical-align:middle;' src='http://cdn0.pokerpartyapp.com/prod_poker/img/js/PokerPalaceLogo2.gif'/>";var c=new SideBySideCells(k);var p=c.getLeftCell();p.style.width="550px";if(a){p.innerHTML="<ol style='color:#FFFFFF'>            <li style='padding:10px;'>The Godfather will give you <span style='color:#00FF00; font-weight:bold;'>$10,000</span> in the bank <br/>            and <span style='color:#00FF00; font-weight:bold;'>$4,000</span> in chips to enter Lucky's poker tournament.</li>            <li style='padding:10px;'>The Godfather will reward you with an <span style='font-weight:bold;'> Armored Rolls Royce </span>             when you win <span style='color:#D9D919; font-weight:bold;'> $20,000 </span> in chips at Poker Palace! </li>            </ol>"}else{p.innerHTML="<span style='color:#FFFFFF'> The Godfather will reward you with an <span style='font-weight:bold;'> Armored Rolls Royce </span>             when you win <span style='color:#D9D919; font-weight:bold;'> $20,000 </span> in chips at Poker Palace! </span>"}var d=c.getRightCell();d.style.textAlign="center";var f=new ImageDiv(d,"http://cdn0.mobwarsapp.com/rpg_images/opensocial/mob/ingame/stockpile/rolls_royce.gif","100px","70px",true);f.getContainerDiv().style.marginLeft="auto";f.getContainerDiv().style.marginRight="auto";var g=makeElement("div",d,{padding:"5px",textAlign:"center"});new DivButton(g,"Enter Tournament!",function(){window.open("http://profile.myspace.com/Modules/Applications/Pages/Canvas.aspx?appId=109588&appParams=%7B%22src%22%3A%22mob%22%7D&track=in_mob")},undefined,true);new DivButton(l,this.m_doButtonText,function(){goToPageTop();m.m_resultDiv.showCustomContent(true,k)})};MobJobListDiv.prototype.getCustomRewardDiv=function(c){var b=document.createElement("div");var d=undefined;if(c){d=createWhiteDiv(b);d.innerHTML=this.m_rewardPayoutLabel+": <span class='rewardPayoutLabel'>$10,000</span>"}d=createWhiteDiv(b);var a=new Array();a.push({number:1,image_url:"http://cdn0.mobwarsapp.com/rpg_images/opensocial/mob/ingame/equipment/vehicles/small/rolls_royce.gif",name:"Armored Rolls Royce"});createItemsListDiv(b,a,1);return b};MobJobListDiv.prototype.getCustomRequirementDiv=function(){var a=document.createElement("div");var b=createWhiteDiv(a);b.style.fontWeight="bold";b.style.fontStyle="italic";b.innerHTML="Needs...";b=createWhiteDiv(a);b.innerHTML="<span style='color:#5F9F9F;'> Some luck!</span>";return a};function MobStatsDiv(a,b){this.m_avatarModalDialog=undefined;MobStatsDiv.baseConstructor.call(this,a,b)}extendClass(MobStatsDiv,StatsDiv);MobStatsDiv.prototype.additionalCareerStats=function(a){$(a).append(this.createStatTr("Level",this.m_targetUser.getLevel()));$(a).append(this.createStatTr("Class",this.m_targetUser.getMobClass()))};MobStatsDiv.prototype.OnGetStats=function(g){var b=getGadgetResponseData(g);var k=new StatsData(b);this.m_refreshDiv.innerHTML="";var f=k.getData().user;this.m_targetUser=f;var h=new Array();var m=new Array();h.push(this.m_attackOptionText);var l=this;m.push(function(){l.m_resultDiv.showMessage(undefined,"Attacking "+f.getMobName()+" ...");goToPageTop();var n={};n.user_id=GBL.MAIN_DATA.getViewer().getUserId();n.target_id=f.getUserId();makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/attack",function(o){handleResult(o,l.m_resultDiv,function(){l.refresh()})},n,1)});h.push(this.m_punchActionText);m.push(function(){l.m_resultDiv.showMessage(undefined,l.m_punchActionPrefix+" "+f.getMobName()+" "+l.m_punchActionSuffix+"...");goToPageTop();var n={};n.user_id=GBL.MAIN_DATA.getViewer().getUserId();n.target_id=f.getUserId();n.punch_in_face=true;makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/attack",function(o){handleResult(o,l.m_resultDiv,function(){l.refresh()})},n,1)});if(isValid(this.m_addHitListActionText)){h.push(this.m_addHitListActionText);m.push(function(){GBL.MAIN_TABS.switchToDynamicTab(function(o,n,p){new l.m_hitListDiv(o,n,p)},f)})}this.createTitleReportDiv(f.getMobName(),h,m,k);var d=makeElement("div",this.m_refreshDiv);var j=new SideBySideCells(this.m_refreshDiv,true);var a=j.getLeftCell();var c=j.getRightCell();a.style.width="350px";a.style.verticalAlign="top";if(GBL.MAIN_DATA.getShowAvatar()&&isValid(this.m_targetUser.getBigAvatarUrl())){this.createAvatarImage(k,a)}else{this.createStatsDiv(a,k.getData())}new CommentDiv(a,this.m_userId);this.createRightColumn(c,f,k)};MobStatsDiv.prototype.createTitleReportDiv=function(m,c,j,s){this.m_titleDiv.innerHTML="";var t=makeElement("div",this.m_titleDiv,{borderBottom:"solid 1px #777777",textAlign:"left"});var d=makeElement("table",t);var p=makeElement("tbody",d);var o=makeElement("tr",p);var v=makeElementClass("td",o,"myStatsTitle");if(this.m_targetUser.hasInstalledIPhone()){v.innerHTML=m+"<img src='http://cdn0.mobwarsapp.com/rpg_images/opensocial/mob/badge.png' style='width:43px;height:19px; vertical-align: bottom; margin-left: 10px; padding-bottom: 3px'/>"}else{v.innerHTML=m}$(v).append("<span style='font-size:12px; color:white;'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"+(s.getData().partOfViewerMob?(GBL.MAIN_DATA.getViewer().getUserId()==this.m_targetUser.getUserId()?"":this.m_inMobLabel):this.m_notInMobLabel)+"</span>");var b=makeElement("div",this.m_titleDiv,{textAlign:"left",borderBottom:"solid 1px #777777"});var g=makeElement("table",b);var q=makeElement("tbody",g);o=makeElement("tr",q);for(var r=0;r<c.length;r++){v=makeElementClass("td",o,"myStatsSubtitle");v.innerHTML=c[r];if(isValidFunction(j[r])){v.className="myStatsSubtitleLink";addEvent(v,"click",j[r])}if(r>0){v.style.borderLeft="solid 2px #FFFFFF"}}var h=this;var l="500px";var n=makeElement("td",o,{width:l,textAlign:"right"});if(isValid(this.m_targetUser.getUserStatusMessage())&&isValid(this.m_targetUser.getUserStatusMessage().getStatusMessage())){var k=makeElementClass("span",n,"myStatsReportInappropriateName");k.innerHTML="Report Inappropriate Status";var a=false;$(k).click(function(){if(a){return}var w={};w.user_id=GBL.MAIN_DATA.getViewer().getUserId();w.offensive_id=h.m_targetUser.getUserId();makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/report_offensive_taunt",function(x){},w);a=true;k.innerHTML="Reported";k.style.cursor="auto"});$(makeElementClass("span",n,"myStatsReportInappropriateName")).text("  |  ")}var u=makeElementClass("span",n,"myStatsReportInappropriateName");u.innerHTML="Report Inappropriate Name";var f=false;addEvent(u,"click",function(){if(f){return}var y={};y.user_id=GBL.MAIN_DATA.getViewer().getUserId();y.offensive_id=h.m_targetUser.getUserId();y.offensive_name=customEncoding(h.m_targetUser.getMobName());var w=document.createElement("div");var z=new SideBySideCells(w);$(z.getLeftCell()).text("You successfully reported this user.");$(z.getLeftCell()).addClass("myStatsReportInappropriateNameSuccess");var x=new DivButton(z.getRightCell(),"OK",function(){$(h.m_resultDiv.getContainerDiv()).hide()});makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/report_offensive_name",function(A){h.m_resultDiv.showMessage(undefined,"You successfully reported this user.");h.m_resultDiv.showCustomContent(undefined,w)},y);f=true;u.innerHTML="Reported";u.style.cursor="auto"})};MobStatsDiv.prototype.createAvatarImage=function(h,d){var l=this;var k=new SideBySideCells(d,true);var f=k.getLeftCell();var m=k.getRightCell();var n=makeElementClass("div",f,"AvatarStatsIcon click");var g=makeElementClass("div",n,"AvatarStatsIcon");makeSafeBackgroundNoRepeat(g,this.m_targetUser.getSmallAvatarUrl());var c=document.createElement("div");c.setAttribute("class","AvatarImage");var j=makeElementClass("div",c,"AvatarImage");makeSafeBackground(j,this.m_targetUser.getBigAvatarUrl());var b=makeElementClass("div",c,"click CloseAvatarImage");b.innerHTML="[click here to close]";var a=function(){if(isValid(l.m_avatarModalDialog)){l.m_avatarModalDialog.cancellModalDialog();$(b).unbind("click");l.m_avatarModalDialog=null}};$(n).click(function(){var o=function(){l.m_avatarModalDialog=null;$(b).unbind("click")};if(!isValid(l.m_avatarModalDialog)){$(b).click(a);var p=document.createElement("div");p.style.color="#ffffff";p.innerHTML="My Avatar";l.m_avatarModalDialog=new PDDialog(p,c,170,400,{"background-color":"black",border:"solid 8px #000000"},o)}l.m_avatarModalDialog.showDialog()});this.createStatsDiv(m,h.getData())};function CompletionBarHTML(l,d,p,k,b){var h=p;p=Math.max(0,p);p=Math.min(p,k);var c=Math.floor(p*100/k);var j=l+": "+p+"/"+k;var o=isValid(b)?b:"#880000";var n=document.createElement("div");var a=makeElement("ul",n,{margin:"0",padding:"0",listStyleType:"none"});var g=makeElement("li",a);$(g).css({margin:"0","float":"left",padding:"1px"});if(isValid(d)){var f=makeElement("img",g,{margin:"0",width:"16px",height:"16px"});f.src=d}g=makeElement("li",a);$(g).css({margin:"0px",padding:"0px","float":"left",position:"relative",width:"102px",height:"14px",backgroundColor:"black",border:"1px solid "+o});var m=makeElement("div",g);$(m).css({margin:"0px",padding:"0px",width:c+"px",height:"12px",backgroundColor:o,border:"1px solid black"});m=makeElement("div",g);$(m).css({margin:"0","float":"left",position:"absolute",left:"5px",top:"0px",height:"12px",color:"#aaaaaa"});m.innerHTML=l;g=makeElement("li",a);$(g).css({margin:"0","float":"left",padding:"1px"});m=makeElement("div",g,{margin:"0",width:"16px",height:"16px"});m.innerHTML=h;return n.innerHTML}function MobViewerStatusDiv(a){this.m_privacyPolicy=undefined;MobViewerStatusDiv.baseConstructor.call(this,a)}extendClass(MobViewerStatusDiv,ViewerStatusDiv);MobViewerStatusDiv.prototype.initialize=function(){this.m_cashLabel="Cash";this.m_healthLabel="Health";this.m_energyLabel="Energy";this.m_staminaLabel="Stamina";this.m_expLabel="Exp";this.m_mobLabel="Mob";this.m_statsDiv=MobStatsDiv};MobViewerStatusDiv.prototype.refreshStatus=function(){this.m_containerDiv.innerHTML="";var y=GBL.MAIN_DATA.getViewer();var s="http://cdn0.mobwarsapp.com/rpg_images/opensocial/mob/ui/";var n=document.createElement("table");this.m_containerDiv.appendChild(n);n.setAttribute("id","statusTable");$(n).addClass("statusTable");var x=document.createElement("tbody");n.appendChild(x);var b=document.createElement("tr");x.appendChild(b);var u=makeElementClass("td",b,"statContentTD");var m=document.createElement("table");u.appendChild(m);m.style.borderCollapse="separate";var v=document.createElement("tbody");m.appendChild(v);var t=document.createElement("tr");v.appendChild(t);var B=document.getElementById("mobNameCell");B.innerHTML='<span title="'+GBL.MAIN_DATA.getViewer().getMobName()+'">'+GBL.MAIN_DATA.getViewer().getShortMobName(this.m_maxNameLength)+"</span><span class='statContentTD myStatsLink' style='font-size: 11px; font-weight: normal; color: rgb(112, 219, 219); cursor: pointer;'>(stats)</span>";$(B).css("padding-bottom","5px");if(!isValid(B.hasStatsLink)){B.hasStatsLink=true;this.addLinkToStats(B)}var c=makeElementClass("td",t,"statCellNew statCellCash");var k=formatNumberWithAbbreviation(y.getCash());var f=formatNumberWithAbbreviation(y.getIncome()-y.getUpkeep());c.innerHTML=this.m_cashLabel+": <span class='incomeTitleText'>$"+k+"</span> &nbsp; &nbsp; Cash flow: $"+f;if(!isValid(c.hasBankLink)){c.hasBankLink=true;this.addLinkToBank(c)}this["oldHealthStatus"]=undefined;this["oldEnergyStatus"]=undefined;this["oldStaminaStatus"]=undefined;var j=makeElementClass("td",t,"statCellNew");j.style.width=160;var D=makeElementId("div",j,"healthStatus");this.m_healthTimerDiv=this.createStatusElement(D,"oldHealthStatus",CompletionBarHTML(this.m_healthLabel,s+"s_health.gif",y.getHealth(),y.getMaxHealth(),"#880000"));if(!isValid(j.hasHospitalLink)){j.hasHospitalLink=true;this.addLinkToHospital(j)}var z=makeElementClass("td",t,"statCellNew");z.style.width=160;var a=makeElementId("div",z,"energyStatus");this.m_energyTimerDiv=this.createStatusElement(a,"oldEnergyStatus",CompletionBarHTML(this.m_energyLabel,s+"s_energy.gif",y.getEnergy(),y.getMaxEnergy(),"#880000"));var p=makeElementClass("td",t,"statCellNew");p.style.width=160;var g=makeElementId("div",p,"staminaStatus");this.m_staminaTimerDiv=this.createStatusElement(g,"oldStaminaStatus",CompletionBarHTML(this.m_staminaLabel,s+"s_stamina.gif",y.getStamina(),y.getMaxStamina(),"#880000"));var w=document.getElementById("mobSizeCell");var l=y.getMobSize();var A=y.getTopMobsActive();if(!isValid(A)){A=0}if(A>0){w.innerHTML=this.m_mobLabel+" size: "+(l-A)+" <span style='color: #ffa500;' title='Extra contribution from your active Top Mob members'>+"+A+"</span>"}else{w.innerHTML=this.m_mobLabel+" size: "+y.getMobSize()}if(!isValid(w.hasMyMobLink)){w.hasMyMobLink=true;this.addLinkToMyMob(w)}var r=document.getElementById("levelStatCell");r.innerHTML="Level:"+y.getLevel();if(!isValid(r.hasMyBossLink)){r.hasMyBossLink=true;this.addLinkToMyBoss(r)}var C=GBL.MAIN_DATA.getViewer().getPercentToNextLevel();if(isValid(C)){var h=null;h=makeElementClass("div",r,"barOutDiv");h.style.width=84;h.style.background="#666666";var d=makeElementClass("div",h,"percentLevelDiv");d.style.width=C+"%"}this.m_refreshButtonEnabled=true;var q=document.getElementById("mainFrame");if(!this.m_refreshButtonDiv){this.m_refreshButtonDiv=makeElementClass("div",document.getElementById("mainFrame"),"refreshButtonDiv")}if(!this.m_privacyPolicy){this.m_privacyPolicy=makeElementClass("span",q,"privacy_link");this.m_privacyPolicy.innerHTML="Privacy Policy";$(this.m_privacyPolicy).click(function(){switchTabsByName("Help");showPrivacyPolicy()})}this.m_refreshButtonDiv.style.width=86;this.m_refreshButtonDiv.style.display="block";this.m_refreshButtonDiv.style.position="absolute";this.m_refreshButtonDiv.style.padding="3px 0";this.m_refreshButtonDiv.style.top=15;this.m_refreshButtonDiv.style.left=811;this.m_refreshButtonDiv.style.textAlign="center";this.m_refreshButtonDiv.innerHTML="REFRESH";var o=this;addEvent(this.m_refreshButtonDiv,"click",function(){if(o.m_refreshButtonEnabled){o.m_refreshButtonEnabled=false;o.m_refreshButtonDiv.style.cursor="default";o.m_refreshButtonDiv.style.backgroundColor=o.m_refreshButtonActionColor;o.m_refreshButtonDiv.style.width=86;o.m_refreshButtonDiv.innerHTML="refreshing...";window.setTimeout("GBL.STATUS_DIV.enableRefreshButton()",1000);MobDoRefresh()}})};MobViewerStatusDiv.prototype.createStatusElement=function(j,f,d){this.addTextStyle(j);$(j).css({position:"relative",left:"0px",top:"0px"});var h=document.all;var a=makeElement("div",j);$(a).css({position:"absolute",left:"0px",top:"-8px"});a.innerHTML=d;var b=null;b=makeElementClass("div",j);$(b).css({position:"absolute",left:"33px",top:"-22px",fontSize:"11px",color:"rgb(212,212,212)"});var g=this[f];this[f]=d;var c=this;if(isValid(g)&&g!=d){$(a).css("color",this.statusHighlightColor);$(a).fadeTo("slow",0.6).fadeTo("fast",1).fadeTo("slow",0.6).fadeTo("fast",1).fadeTo("slow",0.6).fadeTo("fast",1).queue(function(){$(a).css("color",c.statusDefaultColor)})}return b};function MobAvatarIconDiv(a){this.m_parentContainer=a;this.m_containerDiv=undefined;if(isValid(a)){this.createDiv()}}MobAvatarIconDiv.prototype.createDiv=function(){this.m_containerDiv=makeElementClass("div",this.m_parentContainer,"AvatarIconContainer");this.refresh()};MobAvatarIconDiv.prototype.refresh=function(){this.m_containerDiv.innerHTML="";if(isValid(GBL.MAIN_DATA.getViewer().getSmallAvatarUrl())){var a=makeElementClass("div",this.m_containerDiv,"AvatarIcon click");makeSafeBackground(a,GBL.MAIN_DATA.getViewer().getSmallAvatarUrl());$(a).click(function(){switchTabsByName("My Mobster")})}};function MobBossDiv(a,b){this.m_attributeImageArray=undefined;MobBossDiv.baseConstructor.call(this,a,b)}extendClass(MobBossDiv,BossDiv);MobBossDiv.prototype.initialize=function(){this.m_titleString="Your Mobster";this.m_attributeArray=new Array();this.m_attributeValueCallbackArray=new Array();this.m_attributeKeyArray=new Array();this.m_attributeDescriptionArray=new Array();this.m_attributeImageArray=new Array();this.m_attributeKeyArray.push("attack_strength");this.m_attributeArray.push("Attack Strength");this.m_attributeValueCallbackArray.push(function(){return GBL.MAIN_DATA.getViewer().getAttackStrength()});this.m_attributeDescriptionArray.push("Higher attack strength makes you more succe