var GLOBAL_DEBUGGING=false;var REQUEST_DESTINATION_URL="http://aliens-dynamic-lb.myspacegamingapps.com/aliens";var IMAGE_LOCATION_PREFIX="http://cdn0.mobwarsapp.com/prod_aliens/aliens/images/";var RESOURCE_DESTINATION_URL="";var GBL={};GBL.APP_CANVAS_URL="http://profile.myspace.com/Modules/Applications/Pages/Canvas.aspx?appId=113383&";GBL.APP_ERROR_MSG="Sorry, OutWorld is temporarily down for maintenance... <br/> In the meantime, try <a target='_blank' href='http://profile.myspace.com/Modules/Applications/Pages/Canvas.aspx?appId=104283&appParams={\"rsrc\":\"maintenance/outworld\"}'> Mobsters </a> and rule MySpace.";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.LIVE_NEWSFEED=true;GBL.HOT_TIP_FRIENDS_LOADED=false;GBL.CCBill={subaccount:"0007",points:"power crystals"};GBL.POST_AS_STRING=false;GBL.MAIN_DATA=undefined;GBL.STATUS_DIV=undefined;GBL.MAIN_TABS=undefined;GBL.REFRESH_STATUS=undefined;GBL.SHOW_USER_ID="show_user_id";GBL.APP_LOAD_TIME=(new Date()).getTime();GBL.STYLES={text:{color:"#FFFFFF",money:{color:"#00FF00"},favorPoint:{color:"#FF7F00"}}};GBL.TRACK_TAG="aliens";var l_isFacebook=false;try{l_isFacebook=isValid(FACEBOOK)&&FACEBOOK}catch(err){}var FACEBOOK=l_isFacebook;var OUTWORLD={};OUTWORLD.REFRESH_AD=undefined;OUTWORLD.REFRESH_AD_ID=undefined;var ABTEST_DESTINATION_URL="http://fremont02.youplusplus.com";function abTest(b,a){makeXMLNotCachedRequest(ABTEST_DESTINATION_URL+"/abtest?userId="+b+"&app=aliens&abTestName="+a)}if(!!(window.attachEvent&&!window.opera)){try{__revertCreateTextNode()}catch(err){}}String.prototype.supplant=function(a){return this.replace(/{([^{}]*)}/g,function(d,c){var e=a[c];return typeof e==="string"||typeof e==="number"?e: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,e,c,h,g){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(f){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=h;if(!isValid(a)){a=XMLRequestQueue.MAX_RETRIES}if(g==undefined||g==null){g=gadgets.io.ContentType.DOM}XML_REQUEST_QUEUE.addRequest(XMLRequestQueue.DO_GET,d,e,c,a,0,g)}function makeXMLSessionlessCachedRequest(c,d,b,e,h,g){var a=h;if(!isValid(a)){a=XMLRequestQueue.MAX_RETRIES}var f=e;if(!isValid(f)){f=0}if(g==undefined||g==null){g=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,e,g)}function XMLRequestQueue(){var i=0;var m=new Array();var w=new Array();var e=new Array();var t=new Array();var C=new Array();var x=new Array();var F=new Array();var u=new Array();var o=new Array();var k=undefined;var r=undefined;var p=undefined;var g=undefined;var l=undefined;var q=undefined;var n=0;var A=-1;var s=-1;var b=undefined;var B=undefined;var h=true;this.addRequest=j;this.timeoutRequest=y;function j(L,I,J,H,N,K,M){if(!isValid(H)){H={}}if(XMLRequestQueue.PREEMPT_REQUESTS&&h&&isValid(l)){outputDebug("Request to "+r+" has been pre-empted by "+I);m.push(k);w.push(r);e.push(p);t.push(g);x.push(q);C.push(n);F.push(A);u.push(s);o.push(M);G()}i+=1;m.push(L);w.push(I);e.push(J);t.push(H);x.push(N);C.push(0);F.push(K);u.push(i);o.push(M);D()}function z(H){return GBL.FLASH_PROXY_ENABLED&&XMLRequestQueue.USE_FLASH_PROXY&&isValid(XMLRequestQueue.AUTH_KEY)&&isValid(H.auth_key)}function D(){if(w.length==0){return}if(l!=undefined){return}k=m.pop();r=w.pop();p=e.pop();g=t.pop();l=(new Date()).getTime();q=x.pop();n=C.pop();A=F.pop();s=u.pop();b=o.pop();B=false;if(n>q){var H=p;G();if(isValidFunction(H)){outputDebug("calling callback with undefined ");H(undefined)}D()}else{v()}}function E(){n+=1;outputDebug("retrying with id="+s+" url="+r+" num_retries="+n+" retries");m.unshift(k);w.unshift(r);e.unshift(p);t.unshift(g);x.unshift(q);C.unshift(n);F.unshift(A);u.unshift(s);o.unshift(b);G();D()}function y(H){if(s!=H){outputDebug("Timeout request is already over for request with id: "+H);return}if(isValid(B)&&B){XMLRequestQueue.USE_FLASH_PROXY=false}outputDebug("Timeout for request with id: "+s);E()}function v(){if(z(g)){outputDebug("setting timeout for flash request ");window.setTimeout("XML_REQUEST_QUEUE.timeoutRequest(parseInt("+s+"));",XMLRequestQueue.FLASH_PROXY_FAIL_TIMEOUT)}else{window.setTimeout("XML_REQUEST_QUEUE.timeoutRequest(parseInt("+s+"));",XMLRequestQueue.MAX_TIMEOUT)}if(k==XMLRequestQueue.DO_GET){d(s)}else{if(k==XMLRequestQueue.DO_POST){f(s)}else{outputDebug("UNRECOGNIZED REQUEST TYPE!!! "+k);G();D()}}}function d(I){var P="?";if(r.indexOf("?")>-1){P="&"}var N=r;if(isValid(g)){var O="";for(var L in g){if(typeof(g[L])=="number"||typeof(g[L])=="string"||typeof(g[L])=="boolean"){O+=L+"="+g[L]+"&"}}if(O.length>0&&O.lastIndexOf("&")==O.length-1){O=O.substr(0,O.length-1)}N+=P+O}P="?";if(N.indexOf("?")>-1){P="&"}if(A<=0){var H=new Date().getTime();N=[N,P,"nocache=",H].join("")}else{var M=a(A);N=[N,P,"cache=",M].join("")}var J={};J.METHOD="GET";J.CONTENT_TYPE=b;J[gadgets.io.RequestParameters.AUTHORIZATION]=gadgets.io.AuthorizationType.SIGNED;outputDebug("GET request with id "+I+" sent to "+N+" 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(g.auth_key));if(z(g)){B=true;var K=function(Q){if(isValid(Q)){try{Q.text=decodeURI(Q.data)}catch(R){alert(R)}try{Q.data=parseXML(Q.text)}catch(R){alert(R)}}c(Q,I)};RequestProxyJS.makeRequest(N,K,J)}else{B=false;K=function(Q){c(Q,I)};gadgets.io.makeRequest(N,K,J)}}function f(N){var M=function(O){c(O,N)};if(isValid(GBL.POST_AS_STRING)&&GBL.POST_AS_STRING){var H="";for(var L in g){if(typeof(g[L])=="number"||typeof(g[L])=="string"||typeof(g[L])=="boolean"){H+=L+"="+g[L]+"&"}}if(A<=0){var J=new Date().getTime();H+="nocache="+J}else{var K=a(A);H+="cache="+K}var I={};I[gadgets.io.RequestParameters.POST_DATA]=H;I[gadgets.io.RequestParameters.METHOD]=gadgets.io.MethodType.POST;I[gadgets.io.RequestParameters.CONTENT_TYPE]=b;I[gadgets.io.RequestParameters.AUTHORIZATION]=gadgets.io.AuthorizationType.SIGNED;outputDebug("POST string request with id "+N+" sent to "+r+" with param "+H+" expecting content type: "+b);gadgets.io.makeRequest(r,M,I)}else{if(A<=0){g.nocache=new Date().getTime()}else{g.cache=a(A)}I={};I[gadgets.io.RequestParameters.POST_DATA]=g;I[gadgets.io.RequestParameters.METHOD]=gadgets.io.MethodType.POST;I[gadgets.io.RequestParameters.CONTENT_TYPE]=b;I[gadgets.io.RequestParameters.AUTHORIZATION]=gadgets.io.AuthorizationType.SIGNED;outputDebug("POST object request with id "+N+" sent to "+r+" with param "+g+" expecting content type: "+b);gadgets.io.makeRequest(r,M,I)}}function c(L,M){if(s!=M){outputDebug(" OUT of order request came back with id: "+M);return}h=false;if(k==XMLRequestQueue.DO_GET){outputDebug(" GET request with id "+M+" cameback for "+r+" after "+n+" num retries in "+((new Date()).getTime()-l)+" >>> "+L)}else{outputDebug(" POST request with id "+M+" cameback for "+r+" after "+n+" num retries in "+((new Date()).getTime()-l)+" >>> "+L)}var H=true;try{H=isValid(L.data)||isValid(L.text)}catch(J){H=false}if(!H){outputDebug(" response is not valid");E()}else{try{var I=getGadgetResponseData(L);if(isValid(getXMLNodeValue(I,"auth_key"))){XMLRequestQueue.AUTH_KEY=getXMLNodeValue(I,"auth_key")}}catch(J){}var K=p;G();if(isValidFunction(K)){K(L)}D()}h=true}function G(){k=undefined;r=undefined;p=undefined;g=undefined;l=undefined;q=XML_REQUEST_QUEUE.MAX_RETRIES;n=0;s=-1;b=undefined}function a(I){var H=new Date().getTime();return Math.floor(H/1000/I)}}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(e,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,f,a){var c=undefined;try{c=d.getElementsByTagName(f)}catch(b){}var e=[];if(isValid(c)&&c.length>0){jQuery.each(c,function(g,j){var h=a(j);e.push(h)})}return e}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 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(e,d,b,a){if(e.addEventListener){e.addEventListener(d,function(){b(a);return false},false);return true}else{if(e.attachEvent){var c=e.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 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,f){if(!isValid(a)){return a}if(a.length<=f){return a}var e=a.substring(0,f);var d=a.substring(f-1,a.length-1);var c=e.lastIndexOf("&");var b=d.indexOf(";");if(c!==-1&&b!==-1&&f-c-1+b<9){return e+d.substring(0,b+1)+".."}else{return e+".."}}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 f=new Array();if(a<c){for(var d=0;d<=a;d++){f.push(d)}return f}f=new Array();var b={};for(d=0;d<c;d++){var e=Math.round(Math.random()*a)%a;while(isValid(b[e])){e=(e+1)%a}b[e]=1;f.push(e)}return f}function getRandomItems(d,b){var a=getRandomNumbers(d.length,b);var e=new Array();for(var c=0;c<a.length;++c){e.push(d[a[c]])}return e}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(e,a,g,f){if(e<20){return(a&g)|((~a)&f)}if(e<40){return a^g^f}if(e<60){return(a&g)|(a&f)|(g&f)}return a^g^f}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 f="";for(var b=0;b<d.length*4;b+=3){var e=(((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){f+=g_b64pad}else{f+=c.charAt((e>>6*(3-a))&63)}}}return f}function getCSSRule(d,f){d=d.toLowerCase();if(document.styleSheets){var e=document.styleSheets[document.styleSheets.length-1];var c=0;var b=false;var a=0;if(e.cssRules){a=e.cssRules.length}else{a=e.rules.length}for(c=0;c<a;++c){if(e.cssRules){b=e.cssRules[c]}else{b=e.rules[c]}if(b){if(b.selectorText.toLowerCase()==d){if(f=="delete"){if(e.cssRules){e.deleteRule(c)}else{e.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 e=c.slice(0);for(var f=0;f<arguments.length;++f){e.push(arguments[f])}return b.apply(d,e)}};var IE=document.all?true:false;var CSSFLOAT=IE?"styleFloat":"cssFloat";function addCSSRule(f,h){var b=f.split(",");for(var e=0;e<b.length;e++){var a=b[e].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 g=getCSSRule(a);if(h){for(var c in h){if(c=="float"){g.style[CSSFLOAT]=h[c]}else{g.style[c]=h[c]}}}}return g}var convertCSSToJavascript=function(f){var d=document.createElement("STYLE");d.innerHTML=f;var g=document.getElementsByTagName("HEAD")[0];if(!g){throw new Error("Requires a HEAD element.")}g.appendChild(d);var h=document.styleSheets[document.styleSheets.length-1].cssRules;var j="";for(var e=0;e<h.length;e++){j+='addCSSRule("'+h[e].selectorText+'",\n';var c=h[e].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]}}}j+="  "+uneval(a)+"\n);\n"}document.styleSheets[document.styleSheets.length-1].disabled=true;return j};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(e){},d);b=true;a.innerHTML="Reported";a.style.cursor="auto"})}function delayCallback(a){return function(){setTimeout(a,1)}}var InviteUtil={};InviteUtil.REQUEST_URL="http://install-dynamic-lb.playdom.com/";InviteUtil.APP=GBL.TRACK_TAG;InviteUtil.MULTI_INVITE_BUCKET=20;InviteUtil.sendInvite=function(e,b,d,g){if(GBL.MAIN_DATA.takeMessageLock()){var c=e.getUserId===undefined?e:e.getUserId();var f=opensocial.newMessage(b);var h=InviteUtil.handleRequestShareApp(c,g,d);var a=function(i){GBL.MAIN_DATA.releaseMessageLock();h(i)};opensocial.requestShareApp(c,f,a)}};InviteUtil.sendMultipleInvite=function(f,b,c,e){if(GBL.MAIN_DATA.takeMessageLock()){f=f.slice(0,Math.min(f.length,InviteUtil.MULTI_INVITE_BUCKET));var d=opensocial.newMessage(b);var g=InviteUtil.handleMultipleRequestShareApp(f,e,c);var a=function(h){GBL.MAIN_DATA.releaseMessageLock();g(h)};opensocial.requestShareApp(f,d,a)}};InviteUtil.trackInvite=function(b,e,a){var d=InviteUtil.REQUEST_URL+"send_invite";if(!isValid(e)){e="invite"}var c={app:InviteUtil.APP,from_id:GBL.MAIN_DATA.getViewer().getUserId(),to_id:b,source:e,result:a};makeXMLNotCachedRequest(d,function(){},c)};InviteUtil.trackMultipleInvites=function(b,e,a){var d=InviteUtil.REQUEST_URL+"send_invite";if(!isValid(e)){e="invite"}var c={app:InviteUtil.APP,from_id:GBL.MAIN_DATA.getViewer().getUserId(),to_id:escape(b.join(",")),source:e,result:a};makeXMLNotCachedRequest(d,function(){},c)};InviteUtil.handleRequestShareApp=function(a,c,b){return function(e){var d=e.hadError();var g=e.getData();var f=0;if(d||g==MyOpenSpace.PostTo.Result.ERROR){f=-1;InviteUtil.trackInvite(a,c,"block")}else{if(g==MyOpenSpace.PostTo.Result.CANCELLED){f=0;InviteUtil.trackInvite(a,c,"cancel")}else{if(g==MyOpenSpace.PostTo.Result.SUCCESS){f=1;InviteUtil.trackInvite(a,c,"ok")}}}if(b){b(f)}}};InviteUtil.handleMultipleRequestShareApp=function(a,c,b){return function(e){var d=e.hadError();var g=e.getData();var f=0;if(d||g==MyOpenSpace.PostTo.Result.ERROR){f=-1;InviteUtil.trackMultipleInvites(a,c,"block")}else{if(g==MyOpenSpace.PostTo.Result.CANCELLED){f=0;InviteUtil.trackMultipleInvites(a,c,"cancel")}else{if(g==MyOpenSpace.PostTo.Result.SUCCESS){f=1;InviteUtil.trackMultipleInvites(a,c,"ok")}}}if(b){b(f)}}};var V_LIBRARY_OS_CONTAINER=opensocial.Container.get();var MS_OS_TOKEN=MyOpenSpace.MySpaceContainer.OSToken;function sendMessage(e,a,c,d){if(GBL.MAIN_DATA.takeMessageLock()){var b=function(g){GBL.MAIN_DATA.releaseMessageLock();if(isValid(d)){d(g)}};var f;f=opensocial.newMessage(c);f.setField(opensocial.Message.Field.TITLE,a);f.setField(opensocial.Message.Field.TYPE,opensocial.Message.Type.PRIVATE_MESSAGE);goToPageTop();if(e.getUserId()!=GBL.PLAYDOM_ID){opensocial.requestSendMessage(e.getUserId(),f,makeErrorCheckCallback("sendMessage",b))}}}function sendComment(d,b,c){if(GBL.MAIN_DATA.takeMessageLock()){var a=function(f){GBL.MAIN_DATA.releaseMessageLock();if(isValid(c)){c(f)}};var e;e=opensocial.newMessage(b);e.setField(opensocial.Message.Field.TYPE,opensocial.Message.Type.PUBLIC_MESSAGE);goToPageTop();if(d.getUserId()!=GBL.PLAYDOM_ID){opensocial.requestSendMessage(d.getUserId(),e,makeErrorCheckCallback("sendComment",a))}}}function sendCommentWOGoToPageTop(d,b,c){if(GBL.MAIN_DATA.takeMessageLock()){var a=function(f){GBL.MAIN_DATA.releaseMessageLock();if(isValid(c)){c(f)}};var e;e=opensocial.newMessage(b);e.setField(opensocial.Message.Field.TYPE,opensocial.Message.Type.PUBLIC_MESSAGE);if(d.getUserId()!=GBL.PLAYDOM_ID){opensocial.requestSendMessage(d.getUserId(),e,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,g,h){if(GBL.MAIN_DATA.takeMessageLock()){var b=function(i){GBL.MAIN_DATA.releaseMessageLock();if(isValid(g)){g(i)}};var f={};f[opensocial.Message.Field.TITLE]=a;f[opensocial.Message.Field.TYPE]=opensocial.Message.Type.NOTIFICATION;var e=opensocial.newMessage(c,f);goToPageTop();if(d.getUserId()!=GBL.PLAYDOM_ID){opensocial.requestSendMessage(d.getUserId(),e,makeErrorCheckCallback("postToBulletin",b,h))}}}function postToBulletinWOGoToPageTop(e,a,c,d,h){if(GBL.MAIN_DATA.takeMessageLock()){var b=function(i){GBL.MAIN_DATA.releaseMessageLock();if(isValid(d)){d(i)}};var g={};g[opensocial.Message.Field.TITLE]=a;g[opensocial.Message.Field.TYPE]=opensocial.Message.Type.NOTIFICATION;var f=opensocial.newMessage(c,g);if(e.getUserId()!=GBL.PLAYDOM_ID){opensocial.requestSendMessage(e.getUserId(),f,makeErrorCheckCallback("postToBulletinWOGoToPageTop",b,h))}}}function makeErrorCheckCallback(c,a,b){return function(e){var d=e.hadError();var g=e.getData();var f=0;if(d||g==MyOpenSpace.PostTo.Result.ERROR){f=-1}else{if(g==MyOpenSpace.PostTo.Result.CANCELLED){f=0}else{if(g==MyOpenSpace.PostTo.Result.SUCCESS){f=1}}}if(isValid(a)){a(f)}}}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_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{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.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(i){var j=undefined;var p=1;var d=i;var b=new Array();var a=new Array();var h=new Object();var m=100;var f=new Object();this.getNumUsers=l;this.getUsers=s;this.loadMoreUsers=c;this.getUserById=o;this.invalidateCache=k;this.getNumUsersHelper=r;var q=undefined;var n=undefined;function k(){outputDebug("invalidate CachedOSFriendList cache");j=undefined;p=0;b=new Array();a=new Array();h=new Object()}function l(t){outputDebug("CachedOSFriendList: getNumUsers");if(isValid(j)){t(j);return}q=t;r()}function r(){if(!isValid(GBL.ALL_USERS_CACHE.getNumUsers())){window.setTimeout(d+".getNumUsersHelper()",300);return}j=GBL.ALL_USERS_CACHE.getNumUsers();if(isValidFunction(q)){var t=q;q=undefined;t(j)}}function s(C,t,y){var A=C;outputDebug("CachedOSFriendList: getUsers start "+A+" num "+t);var w=Math.min(A+t,j);outputDebug("m_appUsersCache.length: "+b.length+" m_nonAppUsersCache.length: "+a.length+" l_indexEnd: "+w);var D=undefined;var B=a.length;if(B>=w){D=a.slice(A,w)}else{if(p<j){n=function(){s(A,t,y)};c()}else{var v=Math.min(A,B);var u=Math.min(w,B);var z=Math.max(0,A-B);var x=Math.max(0,w-B);D=a.slice(v,u);D=D.concat(b.slice(z,x))}}if(isValid(D)&&isValid(y)){y(D)}}function c(){outputDebug("getOSUsers: "+p);MyOpenSpace.DefaultPageSize=m;var t={};t[opensocial.DataRequest.PeopleRequestFields.FIRST]=p;t[opensocial.DataRequest.PeopleRequestFields.MAX]=m;var u=opensocial.newDataRequest();u.add(u.newFetchPeopleRequest(idSpecUtil.viewerFriends(),t),"viewerFriends");u.send(e)}function e(x){outputDebug("onLoadFriends: "+p);f=new Object();var y=false;var t="";try{var u=x.get("viewerFriends").getData();if(isValid(u)){y=true;u.each(function(A){var z=new User(A);h[z.getUserId()]=z;t+=z.getUserId()+",";f[z.getUserId()]=z});p+=m}}catch(w){y=false;outputDebug("onLoadFriends "+w)}if(!y){outputDebug("Getting OS Users failed, should I retry?")}else{}if(isValid(t)&&t.length>0){var v={};v.user_id=GBL.MAIN_DATA.getViewer().getUserId();v.query_ids=t;makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/get_app_users",g,v,true)}}function g(u){outputDebug("onLoadAppUsers");var x=getGadgetResponseData(u);if(x!=undefined){var y=x.getElementsByTagName("user");if(isValid(y)&&y.length>0){for(var t=0;t<y.length;t++){try{var B=getXMLNodeValue(y[t],"user_id");var z=getXMLNodeValue(y[t],"invite_blocked");var v=h[B];if(isValid(v)){v.fillSpecificInfoFromXML(y[t]);v.setHasApp(true);f[v.getUserId()]=undefined;if(v.getInviteBlocked()||v.getpartOfViewerMob()){b.push(v)}else{b.unshift(v)}}}catch(w){outputDebug("onLoadAppFriends: "+w)}}}}for(B in f){if(isValid(f[B])){a.push(f[B])}}if(isValid(n)){var A=n;n=undefined;A()}}function o(t){return h[t]}}CachedUserList.MY_REQUESTS=1;CachedUserList.MY_MOB=2;function CachedUserList(d){var m=d;var b=undefined;var n=new Array();var a=new Object();this.setTotalNumUsers=p;this.addUser=f;this.invalidateCache=g;var o=undefined;this.getNumUsers=j;this.onLoadNumUsers=l;var i=undefined;this.getUsers=k;this.onLoadUsers=e;this.getUserById=c;function p(q){b=q}function f(q){n.push(q);a[q.getUserId()]=q}function g(){outputDebug("invalidate user cache");b=undefined;n=new Array();a=new Object()}function j(r){if(b!=undefined){r(b);return}o=r;var q={};q.user_id=GBL.MAIN_DATA.getViewer().getUserId();q.action=h(m);makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/get_num_users",l,q)}function l(q){var r=getGadgetResponseData(q);if(r!=undefined){try{b=getXMLNodeValue(r,"num")}catch(s){outputAlert(s)}}if(isValidFunction(o)){var t=o;o=undefined;t(b)}}function k(u,r,q){if(!isValid(b)){j(function(){k(u,r,q)})}var w=Math.min(b-1,u+r-1);if(n.length>w){var v=true;for(var s=u;v&&s<=w;s++){if(!isValid(n[s])){v=false}}if(v){q(n);return}}if(n.length<=w){for(s=(n.length-1);s<=w;s++){n.push(null)}}i=q;var t={};t.user_id=GBL.MAIN_DATA.getViewer().getUserId();t.action=h(m);t.start=u;t.num=Math.min(r,b-u);makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/get_users",function(x){e(u,x)},t)}function e(w,v){var s=getGadgetResponseData(v);if(s!=undefined){var r=s.getElementsByTagName("user");if(isValid(r)&&r.length>0){for(var t=0;t<r.length;t++){var q=new User(undefined);q.createXMLUser(r[t]);n[w+t]=q;a[q.getUserId()]=q}}}if(isValidFunction(i)){var u=i;i=undefined;u(n)}}function c(q){return a[q]}function h(q){switch(q){case CachedUserList.MY_REQUESTS:return"request";case CachedUserList.MY_MOB:return"my_mob";default:outputDebug("Unrecognized category code "+q);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(k,h){var d=k;var n=h;var p=100;var b=50;var u=1;var m=undefined;var a=new Array();var r=new Object();var t=undefined;this.isFinished=f;this.fillList=e;this.getNumUsers=j;this.getMoreUsers=g;this.getCachedUsers=i;this.getUserById=o;this.hasUser=s;this.fillInAdditionalData=c;this.grabRandomFriends=l;function f(){return isValid(m)&&isValid(a)&&(a.length>500||a.length>=m)}function e(v){outputDebug("CachedOSFriendsAutoFetchList: fillList");if(f()){if(isValidFunction(v)){v()}return}t=v;g()}function g(){outputDebug("m_appUsersOnly: "+d+" getMoreUsers: "+a.length);if(f()){outputDebug("getMoreUsers: finished");if(isValidFunction(t)){t()}else{outputDebug("Call back is invalid")}return}MyOpenSpace.DefaultPageSize=p;var v={};if(d){v[opensocial.DataRequest.PeopleRequestFields.FILTER]=opensocial.DataRequest.FilterType.HAS_APP}v[opensocial.DataRequest.PeopleRequestFields.FIRST]=u;v[opensocial.DataRequest.PeopleRequestFields.MAX]=p;u+=p;var w=opensocial.newDataRequest();w.add(w.newFetchPeopleRequest(idSpecUtil.viewerFriends(),v),"viewerFriends");w.send(q)}function q(x){outputDebug("m_appUsersOnly: "+d+" onGetMoreUsers: "+a.length);var y=false;try{if(isValid(x.get("viewerFriends").getData())){m=parseInt(x.get("viewerFriends").getData().getTotalSize());outputDebug("onGetMoreUsers totalUsers: "+m);var w=x.get("viewerFriends").getData();if(isValid(w)){y=true;w.each(function(A){var z=new User(A);a.push(z);r[z.getUserId()]=z})}}}catch(v){y=false;outputDebug("onGetMoreUsers error "+v)}if(!y){outputDebug("onGetMoreUsers failed, should I retry?");return}window.setTimeout(n+".getMoreUsers()",b)}function i(){return a}function o(v){return r[v]}function s(v){return isValid(r[v])}function j(){return m}function c(z){try{var v=z.getElementsByTagName("user");if(isValid(v)&&v.length>0){for(var y=0;y<v.length;y++){var x=parseInt(getXMLNodeValue(v[y],"user_id"));if(this.hasUser(x)){var w=this.getUserById(x);w.fillSpecificInfoFromXML(v[y])}}}}catch(A){}}function l(w){if(!isValid(a)||!isValid(w)||w<=0){return[]}else{var x=getRandomNumbers(a.length,w);var v=[];jQuery.each(x,function(z,A){var y=a[A];if(isValid(y)&&y.getUserId()!=6221){v.push(y)}});return v}}}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,f,b){var e=document.createElement(a);if(b!=undefined&&b!=null&&b){var c=d.childNodes;if(c.length>0){d.insertBefore(e,c[0])}}else{d.appendChild(e)}return setStyle(e,f)}function makeElementId(b,c,e,d){var a=makeElement(b,c,d);a.id=e;return a}function makeElementClass(a,d,c,f,b){var e=makeElement(a,d,f,b);e.className=c;return e}function navigateToCanvas(){var a=gadgets.views.getSupportedViews();var b=a.canvas;gadgets.views.requestNavigateTo(b)}function formatNumberWithCommasAndSuffix(e,a,c,f){var g=Math.abs(a);var b=Math.abs(e);if(b<g){return formatNumberWithCommas(e)}if(b/c>=100){var d=Math.floor(e/c);return formatNumberWithCommas(d)+f}else{d=Math.floor(e*100/c)/100;return d+f}}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 e=c[0];var a=c.length>1?"."+c[1]:"";var b=/(\d+)(\d{3})/;while(b.test(e)){e=e.replace(b,"$1,$2")}return e+a}function ParentButton(e,a,d){this.enable=true;var b=makeElement("div",e,{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/mob/images/ui/button/button_blue.png");loadImage("http://cdn0.mobwarsapp.com/mob/images/ui/button/button_blue_click.png");loadImage("http://cdn0.mobwarsapp.com/mob/images/ui/button/button_blue_hover.png");loadImage("http://cdn0.mobwarsapp.com/mob/images/ui/button/button_gray.png");loadImage("http://cdn0.mobwarsapp.com/mob/images/ui/button/button_gray_click.png");loadImage("http://cdn0.mobwarsapp.com/mob/images/ui/button/button_gray_hover.png");function DivButton(i,d,a,e,c,b,f){var g=this;this.m_colorClass="button_blue";if(isValid(b)){this.m_colorClass="button_"+b}this.m_enabled=true;this.m_parentDiv=i;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(f!=undefined){this.m_btn.href=f}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 j=/Firefox[\/\s](\d+\.\d+)/.test(navigator.userAgent);if(j){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 h=this;if(isValid(a)){$(this.m_btn).click(function(){if(h.m_enabled){a(e)}})}}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(k,h,j,a,m){var i=k;var g=h;var d=j;var l=a;var b=m;var f=null;this.createDiv=e;this.getContainerDiv=c;if(i!=undefined){e(i)}function e(n){i=n;f=document.createElement("div");i.appendChild(f);f.style.backgroundImage="url('"+g+"')";f.style.backgroundPosition="center center";f.style.backgroundRepeat="no-repeat";if(isValid(b)&&b){}else{f.style.backgroundColor="#EEEEEE"}f.style.width=d;f.style.height=l}function c(){return f}}function PaginationDiv(l,f,b,e,j){var h=l;var d=undefined;var a=b;var k=e;var i=j;var c=f;if(isValid(h)){g(h)}function g(u){h=u;d=document.createElement("div");h.appendChild(d);d.style.margin="5px 50px 5px 0px";d.style.textAlign="right";if(a>1&&k>1){var o=document.createElement("a");o.href="#";o.className="paginationProgressionLink";o.appendChild(document.createTextNode("prev<<"));d.appendChild(o);addEventWithParameter(o,"click",c,k-1)}d.appendChild(document.createTextNode("  "));var r=Math.max(Math.ceil(j/2),i-(a-k));var n=Math.max(1,k-r);var s=Math.max(Math.ceil(j/2),i-k);var m=Math.min(a,k+s);if(n>1){var v=document.createElement("a");v.appendChild(document.createTextNode("1"));d.appendChild(v);v.href="#";v.className="paginationPageNum";d.appendChild(document.createTextNode("..."));addEventWithParameter(v,"click",c,1)}for(var p=n;p<=m;p++){if(p!=k){v=document.createElement("a");v.href="#";v.className="paginationPageNum";v.appendChild(document.createTextNode(p));d.appendChild(v);addEventWithParameter(v,"click",c,p)}else{var q=document.createElement("span");d.appendChild(q);q.className="paginationCurPageNum";q.appendChild(document.createTextNode(p))}}if(m<a){d.appendChild(document.createTextNode("..."));v=document.createElement("a");v.appendChild(document.createTextNode(a));v.href="#";v.className="paginationPageNum";d.appendChild(v);addEventWithParameter(v,"click",c,a)}if(b>1&&k<b){var t=document.createElement("a");t.href="#";t.className="paginationProgressionLink";t.appendChild(document.createTextNode("next>>"));d.appendChild(t);addEventWithParameter(t,"click",c,k+1)}}}function SideBySideCells(n,g,m){var k=n;var h=undefined;var e=g;var b=undefined;var d=undefined;var i=undefined;var l=m;this.createDiv=j;this.getTable=f;this.getContainerDiv=c;this.getLeftCell=a;this.getRightCell=o;if(k!=undefined){j(k)}function j(r){k=r;h=document.createElement("div");k.appendChild(h);b=document.createElement("table");h.appendChild(b);var p=document.createElement("tbody");b.appendChild(p);var q=document.createElement("tr");p.appendChild(q);d=document.createElement("td");if(l){d.valign=l;d.style.verticalAlign="top"}q.appendChild(d);i=document.createElement("td");if(l){i.vAlign=l;i.style.verticalAlign="top"}q.appendChild(i);if(e){h.style.textAlign="center";b.style.marginLeft="auto";b.style.marginRight="auto"}}function c(){return h}function a(){return d}function o(){return i}function f(){return b}}function SideBySide3Cells(n,h){var m=n;var j=undefined;var e=h;var b=undefined;var d=undefined;var k=undefined;var g=undefined;this.createDiv=l;this.getTable=f;this.getContainerDiv=c;this.getLeftCell=a;this.getRightCell=o;this.getMiddleCell=i;if(m!=undefined){l(m)}function l(r){m=r;j=document.createElement("div");m.appendChild(j);b=document.createElement("table");j.appendChild(b);var p=document.createElement("tbody");b.appendChild(p);var q=document.createElement("tr");p.appendChild(q);d=document.createElement("td");q.appendChild(d);g=document.createElement("td");q.appendChild(g);k=document.createElement("td");q.appendChild(k);if(e){j.style.textAlign="center";b.style.marginLeft="auto";b.style.marginRight="auto"}}function c(){return j}function a(){return d}function o(){return k}function i(){return g}function f(){return b}}function SideBySide3ClassCells(j){var i=j;var b=undefined;var c=undefined;var g=undefined;var e=undefined;this.createDiv=h;this.getTable=d;this.getLeftCell=a;this.getRightCell=k;this.getMiddleCell=f;if(i!=undefined){h(i)}function h(n){i=n;b=makeElementClass("table",i,"side_by_side_three_cell");var l=makeElement("tbody",b);var m=makeElement("tr",l);c=makeElement("td",m);e=makeElement("td",m);g=makeElement("td",m)}function a(){return c}function k(){return g}function f(){return e}function d(){return b}}function TabsDiv(g,e,i,d,f,c,h,j,b,a,k){this.m_showContentDivTopPosition="155px";this.m_hideContentDivTopPosition="-10000px";this.m_parentDiv=g;this.m_tabsNamesArray=e;this.m_tabsCallbacksArray=i;this.m_tabsAlignArray=d;this.m_defaultTabIndex=f;this.m_unSelectedSpanClassName=c;this.m_selectedSpanClassName=h;this.m_leftWidth=j;this.m_contentX=b;this.m_contentYOffset=a;this.m_contentWidth=k;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 h=document.createElement("tr");a.appendChild(h);var f=makeElementId("td",h,"tabTableLeftCell");var g=makeElementId("td",h,"tabTableRightCell");h.appendChild(f);f.style.textAlign="left";if(isValid(this.m_leftWidth)){if(this.m_leftWidth!="none"){f.style.width=this.m_leftWidth}}else{f.style.width="850px"}var e=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"){g.appendChild(b)}else{f.appendChild(b)}this.m_tabSpansArray.push(b);addEventWithParameter(b,"click",function(i){e.switchToTab(i)},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(h,c,d,a,i,b,e,g,f){this.m_parentDiv=h;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=i;this.m_tabContentHeight=b;this.m_tabAlignment=e;this.m_rightMargin=g;this.m_marginTop=f;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(k,l,b,h,g,a,i){this.m_parentDiv=k;this.m_containerDiv=undefined;this.m_tabsDiv=undefined;this.m_tabCells=undefined;this.m_tabContentDiv=undefined;this.m_tabUnselectedStyles=l;this.m_tabSelectedStyles=b;this.m_spacingStyle=h;this.m_tabCallbacks=g;this.m_contentHeight=a;this.m_defaultTabIndex=i;this.m_curSelectedTabIndex=-1;if(isValid(this.m_tabUnselectedStyles)){for(var e in this.m_tabUnselectedStyles){var c=this.m_tabUnselectedStyles[e];var d=c.width.replace("px","");var j=c.height.replace("px","");var f=c.backgroundImage.replace("url(","").replace(")","");preloadImage(d,j,f)}}if(isValid(this.m_tabSelectedStyles)){for(e in this.m_tabSelectedStyles){c=this.m_tabSelectedStyles[e];d=c.width.replace("px","");j=c.height.replace("px","");f=c.backgroundImage.replace("url(","").replace(")","");preloadImage(d,j,f)}}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 e=makeElement("tbody",c);var a=makeElement("tr",e);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,e,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=e;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 g=makeElement("table",this.m_containerDiv);var b=makeElement("tbody",g);var c=makeElement("tr",b);var j=makeElement("td",c,{verticalAlign:"top",paddingTop:"10px"});var a=makeElement("td",c,{verticalAlign:"top"});this.m_tabsDiv=makeElement("div",j,{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 k=makeElement("table",this.m_tabsDiv,{borderCollapse:"collapse",cellSpacing:"0px"});var i=makeElement("tbody",k);var d=undefined;j=undefined;var h=undefined;for(var e=0;e<this.m_tabNames.length;e++){d=makeElement("tr",i);j=makeElement("td",d,{width:"150px",padding:"0px"});h=makeElement("div",j);this.m_tabTds.push(h);this.createTab(e)}for(var f=0;f<this.m_numGuideCells;f++){d=makeElement("tr",i);j=makeElement("td",d,{width:"150px",padding:"0px"});h=makeElement("div",j,{padding:"3px 10px 3px 10px",backgroundColor:"#000000",color:"#000000",fontSize:"12px",fontWeight:"normal",borderRight:"solid 1px #555555"});h.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(i,j){var g=i;var b=j;var c=null;var a=null;this.createDiv=f;this.getText=h;this.getTextArea=e;this.clear=d;if(g!=undefined){f(g)}function f(k){g=k;c=document.createElement("div");g.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 h(){return a.value}function e(){return a}}function TextFieldDiv(j,k,l,b){var h=j;var a=k;var d=null;var g=null;var c=l;var e=b;this.createDiv=f;this.getText=i;if(h!=undefined){f(h)}function f(n){h=n;outputDebug("TextFieldDiv: createDiv");d=document.createElement("div");h.appendChild(d);try{g=document.createElement("<input type='text' size='"+c+"' maxlength='"+e+"'/>")}catch(m){g=document.createElement("input");g.type="text";g.size=c;g.maxLength=b}if(a!=undefined&&a!=null){g.value=k}d.appendChild(g)}function i(){return g.value}}function CenteredTextMessageDiv(j,i,h){var g=j;var b=i;var d=h;var f=null;var c=null;this.createDiv=e;this.getTextDiv=a;if(g!=undefined){e(g)}function e(k){g=k;outputDebug("CenteredTextMessageDiv: createDiv");f=makeElement("div",g);f.style.textAlign="center";c=makeElementClass("div",f,"centeredMessage");c.style.width=d;c.innerHTML=b}function a(){return c}}function TextMessageDiv(d,f){var b=d;var a=f;var c=null;this.createDiv=e;this.getContainerDiv=g;if(b!=undefined){e(b)}function e(h){b=h;outputDebug("HTMLDiv: createDiv");c=makeElementClass("div",b,"textMessage");c.innerHTML=a}function g(){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(p,l,m,o,b,a,g){var n=p;var k=l;var h=m;var f=o;var q=b;var d=a;var c=g;var j=null;this.createDiv=i;this.getContainerDiv=e;if(n!=undefined){i(n)}function i(r){n=r;j=document.createElement("div");n.appendChild(j);j.style.backgroundImage="url('"+k+"')";j.style.backgroundPosition="center center";j.style.backgroundRepeat="no-repeat";j.style.position="relative";if(isValid(d)){j.style.backgroundColor=d}j.style.width=f;j.style.height=q;appendZoomButton(j,h,c)}function e(){return j}}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 e=this.m_gameName;var c=GBL.MAIN_DATA.getViewer().getId();var b=GBL.MAIN_DATA.getViewer().getMobName();var a=GBL.MAIN_DATA.getShowOfferNetwork();var f="http://support-lb.myspacegamingapps.com/";if(REQUEST_DESTINATION_URL.search(/qa|127\.0\.0\.1/)!=-1){f="http://74.86.60.37:8080/"}var d=f+e+"/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 PDDialog(f,c,e,b,d,a){this.m_titleDiv=f;this.m_contentDiv=c;this.m_onCancellCallback=a;this.m_width=e;this.m_height=b;this.m_dialogStyle=d;this.m_moveOnResize=true;this.m_overlay=undefined;this.m_dialog=undefined}PDDialog.prototype.showDialog=function(){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 e=(document.body.clientWidth-d.m_width)/2;$(d.m_dialog).css({padding:"0px",margin:"auto",top:b+"px",left:e+"px",height:d.m_height+"px",width:d.m_width+"px",verticalAlign:"top",border:"8px solid #555555",zIndex:(PDDialog.maxZIndex++),opacity:"1",position:"absolute"});if(isValid(d.m_dialogStyle)){$(d.m_dialog).css(d.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);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/mob/images/ui/error_stripe.gif";this.iconImage="http://cdn0.mobwarsapp.com/mob/images/ui/icon_error.png";break;case ModalDialog.WARNING:this.headerImage="http://cdn0.mobwarsapp.com/mob/images/ui/warning_stripe.gif";this.iconImage="http://cdn0.mobwarsapp.com/mob/images/ui/icon_warning.png";break;case ModalDialog.INFO:this.headerImage="http://cdn0.mobwarsapp.com/mob/images/ui/info_stripe.gif";this.iconImage="http://cdn0.mobwarsapp.com/mob/images/ui/icon_info.png";break;case ModalDialog.QUESTION:this.headerImage="http://cdn0.mobwarsapp.com/mob/images/ui/question_stripe.gif";this.iconImage="http://cdn0.mobwarsapp.com/mob/images/ui/icon_question.png";break;default:this.headerImage="http://cdn0.mobwarsapp.com/mob/images/ui/error_stripe.gif";this.iconImage="http://cdn0.mobwarsapp.com/mob/images/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 e=(document.body.clientHeight-a.height)/2;var f=(document.body.clientWidth-a.width)/2;$(a.wrapper).css({top:e+"px",left:f+"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 l=this;var d=document.createElement("div");d.setAttribute("id","modal_overlay_id");var i="#f4f4f4";var n=2000;if(document.getElementById("mainFrame")!=null&&document.getElementById("mainFrame").clientHeight!=null){n=document.getElementById("mainFrame").clientHeight}$(d).css({position:"absolute",left:"0px",top:"0px",height:n+"px",width:"100%",zIndex:"10",backgroundColor:i,opacity:"0.5",margin:"0px auto",textAlign:"center"});this.wrapper=document.createElement("div");var m=(document.body.clientHeight-l.height)/2;var h=(document.body.clientWidth-l.width)/2;$(this.wrapper).css({padding:"0px",margin:"auto",top:m+"px",left:h+"px",height:l.height+"px",width:l.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 o=document.createElement("table");$(o).css({width:"100%",height:"100%",border:"2px solid #999",padding:"0px",margin:"0px",zIndex:"12"});var e=document.createElement("tbody");o.appendChild(e);var b=document.createElement("tr");var k=document.createElement("td");b.appendChild(k);e.appendChild(b);$(k).css({background:"transparent url("+l.headerImage+") repeat scroll left top",height:"14px"});var g=document.createElement("tr");var c=document.createElement("td");g.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;">'+l.title+"</td></tr><tr><td>"+l.text+"</td></tr></table>");e.appendChild(g);var a=document.createElement("tr");var j=document.createElement("td");a.appendChild(j);e.appendChild(a);$(j).css({textAlign:"center"});for(var f in l.button_n_params){j.appendChild(l.constructButton(f,l.button_n_params[f]))}l.wrapper.appendChild(o);l.moveOnResize(l.moveOnResze)};ModalDialog.prototype.constructButton=function(b,e){var a=this;if(e==null){e=a.hideModaDialog}var c=document.createElement("input");c.setAttribute("type","button");c.setAttribute("value",b);var d=function(){if(e){e()}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(j,k,c,e,l,a){this.title=j;this.text=k;this.clickCallback=c;this.hideDelay=(e!=undefined&&e!=null)?e:5000;this.height=(l!=undefined&&l!=null)?l:60;this.width=(a!=undefined&&a!=null)?a:250;var f=document.body.clientHeight;var m=document.body.clientWidth;var i=document.createElement("div");document.body.appendChild(i);if(this.text.length>87){this.text=this.text.substring(0,84)+"..."}this.unique_id="dynamic_floatingMessage_div_"+(new Date().getTime());i.setAttribute("id",this.unique_id);$(i).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=f-this.height-20;var g=m-this.width-20;$(i).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 h=this;var d=function(){if(c){c()}DynamicFloatingMessage_remove(h.unique_id)};$("#dynamic_floatingMessage_div_message_id").click(c);$(i).css({top:b,left:g});$(i).show(500);setTimeout("DynamicFloatingMessage_remove('"+h.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(f,e){return c.modal.impl.init(f,e)};c.modal.close=function(){c.modal.impl.close()};c.fn.modal=function(e){return c.modal.impl.init(this,e)};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(f,e){if(this.dialog.data){return false}d=c.browser.msie&&!c.boxModel;this.opts=c.extend({},c.modal.defaults,e);this.zIndex=this.opts.zIndex;this.occb=false;if(typeof f=="object"){f=f instanceof jQuery?f:c(f);if(f.parent().parent().size()>0){this.dialog.parentNode=f.parent();if(!this.opts.persist){this.dialog.orig=f.clone(true)}}}else{if(typeof f=="string"||typeof f=="number"){f=c("<div/>").html(f)}else{alert("SimpleModal Error: Unsupported data type: "+typeof f);return false}}this.dialog.data=f.addClass("simplemodal-data").css(this.opts.dataCss);f=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 e=this;c("."+this.opts.closeClass).bind("click.simplemodal",function(f){f.preventDefault();e.close()});c(window).bind("resize.simplemodal",function(){a=e.getDimensions();e.setPosition();if(b||d){e.fixIE()}else{e.dialog.iframe&&e.dialog.iframe.css({height:a[0],width:a[1]});e.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 e=this.opts.position;c.each([this.dialog.iframe||null,this.dialog.overlay,this.dialog.container],function(q,j){if(j){var o="document.body.clientHeight",t="document.body.clientWidth",v="document.body.scrollHeight",r="document.body.scrollLeft",m="document.body.scrollTop",h="document.body.scrollWidth",g="document.documentElement.clientHeight",p="document.documentElement.clientWidth",n="document.documentElement.scrollLeft",w="document.documentElement.scrollTop",x=j[0].style;x.position="absolute";if(q<2){x.removeExpression("height");x.removeExpression("width");x.setExpression("height",""+v+" > "+o+" ? "+v+" : "+o+' + "px"');x.setExpression("width",""+h+" > "+t+" ? "+h+" : "+t+' + "px"')}else{var l,f;if(e&&e.constructor==Array){var u=e[0]?typeof e[0]=="number"?e[0].toString():e[0].replace(/px/,""):j.css("top").replace(/px/,"");l=u.indexOf("%")==-1?u+" + (t = "+w+" ? "+w+" : "+m+') + "px"':parseInt(u.replace(/%/,""))+" * (("+g+" || "+o+") / 100) + (t = "+w+" ? "+w+" : "+m+') + "px"';if(e[1]){var k=typeof e[1]=="number"?e[1].toString():e[1].replace(/px/,"");f=k.indexOf("%")==-1?k+" + (t = "+n+" ? "+n+" : "+r+') + "px"':parseInt(k.replace(/%/,""))+" * (("+p+" || "+t+") / 100) + (t = "+n+" ? "+n+" : "+r+') + "px"'}}else{l="("+g+" || "+o+") / 2 - (this.offsetHeight / 2) + (t = "+w+" ? "+w+" : "+m+') + "px"';f="("+p+" || "+t+") / 2 - (this.offsetWidth / 2) + (t = "+n+" ? "+n+" : "+r+') + "px"'}x.removeExpression("top");x.removeExpression("left");x.setExpression("top",l);x.setExpression("left",f)}}})},getDimensions:function(){var f=c(window);var e=c.browser.opera&&c.browser.version>"9.5"&&c.fn.jquery<="1.2.6"?document.documentElement.clientHeight:f.height();return[e,f.width()]},setPosition:function(){var h,g,f=(a[0]/2)-((this.dialog.container.height()||this.dialog.data.height())/2),e=(a[1]/2)-((this.dialog.container.width()||this.dialog.data.width())/2);if(this.opts.position&&this.opts.position.constructor==Array){h=this.opts.position[0]||f;g=this.opts.position[1]||e}else{h=f;g=e}this.dialog.container.css({left:g,top:h})},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,e,b){this.m_name=c;this.m_tabCreateCallback=a;this.m_contentCreateCallback=d;this.m_selectedCallback=e;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 e=this.m_tabCells[a];this.m_tabs[a].getUnselectedCallback()(e)}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();this.selectTab(0)}};CustomTabDiv.imageTabDomFunc=function(b,a){return function(e){$(e).html("");var d=makeElementClass("img",e,"TabUnselected");d.src=a;var c=makeElementClass("img",e,"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,e){if(isValidFunction(e)){$(b).find("."+d).each(e)}})}function handleItemsGrid(g,f,e,c,j){if(isValid(j)==false){j=3}var i=makeElement("table",g);var b=makeElement("tbody",i);var d=makeElement("tr",b);var a=undefined;var h=undefined;jQuery.each(f,function(m,l){if(m%j==0){a=makeElement("tr",b);h=makeElement("tr",b)}var k=makeElement("td",a);var n=makeElement("td",h);e(k,l);c(n,l)});return i}jQuery.fn.fadeToggle=function(a,c,b){return this.animate({opacity:"toggle"},a,c,b)};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(f,h,g,d){var c=this.m_handlers[f];if(!c){return}var b=[];for(var e=1;e<arguments.length;++e){b.push(arguments[e])}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 g=false;this.start=b;this.stop=f;this.tick=e;this.isRunning=i;var h=this;var d=function(){h.tick()};function b(){g=true;e()}function i(){return g}function f(){g=false}function e(){if(g){a();window.setTimeout(d,c)}}}function gifTrack(d,e){var c=+new Date();var b="http://install-dynamic-lb.playdom.com/log.gif?c="+c+"&app="+d;for(l_key in e){b+="&"+l_key+"="+e[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/mob/images/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 f=makeElement("ul",this.m_barDiv,{margin:"0px",padding:"0px",display:"inline",listStyleType:"none"});var h=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));h=Math.max(0,h);c=Math.max(0,c);var a=makeElement("li",f);$(a).css({width:h+"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 e=IE?(this.m_height-(0)):(this.m_height);b=Math.max(0,b);e=Math.max(0,e);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 g=makeElement("div",a);if(b!=0){$(g).css({width:b+"px",height:e+"px",background:"url("+this.m_barBackground+")",border:(this.m_border+"px")+" solid "+this.m_innerBorderColor,fontSize:"10px",fontFamily:"verdana"})}else{$(g).css({width:b+"px",height:e+"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)){return a}if(a.search(".gif")){a=a.replace(".gif",".png")}if(isIE6()&&a.search(".png")){a=a.replace(".png",".gif")}return a}function switchTabs(b,a){hideALLPDDialog();GBL.MAIN_TABS.switchToTab(b,a)}function switchTabsByName(b,a){hideALLPDDialog();GBL.MAIN_TABS.switchToTabWithName(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(j,m,i,l,e,o){j.innerHTML="";var g=makeElementClass("div",j,"titleTableDiv");var k=makeElement("table",g);var h=makeElement("tbody",k);var c=makeElement("tr",h);var n=makeElementClass("td",c,"titleTableTD");if(!!o){n.style.fontSize=o}n.innerHTML=m;outputDebug("options length: "+i+" same row: "+e);if(!isValid(i)||i.length<=0){return}outputDebug("doing options");if(!e){var a=makeElementClass("div",j,"subTitleTableDiv");var f=makeElement("table",a);var d=makeElement("tbody",f);c=makeElement("tr",d)}for(var b=0;b<i.length;b++){n=makeElementClass("td",c,"titleDivOption");n.innerHTML=i[b];if(isValidFunction(l[b])){n.className="clickableTitleDivOption";addEvent(n,"click",l[b])}if(b>0&&!e){n.style.borderLeft="solid 2px #FFFFFF"}}}function handleResult(x,o,B,k){try{var r=getGadgetResponseXML(x)}catch(f){r=undefined}if(!isValid(r)){o.showMessage(undefined,"Sorry, there was an unexpected error. Please refresh and try again.");return false}var d=getBooleanValue(getXMLFirstChildValue(r,"success"));try{var z=getBooleanValue(getXMLFirstChildValue(r,"completed"))}catch(f){z=undefined}var a=decodeEncodedStringValue(getXMLFirstChildValue(r,"message"));var h=getXMLFirstChild(r,"bulletin");var y=getXMLFirstChild(r,"viewer");try{var g=decodeEncodedStringValue(getXMLFirstChildValue(r,"image_url"))}catch(f){g=undefined}var j=undefined;try{j=getXMLEncodedStringNodeValue(r,"swf_content")}catch(f){}var q=undefined;try{q=getXMLFirstNode(r,"swf")}catch(f){}var w=undefined;try{w=getXMLEncodedStringNodeValue(r,"auth_key")}catch(f){}var C=GBL.MAIN_DATA.getViewer().getLevel();var A=GBL.MAIN_DATA.getViewer().getFavorPoints();var s=undefined;if(isValid(d)){if(d){z=true}else{if(!isValid(z)){z=false}}if(z){try{s=getBooleanValue(getXMLNodeValue(r,"repeatable"))}catch(f){}if(isValid(s)&&s&&isValid(k)){o.showMessage(d,a,h,g,k)}else{o.showMessage(d,a,h,g)}if(isValid(j)&&isValid(w)){GBL.FLASH_RESULT_DIV=o;var n=createSWFContent(j,w,700,400,GBL.BACKGROUND_COLOR,null);o.showCustomContent(undefined,n)}if(isValid(q)&&isValid(w)){GBL.FLASH_RESULT_DIV=o;n=createMobSWFContent(q,w,GBL.BACKGROUND_COLOR);o.showCustomContent(undefined,n)}GBL.MAIN_DATA.getViewer().fillSpecificInfoFromXML(y);if(isValid(GBL.MAIN_TABS)&&(C!=GBL.MAIN_DATA.getViewer().getLevel()||A!=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(B)){B()}try{var l=parseBoolean(getXMLNodeValue(r,"is_level_up"));if(!isValid(l)){l=isValid(getXMLFirstNode(r,"level_up_gain"))}if(l){postLevelUpAppStream()}}catch(f){}try{var p=getXMLNodeValue(r,"mission_name");var b=parseInt(getXMLNodeValue(r,"num_missions_completed_today"));if(isValid(p)&&b==1){postFirstMissionAppStream(p)}}catch(f){}try{var c=getXMLFirstNode(r,"achievement");if(isValid(c)){var v=getXMLNodeValue(c,"achievement_badge_name");var m=getXMLNodeValue(c,"achievement_badge_description");var t=getXMLNodeValue(c,"achievement_image");if(isValid(v)&&isValid(m)&&isValid(t)){postAchievementAppStream(v)}}}catch(f){}var i=undefined;try{i=customDecoding(getXMLNodeValue(r,"defender_name"))}catch(u){i=undefined}if(d&&isValid(i)&&Math.random()<=0.25){i=shortenedStringKeepEscapedCharacters(i,14);postAttackWonAppStream(i)}}else{o.showMessage(false,a)}}else{o.showMessage(undefined,"Sorry, there was an unexpected error. Please refresh and try again.")}handleAppNotificationCallback(x);return z}function NotificationButton(d){var e=d;var b=undefined;var f={};this.getButtonText=a;this.getAppParams=c;g();function g(){if(!isValid(e)){return}try{b=getXMLEncodedStringNodeValue(e,"button_text")}catch(l){}try{var m=getXMLFirstNode(e,"app_param_list")}catch(l){}if(isValid(m)){try{var i=m.getElementsByTagName("app_param")}catch(l){}if(isValid(i)){for(var k=0;k<i.length;++k){var h=getXMLEncodedStringNodeValue(i[k],"param_name");var j=getXMLEncodedStringNodeValue(i[k],"param_value");f[h]=j}}}}function a(){return b}function c(){return f}}function sendNotification(d,g,c){if(GBL.MAIN_DATA.getShowNotification()){var a=[];for(var f=0;f<c.length;f++){a.push(MyOpenSpace.newNotificationButton(MyOpenSpace.NotificationButton.UrlTypes.CANVAS,c[f].getButtonText(),c[f].getAppParams()))}var h={};h[MyOpenSpace.Notification.Field.BODY]=g;h[MyOpenSpace.Notification.Field.BUTTONS]=a;var i=MyOpenSpace.newNotification(h);var e=[];e.push(opensocial.newMediaItem("",MyOpenSpace.MediaItemHelper.PROFILE_PICTURE));if(e.length>0){h[MyOpenSpace.Notification.Field.MEDIA_ITEMS]=e}var b=[];jQuery.each(d,function(j,k){b.push(k);if((j%10)==9||j==(d.length-1)){setTimeout(sendNotificationOnTimeout(b,i),30*j);b=[]}})}}function sendNotificationOnTimeout(b,a){return function(){MyOpenSpace.requestCreateNotification(b,a,function(c){consoleLog("viral success")})}}function createItemsListDiv(m,n,d,l){if(!isValid(n)||n.length<=0){return}var k=makeElement("div",m);k.style.padding="8px";var h=makeElement("table",k);var f=makeElement("tbody",h);var c=undefined;for(var b=0;b<n.length;b++){if(b%d==0){c=document.createElement("tr");f.appendChild(c)}var j=n[b];if(isValid(j.number)&&j.type!="READABLE"){var g=makeElementClass("td",c,"itemListItemNum");g.innerHTML="<span>"+j.number+" x </span>"}if(j.type=="READABLE"){g=makeElementClass("td",c,"itemListItemNum")}var a=document.createElement("td");a.style.textAlign="center";c.appendChild(a);if(isValid(j.image_url)){var e=document.createElement("img");a.appendChild(e);if(l){e.src=j.small_image_url}else{e.src=j.image_url}}var i=makeElementClass("DIV",a,"itemListItemDesc");i.innerHTML=j.name;if(isValid(j.description)){i.innerHTML+="<br>("+j.description+")"}}}function createSmallItemsListDiv(n,o,e,m,f){if(!isValid(o)||o.length<=0){return undefined}var l=makeElement("div",n,{padding:"8px",textAlign:"center",margin:"auto"});var i=makeElement("table",l,{textAlign:"center",margin:"auto"});var h=makeElement("tbody",i);var d=undefined;var b=undefined;for(var c=0;c<o.length;c++){if(c%e==0){d=makeElement("tr",h);b=makeElement("tr",h,{verticalAlign:"top"})}var k=o[c];var a=makeElement("td",d,{minWidth:"85px"});if(isValid(k.image_url)){var g=document.createElement("img");if(isValid(f)){$(g).width(f+"px")}a.appendChild(g);if(m||isValid(k.small_image_url)){g.src=k.small_image_url}else{g.src=k.image_url}}a=makeElement("td",b,{width:"85px"});var j=makeElementClass("div",a,"itemListItemDesc");if(isValid(k.number)&&k.number>1){j.innerHTML=k.number+" x "+k.name}else{j.innerHTML=k.name}if(isValid(k.description)){j.innerHTML+="<br>("+k.description+")"}}return l}function createToggleItemsListDiv(j,k,c,i){if(!isValid(k)||k.length<=0){return}j.style.textAlign="left";var h=makeElement("div",j);h.style.padding="10px 0px 0px 0px";var a=undefined;var d=makeElement("table",h);var b=makeElement("tbody",d);createToggleItemsListDivHelper(k,b,c,0,Math.min(k.length,c),i);if(c<k.length){var g=makeElement("table",h);var e=makeElement("tbody",g);createToggleItemsListDivHelper(k,e,c,c,k.length,i);var f=makeElement("div",h);f.innerHTML="<a class='standardLink' href='#'><span id='questItemToggleOn'>Show More</span></a><a class='standardLink' href='#'><span id='questItemToggleOff'>Hide</span></a>";f.style.textAlign="center";$("tbody tr",g).hide();$("#questItemToggleOff").hide();$("#questItemToggleOn").click(function(){$("tbody tr",g).slideToggle(500);$("#questItemToggleOn").hide();$("#questItemToggleOff").show();return false});$("#questItemToggleOff").click(function(){$("tbody tr",g).slideToggle(500);$("#questItemToggleOff").hide();$("#questItemToggleOn").show();return false})}}function createToggleItemsListDivHelper(q,i,e,n,g,m){for(var d=n;d<g;d++){if(d%e==0){var c=document.createElement("tr");i.appendChild(c)}var k=q[d];var b=document.createElement("td");b.style.textAlign="center";c.appendChild(b);b.width="95px";if(isValid(k.image_url)){var f=document.createElement("img");b.appendChild(f);if(isValid(m)&&m&&isValid(k.small_image_url)){f.src=k.small_image_url}else{f.src=k.image_url}}if(((d+1)%e)!=0){var l=document.createElement("td");l.style.width="25px";c.appendChild(l)}if((((d+1)%e)==0)||((d+1)==q.length)){c=document.createElement("tr");c.style.verticalAlign="top";i.appendChild(c);var h=e;if((d+1)==q.length){h=q.length%e;if(h==0){h=q.length}}for(var p=0;p<h;p++){var o=d-(h-1)+p;k=q[o];var a=document.createElement("td");a.style.textAlign="center";c.appendChild(a);var j=makeElementClass("DIV",a,"smallLootItemTitle");j.style.width="105px";j.innerHTML=k.number+" x "+k.name+"<br>";if(isValid(k.description)){j.innerHTML+="<br>("+k.description+")"}if(p!=(e-1)){l=document.createElement("td");l.style.width="13px";c.appendChild(l)}}}}}function NumberSelectDiv(k,j,a){var f=k;var e=j;var l=a;var h=undefined;var i=1;var c=new Array();this.getSelectedNumber=m;this.getSelectionBox=b;d();function d(){h=makeElement("select",f);for(var n=1;n<=e;n++){g(n,n,n==i)}if(l!=undefined){for(var o in l){if(typeof(l[o])=="number"){g(l[o],l[o],l[o]==i)}}}}function g(n,o,q){var p=makeElement("OPTION",h);p.innerHTML=n;p.value=o;p.selected=q;c.push(p)}function m(){for(var n=0;n<c.length;n++){if(c[n].selected){return c[n].value}}return undefined}function b(){return h}}function NumberSelectActionDiv(t,i,e,d,u,k,n){var c=t;var v=undefined;var o=i;var j=e;var a=d;var b=u;var q=k;var m=n;var h=1;var s=undefined;this.getSelectionBox=r;this.disable=f;l();function l(){v=makeElement("div",c);var A=undefined;if(!isValid(m)){var x=new SideBySideCells(v);A=x.getRightCell();m=makeElement("select",x.getLeftCell());for(var y=1;y<=o;y++){g(y,y,y==h)}if(q!=undefined){for(var z in q){if(typeof(q[z])=="number"){g(q[z],q[z],q[z]==h)}}}}else{A=v}var w=new DivButton(A,j,function(){a(p())},undefined,false,u);if(isValid(b)){w.setColor(b)}s=w}function g(w,x,z){var y=document.createElement("OPTION");y.innerHTML=w;y.value=x;y.selected=z;m.appendChild(y)}function r(){return m}function p(){return $(m).val()}function f(){s.setEnabled(false)}}function createMobSWFContent(g,h,c){var i={};try{var e=getXMLEncodedStringNodeValue(g,"swf_name")}catch(f){}try{if(isValid(getXMLNodeValue(g,"swf_height"))){var a=parseInt(getXMLNodeValue(g,"swf_height"))}}catch(f){}try{if(isValid(getXMLNodeValue(g,"swf_width"))){var j=parseInt(getXMLNodeValue(g,"swf_width"))}}catch(f){}try{var b=getXMLFirstNode(g,"swf_args")}catch(f){}if(isValid(b)){try{var d=b.getElementsByTagName("swf_var")}catch(f){}if(isValid(d)){for(var k=0;k<d.length;++k){var l=getXMLEncodedStringNodeValue(d[k],"swf_var_name");i[l]=getXMLEncodedStringNodeValue(d[k],"swf_var_value")}}}return createSWFContent(e,h,j,a,c,i)}function createSWFContent(k,h,l,a,e,n){var i=document.createElement("div");i.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>';i.style.textAlign="center";var g=k.substr(0,k.lastIndexOf("/")+1);var m={userId:GBL.MAIN_DATA.getViewer().getUserId(),favorPoints:GBL.MAIN_DATA.getViewer().getFavorPoints(),authKey:h,bigswf:g};if(typeof REQUEST_DESTINATION_URL!="undefined"){consoleLog("Include request destination URL in flash:"+REQUEST_DESTINATION_URL);m.requestDestinationURL=REQUEST_DESTINATION_URL}if(isValid(n)){for(var j in n){m[j]=n[j]}}var f={menu:"false",allowScriptAccess:"always"};var d=null;d=new SWFObject(k,"Flash payload",isValid(l)?l:"550",isValid(a)?a:"350","9.0.28",isValid(e)?e:"#000000");for(var c in f){d.addParam(c,f[c])}for(var b in m){d.addVariable(b,m[b])}d.write(i);return i}function createGalaSWFContent(h,o,s,f,r,a,d,j,g){var i=isValid(g)?g:document.createElement("div");i.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>';i.style.textAlign="center";var e=h.substr(0,h.lastIndexOf("/")+1);var m={userId:GBL.MAIN_DATA.getViewer().getUserId(),favorPoints:GBL.MAIN_DATA.getViewer().getFavorPoints(),authKey:o,bigswf:e};if(typeof SWF_LOCATION!="undefined"){m.location=SWF_LOCATION}if(isValid(a)){for(var b in a){m[b]=a[b]}}var q={menu:"false",allowScriptAccess:"always"};if(isValid(d)){for(b in d){q[b]=d[b]}}var n=null;n=new SWFObject(h,isValid(j)?j:"flashpayload",isValid(s)?s:"550",isValid(f)?f:"350","9.0.28",isValid(r)?r:"#000000");for(var k in q){n.addParam(k,q[k])}for(var c in m){n.addVariable(c,m[c])}var l=n.write(i);return i}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(e){handleResult(e,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 e in a){c[e]=a[e]}}makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/minigame",function(f){handleResult(f,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(j,i,g,f){var e={mob:{img:"http://cdn0.mobwarsapp.com/mob/images/xpromo/mobsters.gif",url:"http://profile.myspace.com/Modules/Applications/Pages/Canvas.aspx?appId=104283&track=topbar"},racing:{img:"http://cdn0.mobwarsapp.com/mob/images/xpromo/overdrive.gif",url:"http://profile.myspace.com/Modules/Applications/Pages/Canvas.aspx?appId=123192&track=topbar"},vampires:{img:"http://cdn0.mobwarsapp.com/mob/images/xpromo/bloodline.gif",url:"http://profile.myspace.com/Modules/Applications/Pages/Canvas.aspx?appId=123150&track=topbar"},poker:{img:"http://cdn0.mobwarsapp.com/mob/images/xpromo/poker_palace.gif",url:"http://profile.myspace.com/Modules/Applications/Pages/Canvas.aspx?appId=109588&track=topbar"},sorority:{img:"http://cdn0.mobwarsapp.com/mob/images/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=i;c.style.top=g;for(var b in e){if(j.indexOf(b)>-1){consoleLog(b);var h=e[b];c.innerHTML+="<a target='_blank' href='"+h.url+"'><img style='border: none; margin-left: 8px;' src='"+h.img+"'></a>"}}if(!!f){$("#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/mob/images/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(v,o,l,e,u,k,a){var j="Like "+k+"?<br>Try these games.";var h=v.split(",");var t={mob:{img:"http://cdn0.mobwarsapp.com/mob/images/xpromo/new/IconStyle/Mobsters_logostyle.gif",url:"http://profile.myspace.com/Modules/Applications/Pages/Canvas.aspx?appId=104283&track=topbar_"+u},racing:{img:"http://cdn0.mobwarsapp.com/mob/images/xpromo/new/IconStyle/Overdrive_LogoStyle.gif",url:"http://profile.myspace.com/Modules/Applications/Pages/Canvas.aspx?appId=123192&track=topbar_"+u},vampires:{img:"http://cdn0.mobwarsapp.com/mob/images/xpromo/new/IconStyle/Bloodline_LogoStyle.gif",url:"http://profile.myspace.com/Modules/Applications/Pages/Canvas.aspx?appId=123150&track=topbar_"+u},poker:{img:"http://cdn0.mobwarsapp.com/mob/images/xpromo/new/IconStyle/Poker_LogoStyle.gif",url:"http://profile.myspace.com/Modules/Applications/Pages/Canvas.aspx?appId=109588&track=topbar_"+u},sorority:{img:"http://cdn0.mobwarsapp.com/mob/images/xpromo/new/IconStyle/Sorority_LogoStyle.gif",url:"http://profile.myspace.com/Modules/Applications/Pages/Canvas.aspx?appId=113384&track=topbar_"+u}};var b=document.createElement("div");var q=document.createElement("table");var d=document.createElement("tbody");var i=document.createElement("tr");q.appendChild(d);b.appendChild(q);d.appendChild(i);b.style.position="absolute";b.style.left=o;b.style.top=l;b.style.width="960px";b.style.background="#FFFFFF";var f=document.createElement("td");f.style.width="10px";i.appendChild(f);var g=document.createElement("td");g.innerHTML=j;$(g).addClass("xpromoText");i.appendChild(g);for(var s in h){var c=h[s];var n=document.createElement("td");var p=t[c];n.innerHTML="<a target='_blank' href='"+p.url+"'><img style='border: none; margin-left: 8px;' src='"+p.img+"'></a>";n.id="xpromoTd"+p.idName;i.appendChild(n)}if(!!e){$("#headerFrame").css({marginTop:49+a});var r=document.createElement("a");r.href="http://www.playdom.com/";r.style.border=0;r.style.position="absolute";r.style.right=10;r.style.top=7;r.target="_blank";var m=makeElement("img",r);m.style.borderStyle="none";m.src="http://cdn0.mobwarsapp.com/mob/images/xpromo/new/PlaydomLogo.gif";b.appendChild(r);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(h){try{var a=getXMLEncodedStringNodeValue(h,"user_list").split(",")}catch(e){consoleLog(e)}try{var f=getXMLEncodedStringNodeValue(h,"body_text")}catch(e){consoleLog(e)}consoleLog("handleAppNotification::Loaded bodyText");var g=[];try{var b=getXMLFirstNode(h,"button_list")}catch(e){consoleLog(e)}try{var d=b.getElementsByTagName("button")}catch(e){consoleLog(e)}if(isValid(d)){for(var c=0;c<d.length;c++){g.push(new NotificationButton(d[c]))}}if(isValid(a)&&a.length>0&&isValid(f)){sendNotification(a,f,g)}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 e=createWhiteDiv(this.m_refreshDiv);e.innerHTML=this.m_warningText}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,"initialViewChooseNameCell");h.innerHTML=this.m_chooseNameExplanation;h=makeElementClass("td",a,"initialViewChooseNameCell");var d=undefined;try{d=document.createElement("<input type='text' maxlength='20' />")}catch(g){d=document.createElement("input");d.type="text";d.maxLength="20"}d.style.width="150px";h.appendChild(d);h=makeElementClass("td",a,"initialViewChooseNameCell");var i=this;new DivButton(h,"Choose Name",function(){i.m_resultDiv.showMessage(undefined,"Checking ... ");var j={};j.user_id=GBL.MAIN_DATA.getViewer().getUserId();j.mob_name=encodeURIComponent(d.value);makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/choose_name",function(k){handleResult(k,i.m_resultDiv,function(){i.refresh()})},j)})};InitialChooserDiv.prototype.createChooseMobClassInterface=function(){createTitleDiv(this.m_title,this.m_chooseClassTitle);var e=document.createElement("table");this.m_refreshDiv.appendChild(e);e.style.marginLeft="auto";e.style.marginRight="auto";e.style.borderSpacing="6px";var c=document.createElement("tbody");e.appendChild(c);var a=document.createElement("tr");c.appendChild(a);var g=makeElementClass("td",a,"initialViewChooseMobClassCell");g.innerHTML=this.m_chooseClassExplanation;g=makeElementClass("td",a,"initialViewChooseMobClassCell");var i=document.createElement("select");g.appendChild(i);var d=new Array();var f=undefined;for(var b=0;b<this.m_classNameArray.length;b++){f=this.createOption(this.m_classDescriptionsArray[b],this.m_classNameArray[b],b==0);i.appendChild(f);d.push(f)}g=makeElementClass("td",a,"initialViewChooseMobClassCell");var h=this;new DivButton(g,"Choose",function(){h.m_resultDiv.showMessage(undefined,"Checking ... ");var k={};k.user_id=GBL.MAIN_DATA.getViewer().getUserId();for(var j=0;j<d.length;j++){if(d[j].selected){k.mob_class=d[j].value;break}}makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/choose_class",function(l){handleResult(l,h.m_resultDiv,function(){h.refresh()})},k)})};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(e){var c=getGadgetResponseData(e);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(!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_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(){this.m_containerDiv=makeElementClass("div",this.m_parentDiv,"statusTableDiv");this.m_parentDiv.appendChild(this.m_containerDiv);this.refreshStatus()};ViewerStatusDiv.prototype.createStatusElement=function(h,e,d){this.addTextStyle(h);$(h).css({position:"relative",left:"0px",top:"0px"});var a=makeElement("div",h);a.innerHTML=d;var g=document.all?true:false;var b=null;b=makeElementClass("div",h,"statsBarReloadTimer");var f=this[e];this[e]=d;var c=this;if(isValid(f)&&f!=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);$(this).dequeue()})}return b};ViewerStatusDiv.prototype.newStatusCell=function(){};ViewerStatusDiv.prototype.refreshStatus=function(){this.m_containerDiv.innerHTML="";var u=GBL.MAIN_DATA.getViewer();var k=document.createElement("table");this.m_containerDiv.appendChild(k);k.setAttribute("id","statusTable");k.style.marginLeft="auto";k.style.marginRight="auto";k.style.borderCollapse="separate";k.style.borderSpacing="3px 3px";var t=document.createElement("tbody");k.appendChild(t);var b=document.createElement("tr");t.appendChild(b);var q=makeElementClass("td",b,"statContentTD");this.addLinkToMyBoss(q);var i=document.createElement("table");q.appendChild(i);i.style.borderCollapse="separate";i.style.borderSpacing="8px 0px";var r=document.createElement("tbody");i.appendChild(r);var p=document.createElement("tr");r.appendChild(p);var w=makeElementClass("td",p,"mobNameCell");w.innerHTML='<span title="'+GBL.MAIN_DATA.getViewer().getMobName()+'">'+GBL.MAIN_DATA.getViewer().getShortMobName(this.m_maxNameLength)+"</span>";var c=makeElementClass("td",p,"statCell");var h=formatNumberWithAbbreviation(u.getCash());c.innerHTML=this.m_cashLabel+": $"+h;var g=makeElementClass("td",p,"statCell");var z=makeElementId("div",g,"healthStatus");this.m_healthTimerDiv=this.createStatusElement(z,"oldHealthStatus",this.m_healthLabel+": "+u.getHealth()+"/"+u.getMaxHealth());var v=makeElementClass("td",p,"statCell");var a=makeElementId("div",v,"energyStatus");this.m_energyTimerDiv=this.createStatusElement(a,"oldEnergyStatus",this.m_energyLabel+": "+u.getEnergy()+"/"+u.getMaxEnergy());var n=makeElementClass("td",p,"statCell");var e=makeElementId("div",n,"staminaStatus");this.m_staminaTimerDiv=this.createStatusElement(e,"oldStaminaStatus",this.m_staminaLabel+": "+u.getStamina()+"/"+u.getMaxStamina());var s=makeElementClass("td",p,"statCell");s.innerHTML=this.m_mobLabel+": ("+u.getMobSize()+")";var x=makeElementClass("td",p,"statCell");x.innerHTML=this.m_expLabel+": "+formatNumberWithCommas(u.getExperience());var o=makeElementClass("td",p,"levelStatCell");o.innerHTML="Level:"+u.getLevel();var y=GBL.MAIN_DATA.getViewer().getPercentToNextLevel();if(isValid(y)){var f=null;f=makeElementClass("div",o,"barOutDiv");var d=makeElementClass("div",f,"percentLevelDiv");d.style.width=y+"%"}var j=makeElementClass("td",b,"statContentTD myStatsLink");j.innerHTML="My Stats";this.addLinkToStats(j);var l=makeElementClass("td",b,"refreshButtonContentTD");this.m_refreshButtonEnabled=true;this.m_refreshButtonDiv=makeElementClass("div",l,"refreshButtonDiv");this.m_refreshButtonDiv.innerHTML="REFRESH";var m=this;addEvent(this.m_refreshButtonDiv,"click",function(){if(m.m_refreshButtonEnabled){m.m_refreshButtonEnabled=false;m.m_refreshButtonDiv.style.cursor="default";m.m_refreshButtonDiv.style.backgroundColor=m.m_refreshButtonActionColor;m.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.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,e,a){var f=d;var c=e;var h=a;var j=false;this.start=b;this.stop=i;this.tick=g;this.isRunning=k;function b(){j=true;g()}function k(){return j}function i(){j=false}function g(){if(j){h();window.setTimeout(f+".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 e=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(e)){e.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/mob/images/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 e=document.getElementById("chat_textarea").value;var b=document.getElementById("chat_header_text_counter");var h=document.getElementById("chat_header_reply_to");var a=document.getElementById("chat_submit_button");b.innerHTML=(this.maxMessageLength-e.length);if(e.length>this.maxMessageLength){document.getElementById("chat_textarea").value=(e.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(e.length>2&&e.charAt(0)=="@"){var d=e.split(" ",1);var g=d[0];h.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 f=this.m_reply_to_header;f=this.m_reply_to_header.replace("{0}",c);h.innerHTML=f}else{h.innerHTML=this.m_send_header}}this.m_submitBtn.setEnabled(e.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(f){},c,0);var e=new Array();for(var a=0;a<this.messageCache.length;a++){if(this.messageCache[a].getMessageId()!=d){e.push(this.messageCache[a])}}this.messageCache=e;return true};ChatWidget.prototype.clear=function(){$("#chat_history_wrapper").html("")};ChatWidget.prototype.sendMessage=function(){var g=GBL.MAIN_DATA.getViewer().getCash();var j=(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 k=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 m=new ChatMessage();var i=new Date();if(GBL.MAIN_DATA!=undefined){var f=GBL.MAIN_DATA.getViewer();m.setFromUserId(f.getUserId());m.setFromUserPix(f.getThumbnailUrl());m.setFromUserName(f.getName())}else{m.setFromUserId(USER_ID);m.setFromUserName(USER_NAME);m.setFromUserPix(PHOTO)}m.setToUserId(b);m.setParentMessage(d);m.setMessageText(a);m.setMessageDate(i);m.setDisplayDate("A moment ago...");m.setBroadcast(true);if(c!=-1){m.setParentMessage(this.getMessageFromCacheById(c))}var h={};h.user_id=m.getFromUserId();h.message=customEncoding(m.getMessageText());h.cost=j;h.reply_to=c;var e=document.getElementById("chat_header_reply_to");e.innerHTML=this.m_posting_message_header;var l=this;makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/broadcast",function(n){e.innerHTML=k.m_send_header;if(handleResult(n,l.m_resultDiv)){try{l.m_resultDiv.hideMessage()}catch(o){}}document.getElementById("chat_textarea").value="";$("chat_textarea").attr("disabled",false);document.getElementById("chat_header_text_counter").innerHTML=k.maxMessageLength;if(!k.isQueueRunning){k.refresh(true)}else{k.refresh(true)}},h,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 e=c.getFromUserName();if(b){d+=e+"; "+a}else{if(a.length>this.m_replyLength){d+=e+"; "+a.substr(0,this.m_replyLength)+"..."}else{d+=e+"; "+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 g=document.getElementById("inreply_"+a+"_"+b);g.innerHTML="";var e=document.getElementById("more_link_"+a+"_"+b);var d=document.getElementById("less_link_"+a+"_"+b);var c=this.getMessageFromCacheById(b);if(c!=null){var f=c.getParentMessage();g.innerHTML=this.constructInReplyText(f,false);$(d).hide();$(e).show()}};ChatWidget.prototype.formatDate=function(a){var c=a.getDate();var f=a.getMonth()+1;var e=a.getFullYear();var b=a.getHours();var d=a.getMinutes();var h=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(h).length==1){h="0"+h}var g=c+"/"+f+"/"+e+" "+b+":"+d+":"+h;return'<span class="chat_date_span">'+g+"</span>"};ChatWidget.prototype.addMessageRecord=function(i,x,E){var c=document.getElementById("chat_history_wrapper");var J=this;var a=false;if(E!=undefined&&E!=null){a=true}if(document.getElementById("table_"+i.getMessageId())!=null){return}var q=document.createElement("table");var K=makeElement("tbody",q);var D=makeElementClass("tr",K,"chat_tr");var o=makeElement("td",D);var B=makeElement("td",D);var h=makeElement("td",D);q.setAttribute("id","table_"+i.getMessageId());q.setAttribute("islive",x===undefined?false:x);$(q).css({"float":"left",width:"100%",marginTop:"5px",borderTop:"1px #ccc dotted",display:"none"});$(o).css({width:"50px",verticalAlign:"top"});$(B).css({width:"100%",verticalAlign:"top"});$(h).css({width:"20px",verticalAlign:"top"});var g=document.createElement("a");g.setAttribute("href","javascript:;");$(g).click(function(){J.deleteMessage(i.getMessageId())});var l=document.createElement("img");l.src="http://cdn0.mobwarsapp.com/mob/images/ui/button/icon_trash.gif";$(l).css({width:"16px",height:"16px",borderWidth:"0px"});g.appendChild(l);h.appendChild(g);var k=i.isBroadcast();if(k){var m=makeElement("a",h);m.setAttribute("href","javascript:;");$(m).click(function(){J.replyToMessage(i.getMessageId())});var H=makeElement("img",m);H.src="http://cdn0.mobwarsapp.com/prod_sororitywars/sororitywars/images/ui/icon_reply3.gif";$(H).css({width:"16px",height:"16px",borderWidth:"0px"})}var n=makeElement("img",o,{width:"48px",height:"48px",borderWidth:"0px"});if(i.getFromUserPix()==undefined||i.getFromUserPix()==null){n.src="http://x.myspacecdn.com/modules/common/static/img/no_pic.gif"}else{if(!isOffSite()&&i.getFromUserId()==GBL.MAIN_DATA.getViewer().getUserId()){try{n.src=GBL.MAIN_DATA.getViewer().getThumbnailUrl()}catch(I){n.src=i.getFromUserPix()}}else{n.src=i.getFromUserPix()}}if(i.getParentMessage()!=null){var f=i.getParentMessage();var b=makeElement("tr",K);var u=makeElement("td",b);var d=makeElement("td",b);var p=makeElement("td",b);b.appendChild(u);b.appendChild(d);b.appendChild(p);d.setAttribute("id","inreply_"+f.getMessageId()+"_"+i.getMessageId());d.setAttribute("class","chat_reply_td");$(d).css({fontSize:"11px"});d.innerHTML=this.constructInReplyText(f,false);var v=f.getMessageText();if(v.length>this.m_replyLength){var A=makeElement("a",p);A.setAttribute("href","javascript:void(0);");A.setAttribute("id","more_link_"+f.getMessageId()+"_"+i.getMessageId());$(A).click(function(){J.showReplyMessage(f.getMessageId(),i.getMessageId())});var s=makeElement("img",A);s.setAttribute("id","more_pix_"+f.getMessageId()+"_"+i.getMessageId());s.src="http://cdn0.mobwarsapp.com/prod_sororitywars/sororitywars/images/ui/icon_expand.gif";$(s).css({width:"16px",height:"16px",borderWidth:"0px"});var t=makeElement("a",p);t.setAttribute("href","javascript:void(0);");t.setAttribute("id","less_link_"+f.getMessageId()+"_"+i.getMessageId());$(t).click(function(){J.hideReplyMessage(f.getMessageId(),i.getMessageId())});var F=makeElement("img",t);F.setAttribute("id","less_pix_"+f.getMessageId()+"_"+i.getMessageId());F.src="http://cdn0.mobwarsapp.com/prod_sororitywars/sororitywars/images/ui/icon_expand.gif";$(F).css({width:"16px",height:"16px",borderWidth:"0px"});$(t).hide()}$(p).css({verticalAlign:"top"})}var j=(c.firstChild==null);if(j){c.appendChild(q)}else{var C=c.childNodes.length;var w=c.firstChild;if(w){c.insertBefore(q,w)}else{c.appendChild(q)}}var r=document.createElement("span");r.innerHTML='<span class="chat_date_span">'+i.getDisplayDate()+"</span><br/>";B.appendChild(r);var G=document.createElement("span");var y=makeElement("span",G);y.setAttribute("class","chat_message_text");y.innerHTML=i.getMessageText();$(G).css({color:GBL.STYLES.text.color});if(i.isBroadcast()){var z=document.createElement("a");z.setAttribute("href","javascript:;");$(z).click(function(){J.replyToMessage(i.getMessageId())});$(z).css({color:"#999999",textDecoration:"none"});z.innerHTML="&nbsp;reply&raquo;";G.appendChild(z)}B.appendChild(G);if(this.numberOfServerRequest==1||a){$(q).show()}else{$(q).slideDown(this.m_slideTime)}if(!a){this.messageCache.push(i)}};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(e){b.serverConnectionOpen=false;try{b.onRefresh(e)}catch(f){outputDebug("ui_chat 968"+f)}},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(e){b.serverConnectionOpen=false;try{b.onRequestData(e)}catch(f){outputDebug("ui_chat 968"+f)}},d,0)}else{d.newsfeed_type=c;makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/messages_by_type",function(e){b.serverConnectionOpen=false;try{b.onRequestFilterData(e)}catch(f){outputDebug("ui_chat 968"+f)}},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 e=d.getElementsByTagName("category_newsfeed");if(e.length>0){var k=e[0].getElementsByTagName("entry");for(var c=0;c<k.length;c++){a.push(new ChatMessage(k[c]))}}}catch(g){outputAlert(g)}}var j=new Array();for(var h=0;h<a.length;h++){var f=a[h].getMessageId();if(this.getMessageFromCacheById(f)==null){j.push(a[h])}}return j};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 e=0;e<b.length;e++){a.push(new ChatMessage(b[e]))}}catch(f){outputAlert(f)}}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 f=new TextBoxDiv(d);f.getTextArea().style.width="400px";f.getTextArea().rows=4;var c=this;var e=new DivButton(d,"Send Broadcast & Bulletin",function(){if(f.getText().length<=0){c.m_resultDiv.showMessage(undefined,"Please type a message.");return}if(f.getText().length>300){c.m_resultDiv.showMessage(undefined,"Sorry, the maximum length limit is 300 characters.");return}c.m_resultDiv.showMessage(undefined,"Sending...");var g={};g.user_id=GBL.MAIN_DATA.getViewer().getUserId();g.message=customEncoding(f.getText());g.cost=(25*GBL.MAIN_DATA.getViewer().getMobSize());c.postBulletinMessage(f.getText());makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/broadcast",function(h){handleResult(h,c.m_resultDiv,function(){c.refresh()})},g,0)});e.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 j=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 k=makeElementClass("a",a,"standardLink");k.href="javascript:void(0);";k.innerHTML="(delete all newsfeeds and broadcasts)";if(GBL.LIVE_NEWSFEED){this.m_resultDiv=new ResultDiv(this.m_refreshDiv)}addEvent(k,"click",function(){if(j.m_chatWidget){j.m_chatWidget.deleteAllMessages()}else{var i={};i.user_id=GBL.MAIN_DATA.getViewer().getUserId();makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/delete_all_newsfeeds",function(l){},i)}return false});var f=this.getTabValues();function c(i){return i}var g=new Array();var b=new Array();var h=this.m_resultDiv;for(var e=0;e<f.length;e++){if(e==0){g.push(c(f[e].tabName));b.push(function(i){i.innerHTML="";if(!isValid(j.m_chatWidget)){j.m_chatWidget=new ChatWidget(i,h,j.m_groupName,j.postBulletinMessage)}else{j.m_chatWidget.reattachDiv();j.m_chatWidget.requestData(f[0].filterKey)}})}else{g.push(c(f[e].tabName));b.push(this.getTabCallbacks(f[e].filterKey))}}this.l_categoryTabsDiv=null;this.l_categoryTabsDiv=new SubTabDiv(this.m_refreshDiv,g,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 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.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}};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};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(f){}try{this.m_data.energy=getXMLNodeValue(this.m_xmlNode,"energy")}catch(f){}try{this.m_data.mobster=getXMLNodeValue(this.m_xmlNode,"mobster")}catch(f){}try{this.m_data.cash=getXMLNodeValue(this.m_xmlNode,"cash")}catch(f){}try{this.m_data.totalTerritories=getXMLNodeValue(this.m_xmlNode,"territories")}catch(f){}try{this.m_data.attack=getXMLNodeValue(this.m_xmlNode,"attack")}catch(f){}try{this.m_data.defense=getXMLNodeValue(this.m_xmlNode,"defense")}catch(f){}try{this.m_data.missionsCompleted=getXMLNodeValue(this.m_xmlNode,"missions_completed")}catch(f){}try{this.m_data.fightsWon=getXMLNodeValue(this.m_xmlNode,"fights_won")}catch(f){}try{this.m_data.totalItems=getXMLNodeValue(this.m_xmlNode,"number_of_items")}catch(f){}try{this.m_data.hitlistKills=getXMLNodeValue(this.m_xmlNode,"hitlist_kills")}catch(f){}try{this.m_data.kills=getXMLNodeValue(this.m_xmlNode,"kills")}catch(f){}try{this.m_data.newMobster=getXMLNodeValue(this.m_xmlNode,"new_mobster")}catch(f){}try{this.m_data.healthRange=getXMLNodeValue(this.m_xmlNode,"health_range")}catch(f){}try{this.m_data.favorPoints=getXMLEncodedStringNodeValue(this.m_xmlNode,"favor_points")}catch(f){}try{this.m_data.additionalInfo=getXMLEncodedStringNodeValue(this.m_xmlNode,"additional_info")}catch(f){}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(f){}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 e=getXMLNodeValue(c[d],"name");this.m_data.classes.push(e)}}}catch(f){}try{var g=this.m_xmlNode.getElementsByTagName("items_of_category");if(isValid(g)&&g.length>0){var h=g[0];this.m_data.itemCategoryNumber=getXMLNodeValue(h,"number");this.m_data.itemCategoryCategory=getXMLNodeValue(h,"category")}}catch(f){}};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(f){}try{this.m_data.max=parseInt(getXMLNodeValue(this.m_xmlNode,"max"))}catch(f){}try{this.m_data.experience=parseInt(getXMLNodeValue(this.m_xmlNode,"experience"))}catch(f){}try{this.m_data.min_skill=parseInt(getXMLNodeValue(this.m_xmlNode,"min_skill"))}catch(f){}try{this.m_data.max_skill=parseInt(getXMLNodeValue(this.m_xmlNode,"max_skill"))}catch(f){}try{this.m_data.min_favor=parseInt(getXMLNodeValue(this.m_xmlNode,"min_favor"))}catch(f){}try{this.m_data.max_favor=parseInt(getXMLNodeValue(this.m_xmlNode,"max_favor"))}catch(f){}try{this.m_data.min_hired=parseInt(getXMLNodeValue(this.m_xmlNode,"min_hired"))}catch(f){}try{this.m_data.max_hired=parseInt(getXMLNodeValue(this.m_xmlNode,"max_hired"))}catch(f){}try{this.m_data.favorPoints=getXMLEncodedStringNodeValue(this.m_xmlNode,"favor_points")}catch(f){}try{this.m_data.additionalInfo=getXMLEncodedStringNodeValue(this.m_xmlNode,"additional_info")}catch(f){}var c=this.m_xmlNode.getElementsByTagName("item");if(isValid(c)&&c.length>0){this.m_data.items=new Array();for(var e=0;e<c.length;e++){var b=false;try{b=getBooleanValue(getXMLNodeValue(c[e],"is_avatar"))}catch(f){}try{var d=new Object();d.number=getXMLNodeValue(c[e],"number");d.image_url=getXMLEncodedStringNodeValue(c[e],"image_url");d.name=getXMLEncodedStringNodeValue(c[e],"name");if(b){d.name+="<br><span class='avatarOnlyTag'>(Avatar Item)</span>"}d.description=getXMLEncodedStringNodeValue(c[e],"description");this.m_data.items.push(d)}catch(f){outputDebug(f)}}}var g=getXMLFirstNode(this.m_xmlNode,"rotating_images");if(isValid(g)){var a=g.getElementsByTagName("url");if(isValid(a)&&a.length>0){this.m_data.rotatingImageUrls=new Array();this.m_data.rotatingImageDelays=new Array();for(e=0;e<a.length;e++){try{this.m_data.rotatingImageUrls.push(a[e].firstChild.nodeValue);this.m_data.rotatingImageDelays.push(300)}catch(f){outputDebug(f)}}}this.m_data.useSlotAnimation=true;try{this.m_data.useSlotAnimation=getBooleanValue(getXMLNodeValue(g,"use_slot_animation"))}catch(f){}}try{this.m_data.lootDescription=getXMLEncodedStringNodeValue(this.m_xmlNode,"loot_description")}catch(f){}};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/mob/images/ui/mastery/mastery_b.gif",SILVER:"http://cdn0.mobwarsapp.com/mob/images/ui/mastery/mastery_s.gif",GOLD:"http://cdn0.mobwarsapp.com/mob/images/ui/mastery/mastery_g.gif",PLATINUM:"http://cdn0.mobwarsapp.com/mob/images/ui/mastery/mastery_p.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=RESOURCE_DESTINATION_URL+"/../swfs";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 e=document.createElement("table");this.m_tableDiv.appendChild(e);e.style.marginLeft="auto";e.style.marginRight="auto";e.style.cellSpacing="0px";e.style.borderCollapse="collapse";var a=document.createElement("tbody");e.appendChild(a);var b=document.createElement("tr");a.appendChild(b);var h=document.createElement("td");b.appendChild(h);addHeaderStyleWithInnerDiv(h,this.m_rewardHeader,"250px");h=document.createElement("td");b.appendChild(h);addHeaderStyleWithInnerDiv(h,this.m_requirementHeader,"450px");h=document.createElement("td");b.appendChild(h);addHeaderStyleWithInnerDiv(h,this.m_actionHeader,"150px");var g=document.createElement("div");this.m_containerDiv.appendChild(g);g.style.padding="10px";g.innerHTML=getLoadingMessageHTML();var f="";var d={};d.level=GBL.MAIN_DATA.getViewer().getLevel();f=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(f,function(i){g.style.display="none";c.onGetJobList(i,a)},d)};JobListDiv.prototype.onGetJobList=function(d,g){var c=getGadgetResponseData(d);if(isValid(c)){try{this.m_authKey=getXMLEncodedStringNodeValue(c,"auth_key")}catch(f){}try{var a=c.getElementsByTagName("job");for(var e=0;e<a.length;e++){var h=new Job(a[e]);g.appendChild(this.createJobTr(h))}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(f){outputAlert("onGetJobList "+f)}if(isValidFunction(this.m_onGetJobListCallback)){this.m_onGetJobListCallback(c)}}};JobListDiv.prototype.createJobTr=function(c){var b=document.createElement("tr");var e=document.createElement("td");b.appendChild(e);e.style.padding="5px 20px 5px 10px";e.style.borderBottom="solid 1px #505050";e.style.verticalAlign="top";var d=createWhiteDiv(e);d.style.fontSize="14px";d.style.fontWeight="bold";d.innerHTML=c.getTitle();e.appendChild(this.getRewardDiv(c.getReward()));e=document.createElement("td");b.appendChild(e);e.style.padding="5px 10px 5px 10px";e.style.borderBottom="solid 1px #505050";e.style.verticalAlign="top";e.appendChild(this.getRequirementDiv(c.getRequirement()));e=document.createElement("td");b.appendChild(e);e.style.padding="5px 15px 5px 15px";e.style.borderBottom="solid 1px #505050";var a=this;new DivButton(e,this.m_doButtonText,function(f){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 e=d.getRequirement();if(isValid(e)){var c=e.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(f){var e={};e.user_id=GBL.MAIN_DATA.getViewer().getUserId();e.job_id=f.getJobId();var d=this;var c=undefined;if(isValid(this.m_repeatText)){c=document.createElement("p");var b=document.createElement("a");c.appendChild(b);b.className="standardLink";b.href="#";b.appendChild(document.createTextNode(this.m_repeatText));addEventWithParameter(b,"click",function(){d.doJob(f);gaTrackEvent("jobs","click","do_again")});GBL.LAST_REPEATABLE_JOB_LINK=document.createElement("p");b=document.createElement("a");GBL.LAST_REPEATABLE_JOB_LINK.appendChild(b);b.className="standardLink";b.href="#";b.appendChild(document.createTextNode(this.m_repeatText));addEventWithParameter(b,"click",function(){d.doJob(f);gaTrackEvent("jobs","click","do_again")})}var a=function(i){var h=function(){GBL.MAIN_TABS.invalidateTabs();d.refresh()};var j=function(){var l=undefined;var k=undefined;var n=undefined;try{k=getGadgetResponseData(i)}catch(m){}try{n=getBooleanValue(getXMLNodeValue(k,"success"))}catch(m){}try{l=getXMLEncodedStringNodeValue(k,"image_url")}catch(m){}if(!isValid(k)||!n||!isValid(l)){outputDebug("setStopImage: Validity check FAILED");return false}try{document.getElementById("imageflipperslot").setStopImageURL(l);return true}catch(m){outputDebug("setStopImage: Flash Call FAILED");return false}};var g=function(){var k=function(){handleResult(i,d.m_resultDiv,h,c)};if(f.getReward().useSlotAnimation()&&j()){slotStopped=k}else{k()}};if(f.getReward().useSlotAnimation()){window.setTimeout(g,2*1000)}else{if(isValid(f.getDelayMillis())&&f.getDelayMillis()>100&&!isSafariLTE3()&&!isOpera()){window.setTimeout(g,f.getDelayMillis())}else{g()}}};makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/do_job",a,e,1)};JobListDiv.prototype.getRewardDiv=function(c){var f=c.getData();var b=document.createElement("div");var a=undefined;var e=undefined;if(f.min>0||f.max>0){e=createWhiteDiv(b);e.innerHTML=this.m_rewardPayoutLabel+": <span class='rewardPayoutLabel'>$"+formatNumberWithCommas(f.min)+" - $"+formatNumberWithCommas(f.max)+" </span>"}if(f.experience>0){e=createWhiteDiv(b);e.innerHTML=this.m_rewardExperienceLabel+": +"+f.experience}if(isValid(f.favorPoints)){e=createWhiteDiv(b);e.style.color="#CD7F32";e.innerHTML=this.m_favorPointsLabel+": "+f.favorPoints}if(isValid(f.additionalInfo)){e=createWhiteDiv(b);e.innerHTML=f.additionalInfo}if(isValid(f.rotatingImageUrls)){this.addRewardImageFlipper(b,f)}else{if(isValid(f.lootDescription)||(isValid(f.items)&&f.items.length>0)){a=e=createWhiteDiv(b);var d=this.m_rewardLootLabel+":";if(isValid(f.lootDescription)){d+=" "+f.lootDescription}e.innerHTML=d;if(isValid(f.items)&&f.items.length>0){createItemsListDiv(b,f.items,1)}}}return b};JobListDiv.prototype.addRewardImageFlipper=function(b,g){var e=new SideBySideCells(b,false);var d={urls:g.rotatingImageUrls.join(","),delays:g.rotatingImageDelays.join(","),moveDuration:"600"};if(isValid(this.m_imageFlipperGalleryOptions)){for(var a in this.m_imageFlipperGalleryOptions){d[a]=encodeURIComponent(this.m_imageFlipperGalleryOptions[a])}}var f="";if(g.useSlotAnimation){f=this.m_swfsDir+"/ImageFlipper/ImageFlipperGallery.swf"}else{f=this.m_swfsDir+"/ImageFlipper/ImageFlipper.swf"}var c=createGalaSWFContent(f,this.getAuthKey(),125,75,"#000000",d,{wmode:"transparent"});$(e.getTable()).css({"border-spacing":"0px","border-collapse":"collapse"});e.getLeftCell().innerHTML='<span style="float:left;">'+this.m_rewardLootLabel+": </span>";$(e.getLeftCell()).css({"vertical-align":"top"});e.getRightCell().appendChild(c)};JobListDiv.prototype.addDoingContentImageFlipper=function(b,f){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:f.rotatingImageUrls.join(","),delays:f.rotatingImageDelays.join(",")};if(isValid(this.m_imageFlipperSlotOptions)){for(var a in this.m_imageFlipperSlotOptions){c[a]=encodeURIComponent(this.m_imageFlipperSlotOptions[a])}}var e=this.m_swfsDir+"/ImageFlipper/ImageFlipperSlot.swf";createGalaSWFContent(e,this.getAuthKey(),125*3,75,"#000000",c,{wmode:"transparent"},"imageflipperslot",d)};JobListDiv.prototype.getRequirementDiv=function(e){var d=e.getData();var c=document.createElement("div");var a=new SideBySideCells(c,false);var f=a.getLeftCell();f.style.verticalAlign="top";var g=createWhiteDiv(f);g.style.fontWeight="bold";g.style.fontStyle="italic";g.innerHTML="Requires...";if(d.energy>0){g=createWhiteDiv(f);g.innerHTML="Energy: "+d.energy}if(isValid(d.totalTerritories)&&d.totalTerritories>0){g=createWhiteDiv(f);g.innerHTML="Territories: "+d.totalTerritories}if(isValid(d.attack)&&d.attack>0){g=createWhiteDiv(f);g.innerHTML="Attack: "+d.attack}if(isValid(d.defense)&&d.defense>0){g=createWhiteDiv(f);g.innerHTML="Defense: "+d.defense}if(isValid(d.missionsCompleted)&&d.missionsCompleted>0){g=createWhiteDiv(f);g.innerHTML="Missions completed: "+d.missionsCompleted}if(isValid(d.fightsWon)&&d.fightsWon>0){g=createWhiteDiv(f);g.innerHTML="Fights Won: "+d.fightsWon}if(isValid(d.itemCategoryCategory)&&isValid(d.itemCategoryNumber)&&d.itemCategoryNumber>0){g=createWhiteDiv(f);g.innerHTML=d.itemCategoryCategory+": "+d.itemCategoryNumber}if(d.mobster>0){g=createWhiteDiv(f);g.innerHTML="Mobsters: "+d.mobster}if(isValid(d.newMobster)&&d.newMobster>0){g=createWhiteDiv(f);g.innerHTML="New Mobsters: "+d.newMobster+" <span class='missionsViewMobstersConsumed'>(consumed)</span>"}if(isValid(d.cash)&&d.cash>0){g=createWhiteDiv(f);g.innerHTML="Cash: $"+d.cash}if(isValid(d.favorPoints)){g=createWhiteDiv(f);g.style.color="#CD7F32";g.innerHTML=this.m_favorPointsLabel+": "+d.favorPoints}if(isValid(d.additionalInfo)){g=createWhiteDiv(f);g.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/mob/images/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(e){d.style.display="none";a.onGetJobList(e,a.m_tableDiv)},b)};SectorJobListDiv.prototype.createJobDiv=function(i){var h=document.createElement("div");$(h).css({paddingTop:"10px"});var d=createWhiteDiv(h,{fontWeight:"bold",backgroundColor:"rgb(70,28,28)",color:"rgb(255,255,255)",fontSize:"15px",paddingLeft:"5px",paddingTop:"2px",paddingBottom:"2px"});$(d).append(i.getTitle());if(i.getNewReleased()){d.innerHTML+="<span style='color:#FFFFFF;'>"+this.m_newMissionLabel+"</span>"}if(i.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(i.getFeatured()){d.style.color="#FFFFFF";$(d).css({backgroundColor:"rgb(28,55,110)"})}if(isValid(i.getFlavorText())){var e=makeElementClass("div",h,"job_flavor_text");e.innerHTML=i.getFlavorText()}var c=makeElement("table",h,{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 f=makeElement("td",b,{width:"240px",paddingLeft:"15px",paddingTop:"0px",verticalAlign:"top"});f.appendChild(this.getRewardDiv(i.getReward()));f=makeElement("td",b,{paddingLeft:"8px",width:"420px",verticalAlign:"top",borderLeft:"1px solid rgb(50, 50, 50)"});f.appendChild(this.getRequirementDiv(i.getRequirement()));f=makeElement("td",b,{width:"100px",paddingTop:"5px"});var g=this;new DivButton(f,this.m_doButtonText,function(){gaTrackEvent("jobs","click",i.getTitle());g.doJob(i)});return h};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 e=makeElement("td",b);addHeaderStyleWithInnerDiv(e,this.m_descriptionHeader,"300px");e=makeElement("td",b);addHeaderStyleWithInnerDiv(e,this.m_requirementHeader,"400px");e=makeElement("td",b);addHeaderStyleWithInnerDiv(e,this.m_actionHeader,"100px");return d};SectorJobListDiv.prototype.createJobsDiv=function(i){$(i).html("");var h=makeElement("div",i,{paddingTop:"5px",paddingDown:"5px"});var n=makeElement("div",h);var p=makeElement("div",h,{paddingTop:"10px"});var g=[];for(var c=0;c<this.m_sectorList.length;++c){var e=this.m_sectorList[c];var d=e.getData().name;if(d=="None"){continue}var f=makeElementClass("div",p,"MissionTabContent");if(this.m_sectorToJobList[d].length==0){if(isValid(e.getData().unlock_message)){var k=makeElement("div",f,{padding:"10px"});var b=makeElementClass("span",k,"nextLevelTabsDiv");b.style.fontSize="14px";b.innerHTML=e.getData().unlock_message}}else{if(isValid(this.m_nextLevel)){var a=makeElementClass("div",f);a.style.padding="10px";var m=makeElementClass("span",a,"nextLevelMissionsDiv");m.style.fontSize="14px";m.style.fontWeight="normal";m.innerHTML=this.m_nextLevelText+" "+this.m_nextLevel+" ..."}}var o=undefined;if(this.m_useTable&&this.m_sectorToJobList[d].length!=0){o=this.createJobTable(f)}else{o=makeElement("div",f)}if(this.m_sectorToJobList[d].length!=0){var l=this;jQuery.each(this.m_featuredJobList,function(q,r){if(l.m_useTable){$(o).children("tbody").append(l.createJobTr(r))}else{o.appendChild(l.createJobDiv(r))}});jQuery.each(this.m_sectorToJobList[d],function(q,r){if(l.m_useTable){$(o).children("tbody").append(l.createJobTr(r))}else{o.appendChild(l.createJobDiv(r))}})}g.push(new CustomTab(d,CustomTabDiv.imageTabDomFunc(e.getData().image_selected_URL,e.getData().image_unselected_URL),CustomTabDiv.showTabContentFunc(f,"MissionTabContent"),CustomTabDiv.tabSelectedFunc(d,"userJobSectorTab"),CustomTabDiv.tabUnselectedFunc()))}$(".MissionTabContent").hide();var j=new CustomTabDiv(n,g);$(j.getTabTable()).css({backgroundImage:this.m_spacerImage});if(isValid(GBL.userJobSectorTab)){j.selectTabByName(GBL.userJobSectorTab)}else{j.selectTab(0)}};SectorJobListDiv.prototype.onGetJobList=function(a,j){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(f){outputDebug("onGetJobList "+f)}try{var d=getXMLEncodedStringNodeValue(c,"latest_sector");if(isValid(d)&&d!=GBL.backendJobSectorTab){GBL.backendJobSectorTab=d;GBL.userJobSectorTab=d}}catch(f){outputDebug("onGetJobList "+f)}var b=undefined;try{var e=c.getElementsByTagName("sector");for(b=0;b<e.length;++b){var h=new JobSector(e[b]);var g=h.getData().name;if(isValid(g)&&!isValid(this.m_sectorToJobList[g])){this.m_sectorList.push(h);this.m_sectorToJobList[g]=[]}}this.m_sectorToJobList.None=[]}catch(f){outputDebug("onGetJobList "+f)}try{var i=c.getElementsByTagName("job");for(b=0;b<i.length;b++){var k=new Job(i[b]);this.m_jobList.push(k);if(k.getFeatured()){this.m_featuredJobList.push(k);continue}if(isValid(k.getSector())&&isValid(this.m_sectorToJobList[k.getSector()])){this.m_sectorToJobList[k.getSector()].push(k)}else{this.m_sectorToJobList.None.push(k)}}}catch(f){outputDebug("onGetJobList "+f)}try{this.m_nextLevel=getXMLNodeValue(c,"next_level")}catch(f){outputDebug("onGetJobList "+f)}this.createJobsDiv(j);if(isValidFunction(this.m_onGetJobListCallback)){this.m_onGetJobListCallback(c)}};SectorJobListDiv.prototype.getRewardDiv=function(c){var e=c.getData();var i=document.createElement("div");var h=undefined;if(isValid(e.mastery)){$(i).append(this.getMasteryTitleDiv(e.mastery))}var d=new SideBySideCells(i);var a=d.getLeftCell();var b=d.getRightCell();var f=d.getTable();setStyle(d.getTable(),{width:"100%",marginTop:"4px",borderCollapse:"collapse"});f.setAttribute("cellpadding",0);f.setAttribute("cellspacing",0);setStyle(a,{verticalAlign:"top"});setStyle(b,{verticalAlign:"top"});if(isValid(e.mastery)){$(a).append(this.getMasteryPercentDiv(e.mastery))}if(isValid(e.items)&&e.items.length>0){createSmallItemsListDiv(b,e.items,1)}var j=makeElementClass("div",a,"mission_reward",{fontWeight:"bold",fontSize:"14px",color:"#dddddd"});setInnerHTML(j,this.m_rewardLabel);if(e.min>0||e.max>0){j=makeElementClass("div",a,"mission_reward");setInnerHTML(j,"<span class='rewardPayoutLabel'>$"+formatNumberWithAbbreviation(e.min)+" - $"+formatNumberWithAbbreviation(e.max)+" </span> <span class='mission_reward_unit'>"+this.m_cashLabel+"</span>")}if(e.experience>0){j=makeElementClass("div",a,"mission_reward");setInnerHTML(j,"+"+e.experience+" <span class='mission_reward_unit'>"+this.m_rewardExperienceLabel+"</span>")}if(isValid(e.favorPoints)){j=makeElementClass("div",a,"mission_reward");setInnerHTML(j,this.m_favorPointsLabel+": "+e.favorPoints);$(j).css("color","#CD7F32")}if(isValid(e.additionalInfo)){j=makeElementClass("div",a,"mission_reward");setInnerHTML(j,e.additionalInfo)}if(isValid(e.rotatingImageUrls)){this.addRewardImageFlipper(i,e);$(i).find("span").addClass("coloredDiv")}else{if(isValid(e.lootDescription)){h=j=makeElementClass("div",a,"mission_reward");var g=this.m_rewardLootLabel+": "+e.lootDescription;setInnerHTML(j,g)}}return i};SectorJobListDiv.prototype.getRequirementDiv=function(e){var d=e.getData();var c=document.createElement("div");var a=new SideBySideCells(c,false);var f=a.getLeftCell();$(f).css("verticalAlign","top");var g=makeElementClass("div",f,"mission_requirement",{fontWeight:"bold",fontSize:"14px",color:"#dddddd"});setInnerHTML(g,this.m_requirementLabel);if(d.energy>0){g=makeElementClass("div",f,"mission_requirement");setInnerHTML(g,d.energy+" <span class='mission_requirement_unit'>"+this.m_energyLabel+"</span>")}if(isValid(d.totalTerritories)&&d.totalTerritories>0){g=makeElementClass("div",f,"mission_requirement");setInnerHTML(g,d.totalTerritories+" <span class='mission_requirement_unit'>"+this.m_totalTerritoriesLabel+"</span>")}if(isValid(d.attack)&&d.attack>0){g=makeElementClass("div",f,"mission_requirement");setInnerHTML(g,d.attack+" <span class='mission_requirement_unit'>"+this.m_attackLabel+"</span>")}if(isValid(d.defense)&&d.defense>0){g=makeElementClass("div",f,"mission_requirement");setInnerHTML(g,d.defense+" <span class='mission_requirement_unit'>"+this.m_defenseLabel+"</span>")}if(isValid(d.missionsCompleted)&&d.missionsCompleted>0){g=makeElementClass("div",f,"mission_requirement");setInnerHTML(g,d.missionsCompleted+" <span class='mission_requirement_unit'>"+this.m_missionsCompletedLabel+"</span>")}if(isValid(d.fightsWon)&&d.fightsWon>0){g=makeElementClass("div",f,"mission_requirement");setInnerHTML(g,d.fightsWon+" <span class='mission_requirement_unit'>"+this.m_fightsWonLabel+"</span>")}if(isValid(d.totalItems)&&d.totalItems>0){g=makeElementClass("div",f,"mission_requirement");setInnerHTML(g,d.totalItems+" <span class='mission_requirement_unit'>"+this.m_totalItemsLabel+"</span>")}if(isValid(d.hitlistKills)&&d.hitlistKills>0){g=makeElementClass("div",f,"mission_requirement");setInnerHTML(g,d.hitlistKills+" <span class='mission_requirement_unit'>"+this.m_hitlistKillsLabel+"</span>")}if(isValid(d.kills)&&d.kills>0){g=makeElementClass("div",f,"mission_requirement");setInnerHTML(g,d.kills+" <span class='mission_requirement_unit'>"+this.m_killsLabel+"</span>")}if(isValid(d.itemCategoryCategory)&&isValid(d.itemCategoryNumber)&&d.itemCategoryNumber>0){g=makeElementClass("div",f,"mission_requirement");setInnerHTML(g,d.itemCategoryNumber+" <span class='mission_requirement_unit'>"+d.itemCategoryCategory+"</span>")}if(isValid(d.classes)){g=makeElementClass("div",f,"mission_requirement");setInnerHTML(g," <span class='mission_requirement_unit'>"+getOrSeparatedListString(d.classes)+" class</span>")}if(d.mobster>0){g=makeElementClass("div",f,"mission_requirement");setInnerHTML(g,d.mobster+" <span class='mission_requirement_unit'>"+this.m_mobLabel+"</span>")}if(isValid(d.newMobster)&&d.newMobster>0){g=makeElementClass("div",f,"mission_requirement");setInnerHTML(g,d.newMobster+" <span class='mission_requirement_unit'>"+this.m_newMobLabel+"</span>")}if(isValid(d.cash)&&d.cash>0){g=makeElementClass("div",f,"mission_requirement");setInnerHTML(g,d.cash+" <span class='mission_requirement_unit'>"+this.m_cashLabel+"</span>")}if(isValid(d.favorPoints)){g=makeElementClass("div",f,"mission_requirement");setInnerHTML(g,d.favorPoints+" <span class='mission_requirement_unit'>"+this.m_favorPointsLabel+"</span>");$(g).css("color","#CD7F32");$(g).children().css("color","#CD7F32")}if(isValid(d.additionalInfo)){g=makeElementClass("div",f,"mission_requirement");setInnerHTML(g,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 f=a.getData().current-a.getData().min;var c=a.getData().max-a.getData().min;if(f>c){var b=makeElementClass("div",d,"mastery_level");var e=makeElement("img",b,{verticalAlign:"middle"});e.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: ");e=makeElement("img",b,{verticalAlign:"middle"});e.src=JobMastery.IMAGE_MAP[a.getData().level]}return d};SectorJobListDiv.prototype.getMasteryPercentDiv=function(a){var c=document.createElement("div");var e=a.getData().current-a.getData().min;var b=a.getData().max-a.getData().min;if(e>b){}else{var d=makeElement("div",c,{verticalAlign:"top",paddingTop:"5px",paddingBottom:"2px"});new ProgressBar(d).setVal(e,b)}return c};function TerritoryMessageList(a){this.m_parentDiv=a;this.m_containerDiv=undefined;this.m_contentDiv=undefined;this.m_broadcast=undefined;this.m_lastBroadcasts=undefined;this.m_showHideLink=undefined;this.createDiv()}TerritoryMessageList.prototype.createDiv=function(){this.m_containerDiv=document.createElement("div");this.m_parentDiv.appendChild(this.m_containerDiv);$(this.m_containerDiv).css({margin:"5px",border:"solid 1px red",textAlign:"left",display:"none"});var f=document.createElement("table");f.setAttribute("cellspacing","0px");f.setAttribute("cellpadding","0px");f.width="808px";this.m_containerDiv.appendChild(f);var b=document.createElement("tbody");var e=document.createElement("tr");var a=document.createElement("td");a.style.width="730px";a.vAlign="top";var c=document.createElement("td");c.vAlign="top";f.appendChild(b);b.appendChild(e);e.appendChild(a);e.appendChild(c);this.m_contentDiv=document.createElement("div");a.appendChild(this.m_contentDiv);this.m_contentDiv.style.margin="5px";this.m_showHideLink=document.createElement("a");this.m_showHideLink.setAttribute("href","javascript:void();");$(this.m_showHideLink).css({fontSize:"10px",color:"red"});this.m_showHideLink.innerHTML="[+] Read More";var d=document.createElement("div");d.appendChild(this.m_showHideLink);$(d).css({width:"70px",margin:"5px 0px"});c.appendChild(d);this.m_broadcast=document.createElement("div");this.m_contentDiv.appendChild(this.m_broadcast);$(this.m_broadcast).css({margin:"0px 5px",height:"auto"});this.m_lastBroadcasts=document.createElement("div");this.m_contentDiv.appendChild(this.m_lastBroadcasts);$(this.m_lastBroadcasts).css({margin:"0px 5px",height:"200px",display:"none"});this.initShowHideLink();this.refresh(1)};TerritoryMessageList.prototype.initShowHideLink=function(){var a=this;$(this.m_showHideLink).click(function(){if($(a.m_broadcast).is(":visible")){$(a.m_broadcast).css({display:"none"});a.m_lastBroadcasts.innerHTML="";$(a.m_lastBroadcasts).slideDown("normal",function(){$(this).css({overflow:"auto"});a.m_showHideLink.innerHTML="[-] Hide";a.refresh(10)})}else{a.m_broadcast.innerHTML="";$(a.m_lastBroadcasts).slideUp("normal",function(){$(a.m_broadcast).css({display:""});a.refresh(1);a.m_showHideLink.innerHTML="[+] Read More"})}})};TerritoryMessageList.prototype.refresh=function(b){if($(this.m_broadcast).is(":visible")){this.m_broadcast.innerHTML=getLoadingMessageHTML()}else{this.m_lastBroadcasts.innerHTML=getLoadingMessageHTML()}var c={};c.user_id=GBL.MAIN_DATA.getViewer().getId();c.start=0;c.max_messages=b;c.newsfeed_type="RAID";var a=this;makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/messages_by_type",function(d){a.onGetMessage(d)},c)};TerritoryMessageList.prototype.onGetMessage=function(a){if($(this.m_broadcast).is(":visible")){this.processBroadcast(a,this.m_broadcast)}else{this.processBroadcast(a,this.m_lastBroadcasts)}};TerritoryMessageList.prototype.processBroadcast=function(b,g){g.innerHTML="";var d=getGadgetResponseData(b);var a=new Array();if(isValid(d)){try{var h=d.getElementsByTagName("category_newsfeed");if(h.length>0){var i=h[0].getElementsByTagName("entry");for(var c=0;c<i.length;c++){a.push(new TerritoryMessageEntry(i[c]))}}}catch(f){outputAlert(f)}}if(a.length<=0){return}else{this.m_containerDiv.style.display=""}for(c=0;c<a.length;c++){if(c>0){if($(this.m_broadcast).is(":visible")){return}var e=document.createElement("hr");$(e).css({width:"100%","border-top":"solid 1px #cccccc","border-left":"0px","border-bottom":"0px","border-right":"0px"});g.appendChild(e)}g.appendChild(this.createBroadcastMessageDiv(a[c]))}};TerritoryMessageList.prototype.createBroadcastMessageDiv=function(a){var b=document.createElement("div");b.style.color="white";b.innerHTML=a.getTimeAgo()+": "+a.getMessage();return b};function TerritoryMessageEntry(a){this.m_xmlNode=a;this.m_id=undefined;this.m_type=undefined;this.m_timeAgo=undefined;this.m_message=undefined;this.fillFromXML()}TerritoryMessageEntry.prototype.fillFromXML=function(){if(!isValid(this.m_xmlNode)){return}try{this.m_id=getXMLNodeValue(this.m_xmlNode,"id")}catch(a){}try{this.m_type=getXMLNodeValue(this.m_xmlNode,"type")}catch(a){}try{this.m_timeAgo=getXMLEncodedStringNodeValue(this.m_xmlNode,"time_ago")}catch(a){}try{this.m_message=getXMLEncodedStringNodeValue(this.m_xmlNode,"message_html")}catch(a){}};TerritoryMessageEntry.prototype.getType=function(){return this.m_type};TerritoryMessageEntry.prototype.getId=function(){return this.m_id};TerritoryMessageEntry.prototype.getTimeAgo=function(){return this.m_timeAgo};TerritoryMessageEntry.prototype.getMessage=function(){return this.m_message};function Property(a){this.m_xmlNode=a;this.m_id=undefined;this.m_imageURL=undefined;this.m_detailsHTML=undefined;this.m_cost=undefined;this.m_numOwned=undefined;this.m_noSell=undefined;this.m_limit=undefined;this.m_purchaseLimit=undefined;this.m_income=undefined;this.m_name=undefined;this.m_builtOn=undefined;this.m_membersRequired=undefined;this.m_favorPoints=undefined;this.m_globalRemaining=undefined;this.m_soldOut=undefined;this.m_enhancementList=[];this.fillFromXML()}Property.prototype.fillFromXML=function(){if(!isValid(this.m_xmlNode)){return}try{this.m_id=getXMLNodeValue(this.m_xmlNode,"id")}catch(b){}try{this.m_imageURL=getXMLEncodedStringNodeValue(this.m_xmlNode,"image_url")}catch(b){}try{this.m_detailsHTML=getXMLEncodedStringNodeValue(this.m_xmlNode,"details")}catch(b){}try{this.m_cost=getXMLNodeValue(this.m_xmlNode,"cost")}catch(b){}try{this.m_numOwned=parseInt(getXMLNodeValue(this.m_xmlNode,"num_owned"))}catch(b){}try{this.m_noSell=parseBoolean(getXMLNodeValue(this.m_xmlNode,"no_sell"))}catch(b){}try{this.m_income=getXMLEncodedStringNodeValue(this.m_xmlNode,"income")}catch(b){}try{this.m_name=getXMLEncodedStringNodeValue(this.m_xmlNode,"name")}catch(b){}try{this.m_builtOn=getXMLEncodedStringNodeValue(this.m_xmlNode,"built_on")}catch(b){}try{this.m_membersRequired=getXMLNodeValue(this.m_xmlNode,"members_req")}catch(b){}try{if(isValid(getXMLNodeValue(this.m_xmlNode,"land_limit"))){this.m_limit=parseInt(getXMLNodeValue(this.m_xmlNode,"land_limit"))}}catch(b){this.m_limit=undefined}try{if(isValid(getXMLNodeValue(this.m_xmlNode,"purchase_limit"))){this.m_purchaseLimit=parseInt(getXMLNodeValue(this.m_xmlNode,"purchase_limit"))}}catch(b){this.m_purchaseLimit=undefined}try{this.m_favorPoints=getXMLNodeValue(this.m_xmlNode,"favor_points")}catch(b){}try{this.m_globalRemaining=parseInt(getXMLNodeValue(this.m_xmlNode,"global_remaining"))}catch(b){}try{this.m_soldOut=parseBoolean(getXMLEncodedStringNodeValue(this.m_xmlNode,"sold_out"))}catch(b){}var a=function(e){var d=new Object();d.prefix=isValid(getXMLEncodedStringNodeValue(e,"prefix"))?getXMLEncodedStringNodeValue(e,"prefix"):"";d.suffix=isValid(getXMLEncodedStringNodeValue(e,"suffix"))?getXMLEncodedStringNodeValue(e,"suffix"):"";d.value=isValid(getXMLEncodedStringNodeValue(e,"value"))?getXMLEncodedStringNodeValue(e,"value"):"";return d};try{var c=getXMLFirstNode(this.m_xmlNode,"enhancements");this.m_enhancementList=getXMLList(c,"enhancement",a)}catch(b){}};Property.prototype.getId=function(){return this.m_id};Property.prototype.getImageURL=function(){return this.m_imageURL};Property.prototype.getDetailsHTML=function(){return this.m_detailsHTML};Property.prototype.getCost=function(){return this.m_cost};Property.prototype.getNumOwned=function(){return this.m_numOwned};Property.prototype.getNoSell=function(){return this.m_noSell};Property.prototype.getLimit=function(){if(!isValid(this.m_limit)){return 20000}return this.m_limit};Property.prototype.getPurchaseLimit=function(){return this.m_purchaseLimit};Property.prototype.getName=function(){return this.m_name};Property.prototype.getBuiltOn=function(){return this.m_builtOn};Property.prototype.getIncome=function(){return this.m_income};Property.prototype.getMembersRequired=function(){return this.m_membersRequired};Property.prototype.getFavorPoints=function(){return this.m_favorPoints};Property.prototype.getGlobalRemaining=function(){return this.m_globalRemaining};Property.prototype.isSoldOut=function(){return this.m_soldOut};Property.prototype.getEnhancementList=function(){return this.m_enhancementList};function CityListDiv(a){this.m_parentDiv=a;this.m_containerDiv=undefined;this.m_titleDiv=undefined;this.m_resultDiv=undefined;this.m_tableDiv=undefined;this.m_featuredContainer=undefined;this.m_featuredList=undefined;this.m_landList=undefined;this.m_establishmentList=undefined;this.m_missionTitle=undefined;this.m_featuredLandTitle=undefined;this.m_undevelopedLandTitle=undefined;this.m_establishmentsTitle=undefined;this.m_explanationText=undefined;this.m_cashFlowText="Cash Flow";this.m_moreTerritoriesText="More territories available after you get to level";this.m_property=undefined;this.m_mobRaidEnabled=false;this.initialize();this.createDiv(this.m_parentDiv)}CityListDiv.prototype.initialize=function(){this.m_missionTitle="Mission Item";this.m_neededTitle="Needed";this.m_featuredLandTitle="Featured Properties";this.m_undevelopedLandTitle="Undeveloped Land";this.m_establishmentsTitle="Developments";this.m_explanationText="Territory produces the income you need to keep up with your expenses.     Your goal is a positive cash flow. Start by buying a plot of land. For even more income, build     developments on your land! If you lack the cash to buy what you want,     <a class='standardLink' href='#' onclick='switchTabsByName(\"Missions\");return false;'>complete missions<a> or     <a class='standardLink' href='#' onclick='switchTabsByName(\"Attack\");return false;'>attack rivals<a>."};CityListDiv.prototype.enableRaid=function(a){this.m_mobRaidEnabled=a};CityListDiv.prototype.createTitle=function(b,a){createTitleDiv(this.m_titleDiv,"Your Territory: <span class='subTitle'> (Income <span class='incomeTitleText'>$"+formatNumberWithCommas(GBL.MAIN_DATA.getViewer().getIncome())+"</span>, Upkeep From Equipment: <span class='expensesTitleText'>$"+formatNumberWithCommas(GBL.MAIN_DATA.getViewer().getUpkeep())+"</span> ) </span>",b,a,false)};CityListDiv.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";this.m_titleDiv=document.createElement("div");this.m_containerDiv.appendChild(this.m_titleDiv);this.createTitle();var a=createWhiteDiv(this.m_containerDiv);a.style.padding="5px";a.innerHTML=this.m_explanationText;this.m_resultDiv=new ResultDiv(this.m_containerDiv);if(this.m_mobRaidEnabled){new TerritoryMessageList(this.m_containerDiv)}this.m_tableDiv=document.createElement("div");this.m_containerDiv.appendChild(this.m_tableDiv);this.m_tableDiv.style.textAlign="center";this.refresh()};CityListDiv.prototype.refresh=function(){outputDebug("refresh");this.m_tableDiv.innerHTML="";var a=this;this.m_missionHolder=makeElement("div",this.m_tableDiv);this.m_featuredContainer=makeElement("div",this.m_tableDiv);this.m_featuredList=new PropertyListDiv(this.m_featuredContainer,this.m_featuredLandTitle,function(c,d){a.doBuy(c,d)},function(c,d){a.doSell(c,d)});$(this.m_featuredContainer).hide();this.m_landList=new PropertyListDiv(this.m_tableDiv,this.m_undevelopedLandTitle,function(c,d){a.doBuy(c,d)},function(c,d){a.doSell(c,d)});this.m_establishmentList=new PropertyListDiv(this.m_tableDiv,this.m_establishmentsTitle,function(c,d){a.doBuy(c,d)},function(c,d){a.doSell(c,d)});var b={};b.user_id=GBL.MAIN_DATA.getViewer().getUserId();b.has_le_land=false;makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/get_city_list",function(c){a.onGetCityList(c)},b)};CityListDiv.prototype.onGetCityList=function(j){outputDebug("onGetCityList");var p=getGadgetResponseData(j);if(isValid(p)){try{this.m_property={};var g=getXMLNodeValue(p,"update_period");var c=getXMLNodeValue(p,"minutes_to_update");var q=new Array();q.push(this.m_cashFlowText+":<span class='incomeTitleText'>$"+formatNumberWithCommas(GBL.MAIN_DATA.getViewer().getIncome()-GBL.MAIN_DATA.getViewer().getUpkeep())+"</span> every "+g+" minutes. Next paid in: "+c+" minutes");var h=new Array();h.push(undefined);this.createTitle(q,h);var n=getXMLFirstNode(p,"featured_lands");var l=n.getElementsByTagName("land");var i=this;jQuery.each(l,function(s,u){var t=new Property(u);i.m_property[t.getId()]=t;i.m_featuredList.addProperty(t)});if(l.length>0){$(this.m_featuredContainer).show()}var k=getXMLFirstNode(p,"undeveloped_lands");var m=k.getElementsByTagName("land");for(var r=0;r<m.length;r++){var o=new Property(m[r]);this.m_property[o.getId()]=o;this.m_landList.addProperty(o)}var a=getXMLFirstNode(p,"establishments");var b=a.getElementsByTagName("land");for(r=0;r<b.length;r++){o=new Property(b[r]);this.m_property[o.getId()]=o;this.m_establishmentList.addProperty(o)}var f=getXMLNodeValue(p,"next_level");if(isValid(f)){var d=document.createElement("div");this.m_tableDiv.appendChild(d);d.style.padding="10px";d.innerHTML="<span class='landUnlockMore'> "+this.m_moreTerritoriesText+" "+f+" ... </span>"}}catch(e){outputAlert("onGetCityList "+e);consoleLog("onGetCityList "+e)}}this.updateHighlight()};CityListDiv.prototype.doBuy=function(a,d){this.m_resultDiv.showMessage(undefined,"Buying ... ");goToPageTop();var c=this;var b=createCallbackLink("Buy more!",function(){c.doBuy(a,d);gaTrackEvent("lands","click","do_again")});var e={};e.user_id=GBL.MAIN_DATA.getViewer().getUserId();e.land_id=a;e.amount=d;makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/buy_land",function(f){handleResult(f,c.m_resultDiv,function(){GBL.MAIN_TABS.invalidateTabs();c.refresh()},b)},e,0)};CityListDiv.prototype.doSell=function(a,d){var c=this;this.m_resultDiv.showMessage(undefined,"Selling ... ");goToPageTop();var b=createCallbackLink("Sell more!",function(){c.doSell(a,d);gaTrackEvent("lands","click","do_again")});var e={};e.user_id=GBL.MAIN_DATA.getViewer().getUserId();e.land_id=a;e.amount=-d;makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/buy_land",function(f){handleResult(f,c.m_resultDiv,function(){GBL.MAIN_TABS.invalidateTabs();c.refresh()},b)},e,0)};CityListDiv.prototype.clearMissionRequirements=function(){$("tr.propertyItem").css("backgroundColor","");$(this.m_missionHolder).html("")};CityListDiv.prototype.highlightItem=function(b,c){if(!isValid(this.m_property)){return}var d=this.m_property[b];if(!isValid(d)){return}this.m_missionList.addProperty(d,c);var a=$(".land_"+b);a.css("backgroundColor","rgb(32,32,32)")};CityListDiv.prototype.updateHighlight=function(){this.clearMissionRequirements();var c=this;if(isValid(GBL.REQUIRED_ITEMS)&&GBL.REQUIRED_ITEMS.length>0){this.m_missionList=new PropertyListDiv(this.m_missionHolder,this.m_missionTitle,function(d,e){c.doBuy(d,e)},function(d,e){c.doSell(d,e)},this.m_neededTitle);for(var b=0;b<GBL.REQUIRED_ITEMS.length;b++){var a=GBL.REQUIRED_ITEMS[b];this.highlightItem(a.id,a.min)}}};function PropertyListDiv(b,c,d,e,a){this.m_parentDiv=b;this.m_containerDiv=undefined;this.m_typeName=c;this.m_loadingDiv=undefined;this.m_contentTBody=undefined;this.m_buyCallback=d;this.m_sellCallback=e;this.m_neededTitle=a;this.m_favorPointsText=isValid(GBL.FAVOR_POINTS_TEXT)?GBL.FAVOR_POINTS_TEXT:"favor points";if(this.m_parentDiv!=undefined){this.initialize();this.createDiv(this.m_parentDiv)}}PropertyListDiv.prototype.initialize=function(a){};PropertyListDiv.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.paddingTop="40px";this.m_containerDiv.style.textAlign="center";var b=makeElementClass("table",this.m_containerDiv,"dataTable",{marginLeft:"auto",marginRight:"auto",marginTop:"5px",cellSpacing:"0px",borderCollapse:"collapse"});this.m_contentTBody=makeElement("tbody",b);var a=makeElement("tr",this.m_contentTBody);if(isValid(this.m_neededTitle)){var d=makeElement("td",a);addHeaderStyleWithInnerDiv(d,this.m_typeName,"400px");d=makeElement("td",a);addHeaderStyleWithInnerDiv(d,this.m_neededTitle,"100px")}else{d=makeElement("td",a);addHeaderStyleWithInnerDiv(d,this.m_typeName,"500px")}d=document.createElement("td");a.appendChild(d);addHeaderStyleWithInnerDiv(d,"Buy / Sell","300px");this.m_loadingDiv=document.createElement("div");this.m_containerDiv.appendChild(this.m_loadingDiv);this.m_loadingDiv.style.padding="10px";this.m_loadingDiv.innerHTML=getLoadingMessageHTML()};PropertyListDiv.prototype.finishLoading=function(){this.m_loadingDiv.style.display="none"};PropertyListDiv.prototype.addProperty=function(g,d){this.m_loadingDiv.style.display="none";if(g.getLimit()<=0&&g.getNumOwned()<=0){return}var c=document.createElement("tr");$(c).addClass("propertyItem").addClass("land_"+g.getId());var h=document.createElement("td");c.appendChild(h);h.style.padding="5px 10px 5px 10px";h.style.textAlign="left";h.style.borderBottom="solid 1px #505050";var k=new SideBySideCells(h,false);k.getLeftCell().innerHTML="<img style='margin-left:auto; margin-right:auto;' src='"+g.getImageURL()+"'/>";k.getRightCell().style.paddingLeft="10px";k.getRightCell().style.verticalAlign="top";k.getRightCell().innerHTML=g.getDetailsHTML();if(!g.isSoldOut()&&g.getGlobalRemaining()>0){k.getRightCell().innerHTML+="<div class='itemRemaining'>Less than <b class='favorOfferQtyRemaining'>"+g.getGlobalRemaining()+"</b> remaining!</div>"}if(isValid(d)){h=makeElementClass("td",c,"landNeededNum");var a=d-g.getNumOwned();if(a>0){h.innerHTML=a+" more"}else{h.innerHTML="0 more"}}h=document.createElement("td");c.appendChild(h);h.style.padding="5px 10px 5px 10px";h.style.borderBottom="solid 1px #505050";var i=new SideBySideCells(h,false);i.getLeftCell().style.width="110px";var j=g.getFavorPoints();if(!j){j=0}if(g.isSoldOut()){i.getLeftCell().innerHTML="<span class='itemSoldOut'><b class='favorOfferQtyRemaining'>Sold Out</b></span>"}else{if(j>0){i.getLeftCell().innerHTML="<span class='itemFavorPrice'> "+formatNumberWithCommas(j)+" "+this.m_favorPointsText+"</span>"}else{i.getLeftCell().innerHTML="<span class='itemPrice'> $"+formatNumberWithCommas(g.getCost())+"</span>"}}if(g.getNumOwned()>0){i.getRightCell().innerHTML="<span class='landNumOwned'> Owned: "+g.getNumOwned()+"</span>"}var b=new SideBySideCells(h,false);var e=b.getLeftCell();var f=b.getRightCell();this.createBuyInterface(e,g);this.createSellInterface(f,g);this.m_contentTBody.appendChild(c)};PropertyListDiv.prototype.createBuyInterface=function(a,c){var b=this;if(c.getLimit()>0&&!c.isSoldOut()){new NumberSelectActionDiv(a,10,"Buy",function(d){b.m_buyCallback(c.getId(),d)},"blue")}else{a.style.width="115px"}};PropertyListDiv.prototype.createSellInterface=function(a,c){var b=this;if(c.getNumOwned()>0&&!c.getNoSell()){new NumberSelectActionDiv(a,10,"Sell",function(d){b.m_sellCallback(c.getId(),d)},"gray")}};function CityGridDiv(a){this.m_parentDiv=a;this.m_containerDiv=undefined;this.m_titleDiv=undefined;this.m_resultDiv=undefined;this.m_featuredContainer=undefined;this.m_featuredList=undefined;this.m_tableDiv=undefined;this.m_landList=undefined;this.m_establishmentList=undefined;this.m_missionTitle=undefined;this.m_featuredLandTitle=undefined;this.m_undevelopedLandTitle=undefined;this.m_establishmentsTitle=undefined;this.m_explanationText=undefined;this.m_cashFlowText="Cash Flow";this.m_moreTerritoriesText="You can unlock more territories after you get to level";this.m_property=undefined;this.initialize();this.createDiv(this.m_parentDiv)}CityGridDiv.prototype.initialize=function(){this.m_missionTitle="Mission Land";this.m_featuredLandTitle="Featured Territories";this.m_neededTitle="Needed";this.m_undevelopedLandTitle="Land";this.m_establishmentsTitle="Developments";this.m_explanationText="Territory produces the income you need to keep up with your expenses.     Your goal is a positive cash flow. Start by buying a plot of land. For even more income, build     developments on your land! If you lack the cash to buy what you want,     <a class='standardLink' href='#' onclick='switchTabsByName(\"Missions\");return false;'>complete missions<a> or     <a class='standardLink' href='#' onclick='switchTabsByName(\"Attack\");return false;'>attack rivals<a>."};CityGridDiv.prototype.createTitle=function(b,a){createTitleDiv(this.m_titleDiv,"Your Territory: <span class='subTitle'> (Income <span class='incomeTitleText'>$"+formatNumberWithCommas(GBL.MAIN_DATA.getViewer().getIncome())+"</span>, Upkeep From Equipment: <span class='expensesTitleText'>$"+formatNumberWithCommas(GBL.MAIN_DATA.getViewer().getUpkeep())+"</span> ) </span>",b,a,false)};CityGridDiv.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";this.m_titleDiv=document.createElement("div");this.m_containerDiv.appendChild(this.m_titleDiv);this.createTitle();var a=createWhiteDiv(this.m_containerDiv);a.style.padding="5px";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()};CityGridDiv.prototype.refresh=function(){outputDebug("refresh");this.m_tableDiv.innerHTML="";var a=this;this.m_missionHolder=makeElement("div",this.m_tableDiv);this.m_featuredContainer=makeElementClass("div",this.m_tableDiv,"featureContainer");this.m_featuredList=new PropertyGridDiv(this.m_featuredContainer,this.m_featuredLandTitle,function(c,d){a.doBuy(c,d)},function(c,d){a.doSell(c,d)});$(this.m_featuredContainer).hide();this.m_landList=new PropertyGridDiv(this.m_tableDiv,this.m_undevelopedLandTitle,function(c,d){a.doBuy(c,d)},function(c,d){a.doSell(c,d)});this.m_establishmentList=new PropertyGridDiv(this.m_tableDiv,this.m_establishmentsTitle,function(c,d){a.doBuy(c,d)},function(c,d){a.doSell(c,d)});var b={};b.user_id=GBL.MAIN_DATA.getViewer().getUserId();b.has_le_land=true;makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/get_city_list",function(c){a.onGetCityList(c)},b)};CityGridDiv.prototype.onGetCityList=function(c){outputDebug("onGetCityList");var h=function(m){return new Property(m)};var d=getGadgetResponseData(c);if(isValid(d)){try{var l=this;this.m_property={};var e=getXMLNodeValue(d,"update_period");var b=getXMLNodeValue(d,"minutes_to_update");var g=new Array();g.push(this.m_cashFlowText+":<span class='incomeTitleText'>$"+formatNumberWithCommas(GBL.MAIN_DATA.getViewer().getIncome()-GBL.MAIN_DATA.getViewer().getUpkeep())+"</span> every "+e+" minutes. Next paid in: "+b+" minutes");var a=new Array();a.push(undefined);this.createTitle(g,a);jQuery.each(getXMLList(getXMLFirstNode(d,"undeveloped_lands"),"land",h),function(m,n){l.m_property[n.getId()]=n;l.m_landList.addProperty(n)});this.m_landList.finishLoading();jQuery.each(getXMLList(getXMLFirstNode(d,"establishments"),"land",h),function(m,n){l.m_property[n.getId()]=n;l.m_establishmentList.addProperty(n)});this.m_establishmentList.finishLoading();var i=getXMLList(getXMLFirstNode(d,"featured_lands"),"land",h);jQuery.each(i,function(m,n){l.m_property[n.getId()]=n;l.m_featuredList.addProperty(n)});this.m_featuredList.finishLoading();if(i.length>0){$(this.m_featuredContainer).show()}var k=getXMLNodeValue(d,"next_level");if(isValid(k)){var j=document.createElement("div");j.style.clear="both";this.m_tableDiv.appendChild(j);j.style.padding="10px";j.innerHTML="<span class='landUnlockMore'> "+this.m_moreTerritoriesText+" "+k+" ... </span>"}}catch(f){outputAlert("onGetCityList "+f)}}this.updateHighlight()};CityGridDiv.prototype.doBuy=function(a,d){this.m_resultDiv.showMessage(undefined,"Buying ... ");goToPageTop();var c=this;var b=createCallbackLink("Buy more!",function(){c.doBuy(a,d);gaTrackEvent("lands","click","do_again")});var e={};e.user_id=GBL.MAIN_DATA.getViewer().getUserId();e.land_id=a;e.amount=d;makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/buy_land",function(f){handleResult(f,c.m_resultDiv,function(){c.refresh()},b)},e,0)};CityGridDiv.prototype.doSell=function(a,d){var c=this;this.m_resultDiv.showMessage(undefined,"Selling ... ");goToPageTop();var b=createCallbackLink("Sell more!",function(){c.doSell(a,d);gaTrackEvent("lands","click","do_again")});var e={};e.user_id=GBL.MAIN_DATA.getViewer().getUserId();e.land_id=a;e.amount=-d;makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/buy_land",function(f){handleResult(f,c.m_resultDiv,function(){c.refresh()},b)},e,0)};CityGridDiv.prototype.clearMissionRequirements=function(){$("tr.propertyItem").css("backgroundColor","");$(this.m_missionHolder).html("")};CityGridDiv.prototype.highlightItem=function(b,c){if(!isValid(this.m_property)){return}var d=this.m_property[b];if(!isValid(d)){return}this.m_missionList.addProperty(d,c);var a=$(".land_"+b);a.css("backgroundColor","rgb(32,32,32)")};CityGridDiv.prototype.updateHighlight=function(){this.clearMissionRequirements();var c=this;if(isValid(GBL.REQUIRED_ITEMS)&&GBL.REQUIRED_ITEMS.length>0){this.m_missionList=new PropertyGridDiv(this.m_missionHolder,this.m_missionTitle,function(d,e){c.doBuy(d,e)},function(d,e){c.doSell(d,e)},this.m_neededTitle);for(var b=0;b<GBL.REQUIRED_ITEMS.length;b++){var a=GBL.REQUIRED_ITEMS[b];this.highlightItem(a.id,a.min)}}};function PropertyGridDiv(b,c,d,e,a){this.m_parentDiv=b;this.m_containerDiv=undefined;this.m_typeName=c;this.m_loadingDiv=undefined;this.m_contentTBody=undefined;this.m_buyCallback=d;this.m_sellCallback=e;this.m_neededTitle=a;this.m_numColumns=4;this.m_itemCount=0;this.m_favorPointsText=isValid(GBL.FAVOR_POINTS_TEXT)?GBL.FAVOR_POINTS_TEXT:"favor points";this.m_currentRow=undefined;this.m_currentBuySellRow=undefined;if(this.m_parentDiv!=undefined){this.createDiv(this.m_parentDiv)}}PropertyGridDiv.prototype.createDiv=function(d){outputDebug("createDiv");this.m_parentDiv=d;this.m_containerDiv=makeElementClass("div",this.m_parentDiv,"propertyGrid",{paddingTop:"15px",paddingBottom:"10px",textAlign:"left"});this.m_contentDiv=makeElement("div",this.m_containerDiv);var b=makeElementClass("div",this.m_contentDiv,"header");if(this.m_neededTitle){b.innerHTML=this.m_typeName+" "+this.m_neededTitle}else{b.innerHTML=this.m_typeName}var a=makeElement("hr",b);$(a).css({border:"0px","border-top":"solid 1px #cccccc",height:"1px"});$(this.m_contentDiv).hide();this.m_loadingDiv=makeElement("div",this.m_containerDiv,{padding:"10px"});this.m_loadingDiv.innerHTML=getLoadingMessageHTML();var c=makeElementClass("table",this.m_contentDiv,"city_list");this.m_contentTBody=makeElement("tbody",c)};PropertyGridDiv.prototype.finishLoading=function(){$(this.m_loadingDiv).hide()};PropertyGridDiv.prototype.addProperty=function(n,i){$(this.m_contentDiv).show();if(n.getLimit()<=0&&n.getNumOwned()<=0){return}if((this.m_itemCount%this.m_numColumns)==0){this.m_currentRow=makeElement("tr",this.m_contentTBody);this.m_currentBuySellRow=makeElement("tr",this.m_contentTBody)}var v=makeElementClass("td",this.m_currentRow,"city_info");v.setAttribute("vAlign","top");var j=makeElement("div",v);$(j).addClass("propertyItem").addClass("land_"+n.getId()).css({margin:"5px"});if(isValid(i)){var b=makeElement("div",j);$(b).css({"margin-left":"10px",color:"white","font-size":"16px"});var p=i-n.getNumOwned();if(p>0){b.innerHTML=p+" more"}else{b.innerHTML="0 more"}}var r=makeElement("img",j);r.setAttribute("src",n.getImageURL());j=makeElement("div",v,{verticalAlign:"top"});j.setAttribute("valign","top");var g=makeElement("div",j,{color:"white"});var s=makeElementClass("span",g,"landName");$(s).css({display:"block",color:"white","font-family":"cursive","font-size":16}).html(n.getName());var h=makeElement("div",j);var t=makeElementClass("span",h,"landIncome");t.innerHTML="<span style='font-size:14px;'>Income:</span> "+n.getIncome();if(!n.isSoldOut()&&n.getGlobalRemaining()>0){$(makeElementClass("div",j,"itemRemaining")).html("Less than <b class='favorOfferQtyRemaining'>"+n.getGlobalRemaining()+"</b> remaining!")}if(isValid(n.getBuiltOn())){var c=makeElement("div",j);var d=makeElementClass("span",c,"landBuiltOn");d.innerHTML="<span style='font-size:14px;'>Built on:</span> "+n.getBuiltOn()}if(isValid(n.getMembersRequired())){var l=makeElement("div",j);var o=makeElementClass("span",l,"landIncome");$(o).css({"font-size":"12px"});o.innerHTML="Each Requires "+n.getMembersRequired()+" Mob Members"}var k=n.getFavorPoints();if(!k){k=0}if(n.getCost()>0||n.isSoldOut()||k>0){var m=makeElement("div",j);if(n.isSoldOut()){m.innerHTML="<span class='itemSoldOut'><b class='favorOfferQtyRemaining'>Sold Out</b></span>"}else{if(k>0){m.innerHTML="<span class='itemFavorPrice'> "+formatNumberWithCommas(k)+" "+this.m_favorPointsText+"</span>"}else{m.innerHTML="<span class='itemPrice'> $"+formatNumberWithCommas(n.getCost())+"</span>"}}}if(n.getNumOwned()>0){var q=makeElementClass("div",j,"landNumOwned");q.innerHTML="<span style='font-size: 14px; font-weight: normal;'>You own:</span> <span style='font-size: 16px;'>"+n.getNumOwned()+"</span>"}if(isValid(n.getPurchaseLimit())){$(makeElementClass("div",j,"landPermitAvailable")).text("Permits Available: "+Math.max(0,(n.getPurchaseLimit()-n.getNumOwned())))}jQuery.each(n.getEnhancementList(),function(w,x){$(j).append("<div class='gridEnhancementContainer'>                                 <span class='gridEnhancementPrefix'>{prefix}</span>                                <span class='gridEnhancementValue'>{value}</span>                                <span class='gridEnhancementSuffix'>{suffix}</span>                           </div>".supplant(x))});v=makeElementClass("td",this.m_currentBuySellRow,"city_buy_sell");if(n.getCost()>0||k>0){var u=makeElement("div",v);u.style.margin="0px 10px";var e=new SideBySideCells(u);this.createBuySellInterface(e.getLeftCell(),e.getRightCell(),n)}else{var f=makeElement("table",v);$(f).css({width:"100%"});var a=makeElement("td",makeElement("tr",(makeElement("tbody",f))));$(a).text("Not purchasable, not sellable").css({fontStyle:"italic",fontSize:"14px",color:"#666666",textAlign:"center"})}this.m_itemCount++};PropertyGridDiv.prototype.createBuySellInterface=function(b,c,g){var d=this;var e=undefined;var f=undefined;var a=!isValid(g.getPurchaseLimit())||g.getPurchaseLimit()>g.getNumOwned();if(a&&g.getLimit()>0&&!g.isSoldOut()){f=new NumberSelectActionDiv(b,10,"Buy",function(h){d.m_buyCallback(g.getId(),h)},"blue",undefined);e=f.getSelectionBox()}if(g.getNumOwned()>0&&!g.getNoSell()){f=new NumberSelectActionDiv(c,10,"Sell",function(h){d.m_sellCallback(g.getId(),h)},"gray",undefined,e)}};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/mob/images/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 e=document.createElement("table");this.m_tableDiv.appendChild(e);e.style.marginLeft="auto";e.style.marginRight="auto";e.style.borderSpacing="6px";var a=document.createElement("tbody");e.appendChild(a);var f=document.createElement("tr");a.appendChild(f);var g=makeElementClass("td",f,"bankViewOpenAccount");g.innerHTML="Open an account with: ";g=document.createElement("td");f.appendChild(g);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();g.appendChild(d);g=document.createElement("td");f.appendChild(g);var c=this;new DivButton(g,"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(i){}var h={};h.user_id=GBL.MAIN_DATA.getViewer().getUserId();h.amount=d.value;makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/deposit",function(j){handleResult(j,c.m_resultDiv,function(){c.refresh()})},h,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 e=makeElementClass("td",b,"dataTableHeader",{width:"350px"});e.innerHTML="Withdraw";e=makeElementClass("td",b,"dataTableHeader",{width:"400px"});e.innerHTML="Deposit";var d=document.createElement("tr");a.appendChild(d);d.appendChild(this.createInterfaceTd(true));d.appendChild(this.createInterfaceTd(false))};BankDiv.prototype.createInterfaceTd=function(g){var h=document.createElement("td");h.style.verticalAlign="top";var c=new SideBySideCells(h,true);setStyle(c.getLeftCell(),{verticalAlign:"top",width:"160px"});if(g){c.getLeftCell().className="bankViewInputLabel";c.getLeftCell().innerHTML="Withdrawal Amount: "}else{c.getLeftCell().className="bankViewInputLabel";c.getLeftCell().innerHTML="Deposit Amount: "}if(g){setStyle(c.getRightCell(),{width:"200px"})}else{setStyle(c.getRightCell(),{width:"250px"})}var f=undefined;try{f=document.createElement("<input type='text'/>")}catch(d){f=document.createElement("input");f.type="text"}if(g){f.value=""+Math.min(1000,GBL.MAIN_DATA.getViewer().getCashInBank())}else{f.value=GBL.MAIN_DATA.getViewer().getCash()}c.getRightCell().appendChild(f);var a=undefined;var e=this;if(g){a=new DivButton(c.getRightCell(),"Withdraw",function(){if(!validateAmount(f.value)){e.m_resultDiv.showMessage(undefined,"Please specify a valid amount to withdraw!");return}var i={};i.user_id=GBL.MAIN_DATA.getViewer().getUserId();i.amount=-f.value;makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/deposit",function(j){handleResult(j,e.m_resultDiv,function(){e.refresh()})},i,1)})}else{a=new DivButton(c.getRightCell(),"Deposit",function(){if(!validateAmount(f.value)){e.m_resultDiv.showMessage(undefined,"Please specify a valid amount to deposit!");return}var i={};i.user_id=GBL.MAIN_DATA.getViewer().getUserId();i.amount=f.value;makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/deposit",function(j){handleResult(j,e.m_resultDiv,function(){e.refresh()})},i,1)})}a.getButtonDiv().style.marginTop="10px";a.getButtonDiv().style.width="100px";var b=makeElementClass("div",c.getRightCell(),"bankViewActionExplanation",{paddingTop:"5px"});if(g){b.innerHTML=this.m_withdrawExplanation}else{b.innerHTML=this.m_depositTaxExplanation}return h};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}}}var d=(isDebugging())?"http://74.86.60.46/":"http://offer-dynamic-lb.playdom.com/";this.m_monetizationIframeUrl=d+"show?app=mob&network=myspace&currency=fp&zone=main&userId="+GBL.MAIN_DATA.getViewer().getUserId();var c=GBL.MAIN_DATA.getViewer().getAge();var b=GBL.MAIN_DATA.getViewer().getGender();if(isValid(c)){this.m_monetizationIframeUrl+="&age="+c}if(isValid(b)){this.m_monetizationIframeUrl+="&gender="+b.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 g=document.createElement("table");this.m_refreshDiv.appendChild(g);g.style.marginLeft="auto";g.style.marginRight="auto";g.style.borderSpacing="6px";var a=document.createElement("tbody");g.appendChild(a);for(var e=0;e<this.m_offerKeys.length;e++){var b=undefined;if(isValid(this.m_offerHighlight)&&isValid(this.m_offerHighlight[e])){b=this.m_offerHighlight[e]}var h=undefined;if(isValid(this.m_offerAmounts)&&isValid(this.m_offerAmounts[e])){h=this.m_offerHighlight[e]}var d=this.createContentElement(this.m_offerKeys[e],this.m_offerDescriptions[e],this.m_offerCosts[e],b,h,isValid(this.m_offerRequests)?this.m_offerRequests[e]: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 f={};var c=this;f.user_id=GBL.MAIN_DATA.getViewer().getUserId();makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/get_offers",function(i){c.onGetSpecialOffers(i,a)},f)}};GodfatherDiv.prototype.onGetSpecialOffers=function(i,p){var n=getGadgetResponseData(i);if(isValid(n)){try{var d=n.getElementsByTagName("offer");for(var q=0;q<d.length;q++){try{var m=d[q];var o=getXMLNodeValue(m,"key");var h=getXMLEncodedStringNodeValue(m,"product");var j=getXMLNodeValue(m,"amount");var k=getXMLNodeValue(m,"cost");var g=getBooleanValue(getXMLNodeValue(m,"highlight"));var c=undefined;try{c=getXMLEncodedStringNodeValue(m,"description")}catch(a){c=undefined}var l=undefined;try{l=getXMLNodeValue(m,"remaining")}catch(a){l=undefined}var b=undefined;try{b=getXMLNodeValue(m,"image_url")}catch(a){b=undefined}var e=undefined;try{e=getXMLNodeValue(m,"max_per_user")}catch(a){e=undefined}var f=this.m_offerer+" offers you <b class='favorOfferItem'>"+h+" </b>";if(isValid(l)){f+=" for a limited time!";f+="<table><tr>";if(isValid(b)){f+="<td><img src='"+b+"'/></td>"}f+="<td class='favorOfferDescription'>"+c+"<br/>Cost: "+k+" "+this.m_offerCurrency+"<br/>";if(l>0){f+="Less than <b class='favorOfferQtyRemaining'>"+l+"</b> left!";if(isValid(e)){f+="<span class='favorOfferQtyLimits'>  (Limited to "+e+" per mobster) </span>"}}else{f+="<b class='favorOfferSoldOut'>SOLD OUT!</b>"}f+="</td></tr></table>"}else{f+=" for "+k+" favor points."}var r=this.createContentElement(o,f,k,g,j);p.appendChild(r)}catch(a){outputDebug("offerDecoding "+a)}}}catch(a){outputDebug("onGetOffers "+a)}}};GodfatherDiv.prototype.createContentElement=function(h,c,b,j,e,f){var a=document.createElement("tr");var g=makeElementClass("td",a,"favorOfferUnhighlighted");g.innerHTML=c;if(isValid(j)&&j){g.className="favorOfferHighlighted"}else{g.className="favorOfferUnhighlighted"}g=document.createElement("td");a.appendChild(g);g.style.verticalAlign="middle";var i=this;var d=function(){i.m_resultDiv.showMessage(undefined,"Checking.....");gaTrackEvent("godfather","click",h);var l={};l.user_id=GBL.MAIN_DATA.getViewer().getUserId();l.reward=h;if(isValid(e)){l.amount=e}if(isValid(f)){l.request=f}makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/accept_godfather",function(m){i.onAcceptGodfather(m)},l,0)};var k=new DivButton(g,this.getButtonText(b),d);k.getButtonDiv().style.fontSize="14px";k.getButtonDiv().style.width="200px";return a};GodfatherDiv.prototype.createPickableElement=function(j,o,t,g,e,m){var n=document.createElement("tr");var c=0;var u=makeElementClass("td",n,"favorOfferUnhighlighted");var i=document.createElement("table");u.appendChild(i);var q=document.createElement("tbody");i.appendChild(q);var h=document.createElement("tr");q.appendChild(h);var f=document.createElement("td");h.appendChild(f);var b=document.createElement("td");h.appendChild(b);var l=document.createElement("td");h.appendChild(l);if(isValid(j)&&j){f.className="favorOfferHighlighted";b.className="favorOfferHighlighted";l.className="favorOfferHighlighted"}else{f.className="favorOfferUnhighlighted";b.className="favorOfferUnhighlighted";l.className="favorOfferUnhighlighted"}var d=undefined;var k=this;f.innerHTML=t[c];l.innerHTML=e[c];var r=document.createElement("select");b.appendChild(r);for(var s=0;s<o.length;s++){var p=this.createOption(g[s],s,s==0);r.appendChild(p)}addEvent(r,"change",function(){c=r.selectedIndex;f.innerHTML=t[c];l.innerHTML=e[c];d.setString(k.getButtonText(m[c]))});u=document.createElement("td");n.appendChild(u);u.style.verticalAlign="middle";var a=function(){k.m_resultDiv.showMessage(undefined,"Checking.....");var v={};v.user_id=GBL.MAIN_DATA.getViewer().getUserId();v.reward=o[c];makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/accept_godfather",function(w){k.onAcceptGodfather(w)},v,0)};d=new DivButton(u,this.getButtonText(m[c]),a);d.getButtonDiv().style.fontSize="14px";d.getButtonDiv().style.width="200px";return n};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(e){outputDebug("onAcceptGodfather "+e)}}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 f=document.createElement("div");this.m_containerDiv.appendChild(f);createTitleDiv(f,"<span class='favorPointsSectionTitle'>"+this.m_titleText+"</span> <span  class='favorPointsSectionSubtitle'>and help sponsor this application by completing offers!</span>")}var e=createWhiteDiv(this.m_containerDiv);e.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(g){b.createSuperRewardDiv(g)});a.push(function(g){b.createOfferPalDiv(g)});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 e=document.createElement("div");$(e).addClass("CCBillMainDiv");e.style.position="relative";e.style.textAlign="left";e.style.marginLeft="3px";e.style.marginTop=IE?"0px":"10px";e.style.paddingTop="8px";e.style.borderTop="1px dotted #222222";var c="40px";if(isValid(GBL.CCBill.right)){c=GBL.CCBill.right}var d=makeElementClass("form",e,"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/mob/images/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(e);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 e=makeElementClass("table",this.m_tableDiv,"dataTable",{marginLeft:"auto",marginRight:"auto",borderSpacing:"6px"});var a=makeElement("tbody",e);var b=makeElement("tr",a);var g=makeElementClass("td",b,"dataTableHeader");g.style.width="550px";g.innerHTML=this.m_mobNameLabel;g=makeElementClass("td",b,"dataTableHeader");g.style.width="100px";g.innerHTML=this.m_mobSizeLabel;g=makeElementClass("td",b,"dataTableHeader");g.style.width="100px";g.innerHTML=this.m_mobActionLabel;var f=document.createElement("div");this.m_containerDiv.appendChild(f);f.style.padding="10px";f.innerHTML=getLoadingMessageHTML();var d={};d.user_id=GBL.MAIN_DATA.getViewer().getUserId();var c=this;makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/get_fight_list",function(h){f.style.display="none";c.onGetFightList(h,a)},d)};FightListDiv.prototype.onGetFightList=function(a,h){var d=getGadgetResponseData(a);var i=undefined;if(isValid(d)){try{i=parseInt(getXMLNodeValue(d,"num_targets"));var g=d.getElementsByTagName("user");for(var c=0;c<g.length;c++){var f=new User(undefined);f.createXMLUser(g[c]);h.appendChild(this.createContentElement(f))}}catch(e){outputAlert("onGetJobList "+e)}}if(!isValid(i)||i<=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(e){handleResult(e,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(g,l){var c=getGadgetResponseData(g);var m=undefined;try{m=getXMLNodeValue(c,"min_cost")}catch(e){}if(!isValid(m)){this.m_resultDiv.showMessage(undefined,"Sorry, there was an error, please refresh");return}m=parseInt(m);createTitleDiv(this.m_title,"Place Bounty on &quot;"+this.m_targetUser.getMobName()+"&quot; <span style='font-size:14px;'> (Minimum of $"+formatNumberWithCommas(m)+")</span>");if(l){var d=GBL.MAIN_DATA.getViewer().getCash()+GBL.MAIN_DATA.getViewer().getCashInBank();if(m>d){this.m_resultDiv.showMessage(undefined,"Sorry, you need at least $"+formatNumberWithCommas(m)+" to put "+this.m_targetUser.getMobName()+" on the "+this.m_hitListName+".");return}}var h=document.createElement("table");this.m_refreshDiv.appendChild(h);h.style.marginLeft="auto";h.style.marginRight="auto";h.style.borderSpacing="6px";var f=document.createElement("tbody");h.appendChild(f);var b=document.createElement("tr");f.appendChild(b);var j=makeElementClass("td",b,"createBountyAmount");j.innerHTML=this.m_hitListAmountText;j=document.createElement("td");b.appendChild(j);var a=undefined;try{a=document.createElement("<input type='text'/>")}catch(i){a=document.createElement("input");a.type="text"}a.value=m;j.appendChild(a);j=document.createElement("td");b.appendChild(j);var k=this;new DivButton(j,"Set Bounty",function(){if(!validateAmount(a.value)){k.m_resultDiv.showMessage(undefined,"Please specify a valid amount!");return}var n={};n.user_id=GBL.MAIN_DATA.getViewer().getUserId();n.target_id=k.m_targetUser.getUserId();n.bounty=a.value;makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/add_hit_list",function(o){handleResult(o,k.m_resultDiv,function(){k.refresh()})},n,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 e=makeElementClass("table",this.m_tableDiv,"dataTable",{marginLeft:"auto",marginRight:"auto",borderSpacing:"6px"});var a=document.createElement("tbody");e.appendChild(a);var b=makeElementClass("tr",a,"dataTableHeaderTR");var g=document.createElement("td");b.appendChild(g);addHeaderStyle(g);g.style.width="225px";g.innerHTML=this.m_targetLabel;g=document.createElement("td");b.appendChild(g);addHeaderStyle(g);g.style.width="225px";g.innerHTML=this.m_markedLabel;g=document.createElement("td");b.appendChild(g);addHeaderStyle(g);g.style.width="150px";g.innerHTML=this.m_bountyLabel;g=document.createElement("td");b.appendChild(g);addHeaderStyle(g);g.style.width="100px";g.innerHTML="When";g=document.createElement("td");b.appendChild(g);addHeaderStyle(g);g.style.width="100px";g.innerHTML=this.m_actionLabel;var f=document.createElement("div");this.m_containerDiv.appendChild(f);f.style.padding="10px";f.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(h){f.style.display="none";c.onGetFightList(h,a)},d)};HitListDiv.prototype.onGetFightList=function(a,j){var n=undefined;var d=getGadgetResponseData(a);if(isValid(d)){try{n=parseInt(getXMLNodeValue(d,"num_targets"));var l=d.getElementsByTagName("entry");for(var c=0;c<l.length;c++){var g=getXMLFirstNode(l[c],"target_user");var h=new User(undefined);h.createXMLUser(g);var m=getXMLFirstNode(l[c],"paid_user");var e=new User(undefined);e.createXMLUser(m);var k=getXMLNodeValue(l[c],"amount");var i=getXMLNodeValue(l[c],"placed_time_ago");j.appendChild(this.createContentElement(h,e,k,i))}}catch(f){outputAlert("onGetJobList "+f)}}if(!isValid(n)||n<=0){var b=createWhiteDiv(this.m_tableDiv);b.style.textAlign="center";b.innerHTML=this.m_emptyMessage}};HitListDiv.prototype.createContentElement=function(c,e,d,a){outputDebug("createContentElement");var f=document.createElement("tr");var g;g=makeElementClass("td",f,"hitListClickableCell");g.innerHTML="<span class='fightListMobName'> "+c.getMobName()+" </span>";addEvent(g,"click",function(){showUserStats(c.getUserId())});g=makeElementClass("td",f,"hitListClickableCell");g.innerHTML="<span class='fightListMobName'> "+e.getMobName()+" </span>";addEvent(g,"click",function(){showUserStats(e.getUserId())});g=makeElementClass("td",f,"hitListCell");g.innerHTML="<span class='hitListBountyNum'>$"+formatNumberWithCommas(d)+"</span>";g=makeElementClass("td",f,"hitListCell");g.innerHTML=a;g=makeElementClass("td",f,"hitListCell");var b=this;new DivButton(g,"Attack",function(){gaTrackEvent("hit_list","click","attack");b.m_resultDiv.showMessage(undefined,"Attacking "+c.getMobName()+" ...");var h={};h.user_id=GBL.MAIN_DATA.getViewer().getUserId();h.target_id=c.getUserId();makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/attack_hitlist",function(i){handleResult(i,b.m_resultDiv,function(){b.refresh()})},h,1)});return f};function RPGItem(a){this.m_xmlNode=a;this.m_id=undefined;this.m_imageURL=undefined;this.m_smallImageURL=undefined;this.m_upkeep=undefined;this.m_attack=undefined;this.m_defense=undefined;this.m_detailsHTML=undefined;this.m_cost=undefined;this.m_favorPoints=undefined;this.m_numOwned=undefined;this.m_itemLimit=undefined;this.m_purchasable=undefined;this.m_itemRemaining=undefined;this.m_soldOut=undefined;this.m_type=undefined;this.m_category=undefined;this.m_isAvatar=undefined;this.m_name=undefined;this.m_description=undefined;this.m_buyLabel=undefined;this.m_isMastery=undefined;this.m_isJackpot=undefined;this.m_isGala=undefined;this.m_isMissionOnly=undefined;this.m_hasPurchased=undefined;this.m_secondsRemaining=undefined;this.m_enhancementList=[];this.m_avatarEnhancementList=[];this.fillFromXML()}RPGItem.prototype.fillFromXML=function(){if(!isValid(this.m_xmlNode)){return}try{this.m_id=getXMLNodeValue(this.m_xmlNode,"id")}catch(c){}try{this.m_name=getXMLEncodedStringNodeValue(this.m_xmlNode,"name")}catch(c){}try{this.m_imageURL=getXMLEncodedStringNodeValue(this.m_xmlNode,"image_url")}catch(c){}try{this.m_smallImageURL=getXMLEncodedStringNodeValue(this.m_xmlNode,"small_image_url")}catch(c){}try{this.m_upkeep=parseInt(getXMLNodeValue(this.m_xmlNode,"upkeep"))}catch(c){}try{this.m_attack=parseInt(getXMLNodeValue(this.m_xmlNode,"attack"))}catch(c){}try{this.m_defense=parseInt(getXMLNodeValue(this.m_xmlNode,"defense"))}catch(c){}try{this.m_detailsHTML=getXMLEncodedStringNodeValue(this.m_xmlNode,"details")}catch(c){}try{this.m_cost=getXMLNodeValue(this.m_xmlNode,"cost")}catch(c){}try{this.m_favorPoints=getXMLNodeValue(this.m_xmlNode,"favor_points")}catch(c){}try{this.m_numOwned=parseInt(getXMLNodeValue(this.m_xmlNode,"num_owned"))}catch(c){}try{this.m_itemLimit=parseInt(getXMLNodeValue(this.m_xmlNode,"item_limit"))}catch(c){}try{this.m_itemRemaining=parseInt(getXMLNodeValue(this.m_xmlNode,"item_remaining"))}catch(c){}try{this.m_purchasable=getXMLEncodedStringNodeValue(this.m_xmlNode,"purchasable")}catch(c){}try{this.m_soldOut=getXMLEncodedStringNodeValue(this.m_xmlNode,"sold_out")}catch(c){}try{this.m_type=getXMLEncodedStringNodeValue(this.m_xmlNode,"type")}catch(c){}try{this.m_category=getXMLEncodedStringNodeValue(this.m_xmlNode,"category")}catch(c){}try{this.m_wearablePart=getXMLEncodedStringNodeValue(this.m_xmlNode,"wearable_part")}catch(c){}try{this.m_description=getXMLEncodedStringNodeValue(this.m_xmlNode,"description")}catch(c){}try{this.m_buyLabel=getXMLEncodedStringNodeValue(this.m_xmlNode,"buy_label")}catch(c){}try{this.m_isMastery=getXMLEncodedStringNodeValue(this.m_xmlNode,"is_mastery")=="true"}catch(c){}try{this.m_isJackpot=getXMLEncodedStringNodeValue(this.m_xmlNode,"is_jackpot")}catch(c){}try{this.m_isGala=getXMLEncodedStringNodeValue(this.m_xmlNode,"is_gala")}catch(c){}try{this.m_isAvatar=getXMLEncodedStringNodeValue(this.m_xmlNode,"is_avatar")=="true"}catch(c){}try{this.m_isMissionOnly=getXMLEncodedStringNodeValue(this.m_xmlNode,"is_mission_only")}catch(c){}try{this.m_hasPurchased=getXMLEncodedStringNodeValue(this.m_xmlNode,"has_purchased")}catch(c){}try{this.m_secondsRemaining=getXMLEncodedStringNodeValue(this.m_xmlNode,"seconds_remaining")}catch(c){}var a=function(f){var e=new Object();e.prefix=isValid(getXMLEncodedStringNodeValue(f,"prefix"))?getXMLEncodedStringNodeValue(f,"prefix"):"";e.suffix=isValid(getXMLEncodedStringNodeValue(f,"suffix"))?getXMLEncodedStringNodeValue(f,"suffix"):"";e.value=isValid(getXMLEncodedStringNodeValue(f,"value"))?getXMLEncodedStringNodeValue(f,"value"):"";return e};try{var d=getXMLFirstNode(this.m_xmlNode,"enhancements");this.m_enhancementList=getXMLList(d,"enhancement",a)}catch(c){}try{var b=getXMLFirstNode(this.m_xmlNode,"avatar_enhancements");this.m_avatarEnhancementList=getXMLList(b,"enhancement",a)}catch(c){}};RPGItem.prototype.getId=function(){return this.m_id};RPGItem.prototype.getImageURL=function(){return this.m_imageURL};RPGItem.prototype.getSmallImageURL=function(){return this.m_smallImageURL};RPGItem.prototype.getUpkeep=function(){return this.m_upkeep};RPGItem.prototype.getAttack=function(){return this.m_attack};RPGItem.prototype.getDefense=function(){return this.m_defense};RPGItem.prototype.getDetailsHTML=function(){return this.m_detailsHTML};RPGItem.prototype.getCost=function(){return this.m_cost};RPGItem.prototype.getFavorPoints=function(){return this.m_favorPoints};RPGItem.prototype.getNumOwned=function(){return this.m_numOwned};RPGItem.prototype.getCategory=function(){return this.m_category};RPGItem.prototype.getItemLimit=function(){return this.m_itemLimit};RPGItem.prototype.getType=function(){return this.m_type};RPGItem.prototype.getItemRemaining=function(){return this.m_itemRemaining};RPGItem.prototype.isPurchasable=function(){return this.m_purchasable};RPGItem.prototype.isSoldOut=function(){return this.m_soldOut};RPGItem.prototype.isLimitedEdition=function(){return isValid(this.m_favorPoints)&&this.m_favorPoints>0};RPGItem.prototype.getWearablePart=function(){return this.m_wearablePart};RPGItem.prototype.getName=function(){return this.m_name};RPGItem.prototype.getDescription=function(){return this.m_description};RPGItem.prototype.getBuyLabel=function(){return this.m_buyLabel};RPGItem.prototype.isAvatar=function(){return this.m_isAvatar};RPGItem.prototype.isMastery=function(){return this.m_isMastery};RPGItem.prototype.isJackpot=function(){return this.m_isJackpot};RPGItem.prototype.isGala=function(){return this.m_isGala};RPGItem.prototype.isMissionOnly=function(){return this.m_isMissionOnly};RPGItem.prototype.getSecondsRemaining=function(){return this.m_secondsRemaining};RPGItem.prototype.getEnhancementList=function(){return this.m_enhancementList};RPGItem.prototype.getAvatarEnhancementList=function(){return this.m_avatarEnhancementList};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 e=getXMLFirstNode(b,"stockpile");this.m_mobItemsDiv.fillFromXML(e)}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,f,h){var e=document.createElement("table");if(d){d.appendChild(e)}e.style.marginLeft="auto";e.style.marginRight="auto";e.style.marginTop="5px";e.style.marginBottom="15px";e.style.cellSpacing="0px";e.style.borderCollapse="collapse";var a=document.createElement("tbody");e.appendChild(a);if(!h){var b=document.createElement("tr");a.appendChild(b);var g=undefined;if(isValid(f)){g=makeElement("td",b);addHeaderStyleWithInnerDiv(g,c,"400");g=makeElement("td",b);addHeaderStyleWithInnerDiv(g,f,"100")}else{g=makeElement("td",b);addHeaderStyleWithInnerDiv(g,c,"500px")}g=document.createElement("td");b.appendChild(g);addHeaderStyleWithInnerDiv(g,"Buy / Sell","300px")}return a};ItemsDiv.prototype.fillCategory=function(a,f,e){if(!isListValid(a,f,e)){return false}var c=getXMLFirstNode(a,f);if(!isValid(c)){return false}var b=c.getElementsByTagName("item");if(b.length==0){return false}var d=this;jQuery.each(b,function(g,i){var h=new RPGItem(i);d.m_items[h.getId()]=h;d.handleNormalItems(e,h)});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 f=getXMLFirstNode(a,"featured_items");if(isValid(f)){var c=new Array();var b=f.getElementsByTagName("item");for(var d=0;d<b.length;d++){var e=new RPGItem(b[d]);c.push(e)}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 e=getXMLNodeValue(a,"next_level");if(isValid(e)){if(isValid(this.m_unlockLevelDiv)){$(this.m_unlockLevelDiv).show();$(this.m_unlockLevelDiv).html("<span class='equipmentUnlockMessage'>"+this.m_leveMoreText+" "+e+" ...")}else{var d=document.createElement("div");this.m_containerDiv.appendChild(d);d.style.padding="10px";d.innerHTML="<span class='equipmentUnlockMessage'>"+this.m_leveMoreText+" "+e+" ..."}}var b=+(new Date())-c;consoleLog("Adding items took {time}msec".supplant({time:b}))}catch(f){outputDebug("onGetStockpileList "+f);consoleLog("onGetStockpileList "+f)}}};ItemsDiv.prototype.handleNormalItems=function(a,b){a.appendChild(this.createContentElement(b))};ItemsDiv.prototype.handleFeaturedItems=function(a){};ItemsDiv.prototype.createContentElement=function(g,e){var n=document.createElement("tr");$(n).addClass("stockpileItem").addClass("item_"+g.getId());var r=makeElementClass("td",n,"itemCell");var b=new SideBySideCells(r,false);var l=g.getCategory()=="BOOST";var m=b.getLeftCell();m.style.width="150px";m.innerHTML="<img style='margin-left:auto; margin-right:auto;' src='"+g.getImageURL()+"'/>";var p=b.getRightCell();p.style.width="300px";p.style.paddingLeft="10px";p.style.verticalAlign="top";if(l){p.innerHTML="<div class='itemTitle' style='font-weight: bold;'>"+g.getName()+"</div><div class='itemAttack'>"+g.getDescription()+"</div>";p.style.verticalAlign="middle"}else{p.innerHTML=g.getDetailsHTML()}if(isValid(e)){r=makeElementClass("td",n,"itemNeededCount");var o=e-g.getNumOwned();if(o>0){r.innerHTML=o+" more"}else{r.innerHTML="0 more"}}r=makeElementClass("td",n,"itemTxnCell");var f=new SideBySideCells(r,false);f.getLeftCell().style.width="110px";var h=g.getFavorPoints();if(!h){h=0}if(g.isSoldOut()){f.getLeftCell().innerHTML="<span class='itemSoldOut'>Sold Out</span>"}else{if(h>0){f.getLeftCell().innerHTML="<span class='itemFavorPrice'> "+formatNumberWithCommas(h)+" "+this.m_favorPointsText+"</span>"}else{if(!l){f.getLeftCell().innerHTML="<span class='itemPrice'> $"+formatNumberWithCommas(g.getCost())+"</span>"}}}if(g.getNumOwned()>0){f.getRightCell().innerHTML="<span class='itemNumOwned'> Owned: "+g.getNumOwned()+"</span>"}var j=this;var a=new SideBySideCells(r,false);var i=a.getLeftCell();if(l){if(!g.isSoldOut()){var d="Buy";if(isValid(g.getBuyLabel())){d=g.getBuyLabel()}var c=new DivButton(i,d,function(){j.doBuy(g.getId(),1)})}}else{i.style.width="115px";if(!g.isSoldOut()&&!(isValid(g.getItemLimit())&&g.getItemLimit()<=g.getNumOwned())){new NumberSelectActionDiv(i,10,"Buy",function(s){j.doBuy(g.getId(),s)},"blue",[100])}if(g.getNumOwned()>0&&g.getCost()>0&&h==0){var k=a.getRightCell();k.style.width="115px";var q=[];if(g.getNumOwned()>=100){q=[100]}new NumberSelectActionDiv(k,Math.min(10,g.getNumOwned()),"Sell",function(s){j.doSell(g.getId(),s)},"gray",q)}}return n};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 e=this;setTimeout(function(){e.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(e,d){var b=this;var a=createCallbackLink("Buy more!",function(){b.doBuy(e,d);gaTrackEvent("items","click","do_again")});gaTrackEvent("stockpile","click","buy/"+e,d);b.m_resultDiv.showMessage(undefined,"Buying ... ");goToPageTop();var c={};c.user_id=GBL.MAIN_DATA.getViewer().getUserId();c.item_id=e;c.amount=d;makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/buy_item",function(h){var j=handleResult(h,b.m_resultDiv,function(){b.m_refreshCallback()},a);if(j&&b.m_items[e].isLimitedEdition()){var g=GBL.MAIN_DATA.getViewer();try{GBL.pageTracker._addTrans(g.getUserId()+"_"+ +new Date(),g.getLevel(),b.m_items[e].getFavorPoints(),g.getCash(),g.getCashInBank(),g.m_city,g.m_region);var f=b.m_items[e].getDetailsHTML().split(">")[1].split("<")[0];GBL.pageTracker._addItem(e,e,f,"",b.m_items[e].getFavorPoints(),d);GBL.pageTracker._trackTrans()}catch(i){outputDebug(i)}}},c,0)};ItemsDiv.prototype.doSell=function(f,e){var b=this;consoleLog(this.m_items[f].getNumOwned());var d=Math.min(e,(this.m_items[f].getNumOwned()-e));var a=undefined;a=createCallbackLink("Sell more!",function(){b.doSell(f,e);gaTrackEvent("items","click","do_again")});gaTrackEvent("stockpile","click","sell/"+f,e);b.m_resultDiv.showMessage(undefined,"Selling ... ");goToPageTop();var c={};c.user_id=GBL.MAIN_DATA.getViewer().getUserId();c.item_id=f;c.amount=-e;makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/buy_item",function(g){handleResult(g,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 h=undefined;if(isValid(c)){try{var e=c.getElementsByTagName("item");if(isValid(e)&&e.length>0){h=new Array();for(var b=0;b<e.length;b++){var g=new RPGItem(e[b]);if(g.getNumOwned()>0){var a=new Object();a.number=g.getNumOwned();a.type=g.getType();a.image_url=g.getImageURL();a.name=g.getDetailsHTML();h.push(a)}}}}catch(d){outputDebug("fillFromXML "+d)}}if(!isValid(h)||h.length==0){return}this.m_containerDiv.style.display="block";$(this.m_containerDiv).html("");var f=document.createElement("div");this.m_containerDiv.appendChild(f);createTitleDiv(f,this.m_title);var i=document.createElement("div");this.m_containerDiv.appendChild(i);createItemsListDiv(i,h,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(e){var d=getGadgetResponseData(e);if(isValid(d)){try{var c=getXMLFirstNode(d,"inventory");a.fillFromXML(c)}catch(f){outputAlert("onGetStockpileList "+f)}}},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 e=GBL.MAIN_DATA.getViewer();var c=this.getCost();if(e.getHealth()>=0.67*e.getMaxHealth()){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 f={};f.user_id=GBL.MAIN_DATA.getViewer().getUserId();f.level=GBL.MAIN_DATA.getViewer().getLevel();makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/heal",function(g){handleResult(g,d.m_resultDiv,function(){GBL.MAIN_TABS.invalidateTabs();d.refresh()})},f,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(j,g,f){if(GBL.ALL_USERS_CACHE.getCachedUsers().length==0){g.showMessage(false,"Error: 0 friends invited");return}var a=GBL.ALL_USERS_CACHE.getCachedUsers();var i=Math.floor(Math.random()*GBL.ALL_USERS_CACHE.getCachedUsers().length-1);var c={};var k=0;var h=[];var l=[];var e=[];goToPageTop();b(f);function b(m){if(k>=a.length){var p="You finished inviting <span class='invitationsViewNumFriends'>"+h.length+"</span> friends to join your "+m;g.showMessage(true,p);d();return}var q=[];if(a.length<InviteUtil.MULTI_INVITE_BUCKET){jQuery.each(a,function(s,r){q.push(r.getUserId());c[r.getUserId()]=true;++k})}else{for(var o=0;o<InviteUtil.MULTI_INVITE_BUCKET;++o){var n=a[i];if(isValid(n)){if(!isValid(c[n.getUserId()])){c[n.getUserId()]=true;++k;q.push(n.getUserId());i=(i+1)%a.length}else{break}}else{break}}}if(q.length==0){return}sendMultipleInvite(q,j(),function(t){if(t==0||((new Date()).getTime()-GBL.APP_LOAD_TIME)>15*60*1000){var u=document.createElement("div");var s=createWhiteDiv(u);s.innerHTML="You have invited <span class='invitationsViewNumFriends'>"+h.length+"</span> friends to join your "+m+" so far. Continue?";var r=new SideBySideCells(u);r.getLeftCell().style.padding="10px";new DivButton(r.getLeftCell(),GBL.STA_CONTINUE_INVITING_TEXT,function(){b(m)});r.getRightCell().style.padding="10px";new DivButton(r.getRightCell(),"Cancel",function(){if(h.length>0){g.showMessage(true,"You finished inviting <span class='invitationsViewNumFriends'>"+h.length+"</span> friends to join your "+m)}else{g.showMessage(false,"You didn't send any invites!")}d()});g.showCustomContent(h.length>0,u)}else{if(t>0){jQuery.each(q,function(v,w){h.push(w)});d();u=document.createElement("div");s=createWhiteDiv(u);s.innerHTML="You have invited <span class='invitationsViewNumFriends'>"+h.length+"</span> friends to join your "+m+" so far. Continue?";r=new SideBySideCells(u);r.getLeftCell().style.padding="10px";new DivButton(r.getLeftCell(),GBL.STA_CONTINUE_INVITING_TEXT,function(){b(m)});r.getRightCell().style.padding="10px";new DivButton(r.getRightCell(),"Cancel",function(){if(h.length>0){g.showMessage(true,"You finished inviting <span class='invitationsViewNumFriends'>"+h.length+"</span> friends to join your "+m)}else{g.showMessage(false,"You didn't send any invites!")}d()});g.showCustomContent(h.length>0,u)}else{jQuery.each(q,function(v,w){l.push(w)});u=document.createElement("div");s=createWhiteDiv(u);s.innerHTML="You have invited <span class='invitationsViewNumFriends'>"+h.length+"</span> friends to join your "+m+" so far. Continue?";r=new SideBySideCells(u);r.getLeftCell().style.padding="10px";new DivButton(r.getLeftCell(),GBL.STA_CONTINUE_INVITING_TEXT,function(){b(m)});r.getRightCell().style.padding="10px";new DivButton(r.getRightCell(),"Cancel",function(){if(h.length>0){g.showMessage(true,"You finished inviting <span class='invitationsViewNumFriends'>"+h.length+"</span> friends to join your "+m)}else{g.showMessage(false,"You didn't send any invites!")}d()});g.showCustomContent(h.length>0,u)}}})}function d(){consoleLog(h);if(h.length>0||l.length>0){var n={};n.user_id=GBL.MAIN_DATA.getViewer().getUserId();n.to_user_ids=h.join(",");n.blocked_user_ids=l.join(",");var m=this;makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/send_requests",function(o){outputDebug("finished sending one chunk")},n)}}}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 e=GBL.ALL_USERS_CACHE.getCachedUsers();var f=Math.floor(Math.random()*Math.max(e.length-30,0));var a=0;var d={};d.user_id=GBL.MAIN_DATA.getViewer().getUserId();d.query_ids="";for(var c=f;c<Math.min(f+40,e.length);c++){if(!GBL.APP_USERS_CACHE.hasUser(e[c].getUserId())){d.query_ids+=e[c].getUserId()+",";a+=1}}var b=this;makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/get_app_users_for_invite",function(g){b.onGetInviteUsers(g)},d)};HotTipDiv.prototype.onGetInviteUsers=function(d){var m=new Array();GBL.HOT_TIP_FRIENDS_LOADED=true;try{var f=getGadgetResponseData(d);if(f!=undefined){var h=f.getElementsByTagName("invite_id");if(isValid(h)&&h.length>0){for(var e=0;e<h.length;e++){var n=h[e].firstChild.nodeValue;m.push(GBL.ALL_USERS_CACHE.getUserById(n))}}}}catch(i){outputDebug("HotTip error: "+i)}if(m.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()*m.length),m.length-1);var p=m[a];var o=this;var q=function(){var r=new Array();r.push(p);o.m_sentFriends=new Array();o.m_blockedFriends=new Array();o.sendInvite(r,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 g=new ImageDiv(b,p.getThumbnailUrl(),"70px","70px");g.getContainerDiv().style.marginLeft="auto";g.getContainerDiv().style.marginRight="auto";g.getContainerDiv().style.cursor="pointer";addEvent(g.getContainerDiv(),"click",q);var k=makeElement("div",b,{textAlign:"center",cursor:"pointer"});k.innerHTML="<span class='invitationsViewShortName'>"+p.getShortName()+"</span><br/><span class='invitationsViewInviteNotPartText'> "+this.m_inviteNotPartText+" </span>";addEvent(k,"click",q);var j=c.getRightCell();var l=new DivButton(j,"Invite "+shortenedStringKeepEscapedCharacters(p.getName(),this.m_inviteNameMaxLength),q,undefined,false);setStyle(l.getButtonDiv(),{marginLeft:"5px",marginTop:"3px"});outputDebug("num invitable friends: "+m.length);l=new DivButton(j,"Invite "+InviteUtil.MULTI_INVITE_BUCKET+" Friends",function(){var r=new Array();var t=getRandomNumbers(m.length-1,InviteUtil.MULTI_INVITE_BUCKET);for(var s=0;s<t.length;s++){r.push(m[t[s]])}o.m_sentFriends=new Array();o.m_blockedFriends=new Array();o.sendMultipleInvites(r,0,function(){o.finishSending(r)})},undefined,false);l.getButtonDiv().style.margin="5px";l=new DivButton(j,"Invite All Friends",function(){sendToAllNonAppUsersV2(o.generateInvite,o.m_resultDiv,o.m_groupName)},undefined,false);l.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(e,a){var d=e[a];var c=this;var b=function(f){if(f>0){d.setRequestedByUser(true);c.m_sentFriends.push(d)}else{if(f==-1){c.m_blockedFriends.push(d)}}var g=a+1;if(g<e.length){c.sendInvite(e,g)}else{c.finishSending(e)}};sendInvite(d,this.generateInvite(d),b)};HotTipDiv.prototype.sendMultipleInvites=function(e,b,g){if(e.length==0){if(isValidFunction(g)){g()}}else{var a=new Array();var c=new Array();jQuery.each(e.slice(b,b+InviteUtil.MULTI_INVITE_BUCKET),function(j,h){a.push(h.getUserId());c.push(h)});var d=this;var f=function(h){jQuery.each(c,function(k,j){if(h>0){j.setRequestedByUser(true);d.m_sentFriends.push(j)}else{if(h==-1){d.m_blockedFriends.push(j)}}});var i=b+InviteUtil.MULTI_INVITE_BUCKET;if(i<e.length){setTimeout(function(){d.sendMultipleInvites(e,i,g)},800)}else{if(isValidFunction(g)){g()}}};if(isValid(this.m_sendInvite)&&this.m_sendInvite){sendMultipleInvite(a,this.generateInvite(),f)}}};HotTipDiv.prototype.finishSending=function(e){if(e.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 f="";for(c=0;c<this.m_blockedFriends.length;c++){if(c>0){f+=","}f+=this.m_blockedFriends[c].getUserId()}var d={};d.user_id=GBL.MAIN_DATA.getViewer().getUserId();d.to_user_ids=a;d.blocked_user_ids=f;var b=this;makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/send_requests",function(g){handleResult(g,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/mob/images/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/mob/images/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(f,e){if(GBL.APP_USERS_CACHE.hasUser(e.getUserId())){a.push(e);e.setRequestedByUser(true);d.m_sentFriends.push(e)}else{c.push(e)}});goToPageTop();this.sendInvites(c,0,function(){var e=function(){d.sendComment(a,0,function(){consoleLog("Finishing sending comments.");d.finishSending(b)})};if(c.length==0){e()}else{setTimeout(e,1000)}})};InviteDiv.prototype.sendInvites=function(e,b,g){if(e.length==0){if(isValidFunction(g)){g()}}else{var a=new Array();var c=new Array();jQuery.each(e.slice(b,b+InviteUtil.MULTI_INVITE_BUCKET),function(j,h){a.push(h.getUserId());c.push(h)});var d=this;var f=function(h){jQuery.each(c,function(k,j){if(h>0){j.setRequestedByUser(true);d.m_sentFriends.push(j)}else{if(h==-1){d.m_blockedFriends.push(j)}}});var i=b+InviteUtil.MULTI_INVITE_BUCKET;if(i<e.length){setTimeout(function(){d.sendInvites(e,i,g)},800)}else{if(isValidFunction(g)){g()}}};if(isValid(this.m_sendInvite)&&this.m_sendInvite){sendMultipleInvite(a,this.generateInvite(),f)}}};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(f,a,h){if(f.length==0){h()}else{var e=[];var g=this.generateNotificationText();var d=this.generateNotificationButtonList(GBL.MAIN_DATA.getViewer());for(var c=0;c<f.length;c++){var b=f[c];if(isValid(b)){e.push(b.m_userId)}}if(e.length>0){sendNotification(e,g,d)}this.sendCommentPostNotification(f,a,h)}};InviteDiv.prototype.sendCommentPostNotification=function(e,a,g){if(e.length==0){g()}else{var d=e[a];var c=this;if(isValid(d)){var b=function(h){if(h>0){d.setRequestedByUser(true);c.m_sentFriends.push(d)}else{if(h==-1){c.m_blockedFriends.push(d)}}var i=a+1;if(i<e.length){setTimeout(function(){c.sendCommentPostNotification(e,i,g)},400)}else{g()}};if(isValid(this.m_sendMessages)&&this.m_sendMessages&&GBL.APP_USERS_CACHE.hasUser(d.getUserId())){var f=this.generateMessage();sendMessage(d,f.subject,f.content,b)}else{sendCommentWOGoToPageTop(d,this.generateComment(),b)}}}};InviteDiv.prototype.finishSending=function(e){if(e.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 f="";for(b=0;b<this.m_blockedFriends.length;b++){if(b>0){f+=","}f+=this.m_blockedFriends[b].getUserId()}var c={};c.user_id=GBL.MAIN_DATA.getViewer().getUserId();c.to_user_ids=d;c.blocked_user_ids=f;var a=this;makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/send_requests",function(g){handleResult(g,a.m_resultDiv,function(){})},c)};function FriendPicker(p,q,m){var b=p;var n=q;var k=m;var s=undefined;var r=new Object();var h=undefined;var j=undefined;var i=undefined;g(b);this.getSelectedFriends=d;this.unselectFriends=e;function g(u){b=u;s=makeElementClass("div",b,"invitationsView");s.innerHTML=getLoadingMessageHTML();n.getNumUsers(c)}function c(u){outputDebug("FriendPicker: onGottenNumUsers: "+u);h=u;a(1)}function a(u){j=u;s.innerHTML="";l(s);if(!isValid(h)||h==0){var v=makeElementClass("div",s,"invitationsViewEmptyPage");v.innerHTML="Sorry, this shouldn't be empty, the technical team has been notified."}else{o(s);i=new FriendPickerContentDiv(s,n,j,r,f(),k);o(s)}}function f(){var u=0;for(var v in r){if(isValid(r[v])){u+=1}}return u}function l(w){var y=document.createElement("div");w.appendChild(y);y.style.textAlign="center";var u=makeElementClass("span",y,"invitationsViewSelectRandomTen");u.innerHTML="Select Random "+InviteUtil.MULTI_INVITE_BUCKET;addEvent(u,"click",function(){gaTrackEvent("my_mob","click","select_random_10");t();if(isValid(i)){i.selectRandom()}});var x=makeElementClass("span",y,"pipeDivider");x.innerHTML="|";var v=makeElementClass("span",y,"invitationsViewClearSelected");v.innerHTML="Clear Selected";addEvent(v,"click",function(){t();if(isValid(i)){i.unselectFriends()}})}function o(v){var u=Math.ceil(h/40);new PaginationDiv(v,a,u,j,20)}function d(){var u=new Array();for(var v in r){if(isValid(r[v])){u.push(n.getUserById(v))}}return u}function e(){r=new Object();a(j)}function t(){for(var u in r){r[u]=undefined}}}function FriendPickerContentDiv(w,u,v,m,s,q){var c=w;var b=u;var e=s;var k=v;var x=m;var p=q;var y=undefined;var i=undefined;var l=new Array();var n=new Array();this.getSelectedFriendIds=t;this.unselectFriends=d;this.selectRandom=h;if(isValid(c)){g(c)}function g(z){c=z;y=document.createElement("div");y.style.height="auto";y.style.overflow="auto";y.style.textAlign="center";y.innerHTML="Loading Users...";c.appendChild(y);b.getUsers((k-1)*40,40,a)}function a(B){var A=B;y.innerHTML="";i=document.createElement("form");y.appendChild(i);var D=document.createElement("table");D.style.borderSpacing="2px";D.style.border="none";D.style.marginLeft="auto";D.style.marginRight="auto";i.appendChild(D);var G=document.createElement("tbody");D.appendChild(G);var F=document.createElement("tr");G.appendChild(F);var E=0;for(var C=0;C<A.length;C++){var z=A[C];if(E>=5){F=document.createElement("tr");G.appendChild(F);E=0}if(z.getpartOfViewerMob()){F.appendChild(r(z))}else{F.appendChild(o(z))}E+=1}}function r(B){var E=document.createElement("td");E.className="invitationsViewUnpickableCell";if(B.getpartOfViewerMob()){var C=document.createElement("div");E.appendChild(C);C.innerHTML="<span class='invitationsViewFriendStatusMember'> Member</span>"}else{if(B.getRequestedByUser()){C=document.createElement("div");E.appendChild(C);C.innerHTML="<span class='invitationsViewFriendStatus'> Requested </span>"}else{if(B.getInviteBlocked()){C=document.createElement("div");E.appendChild(C);C.innerHTML="<span class='invitationsViewFriendStatus'> Blocking Invites </span>"}}}var A=document.createElement("div");E.appendChild(A);var D=B.getThumbnailUrl();A.style.backgroundImage="url('"+D+"')";A.style.backgroundPosition="center center";A.style.backgroundRepeat="no-repeat";A.style.width="70px";A.style.height="70px";var z=document.createElement("div");E.appendChild(z);z.innerHTML=shortenedStringKeepEscapedCharacters(B.getName(),16);return E}function o(D,J){var K=document.createElement("td");K.className="invitationsViewPickableCell";K.selected=false;K.onmouseover=function(){if(!K.selected){K.style.backgroundColor="#bdc7d8"}};K.onmouseout=function(){if(!K.selected){K.style.backgroundColor="#ffffff"}};if(D.getpartOfViewerMob()){var A=document.createElement("div");K.appendChild(A);if(isValid(GBL.TOP_MOB)&&GBL.TOP_MOB.isTopMob(D.getUserId())){A.innerHTML="<span class='invitationsViewFriendStatusMember'> Top Mob! </span>"}else{if(isValid(GBL.TOP_MOB)){A.innerHTML="<span class='invitationsViewFriendStatusMember'> Member <a style='cursor: pointer;' onclick='GBL.TOP_MOB.add("+D.getUserId()+")'>[promote]</a></span>"}else{A.innerHTML="<span class='invitationsViewFriendStatusMember'> Member </span>"}}}else{if(D.getInviteBlocked()){A=document.createElement("div");K.appendChild(A);A.innerHTML="<span class='invitationsViewFriendStatus'> Blocking Invites </span>"}else{if(D.getRequestedByUser()){A=document.createElement("div");K.appendChild(A);A.innerHTML="<span class='invitationsViewFriendStatus'> Requested </span>"}}}var M=document.createElement("table");M.style.border="none";M.align="CENTER";K.appendChild(M);var G=document.createElement("tbody");M.appendChild(G);var E=document.createElement("tr");G.appendChild(E);var C=document.createElement("td");E.appendChild(C);var B=document.createElement("div");C.appendChild(B);var L=D.getThumbnailUrl();B.style.backgroundImage="url('"+L+"')";B.style.backgroundPosition="center center";B.style.backgroundRepeat="no-repeat";B.style.width="70px";B.style.height="70px";var z=document.createElement("td");E.appendChild(z);var F=undefined;try{F=document.createElement("<input type='CHECKBOX' name='pickFriend' value='"+D.getUserId()+"'/>")}catch(I){F=document.createElement("input");F.type="checkbox";F.name="pickFriend";F.value=D.getUserId()}if(isValid(x[D.getUserId()])){F.checked=true;z.style.backgroundColor="#3b5998";z.style.color="white"}z.appendChild(F);var H=document.createElement("div");K.appendChild(H);if(isValid(D)){H.innerHTML=shortenedStringKeepEscapedCharacters(D.getName(),16)}addEvent(K,"click",function(N){j(F,K)});l.push(K);n.push(F);return K}function j(z,A){f(A);z.checked=!A.selected;if(z.checked){z.checked=false;x[z.value]=undefined;e--}else{z.checked=true;x[z.value]=z.value;e++;if(e>=InviteUtil.MULTI_INVITE_BUCKET){p()}}return false}function f(z){z.selected=!z.selected;if(z.selected){z.style.backgroundColor="#3b5998";z.style.color="white"}else{z.style.backgroundColor="white";z.style.color="black"}}function t(){var A=new Array();for(var z=0;z<i.pickFriend.length;z++){if(i.pickFriend[z].checked){A.push(i.pickFriend[z].value)}}return A}function d(){for(var z=0;z<l.length;z++){l[z].checked=false;l[z].selected=false;l[z].style.backgroundColor="white";l[z].style.color="black"}for(z=0;z<n.length;z++){n[z].checked=false;e=0}}function h(){d();var B=getRandomNumbers(l.length-1,InviteUtil.MULTI_INVITE_BUCKET);e=B.length;for(var A=0;A<B.length;A++){var C=B[A];var z=n[C].value;l[C].checked=true;l[C].selected=true;l[C].style.backgroundColor="#3b5998";l[C].style.color="white";n[C].checked=true;x[z]=z}if(e>=InviteUtil.MULTI_INVITE_BUCKET){p()}}}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(e){e.innerHTML="";c.m_page_view=1;new c.m_mobMembersDiv(e)})});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.createBulletin(this.m_refreshDiv);this.m_inviteDiv=new this.m_mobInviteDiv(this.m_refreshDiv)}};ViewerMobDiv.prototype.createBulletin=function(d){var b=new SideBySideCells(d);b.getContainerDiv().style.paddingTop="5px";b.getContainerDiv().style.paddingBottom="5px";var e=b.getLeftCell();e.style.textAlign="left";e.style.color=GBL.STYLES.text["color"];e.style.paddingRight="30px";e.innerHTML="Invite ALL your friends to join your Mob!";var f=b.getRightCell();var c=this;var a=new DivButton(f,"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 e=createWhiteDiv(this.m_containerDiv);e.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 f={};f.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(g){GBL.MAIN_DATA.getCachedUsers(CachedUserList.MY_REQUESTS).invalidateCache();handleResult(g,c.m_resultDiv,function(){c.m_refreshCallback()})},f,0)},null,true);new UserTableParentDiv(this.m_containerDiv,GBL.MAIN_DATA.getCachedUsers(CachedUserList.MY_REQUESTS),4,12,function(f){return c.canAcceptRejectTdCreater(f)},null,false)}};MobRequestsDiv.prototype.canAcceptRejectTdCreater=function(j){var i=this;var h=document.createElement("td");h.style.textAlign="center";h.style.width="145px";h.style.padding="5px";h.style.border="solid 1px #555555";var e=makeElementClass("div",h,"requestNameDiv");e.innerHTML=j.getMobName();addEvent(e,"click",function(){showUserStats(j.getUserId())});var a=new SideBySideCells(h,true);var c=a.getLeftCell();var d=new ImageDiv(c,j.getThumbnailUrl(),"60px","60px");d.getContainerDiv().style.cursor="pointer";addEvent(d.getContainerDiv(),"click",function(){showUserStats(j.getUserId())});var b=a.getRightCell();var f=makeElementClass("div",b,"requestAcceptDiv");f.innerHTML="<span style='font-weight:bold;'>Accept</span>";addEvent(f,"click",function(){i.m_resultDiv.showMessage(undefined,"Accepting ... ");goToPageTop();var k={};k.user_id=GBL.MAIN_DATA.getViewer().getUserId();k.accept_user_id=j.getUserId();makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/accept_mob_request",function(l){GBL.MAIN_DATA.getCachedUsers(CachedUserList.MY_REQUESTS).invalidateCache();handleResult(l,i.m_resultDiv,function(){i.m_refreshCallback()})},k)});var g=makeElementClass("div",b,"requestRejectDiv");g.innerHTML="Reject";addEvent(g,"click",function(){i.m_resultDiv.showMessage(undefined,"Rejecting ... ");goToPageTop();var k={};k.user_id=GBL.MAIN_DATA.getViewer().getUserId();k.reject_user_id=j.getUserId();makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/reject_mob_request",function(l){GBL.MAIN_DATA.getCachedUsers(CachedUserList.MY_REQUESTS).invalidateCache();handleResult(l,i.m_resultDiv,function(){i.m_refreshCallback()})},k)});return h};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 h=GBL.MAIN_DATA.getViewer().getMobSize();var c=h-1;var g=GBL.MAIN_DATA.getViewer().getTopMobsActive();if(!isValid(g)){g=0}var f=GBL.MAIN_DATA.getViewer().getNumHiredGuns();if(!isValid(f)){f=c-d}var e=c-f-g;if(d<=500){createTitleDiv(this.m_title,"Your "+c+" Mob Members: <span style='font-size:15px'> ("+f+" hired guns + "+g+" active top mob) </span>",null,null,null,this.m_titleFontSize)}else{createTitleDiv(this.m_title,"Your "+c+" Mob Members: <span style='font-size:15px'> ("+f+" hired guns + "+g+" 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(i){return b.canRemoveTdCreater(i)},"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 g=document.createElement("td");g.style.textAlign="center";g.style.width="120px";g.style.padding="5px";g.style.border="solid 1px #555555";if(isValid(GBL.TOP_MOB)){var f=document.createElement("div");f.style.color="#448844";f.style.fontSize="10px";f.style.fontWeight="bold";f.style.textAlign="center";f.style.padding="3px";f.style.cursor="pointer";f.style.marginTop=-4;if(GBL.TOP_MOB.isTopMob(d.getUserId())){f.innerHTML="Top Mob!"}else{f.innerHTML="[promote]"}g.appendChild(f);addEvent(f,"click",function(){GBL.TOP_MOB.add(d.getUserId())})}var b=document.createElement("div");g.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(g,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 e=document.createElement("div");g.appendChild(e);e.style.color=this.m_textColor;e.style.fontSize="11px";e.style.textAlign="center";e.innerHTML="[x]Remove";e.style.cursor="pointer";var c=this;addEvent(e,"click",function(){c.m_resultDiv.showMessage(undefined,"Removing ... ");goToPageTop();var h={};h.user_id=GBL.MAIN_DATA.getViewer().getUserId();h.remove_user_id=d.getUserId();makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/remove_mob_member",function(i){GBL.MAIN_DATA.getCachedUsers(CachedUserList.MY_MOB).invalidateCache();try{GBL.TOP_MOB.refresh()}catch(j){}handleResult(i,c.m_resultDiv,function(){c.refresh()})},h)});return g};function UserTableParentDiv(t,f,x,i,k,u,q,p){var c=t;var e=f;var g=x;var r=i;var b=k;var o=u;var w=undefined;var v=undefined;this.getCurrentPage=m;var l=undefined;var n=1;if(p){n=p}var h=q;if(c!=undefined){j(c)}function m(){return n}function j(y){outputDebug("createDiv");c=y;w=document.createElement("div");c.appendChild(w);w.style.padding="15px";w.style.textAlign="center";v=document.createElement("div");w.appendChild(v);v.style.textAlign="center";v.style.color=GBL.STYLES.text["color"];v.innerHTML="Loading number ...";e.getNumUsers(d)}function d(y){l=y;if(l==0){if(!isValid(o)){w.style.display="none"}else{v.innerHTML=o}return}outputDebug("UserTableParentDiv: onGottenNumUsers: "+y);a(n)}function a(y){outputDebug("UserTableParentDiv: jumpToPage "+y);n=y;v.innerHTML="";s(v);new UserListTableDiv(v,e,n,g,r,b,h);s(v)}function s(A,z){var y=Math.ceil(l/r);new PaginationDiv(A,a,y,n,30)}}function UserListTableDiv(q,k,f,h,o,p,d){var m=q;var e=k;var a=f;var g=h;var i=o;var c=p;var j=(f-1)*o;var b=null;this.createDiv=l;this.onGetUsers=n;if(m!=undefined&&m!=null){l(m)}function l(r){m=r;outputDebug("UserListTableDiv: createDiv ");b=document.createElement("div");m.appendChild(b);b.style.textAlign="center";b.innerHTML="<br><font color='red'><b>[Loading Users... Please wait.]</b></font>";e.getUsers(j,i,n)}function n(w){outputDebug("UserListTableDiv: onGetUsers");b.innerHTML="";var v=document.createElement("table");b.appendChild(v);v.style.marginLeft="auto";v.style.marginRight="auto";var s=document.createElement("tbody");v.appendChild(s);var r=Math.min(w.length,j+i);var u=undefined;for(var t=j;t<r;t++){if((t-j)%g==0){u=document.createElement("tr");s.appendChild(u)}if(isValid(w[t])){u.appendChild(c(w[t]))}}}}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 e=createWhiteDiv(this.m_containerDiv);e.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 f={};f.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(g){GBL.MAIN_DATA.getCachedUsers(CachedUserList.MY_REQUESTS).invalidateCache();handleResult(g,c.m_resultDiv,function(){c.m_refreshCallback()})},f,0)},null,true);new SearchableUserTableParentDiv(this.m_containerDiv,GBL.MAIN_DATA.getCachedUsers(CachedUserList.MY_REQUESTS),4,12,function(f){return c.canAcceptRejectTdCreater(f)},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 h=GBL.MAIN_DATA.getViewer().getMobSize();var c=h-1;var g=GBL.MAIN_DATA.getViewer().getTopMobsActive();if(!isValid(g)){g=0}var f=GBL.MAIN_DATA.getViewer().getNumHiredGuns();if(!isValid(f)){f=c-d}var e=c-f-g;if(d<=500){createTitleDiv(this.m_title,"Your "+c+" Mob Members: <span style='font-size:15px'> ("+f+" hired guns + "+g+" active top mob) </span>",null,null,null,this.m_titleFontSize)}else{createTitleDiv(this.m_title,"Your "+c+" Mob Members: <span style='font-size:15px'> ("+f+" hired guns + "+g+" 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(i){return b.canRemoveTdCreater(i)},"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(s,e,d,n,m,j,g,r){var i=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=s;this.m_userList=e;this.m_numPerRow=d;this.m_numUsersPerPage=n;this.m_userTdCreater=m;this.m_emptyMessage=j;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=h;if(r){i.m_startPage=r}if(i.m_parentDiv!=undefined){q(i.m_parentDiv)}function q(u){i.m_parentDiv=u;i.m_containerDiv=document.createElement("div");i.m_parentDiv.appendChild(i.m_containerDiv);i.m_containerDiv.style.padding="15px";i.m_containerDiv.style.textAlign="center";i.m_outerTableDiv=document.createElement("div");i.m_containerDiv.appendChild(i.m_outerTableDiv);i.m_outerTableDiv.style.textAlign="center";i.m_outerTableDiv.style.color=GBL.STYLES.text["color"];i.m_outerTableDiv.innerHTML="";i.m_filterDiv=makeElementClass("div",i.m_outerTableDiv,"friend_filter");makeElement("div",i.m_filterDiv).innerHTML="<font color='green'>Mob Member Search (BETA)</font><br>&nbsp;";i.m_searchInput=new HelpfulInput(i.m_filterDiv,i.m_helpMessage);$(i.m_searchInput.getInput()).keyup(l.bind(i));i.m_innerTableDiv=document.createElement("div");i.m_outerTableDiv.appendChild(i.m_innerTableDiv);i.m_innerTableDiv.style.textAlign="center";i.m_innerTableDiv.style.color=GBL.STYLES.text["color"];i.m_innerTableDiv.innerHTML="Loading number ...";i.m_userList.getNumUsers(b)}function b(u){i.m_totalNumUsers=u;i.m_currentNumUsers=u;if(i.m_totalNumUsers==0){if(!isValid(i.m_emptyMessage)){i.m_containerDiv.style.display="none"}else{i.m_outerTableDiv.innerHTML=i.m_emptyMessage}return}a(i.m_startPage,0,1)}function a(v,u,w){i.m_startPage=v;i.m_innerTableDiv.innerHTML="";if(isValid(i.m_userArray)){o(w)}if(i.m_currentLoadedNumUsers<i.m_totalNumUsers){t()}if(u==0){c(1);p(i.m_innerTableDiv);i.m_startIndex=(i.m_startPage-1)*i.m_numUsersPerPage;i.m_userTableDiv=null;i.m_userArray=null;i.innerCreateDiv=k;i.onGetUsers=f;if(i.m_innerTableDiv!=undefined&&i.m_innerTableDiv!=null){k(i.m_innerTableDiv)}p(i.m_innerTableDiv)}else{p(i.m_innerTableDiv);i.m_startIndex=(i.m_startPage-1)*i.m_numUsersPerPage;i.m_userTableDiv=document.createElement("div");i.m_innerTableDiv.appendChild(i.m_userTableDiv);i.m_userTableDiv.style.textAlign="center";i.m_userTableDiv.innerHTML="<br><font color='red'><b>[Loading Users... Please wait.]</b></font>";l(1,w);p(i.m_innerTableDiv)}}function k(u){i.m_innerTableDiv=u;i.m_userTableDiv=document.createElement("div");i.m_innerTableDiv.appendChild(i.m_userTableDiv);i.m_userTableDiv.style.textAlign="center";i.m_userTableDiv.innerHTML="<br><font color='red'><b>[Loading Users... Please wait.]</b></font>"}function p(v){var u=Math.ceil(Math.min(i.m_currentNumUsers,i.m_currentLoadedNumUsers)/i.m_numUsersPerPage);new PaginationDiv(v,a,u,i.m_startPage,30)}function t(){if(i.m_currentLoadedNumUsers!=0){i.m_loadingTableDiv=document.createElement("div");i.m_innerTableDiv.appendChild(i.m_loadingTableDiv);i.m_loadingTableDiv.style.textAlign="center";i.m_loadingTableDiv.innerHTML="<br><font color='red'><b>[Currently loaded "+i.m_currentLoadedNumUsers+"/"+i.m_totalNumUsers+" users.]</b></font>"}}function h(){return i.m_startPage}function f(u){i.m_userArray=u.slice();if(i.m_currentLoadedNumUsers<i.m_totalNumUsers){setTimeout(c,i.m_incrementWait)}else{a(h(),1,1)}}function c(u){i.m_userList.getUsers(i.m_currentLoadedNumUsers,i.m_incrementAmount,f);i.m_currentLoadedNumUsers=Math.min(i.m_currentLoadedNumUsers+i.m_incrementAmount,i.m_totalNumUsers);if(u!=1){a(h(),1,1)}}function l(w,A){var B=o(A);i.m_userTableDiv.innerHTML="";var z=document.createElement("table");i.m_userTableDiv.appendChild(z);z.style.marginLeft="auto";z.style.marginRight="auto";var v=document.createElement("tbody");z.appendChild(v);var u=Math.min(B.length,i.m_startIndex+i.m_numUsersPerPage);var y=undefined;for(var x=i.m_startIndex;x<u;x++){if((x-i.m_startIndex)%i.m_numPerRow==0){y=document.createElement("tr");v.appendChild(y)}if(isValid(B[x])){y.appendChild(i.m_userTdCreater(B[x]))}}if(isValid(w)){if(w!=1){a(i.m_startPage,1,A)}}}function o(w){if(isValid(i.m_userArray)){var x=i.m_userArray.slice();var v=i.m_searchInput.getValue().trim().toLowerCase();if(isValid(v)){if(v!=i.m_helpMessage&&v!=""){for(var u=(x.length-1);u>=0;u--){if(isValid(x[u])&&isValid(x[u].getMobName())){if((x[u].getMobName().toLowerCase()).indexOf(v)==-1){x.splice(u,1)}}}}}if(i.m_currentNumUsers!=(x.length-1)){if(isValid(w)){if(w!=1){i.m_startPage=1}}else{i.m_startPage=1}i.m_currentNumUsers=x.length-1}if(i.m_currentNumUsers==0){x=i.m_userArray.slice();i.m_currentNumUsers=x.length-1}return x}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 e={};e.user_id=GBL.MAIN_DATA.getViewer().getUserId();e.target_id=a.m_targetUserId;e.message=customEncoding(d.getText());if(isValid(GBL.MAIN_DATA.getViewer().getThumbnailUrl())){e.thumbnail_url=GBL.MAIN_DATA.getViewer().getThumbnailUrl()}makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/save_comment",function(f){handleResult(f,a.m_resultDiv,function(){a.refresh()})},e,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(f){this.m_tableDiv.innerHTML="";var e=getGadgetResponseData(f);if(isValid(e)){var b=getXMLNodeValue(e,"hide_comments_div");if(isValid(b)&&b){this.m_containerDiv.style.display="none"}}try{var d=getXMLNodeValue(e,"comment_cost");if(isValid(d)){if(parseInt(d)>0){this.m_explanationDiv.innerHTML="Each comment costs $"+d}}else{this.m_explanationDiv.innerHTML=""}}catch(h){this.m_explanationDiv.innerHTML=""}var a=new Array();if(isValid(e)){try{var c=e.getElementsByTagName("entry");for(var g=0;g<c.length;g++){a.push(new CommentEntry(c[g]))}}catch(h){outputAlert(h)}}if(a.length<=0){return}this.m_tableDiv.innerHTML="";this.m_tableDiv.style.height="500px";this.m_tableDiv.style.overflow="auto";for(g=0;g<a.length;g++){this.m_tableDiv.appendChild(this.createEntryDiv(a[g]))}};CommentDiv.prototype.createEntryDiv=function(d){var i=document.createElement("div");i.style.margin="5px";var j=new SideBySideCells(i);var a=j.getLeftCell();a.style.verticalAlign="top";a.style.width="53px";new ImageDiv(a,d.getFromUser().getThumbnailUrl(),"50px","60px");var k=j.getRightCell();k.style.verticalAlign="top";k.style.paddingLeft="5px";k.style.width="230px";var e=document.createElement("div");k.appendChild(e);e.style.borderTop="1px solid #888888";var b=new SideBySideCells(e);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 h=b.getRightCell();h.innerHTML="<span class='commentsCommentDelete'>X</span>";h.style.cursor="pointer";var f=this;addEvent(h,"click",function(){var l={};l.user_id=GBL.MAIN_DATA.getViewer().getUserId();l.delete_entry_id=d.getId();makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/delete_comment_entry",function(){f.refresh()},l)})}if(this.m_targetUserId==GBL.MAIN_DATA.getViewer().getUserId()&&d.getFromUser().getUserId()!=GBL.MAIN_DATA.getViewer().getUserId()){k.appendChild(this.createBlockDiv(d.getFromUser()))}var g=createWhiteDiv(k);g.style.width="230px";g.style.overflow="hidden";g.style.fontSize="11px";g.style.fontFamily="lucida grande,tahoma,verdana,arial,sans-serif";g.innerHTML=d.getMessage();a.style.cursor="pointer";addEvent(a,"click",function(){showUserStats(d.getFromUser().getUserId())});e.style.cursor="pointer";addEvent(c,"click",function(){showUserStats(d.getFromUser().getUserId())});return i};CommentDiv.prototype.createBlockDiv=function(h){var b=document.createElement("div");var i=document.createElement("div");b.appendChild(i);i.style.textAlign="right";var e=makeElementClass("span",i,"commentsCommentBlock");e.innerHTML="block";var c=makeElementClass("div",b,"commentsConfirmBlock");c.innerHTML="Are you sure you want to block "+h.getShortMobName()+" permanently from now on?";var g=new SideBySideCells(c,true);var f=g.getLeftCell();var j=new DivButton(f,"Yes",function(){c.innerHTML="Blocking "+h.getShortMobName()+"...";var k={};k.user_id=GBL.MAIN_DATA.getViewer().getUserId();k.target_id=h.getUserId();makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/block_user",function(){c.innerHTML=h.getShortMobName()+" has been blocked from now on."},k)});j.getButtonDiv().style.fontSize="11px";var a=g.getRightCell();var d=new DivButton(a,"Cancel",function(){c.style.display="none"});d.getButtonDiv().style.fontSize="11px";d.getButtonDiv().style.backgroundColor="#777777";addEvent(e,"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 e={};e.user_id=GBL.MAIN_DATA.getViewer().getUserId();e.target_id=a.m_targetUserId;e.message=customEncoding(d.getText());if(isValid(GBL.MAIN_DATA.getViewer().getThumbnailUrl())){e.thumbnail_url=GBL.MAIN_DATA.getViewer().getThumbnailUrl()}makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/save_comment",function(f){a.m_dismissFunc()},e,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 e=document.createElement("td");b.appendChild(e);addHeaderStyle(e);e.style.width="150px";e.innerHTML="Stat";e=document.createElement("td");b.appendChild(e);addHeaderStyle(e);e.style.width="80px";e.innerHTML="Score";e=document.createElement("td");b.appendChild(e);addHeaderStyle(e);e.style.width="150px";e.innerHTML="Action";e=document.createElement("td");b.appendChild(e);addHeaderStyle(e);e.style.width="400px";e.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(g,a,b,d){var e=document.createElement("tr");var f=makeElementClass("td",e,"myCharacterAttributeName");f.innerHTML=g;f=makeElementClass("td",e,"myCharacterAttributeScore");f.innerHTML=a;f=makeElement("td",e);var c=this;if(GBL.MAIN_DATA.getViewer().getSkillPoints()>0){new DivButton(f,"Increase",function(){gaTrackEvent("my_character","click","increase_attribute_"+g);c.m_resultDiv.showMessage(undefined,"Increasing ... ");var h={};h.user_id=GBL.MAIN_DATA.getViewer().getUserId();h.attribute=b;makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/increase_attribute",function(i){handleResult(i,c.m_resultDiv,function(){c.refresh()})},h,0)})}else{f.style.textAlign="center";f.innerHTML="<span class='myCharacterInsufficientSkillPoints'> Insufficient skill points </span>"}f=makeElementClass("td",e,"myCharacterAttributeDescription");f.innerHTML=d;return e};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 e=document.createElement("div");this.m_containerDiv.appendChild(e);e.style.padding="10px";e.innerHTML=getLoadingMessageHTML();var c={};c.user_id=GBL.MAIN_DATA.getViewer().getUserId();var b=this;makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/get_save_game_list",function(f){e.style.display="none";b.onGetSavedGames(f,d)},c)};CharacterChooserDiv.prototype.onGetSavedGames=function(c,e){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(f){outputAlert("onGetSavedGames "+f)}}for(d=0;d<this.m_savedGames.length;d++){e.appendChild(this.createSavedGameDiv(this.m_savedGames[d]))}e.appendChild(this.createNewGameDiv())};CharacterChooserDiv.prototype.createSavedGameDiv=function(f){var g=document.createElement("div");var c=new SideBySideCells(g);var e=this;var d=this.createConfirmationDiv(this.m_loadConfirmationText,"Do it!",function(){gaTrackEvent("my_character","click","load_game");e.m_resultDiv.showMessage(undefined,"Checking...");var h={};h.user_id=GBL.MAIN_DATA.getViewer().getUserId();h.save_id=f.getId();makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/load_game",function(i){e.handleGameResponse(i)},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=f.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 g};CharacterChooserDiv.prototype.createNewGameDiv=function(){var f=document.createElement("div");var c=new SideBySideCells(f);var e=this;var d=this.createConfirmationDiv(this.m_newGameConfirmationText,"Do It!",function(){e.m_resultDiv.showMessage(undefined,"Checking...");var g={};g.user_id=GBL.MAIN_DATA.getViewer().getUserId();makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/start_new_game",function(h){e.handleGameResponse(h)},g,1)});f.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 f};CharacterChooserDiv.prototype.createConfirmationDiv=function(b,f,e){var g=document.createElement("div");g.style.margin="10px";g.style.border="1px solid #888888";g.style.padding="5px 5px 5px 20px";var c=new SideBySideCells(g);var d=c.getLeftCell();d.className="myCharacterLoadGameMessage";d.innerHTML=b;var a=c.getRightCell();a.style.width="150px";new DivButton(a,f,e);return g};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 k=getXMLFirstNode(a,"target");this.m_statsData.user=new User(undefined);this.m_statsData.user.createXMLUser(k);try{var e=getXMLFirstNode(a,"weapon_urls");if(isValid(e)){this.m_statsData.weaponURLsArray=new Array();var o=e.getElementsByTagName("image_url");for(var c=0;c<o.length;c++){this.m_statsData.weaponURLsArray.push(decodeEncodedStringValue(o[c].firstChild.nodeValue))}}}catch(g){outputDebug(g)}try{var p=getXMLFirstNode(a,"armor_urls");if(isValid(p)){this.m_statsData.armorURLsArray=new Array();var j=p.getElementsByTagName("image_url");for(c=0;c<j.length;c++){this.m_statsData.armorURLsArray.push(decodeEncodedStringValue(j[c].firstChild.nodeValue))}}}catch(g){outputDebug(g)}try{var d=getXMLFirstNode(a,"vehicle_urls");if(isValid(d)){this.m_statsData.vehicleURLsArray=new Array();var n=d.getElementsByTagName("image_url");for(c=0;c<n.length;c++){this.m_statsData.vehicleURLsArray.push(decodeEncodedStringValue(n[c].firstChild.nodeValue))}}}catch(g){}try{var l=getXMLFirstNode(a,"henchmen_urls");if(isValid(l)){this.m_statsData.henchmenURLsArray=new Array();var h=l.getElementsByTagName("image_url");for(c=0;c<h.length;c++){this.m_statsData.henchmenURLsArray.push(decodeEncodedStringValue(h[c].firstChild.nodeValue))}}}catch(g){}try{var f=getXMLFirstNode(a,"land_urls");if(isValid(f)){this.m_statsData.propertyURLsArray=new Array();var b=f.getElementsByTagName("image_url");for(c=0;c<b.length;c++){this.m_statsData.propertyURLsArray.push(decodeEncodedStringValue(b[c].firstChild.nodeValue))}}}catch(g){}try{var i=getXMLFirstNode(a,"achievements");if(isValid(i)){this.m_statsData.achievementsArray=new Array();var m=i.getElementsByTagName("achievement");for(c=0;c<m.length;c++){this.m_statsData.achievementsArray.push(new Achievement(m[c]))}}}catch(g){}try{this.m_statsData.partOfViewerMob=getXMLNodeValue(a,"part_of_viewer_mob")}catch(g){}try{this.m_statsData.jobsCompleted=getXMLNodeValue(a,"jobs_completed")}catch(g){}try{this.m_statsData.jailed=getXMLNodeValue(a,"jailed")}catch(g){}try{this.m_statsData.escaped=getXMLNodeValue(a,"escaped_count")}catch(g){}try{this.m_statsData.bountyKills=getXMLNodeValue(a,"bounty_kills")}catch(g){}try{this.m_statsData.fightsWon=getXMLNodeValue(a,"fights_won")}catch(g){}try{this.m_statsData.fightsLost=getXMLNodeValue(a,"fights_lost")}catch(g){}try{this.m_statsData.deathCount=getXMLNodeValue(a,"death_count")}catch(g){}try{this.m_statsData.killCount=getXMLNodeValue(a,"kill_count")}catch(g){}try{this.m_statsData.recentVoteCount=getXMLNodeValue(a,"num_recent_vote")}catch(g){}try{this.m_statsData.darkness=getXMLNodeValue(a,"darkness")}catch(g){}};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(n,j,m){this.m_titleDiv.innerHTML="";var i=makeElement("div",this.m_titleDiv,{borderBottom:"solid 1px #777777",textAlign:"left"});var l=makeElement("table",i);var k=makeElement("tbody",l);var d=makeElement("tr",k);var o=makeElementClass("td",d,"myStatsTitle");o.innerHTML=n;var b=makeElement("div",this.m_titleDiv,{textAlign:"left",borderBottom:"solid 1px #777777"});var h=makeElement("table",b);var e=makeElement("tbody",h);d=makeElement("tr",e);for(var c=0;c<j.length;c++){o=makeElementClass("td",d,"myStatsSubtitle");o.innerHTML=j[c];if(isValidFunction(m[c])){o.className="myStatsSubtitleLink";addEvent(o,"click",m[c])}if(c>0){o.style.borderLeft="solid 2px #FFFFFF"}}var a="500px";var f=makeElement("td",d,{width:a,textAlign:"right"});var g=makeElementClass("span",f,"myStatsReportInappropriateName");g.innerHTML="Report Inappropriate Name";var p=this;addEvent(g,"click",function(){var s={};s.user_id=GBL.MAIN_DATA.getViewer().getUserId();s.offensive_id=p.m_targetUser.getUserId();s.offensive_name=customEncoding(p.m_targetUser.getMobName());var q=document.createElement("div");var t=new SideBySideCells(q);$(t.getLeftCell()).text("You successfully reported this user.");$(t.getLeftCell()).addClass("myStatsReportInappropriateNameSuccess");var r=new DivButton(t.getRightCell(),"OK",function(){$(p.m_resultDiv.getContainerDiv()).hide()});makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/report_offensive_name",function(u){p.m_resultDiv.showMessage(undefined,"You successfully reported this user.");p.m_resultDiv.showCustomContent(undefined,q)},s);g.innerHTML="Reported";g.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(e){var b=getGadgetResponseData(e);var h=new StatsData(b);this.m_refreshDiv.innerHTML="";var d=h.getData().user;this.m_targetUser=d;var f=new Array();var j=new Array();f.push(this.m_attackOptionText);var i=this;j.push(function(){i.m_resultDiv.showMessage(undefined,"Attacking "+d.getMobName()+" ...");goToPageTop();var k={};k.user_id=GBL.MAIN_DATA.getViewer().getUserId();k.target_id=d.getUserId();makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/attack",function(l){handleResult(l,i.m_resultDiv,function(){i.refresh()})},k,1)});f.push(this.m_punchActionText);j.push(function(){i.m_resultDiv.showMessage(undefined,i.m_punchActionPrefix+" "+d.getMobName()+" "+i.m_punchActionSuffix+"...");goToPageTop();var k={};k.user_id=GBL.MAIN_DATA.getViewer().getUserId();k.target_id=d.getUserId();k.punch_in_face=true;makeXMLNotCachedRequest(REQUEST_DESTINATION_URL+"/attack",function(l){handleResult(l,i.m_resultDiv,function(){i.refresh()})},k,1)});if(isValid(this.m_addHitListActionText)){f.push(this.m_addHitListActionText);j.push(function(){GBL.MAIN_TABS.switchToDynamicTab(function(l,k,m){new i.m_hitListDiv(l,k,m)},d)})}this.createTitleReportDiv("&quot;"+d.getMobName()+"&quot;, Level "+d.getLevel()+" "+d.getMobClass()+"<span style='font-size:12px'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"+(h.getData().partOfViewerMob?this.m_inMobLabel:this.m_notInMobLabel)+"</span>",f,j);var g=new SideBySideCells(this.m_refreshDiv,true);var a=g.getLeftCell();var c=g.getRightCell();a.style.width="350px";a.style.verticalAlign="top";this.createStatsDiv(a,h.getData());new CommentDiv(a,this.m_userId);this.createRightColumn(c,d,h)};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(j,h){var f=document.createElement("div");j.appendChild(f);createTitleDiv(f,"Stats");var d=new SideBySideCells(j,true);var e=d.getLeftCell();var c=d.getRightCell();var g=makeElementClass("table",e,"dataTable stats",{marginLeft:"auto",marginRight:"auto",borderSpacing:"6px"});var b=document.createElement("tbody");g.appendChild(b);var a=document.createElement("tr");b.appendChild(a);var i=document.createElement("td");a.appendChild(i);addHeaderStyle(i);i.style.width="180px";i.innerHTML="Career Stats";i=document.createElement("td");a.appendChild(i);addHeaderStyle(i);i.style.width="50px";i.innerHTML="Value";this.additionalCareerStats(b);b.appendChild(this.createStatTr(this.m_jobsCompletedLabel,h.jobsCompleted));if(isValid(this.m_jailedLabel)){b.appendChild(this.createStatTr(this.m_jailedLabel,h.jailed))}if(isValid(this.m_escapedLabel)){b.appendChild(this.createStatTr(this.m_escapedLabel,h.escaped))}b.appendChild(this.createStatTr(this.m_bountyKillsLabel,h.bountyKills));a=document.createElement("tr");b.appendChild(a);i=document.createElement("td");a.appendChild(i);addHeaderStyle(i);i.style.width="250px";i.innerHTML="Fight Stats";i=document.createElement("td");a.appendChild(i);addHeaderStyle(i);i.style.width="50px";i.innerHTML="Value";b.appendChild(this.createStatTr(this.m_fightsWonLabel,h.fightsWon));b.appendChild(this.createStatTr(this.m_fightsLostLabel,h.fightsLost));b.appendChild(this.createStatTr(this.m_deathCountLabel,h.deathCount));b.appendChild(this.createStatTr(this.m_killCountLabel,h.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(e,d,c){if(!isValid(c)||c.length<=0){return}var g=document.createElement("div");e.appendChild(g);createTitleDiv(g,d);var b=document.createElement("div");e.appendChild(b);b.style.textAlign="left";b.style.paddingLeft="30px";for(var f=0;f<c.length;f++){var a=document.createElement("img");b.appendChild(a);a.src=c[f];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 f=document.createElement("div");this.m_containerDiv.appendChild(f);f.style.paddingLeft="10px";var e=document.createElement("table");f.appendChild(e);var b=document.createElement("tbody");e.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 e=makeElement("table",this.m_statusMessageSpan,{display:"inline"});var c=makeElement("tbody",e);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 f=makeElement("div",this.m_containerDiv);$(f).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 g=makeElement("div",this.m_containerDiv);$(g).css({textAlign:"center",margin:"auto"});var e=makeElement("table",g);var d=makeElement("tbody",e);var h=makeElement("tr",d);var a=makeElement("td",h);$(a).text("Status Message:");a=makeElement("td",h);hugeQuote(a);this.m_currentStatusMessage=new HelpfulInput(a,this.m_userStatusMessage.getStatusMessage(),true);hugeQuote(a);h=makeElement("tr",d);a=makeElement("td",h);$(a).text("When you win a fight:");a=makeElement("td",h);hugeQuote(a);this.m_currentWinMessage=new HelpfulInput(a,this.m_userStatusMessage.getWinMessage(),true);hugeQuote(a);h=makeElement("tr",d);a=makeElement("td",h);$(a).text("When you lose a fight:");a=makeElement("td",h);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 e=makeElementClass("table",this.m_containerDiv,"dataTable",{marginLeft:"auto",marginRight:"auto",borderSpacing:"1px"});var a=document.createElement("tbody");e.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(f){c.onGetMadeMen(f)},d)};MadeMenDiv.prototype.onGetMadeMen=function(c){var b=getGadgetResponseData(c);if(isValid(b)){try{var f=getXMLFirstNode(b,"most_deadly");this.m_mostDeadlyRankingDiv.fillFromXML(f);var a=getXMLFirstNode(b,"top_fighters");this.m_topFightersRankingDiv.fillFromXML(a);var g=getXMLFirstNode(b,"top_bounty_hunters");this.m_topBountyHuntersRankingDiv.fillFromXML(g);var e=getXMLFirstNode(b,"top_tycoons");this.m_topTycoonsRankingDiv.fillFromXML(e)}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(e){this.m_containerDiv=makeElement("div",this.m_parentDiv,{padding:"15px"});var a=new SideBySideCells(this.m_containerDiv);var b=this;var f=a.getLeftCell();setStyle(f,{width:"200px",verticalAlign:"top"});this.m_regionsDiv=new RegionsDiv(f,function(g){b.onChangeSelectedRegion(g)});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(g){b.onGetData(g)},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(f){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=f.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(e){outputAlert(e)}};RegionsDiv.prototype.createRegionDiv=function(f,a,d,e){var b=makeElementClass("div",d,"madeMenRegionUnhighlighted");b.innerHTML=f;var c=this;addEvent(b,"click",function(){c.selectRegion(a)});this.m_regionIdRegionDivMap[a]=b;if(e){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(f){this.m_messageDiv.style.display="none";this.m_rankingsDiv.style.display="block";var e=true;if(isValid(f)){try{var d=getXMLFirstNode(f,"most_deadly");var a=getXMLFirstNode(f,"top_fighters");var g=getXMLFirstNode(f,"top_bounty_hunters");var c=getXMLFirstNode(f,"top_tycoons");if(isValid(d)||isValid(a)||isValid(g)||isValid(c)){this.m_mostDeadlyRankingDiv.fillFromXML(d);this.m_topFightersRankingDiv.fillFromXML(a);this.m_topBountyHuntersRankingDiv.fillFromXML(g);this.m_topTycoonsRankingDiv.fillFromXML(c)}else{e=false}}catch(b){outputDebug("onGetMadeMen "+b)}}else{e=false}if(!e){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(k,a,e){var i=k;var l=a;var b=e;var f=undefined;var d=undefined;var j=undefined;this.fillFromXML=h;if(i!=undefined){g(i)}function g(m){outputDebug("createDiv");i=m;f=document.createElement("div");i.appendChild(f);f.style.padding="0px";f.style.textAlign="center";j=document.createElement("div");f.appendChild(j);j.style.padding="10px";j.innerHTML=getLoadingMessageHTML()}function h(s){f.innerHTML="";var r=makeElementClass("table",f,"dataTable",{marginLeft:"auto",marginRight:"auto",borderSpacing:"1px"});d=document.createElement("tbody");r.appendChild(d);var p=makeElementClass("tr",d,"dataTableHeaderTR");var t=document.createElement("td");p.appendChild(t);addHeaderStyle(t);t.style.width="200px";t.innerHTML=l;t.style.paddingTop="2px";t.style.paddingBottom="2px";t=document.createElement("td");p.appendChild(t);addHeaderStyle(t);t.style.width="100px";t.style.paddingTop="2px";t.style.paddingBottom="2px";t.innerHTML=e;if(isValid(s)){try{var u=s.getElementsByTagName("entry");for(var n=0;n<u.length;n++){var o=new User(undefined);o.createXMLUser(getXMLFirstNode(u[n],"user"));var m=getXMLNodeValue(u[n],"count");d.appendChild(c(o,m))}}catch(q){outputAlert("fillFromXML "+q)}}}function c(n,m){outputDebug("createContentElement");var o=document.createElement("tr");var p=document.createElement("td");$(p).css({textAlign:"left"});o.appendChild(p);p.style.padding="0px 10px 0px 10px";p.innerHTML="<span class='madeMenMobName'> "+n.getMobName()+" </span>";p.style.paddingTop="2px";p.style.paddingBottom="2px";p.style.cursor="pointer";addEvent(p,"click",function(){showUserStats(n.getUserId())});p=makeElementClass("td",o,"madeMenStat");p.innerHTML=formatNumberWithCommas(m);return o}}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/mob/images/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/mob/images/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/mob/images/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/mob/images/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"});function getCDNRequestDestinationURL(){return REQUEST_DESTINATION_URL}function ResultDiv(c){var a=c;var d=undefined;this.showCustomContent=b;this.showMessage=f;this.getContainerDiv=g;e();function e(){d=makeElementClass("div",a,"resultDiv");d.style.color="white";d.style.padding="10px 5px 5px 20px";d.style.border="solid 1px #CCCCCC";d.style.display="none";d.style.textAlign="left"}function b(j,i){d.style.display="block";d.innerHTML="";if(isValid(j)){var h=document.createElement("div");d.appendChild(h);h.style.color="#FF7F00";h.style.fontSize="14px";h.style.fontWeight="bold";h.style.textAlign="left";if(j){h.innerHTML="Success!"}else{h.innerHTML="Ugh...:"}}d.appendChild(i)}function f(t,w,i,u,q){d.style.display="block";d.innerHTML="";if(isValid(t)){var r=document.createElement("div");d.appendChild(r);r.style.color="#FF7F00";r.style.fontSize="14px";r.style.fontWeight="bold";r.style.textAlign="left";if(t){r.innerHTML="Success!"}else{r.innerHTML="Ugh...:"}}var m=new SideBySide3Cells(d);var k=m.getLeftCell();if(isValid(u)){var j=document.createElement("img");k.appendChild(j);j.src=u}var v=m.getMiddleCell();v.style.color="#FFFFFF";v.style.textAlign="left";v.style.padding="8px";setInnerHTML(v,w);if(isValid(q)){v.appendChild(document.createElement("br"));v.appendChild(q)}try{if(isValid(i)){var p=getXMLEncodedStringNodeValue(i,"button_text");var o=getXMLEncodedStringNodeValue(i,"subject");var n=getXMLEncodedStringNodeValue(i,"body_html");var h=m.getRightCell();h.style.padding="0px";h.style.textAlign="right";h.style.width="290px";var s=new DivButton(h,p,function(){postToBulletin(GBL.MAIN_DATA.getViewer(),o,n,function(){})})}}catch(l){}}function g(){return d}}function AliensInitialChooserDiv(b,a){AliensInitialChooserDiv.baseConstructor.call(this,b,a)}extendClass(AliensInitialChooserDiv,InitialChooserDiv);AliensInitialChooserDiv.prototype.initialize=function(){this.m_chooseNameTitle="Crew Name";this.m_chooseNameExplanation="Give your crew a callsign (please be tasteful):";this.m_warningText="<span style='color:#FF0000; fot-weight:bold;'> Warning! Please change your crew name. </span> <br> Users have complained that your crew 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 Class";this.m_chooseClassExplanation="What kind of operation do you want to run:";this.m_classNameArray=new Array();this.m_classDescriptionsArray=new Array();this.m_classNameArray.push("Explorer");this.m_classDescriptionsArray.push("Explorer (recharge faster)");this.m_classNameArray.push("Soldier");this.m_classDescriptionsArray.push("Soldier (heal faster)");this.m_classNameArray.push("Colonist");this.m_classDescriptionsArray.push("Colonist (earn credits faster)")};function AliensViewerStatusDiv(a){AliensViewerStatusDiv.baseConstructor.call(this,a)}extendClass(AliensViewerStatusDiv,ViewerStatusDiv);AliensViewerStatusDiv.prototype.initialize=function(){this.m_cashLabel="Credits";this.m_healthLabel="Health";this.m_energyLabel="Energy";this.m_staminaLabel="Stamina";this.m_expLabel="Exp";this.m_mobLabel="Crew";this.m_statsDiv=AliensStatsDiv};AliensViewerStatusDiv.prototype.addStandardStyle=function(a){a.style.border="none";a.style.padding="6px 6px 0px 6px";a.style.color="white";a.style.fontSize="11px"};AliensViewerStatusDiv.prototype.addRefreshButtonStyle=function(a){a.style.padding="6px 6px 0px 6px"};function AliensViewerRefreshStatus(a){AliensViewerRefreshStatus.baseConstructor.call(this,a)}extendClass(AliensViewerRefreshStatus,ViewerRefreshStatus);AliensViewerRefreshStatus.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>"};function AliensHotTipDiv(a){AliensHotTipDiv.baseConstructor.call(this,a)}extendClass(AliensHotTipDiv,HotTipDiv);AliensHotTipDiv.prototype.initialize=function(){this.m_inviteTipText="A bigger crew is a more powerful crew!";this.m_inviteNotPartText="is not part of your crew";this.m_groupName="crew"};AliensHotTipDiv.prototype.generateInvite=function(){return GBL.MAIN_DATA.getViewer().getName()+' wants you to join their crew in OutWorld, save yourself, save your friends, save humanity! Just click "Add OutWorld" to start playing!'};AliensHotTipDiv.prototype.showDefaultHotTip=function(a){var c=undefined;var b=Math.random();if(b<=0.5){c="<span style='color: #CD7F32; font-size:16px; font-weight:bold;'> The Bigger the Crew, the better! </span> <br>A bigger crew will make you more <b>powerful in battles</b> and give you access to <b>more advanced missions</b>. <a href='#' class='standardLink' onclick='switchTabs(9); return false;'>Click here to invite more friends</a> to join your crew!"}else{c="<span onclick='window.open(\"http://profile.myspace.com/Modules/Applications/Pages/Canvas.aspx?appId=104283&track=aliens_hottip\");return false;' style='color: #CD7F32; font-size:14px; font-weight:bold; cursor:pointer;' > Like OutWorld? Try Mobsters! </span> <br>Mobsters is mafia-combat themed strategy game similar to OutWorld. Start a Mob with your friends. Rise from a petty thief to Mafia Don. Rule MySpace! <a onclick='window.open(\"http://profile.myspace.com/Modules/Applications/Pages/Canvas.aspx?appId=104283&track=aliens_hottip\");return false;' href='#' class='standardLink'>Click here</a> to play Mobsters!"}a.innerHTML="<ul><li>"+c+"</li></ul>"};function AliensCategorizedNewsFeedDiv(a){AliensCategorizedNewsFeedDiv.baseConstructor.call(this,a)}extendClass(AliensCategorizedNewsFeedDiv,CategorizedNewsFeedDiv);AliensCategorizedNewsFeedDiv.prototype.initialize=function(){this.m_sendCommandText="Broadcast a message to your crew for ";this.m_groupName="crew"};AliensCategorizedNewsFeedDiv.prototype.createBulletinSubject=function(){return"A Broadcast to my Crew!"};AliensCategorizedNewsFeedDiv.prototype.createBulletin=function(a){return a+"<br><br>------------------------------------------------------<br><a href='"+GBL.APP_CANVAS_URL+"track=command'>This message sent from: OutWorld. Save yourself, save the world!</a>"};AliensCategorizedNewsFeedDiv.prototype.postBulletinMessage=function(a){postToBulletin(GBL.MAIN_DATA.getViewer(),"A Broadcast to my Crew!",a+"<br><br>------------------------------------------------------<br><a href='"+GBL.APP_CANVAS_URL+"track=command'>This message sent from: OutWorld. Save yourself, save the world!</a>",function(b){})};AliensCategorizedNewsFeedDiv.prototype.getTabValues=function(){var a=new Array();a.push({tabName:"Complete",filterKey:"ALL"});a.push({tabName:"Battle",filterKey:"CMBT"});a.push({tabName:"Social",filterKey:"SOCL"});a.push({tabName:"Finance",filterKey:"FINC"});return a};function AliensJobListDiv(a){AliensJobListDiv.baseConstructor.call(this,a)}extendClass(AliensJobListDiv,JobListDiv);AliensJobListDiv.prototype.initialize=function(){this.m_titleDiv="Missions:";this.m_rewardHeader="What / Rewards";this.m_requirementHeader="Requirements";this.m_actionHeader="Action";this.m_nextLevelText="Get more missions when you reach level";this.m_doButtonText="Do Mission";this.m_doingText="Doing Mission ... ";this.m_repeatText="Do this mission again!";this.m_rewardSkillPointsLabelPlural="Skill Points";this.m_rewardFavorPointsLabelPlural="Power Crystals";this.m_rewardHiredGunsLabelPlural="Cyborgs";this.m_rewardSkillPointsLabel="Skill Point";this.m_rewardFavorPointsLabel="Power Crystal";this.m_rewardHiredGunsLabel="Cyborg"};AliensJobListDiv.prototype.getRequirementDiv=function(e){var d=e.getData();var c=document.createElement("div");var a=new SideBySideCells(c,false);var f=a.getLeftCell();f.style.verticalAlign="top";var g=createWhiteDiv(f);g.style.fontWeight="bold";g.innerHTML="Required";if(d.energy>0){g=createWhiteDiv(f);g.innerHTML="Energy: "+d.energy}if(d.mobster>0){g=createWhiteDiv(f);g.innerHTML="Crew Size: "+d.mobster}if(isValid(d.newMobster)&&d.newMobster>0){g=createWhiteDiv(f);g.innerHTML="New Members: "+d.newMobster+" <span style='font-size:11px; color:#aaaaaa'>(consumes)</span>"}if(isValid(d.cash)&&d.cash>0){g=createWhiteDiv(f);g.innerHTML="Cash: "+d.cash}if(isValid(d.additionalInfo)){g=createWhiteDiv(f);g.innerHTML=d.additionalInfo}var b=a.getRightCell();createItemsListDiv(b,d.items,2);return c};function AliensCityList(a){AliensCityList.baseConstructor.call(this,a)}extendClass(AliensCityList,CityListDiv);AliensCityList.prototype.initialize=function(){this.m_missionTitle="Mission Item";this.m_neededTitle="Needed";this.m_undevelopedLandTitle="Land";this.m_establishmentsTitle="Developments";this.m_explanationText="Colonize the land to earn a stable hourly income. Develop your colonies to earn even more. Once upgraded, your land will be converted permanently to a development and no longer generate income. Need more cash? <a class='standardLink' href='#' onclick='switchTabs(1);return false;'>Do some missions!</a>";this.m_cashFlowText="Creditflow"};AliensCityList.prototype.createTitle=function(b,a){createTitleDiv(this.m_titleDiv,"Colonies: <span style='font-size:14px'> (Income <span style='color:#00FF00'>$"+GBL.MAIN_DATA.getViewer().getIncome()+"</span>, Upkeep: <span style='color:#00FF00'>$"+GBL.MAIN_DATA.getViewer().getUpkeep()+"</span> ) </span>",b,a,false)};function AliensBankDiv(a){AliensBankDiv.baseConstructor.call(this,a)}extendClass(AliensBankDiv,BankDiv);AliensBankDiv.prototype.initialize=function(){this.m_bankName="Credit Union";this.m_depositTaxExplanation="The Credit Union does't make money by being generous -  it charges a 10% fee on credits deposited.";this.m_withdrawExplanation="Withdrawing credits is free."};AliensBankDiv.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 credit union can insure your account up to $"+formatNumberWithCommas(a)+"."}else{return""}};function AliensGodfatherDiv(a){AliensGodfatherDiv.baseConstructor.call(this,a)}extendClass(AliensGodfatherDiv,GodfatherDiv);AliensGodfatherDiv.prototype.initialize=function(){this.m_offerHeadingText="The Ark's Offers";this.m_explanationText="Complete offers below to earn crystals that will power The Ark. Since your colony ship \"The Ark\" was damaged after the crash, you must provide power crystals for it to manufacture such rewards as credits, special items, energy, crew members, etc.*<br/><br/><font size='1'>*Power crystals are NOT necessary for game play or game advancement.</font>";this.m_offerer="The Ark";this.m_offerCurrency="power crystals";this.m_offerKeys=new Array();this.m_offerDescriptions=new Array();this.m_offerCosts=new Array();this.m_offerHighlight=new Array();this.m_offerKeys.push("cash");this.m_offerDescriptions.push("The Ark offers you <b style='color: rgb(165,20,20)'>$"+formatNumberWithCommas(10000*GBL.MAIN_DATA.getViewer().getLevel())+"</b> credits for 10 power crystals.");this.m_offerCosts.push(10);this.m_offerHighlight.push(true);this.m_offerKeys.push("hire");this.m_offerDescriptions.push("The Ark offers you <b style='color: rgb(165,20,20)'>1 cyborg</b> (extra crew member) for 20 power crystals.");this.m_offerCosts.push(20);this.m_offerHighlight.push(false);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 Ark offers you");this.m_offerDescriptionArray.push("full energy refill");this.m_offerSuffixArray.push("for 10 power crystals.");this.m_offerCostArray.push(10);this.m_offerKeysArray.push("pick_full_stamina");this.m_offerPrefixArray.push("The Ark offers you");this.m_offerDescriptionArray.push("full stamina refill");this.m_offerSuffixArray.push("for 10 power crystals.");this.m_offerCostArray.push(10);this.m_offerKeysArray.push("pick_full_health");this.m_offerPrefixArray.push("The Ark offers you");this.m_offerDescriptionArray.push("full health");this.m_offerSuffixArray.push("for 10 power crystals.");this.m_offerCostArray.push(10);if(GBL.MAIN_DATA.getShowOfferNetwork()==AliensSuperRewardsDiv.prototype.getOfferNetworkKey()){this.m_offerpalConstructor=AliensSuperRewardsDiv}else{if(GBL.MAIN_DATA.getShowOfferNetwork()==AliensOfferPalDiv.prototype.getOfferNetworkKey()){this.m_offerpalConstructor=AliensOfferPalDiv}else{if(GBL.MAIN_DATA.getShowOfferNetwork()==AliensGambitDiv.prototype.getOfferNetworkKey()){this.m_offerpalConstructor=AliensGambitDiv}else{this.m_offerpalConstructor=AliensOfferPalDiv}}}};AliensGodfatherDiv.prototype.createTitle=function(b){var a=GBL.MAIN_DATA.getViewer().getUserId()*3+1;var c="<span onclick='window.open(\"http://pub.myofferpal.com/ba67aa1faba63be052f3098aa244a036/userstatus.action?snuid="+a+"\"); return false;' style='text-decoration:underline; cursor:pointer; font-size:11px; color:#EEEEEE;'> Missing power crystals, click here! </span>";c="";createTitleDiv(b,"The Ark: <span style='font-size:14px; color:#D9D919;'>(You have "+GBL.MAIN_DATA.getViewer().getFavorPoints()+" power crystals) </span> "+c)};AliensGodfatherDiv.prototype.getButtonText=function(a){return"Accept for "+a+" crystals!"};function AliensSuperRewardsDiv(a){AliensSuperRewardsDiv.baseConstructor.call(this,a)}extendClass(AliensSuperRewardsDiv,SuperRewardDiv);AliensSuperRewardsDiv.prototype.getSuperRewardIframeLink=function(a){var b="http://super.kitnmedia.com/super/offers?h=ixehge.502773444845&";b+="uid="+a.getUserId();if(isValid(a.getGender())){b+="&gender="+a.getGender()}if(isValid(a.getAge())){b+="&age="+a.getAge()}return b};AliensSuperRewardsDiv.prototype.initialize=function(){this.m_titleText="Earn Power Crystals";this.m_explanationText=""};function AliensOfferPalDiv(a){AliensOfferPalDiv.baseConstructor.call(this,a)}extendClass(AliensOfferPalDiv,OfferPalDiv);AliensOfferPalDiv.prototype.initialize=function(){this.m_titleText="Earn Power Crystals"};AliensOfferPalDiv.prototype.getOfferpalCSLink=function(a){return"http://pub.myofferpal.com/ba67aa1faba63be052f3098aa244a036/userstatus.action?snuid="+(a.getUserId()*3+1)};AliensOfferPalDiv.prototype.getOfferpalIframeBaseLink=function(a){return"http://pub.myofferpal.com/ba67aa1faba63be052f3098aa244a036/showoffers.action?"};function AliensGambitDiv(a){AliensGambitDiv.baseConstructor.call(this,a)}extendClass(AliensGambitDiv,GambitDiv);AliensGambitDiv.prototype.getGambitIframeLink=function(a){var b="http://getgambit.com/panel?k=a03f0f723a1435441715bf8071f6745c&";b+="uid="+a.getUserId();if(isValid(a.getGender())){b+="&gender="+a.getGender()}if(isValid(a.getAge())){b+="&age="+a.getAge()}return b};AliensGambitDiv.prototype.initialize=function(){this.m_titleText="Earn Power Crystals";this.m_explanationText=""};function AliensFightListDiv(a){AliensFightListDiv.baseConstructor.call(this,a)}extendClass(AliensFightListDiv,FightListDiv);AliensFightListDiv.prototype.initialize=function(){this.m_titleString="Choose a rival crew to Attack";this.m_mobNameLabel="Crew Callsign";this.m_mobSizeLabel="Crew Size";this.m_mobActionLabel="Attack Crew";this.m_emptyMessage="There are no other crews around your level to fight. You should check the battlefield again in a few minutes. Why not <a class='standardLink' href='#' onclick='switchTabs(1);return false;'>take on some missions</a> in the meantime?";this.m_repeatText="Fight them again!"};function AliensHitListBountyDiv(b,c,a){AliensHitListBountyDiv.baseConstructor.call(this,b,c,a)}extendClass(AliensHitListBountyDiv,HitListBountyDiv);AliensHitListBountyDiv.prototype.initialize=function(){this.m_explanationText="Once your bounty is posted, this user will be publicly listed for attack. The reward will be given to whoever accomplishes the task. <b> It costs 1 stamina point to place a user on the hitlist.</b>"};function AliensHitListDiv(a){AliensHitListDiv.baseConstructor.call(this,a)}extendClass(AliensHitListDiv,HitListDiv);AliensHitListDiv.prototype.initialize=function(){this.m_titleText="The Bounty List";this.m_explanationText="To add a crew to the bounty list visit their leader's profile page and click &quot;Add To Bounty List&quot;.";this.m_emptyMessage="The bounty list is currently empty. Check back often for crews that stepped on the wrong toes for a chance at a big bounty!";this.m_targetLabel="Target Crew";this.m_actionLabel="Attack Now"};function AliensStockPileDiv(a){AliensStockPileDiv.baseConstructor.call(this,a)}extendClass(AliensStockPileDiv,StockPileDiv);AliensStockPileDiv.prototype.initialize=function(a){this.m_mobItemsConstructor=AliensItemsDiv};function AliensItemsDiv(b,c,a){AliensItemsDiv.baseConstructor.call(this,b,c,a)}extendClass(AliensItemsDiv,ItemsDiv);AliensItemsDiv.prototype.initialize=function(a){this.m_titleText="Your Armory";this.m_explanationText="In a battle, each member of your crew will use whatever weapons, armor, and vehicles that you own. The battle results are calculated based on your crew size and what their equipment. Each crew member will use 1 weapon, wear 1 armor, and pilot 1 vehicle.";this.m_missionTitle="Mission Item";this.m_neededTitle="Needed";this.m_weaponsTitle="Weapons";this.m_armorTitle="Armor";this.m_vehiclesTitle="Vehicles";this.m_favorPointsText="power crystals"};function AliensHospitalDiv(a){AliensHospitalDiv.baseConstructor.call(this,a)}extendClass(AliensHospitalDiv,HospitalDiv);HospitalDiv.prototype.initialize=function(){this.m_titleText="Sickbay";this.m_explanationMsg="The doc can patch you up for a price. However, the doc runs a clean operation and demands a proof of payment from <a href='#' class='standardLink' onclick='switchTabs(3); return false;'>the Credit Union</a>. You currently have <span style='color:#32CD32'>$"+formatNumberWithCommas(GBL.MAIN_DATA.getViewer().getCashInBank())+"</span> credits in the credit union.";this.m_cantHealText="The doc already did his best, give your body some time...";this.m_healPrefix="Get patched up for";this.m_healProcessText="The doc is working..."};function AliensViewerMobDiv(a){AliensViewerMobDiv.baseConstructor.call(this,a)}extendClass(AliensViewerMobDiv,ViewerMobDiv);AliensViewerMobDiv.prototype.initialize=function(){this.m_titleString="Your Crew:";this.m_maxExplanation="Note: Your current maximum crew size limit is: <b>"+500+"</b>";this.m_mobMembersDiv=AliensMobMembersDiv;this.m_mobRequestsDiv=AliensMobRequestsDiv;this.m_mobInviteDiv=AliensInviteDiv;this.m_groupName="crew"};AliensViewerMobDiv.prototype.createBulletin=function(d){var b=new SideBySideCells(d);b.getContainerDiv().style.paddingTop="5px";b.getContainerDiv().style.paddingBottom="5px";var e=b.getLeftCell();e.style.textAlign="left";e.style.color="#FFFFFF";e.style.paddingRight="30px";e.innerHTML="Invite ALL your friends to your crew!";var f=b.getRightCell();var c=this;var a=new DivButton(f,"Invite All Your Friends!",function(){sendToAllNonAppUsers(c.m_inviteDiv.generateInvite,c.m_resultDiv,c.m_groupName)})};function AliensMobRequestsDiv(b,c,a){AliensMobRequestsDiv.baseConstructor.call(this,b,c,a)}extendClass(AliensMobRequestsDiv,MobRequestsDiv);AliensMobRequestsDiv.prototype.initialize=function(){this.m_explanationMsg="The following people have requested that you join their crews. If you accept, they will also become your crew member, giving your more power in battles, and allowing you to take on more challenging missions."};function AliensMobMembersDiv(a){AliensMobMembersDiv.baseConstructor.call(this,a)}extendClass(AliensMobMembersDiv,MobMembersDiv);AliensMobMembersDiv.prototype.initialize=function(){this.m_titleString="Your Crew Members:"};AliensMobMembersDiv.prototype.onGottenNumUsers=function(b){this.m_refreshDiv.innerHTML="";if(b<=500){createTitleDiv(this.m_title,"Your Crew Members: <span style='font-size:15px'> ("+(GBL.MAIN_DATA.getViewer().getMobSize()-b-1)+" cyborgs) </span>")}else{createTitleDiv(this.m_title,"Your Crew Members: <span style='font-size:15px'> ("+(GBL.MAIN_DATA.getViewer().getMobSize()-b-1)+" cyborgs) </span> <span style='color:#FF0000; font-style:italic; font-size:15px'> (500 Active) </span>")}var a=this;new UserTableParentDiv(this.m_refreshDiv,GBL.MAIN_DATA.getCachedUsers(CachedUserList.MY_MOB),5,40,function(c){return a.canRemoveTdCreater(c)},"You have a one member crew, yourself! The more friends in your crew the stronger (and less lonely) you are, so you should <a href='#' class='standardLink' onclick='switchTabs(9);return false;'>invite some friends</a> to be part of your crew!")};function AliensInviteDiv(a){AliensInviteDiv.baseConstructor.call(this,a)}extendClass(AliensInviteDiv,InviteDiv);AliensInviteDiv.prototype.initialize=function(){this.m_sendInvite=true;this.m_explanationMsg='Select your friends from below to recruit them. <b>Having a bigger crews means you are more powerful when attacking rival crews, and can also take on more challenging missions!</b> To build a successful crew you should choose all friends from below who are most likely to join, then click "Send Invites".'};AliensInviteDiv.prototype.generateComment=function(){return"todo dan"};AliensInviteDiv.prototype.generateInvite=function(){return GBL.MAIN_DATA.getViewer().getName()+' wants you to join their crew in OutWorld, a futuristic combat game on MySpace. Explore, Colonize, and Conquer! Just click "Add OutWorld" to start playing!'};function AliensBossDiv(a){AliensBossDiv.baseConstructor.call(this,a)}extendClass(AliensBossDiv,BossDiv);AliensBossDiv.prototype.initialize=function(){this.m_titleString="Your Character";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("More attack points means you are more powerful when attacking rival crews.");this.m_attributeKeyArray.push("defense_strength");this.m_attributeArray.push("Defense Strength");this.m_attributeValueCallbackArray.push(function(){return GBL.MAIN_DATA.getViewer().getDefenseStrength()});this.m_attributeDescriptionArray.push("More defense points means you are more effective at defending against hostile attacks.");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("Increase your energy capacity to complete more missions and other actions.");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("Increase your max health by <b>10</b> to better survive intense battles.");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("Increase your stamina to attack in battle more often. <style='color:#FF0000'><b>2</b> skill points needed for increase!</span>");this.m_characterChooserDiv=AliensCharacterChooserDiv};function AliensCharacterChooserDiv(a){AliensCharacterChooserDiv.baseConstructor.call(this,a)}extendClass(AliensCharacterChooserDiv,CharacterChooserDiv);AliensCharacterChooserDiv.prototype.initialize=function(){this.m_titleText="Switch Characters/Start New Character (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 characters under the same account. The characters will share: (1) power crystals, (2) crew members, and (3) 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 character 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 character will not regenerate or make money while it is inactive."};function AliensStatsDiv(a,b){AliensStatsDiv.baseConstructor.call(this,a,b)}extendClass(AliensStatsDiv,StatsDiv);AliensStatsDiv.prototype.initialize=function(){this.m_attackOptionText="Attack";this.m_punchActionText="Punch in Face";this.m_addHitListActionText="Add to Bounty List";this.m_inMobLabel="This person is in your crew.";this.m_notInMobLabel="This person is NOT in your crew.";this.m_weaponsTitle="Weapons";this.m_armorsTitle="Armor";this.m_vehiclesTitle="Vehicles";this.m_propertiesTitle="Colonies";this.m_jobsCompletedLabel="Missions Completed";this.m_jailedLabel="Jailed";this.m_escapedLabel="Escaped";this.m_bountyKillsLabel="Bounty Count";this.m_fightsWonLabel="Battles Won";this.m_fightsLostLabel="Battles Lost";this.m_deathCountLabel="Deaths";this.m_killCountLabel="Crews Destroyed";this.m_hitListDiv=AliensHitListBountyDiv};function AliensRegionizedLeaderboardDiv(a){AliensRegionizedLeaderboardDiv.baseConstructor.call(this,a)}extendClass(AliensRegionizedLeaderboardDiv,RegionizedLeaderboardDiv);AliensRegionizedLeaderboardDiv.prototype.initialize=function(){this.m_titleString="Top Aliens and their Guilds";this.m_leaderBoardConstructor=AliensRegionalLeaderBoardDiv};function AliensRegionalLeaderBoardDiv(a){AliensRegionalLeaderBoardDiv.baseConstructor.call(this,a)}extendClass(AliensRegionalLeaderBoardDiv,RegionalLeaderBoardDiv);AliensRegionalLeaderBoardDiv.prototype.initialize=function(){};AliensRegionalLeaderBoardDiv.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,"Legendary Fighters","Victories");c=document.createElement("td");b.appendChild(c);c.style.width="390px";c.style.verticalAlign="top";this.m_topTycoonsRankingDiv=new MobRankingDiv(c,"Most Wealthy","$$$");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,"Most Deadly","Destroyed");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")};function AliensMadeMenDiv(a){AliensMadeMenDiv.baseConstructor.call(this,a)}extendClass(AliensMadeMenDiv,MadeMenDiv);AliensMadeMenDiv.prototype.initialize=function(){this.m_titleString="Top Crews"};AliensMadeMenDiv.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,"Legendary Fighters","Victories");c=document.createElement("td");b.appendChild(c);c.style.width="390px";c.style.verticalAlign="top";this.m_topTycoonsRankingDiv=new MobRankingDiv(c,"Most Wealthy","$$$");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,"Most Deadly","Destroyed");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")};function switchToMyMobTab(){switchTabsByName("My Crew")}function init(){outputDebug("init called");if(isDebugging()){gadgets.window.adjustHeight(6400)}else{gadgets.window.adjustHeight(6200)}document.body.style.backgroundColor="#000000";var c=document.getElementById("headerFrame");if(isValid(c)){c.style.backgroundColor="#000F1D";c.style.backgroundImage="url("+IMAGE_LOCATION_PREFIX+"outworld_header.gif)";c.style.backgroundRepeat="no-repeat";c.style.backgroundPosition="0 0";c.style.margin="0px";c.style.padding="0px";c.style.border="none";c.style.display="block";c.style.height="80px"}var a=document.getElementById("mainFrame");if(isValid(a)){a.style.paddingLeft="50px";a.style.paddingRight="50px";a.style.backgroundColor="#000F1D";a.style.backgroundImage="url("+IMAGE_LOCATION_PREFIX+"canvas_bg2.jpg)";a.style.backgroundRepeat="no-repeat";a.style.backgroundPosition="0 -8";a.style.margin="0px";a.style.padding="10px 5px 0px 5px";a.style.overflow="hidden";a.style.border="none";a.style.height="6000px"}var b=document.getElementById("debugOutput");if(isValid(b)){b.style.width="830px"}initializeGA("UA-4182330-12");var f=gadgets.views.getParams();for(var g in f){outputDebug(g+" >>> "+f[g])}try{var d=f.installState;switch(d){case"0":GBL.app_install_state=GBL.APP_NOT_INSTALLED;break;case"1":GBL.app_install_state=GBL.APP_INSTALLED;break;case"2":GBL.app_install_state=GBL.APP_JUST_INSTALLED;break;default:GBL.app_install_state=GBL.APP_INSTALLED;break}}catch(e){GBL.app_install_state=GBL.APP_INSTALLED}startGame()}function startGame(){var b=document.getElementById("headerFrame");b.innerHTML="";var a=document.getElementById("mainFrame");a.innerHTML="";if(GBL.app_install_state==GBL.APP_NOT_INSTALLED){showNotInstalledMessage()}else{var c=c=new CenteredTextMessageDiv(a,"<span style='font-weight:bold;'> Loading application data... </span> <br/> <span style='font-size:10px;'> (Refreshing the page may help...) </span>","300px");GBL.MAIN_DATA=new CentralData(createUI,c)}}function showNotInstalledMessage(){var b=document.getElementById("mainFrame");var i="12px";var c="340px";var d="120px";var f="80px";var e=document.createElement("img");document.body.appendChild(e);e.src="http://cdn0.mobwarsapp.com/mob/images/promotional/up_arrow2.gif";e.style.position="absolute";e.style.top=i;e.style.left=c;e.style.zIndex=0;var g=document.createElement("div");document.body.appendChild(g);g.style.textAlign="center";g.style.backgroundColor="#FFFFFF";g.style.padding="10px";g.style.fontSize="18px";g.style.borderColor="black";g.style.borderStyle="solid";g.style.borderWidth="4px";g.style.position="absolute";g.style.top=d;g.style.left=f;g.style.zIndex=0;if(screen.availHeight<600){g.style.textAlign="left";g.innerHTML="1. Press <b>F11</b> for fullscreen.<br> 2. Click &quot;Add this App&quot; above to continue!"}else{g.innerHTML="You must add this application to continue!"}document.body.style.backgroundColor="#000000";document.body.style.backgroundRepeat="no-repeat";var h=document.getElementById("headerFrame");if(isValid(h)){h.style.display="none"}var a=document.getElementById("mainFrame");if(isValid(a)){a.style.display="none"}if(isValid(getOpenSocialParameter("rsrc"))){abTest(-1,getOpenSocialParameter("rsrc"))}return false}function createUI(){if(GBL.app_install_state==GBL.APP_JUST_INSTALLED){gifTrack("aliens",{freshInstall:1})}var g=document.getElementById("headerFrame");var c=document.getElementById("mainFrame");c.innerHTML="";goToPageTop();if(!isValid(GBL.MAIN_DATA.getViewer().getMobName())||!isValid(GBL.MAIN_DATA.getViewer().getMobClass())){c.style.backgroundImage="url()";new AliensInitialChooserDiv(c,createUI);return}c.style.backgroundImage="url("+IMAGE_LOCATION_PREFIX+"canvas_bg2.jpg)";var a=new Array();a.push("Main");a.push("Missions");a.push("Colonize");a.push("Credit Union");a.push("Ark");a.push("Battle");a.push("Bounties");a.push("Armory");a.push("Sickbay");a.push("My Crew");a.push("My Upgrades");a.push("Legends");a.push("FAQ");var e=new Array();e.push(toMainMenuTab);e.push(toMissions);e.push(toTerritoriesTab);e.push(toCreditUnionTab);e.push(toArkTab);e.push(toBattleTab);e.push(toBountiesTab);e.push(toArmamentTab);e.push(toSickbayTab);e.push(toMyCrewTab);e.push(toMyUpgradesTab);e.push(toLegendsTab);e.push(toFAQTab);var d=new Array();d.push("left");d.push("left");d.push("left");d.push("left");d.push("left");d.push("left");d.push("left");d.push("left");d.push("left");d.push("left");d.push("left");d.push("left");d.push("left");var b=0;GBL.REFRESH_STATUS=new AliensViewerRefreshStatus(g);showXPromos("mob,racing,vampires,poker,sorority",455,IE?16:7);GBL.STATUS_DIV=new AliensViewerStatusDiv(c);GBL.MAIN_TABS=new TabsDiv(c,a,e,d,b,"unSelectedTab","selectedTab",undefined,"55px",0,"850px");function h(){$(this).addClass("highlightedTab")}function f(){$(this).removeClass("highlightedTab")}$("span.unSelectedTab").hover(h,f);$("span.selectedTab").hover(h,f);if(isValid(getOpenSocialParameter(GBL.SHOW_USER_ID))){GBL.MAIN_TABS.switchToDynamicTab(function(i){i.innerHTML="";new AliensStatsDiv(i,getOpenSocialParameter(GBL.SHOW_USER_ID))})}if(GBL.app_install_state!=GBL.APP_JUST_INSTALLED&&isValid(getOpenSocialParameter("rsrc"))){abTest(GBL.MAIN_DATA.getViewer().getUserId(),getOpenSocialParameter("rsrc")+"_installed")}}function toMainMenuTab(a,d){if(!d){a.innerHTML="";new AliensMainMenuDiv(a);var c=$("#newsfeedHolder");if(!CategorizedNewsFeedDiv.prototype._oldOnGet){CategorizedNewsFeedDiv.prototype._oldOnGet=CategorizedNewsFeedDiv.prototype.onGetNewsfeeds;CategorizedNewsFeedDiv.prototype.onGetNewsfeeds=function(f,e){this._oldOnGet(f,e);if(c.length==0){return}var g=0;for(;g<b.m_all_entries.length;++g){if(b.m_all_entries[g].getTimeAgo().search("day")!=-1){break}}c.html("");showNewsfeedMessage(c[0],g)}}var b=new AliensCategorizedNewsFeedDiv(a);$("#mainNewsFeedDiv").css({border:"0px none",margin:"0px"})}}function toMissions(a,b){if(!b){a.innerHTML="";new AliensJobListDiv(a)}}function toTerritoriesTab(a,b){if(!b){a.innerHTML="";new AliensCityList(a)}}function toCreditUnionTab(b,c){if(!c){b.innerHTML="";var a=new AliensBankDiv(b)}}function toArkTab(a,b){if(!b){a.innerHTML="";new AliensGodfatherDiv(a)}}function toBattleTab(a,b){if(!b){a.innerHTML="";new AliensFightListDiv(a)}}function toBountiesTab(a,b){a.innerHTML="";new AliensHitListDiv(a)}function toArmamentTab(a,b){if(!b){a.innerHTML="";new AliensStockPileDiv(a)}}function toSickbayTab(a,b){if(!b){a.innerHTML="";new AliensHospitalDiv(a)}}function toMyCrewTab(a,b){if(!b){a.innerHTML="";new AliensViewerMobDiv(a)}}function toMyUpgradesTab(a,b){if(!b){a.innerHTML="";new AliensBossDiv(a)}}function toLegendsTab(a,b){if(!b){a.innerHTML="";new AliensRegionizedLeaderboardDiv(a)}}function toFAQTab(a,b){if(!b){a.innerHTML="";renderMobFAQDiv(a)}}function renderMobFAQDiv(c){var a="";a+='<font size="4"><b>The answer to your questions may be below. If you have a question or a problem with the app, please use the form in the "Support" tab rather than sending a MySpace message to the developer.</b></font><br><br>';var b=new FAQDiv(c,"outworld",a);b.showSupportIFrame()}function showWelcomeMessage(c){var a=document.createElement("div");c.appendChild(a);a.style.margin="10px 0px 10px 0px";a.style.padding="10px";a.style.border="solid 1px #888888";a.style.fontSize="20px";a.style.fontWeight="bold";a.style.textAlign="left";a.style.color="#CD7F32";a.innerHTML="Welcome, to an alien world...";var b=document.createElement("div");a.appendChild(b);b.style.padding="8px 8px 8px 20px";b.style.fontSize="14px";b.style.fontWeight="300";b.style.color="#FFFFFF";b.innerHTML="Your spaceship, \"The Ark\", has crash landed on a mysterious alien world. You and your shipmates have splintered into small factions in a fight to dominate the new planet. The goal is simple: explore, colonize, and conquer! Start earning credits and gaining experience by <a href='#' class='standardLink' onclick='switchTabs(1); return false;'>completing some missions.</a><br/>When you're through earning credits, you can also:<br/><ul><li><a href='#' class='standardLink' onclick='switchTabs(2); return false;'>Claim land</a> and develop on it to earn recurring income.</li><li>Buy weapons, armor, and vehicles to <a href='#' class='standardLink' onclick='switchTabs(7); return false;'>equip your crew</a>.</li><li>Use your vehicles and equipment to <a href='#' class='standardLink' onclick='switchTabs(5); return false;'>battle</a> against opposing crews.</li><li><a href='#' class='standardLink' onclick='switchTabs(9); return false;'>Invite your friends</a> to join your crew to grow in strength!</li></ul>This is OutWorld, where the greatest dangers can't be seen. For more information <a href='#' class='standardLink' onclick='switchTabs(12); return false;'>read our FAQ!</a>"}function buildMessage(d,c,b){var e=makeElementClass("div",d,"tipContainer");var f=makeElementClass("div",e,"tipTitle");$(f).html(c);var a=makeElementClass("div",e,"tipDivMessage");$(a).html(b);return e}function showUpdatesMessage(a){var b=GBL.MAIN_DATA.getMyspaceAnnouncement();if(!isValid(b)){return null}return buildMessage(a,"Announcement",b)}function showInviteMessage(b,a){return buildMessage(b,"Invites","You have <a href='#' class='standardLink' onclick='switchTabs(9); return false;'>"+a+" request(s)</a> to join people's crews.")}function showNewsfeedMessage(b,a){if(a<=0){return null}return buildMessage(b,"Newsfeed","You received "+a+" news feed item"+(a>1?"s":"")+" today. ")}function showNotifactionMessage(a){GBL.HOT_TIP_DIV=new AliensHotTipDiv(a);$(".hotTipContainer").css({padding:"0",margin:"0",border:"0px none"})}function AliensMainMenuDiv(c){var b=c;var d=undefined;var a=undefined;if(b!=undefined){e(b)}function e(n){b=n;d=makeElementClass("div",b,"mainMenuDiv");b.appendChild(d);d.style.padding="15px";d.style.textAlign="center";a=new SideBySide3Cells(d,false);var l=a.getLeftCell();var h=a.getMiddleCell();var q=a.getRightCell();$(l).addClass("tipDiv").addClass("tipDivLeft");$(h).addClass("tipDivMiddle");$(q).addClass("tipDiv").addClass("tipDivRight");if(GBL.app_install_state==GBL.APP_JUST_INSTALLED||(isValid(GBL.MAIN_DATA.getViewer().getJoinedDaysAgo())&&GBL.MAIN_DATA.getViewer().getJoinedDaysAgo()<=1)){showWelcomeMessage(l)}else{showNotifactionMessage(l)}showUpdatesMessage(q);var i=GBL.MAIN_DATA.getViewer().getNumRequests();if(isValid(i)&&i>0){var o=showInviteMessage(q,i);addEvent(o,"click",function(){GBL.MAIN_TABS.switchToTab(9)})}makeElementId("div",q,"newsfeedHolder");var p=makeElementClass("div",d,"mainContent");p.style.textAlign="left";var j=makeElement("div",p);createTitleDiv(j,"Main Menu");var m=makeElement("table",p,{marginLeft:"30px",textAlign:"left"});var k=document.createElement("tbody");m.appendChild(k);k.appendChild(f("Missions","Take your crew on missions to earn credits and experience.",1));k.appendChild(f("Colonize","Build up a settlement on this alien world to earn a more stable income.",2));k.appendChild(f("The Credit Union","The Credit Union will safekeep your credits, but it'll cost you.",3));k.appendChild(f("The Ark","Provide the colony ship's computers with energy crystals and earn rewards...",4));k.appendChild(f("Battle","Raid the colonies of opposing crews.",5));k.appendChild(f("Bounties","These crews stepped on the wrong toes. Take them out for a big bounty.",6));k.appendChild(f("Armory","Equip your crew with the most advanced weapons and vehicles money can buy.",7));k.appendChild(f("Sickbay","The doc will patch you up in the sickbay, for a fee.",8));k.appendChild(f("My Crew","Grow your crew to become more powerful!",9));k.appendChild(f("My Character","Upgrade your character's skills here.",10));k.appendChild(f("Legends","Legendary crews of MySpace.",11));var g=makeElement("a",d);g.name="main_newsfeed";showLoginMessage(d)}function f(h,i,g){var j=document.createElement("tr");$(j).addClass("mainMenuTr");var k=makeElementClass("td",j,"mainMenuBullet");k.innerHTML="<img src='http://static.supercomment.com/qa_mob/aliens/images/outworld_bullet.gif'/>";k=makeElementClass("td",j,"mainMenuTitle");k.innerHTML="<a href='#' class='standardLink'>"+h+"</a>";k=makeElementClass("td",j,"mainMenuDescription");k.innerHTML="("+i+")";addEvent(j,"click",function(){gaTrackEvent("main_menu","click",h);GBL.MAIN_TABS.switchToTab(g)});return j}}function refreshAdvertisement(){var a=70000;gaTrackPageview("refresh_ad");if(isValidFunction(sr_gof)){try{sr_gof()}catch(b){}}outputDebug("ad refreshed at ="+new Date());if(OUTWORLD.REFRESH_AD){OUTWORLD.REFRESH_AD=false;if(isValid(OUTWORLD.REFRESH_AD_ID)){clearTimeout(OUTWORLD.REFRESH_AD_ID)}OUTWORLD.REFRESH_AD_ID=setTimeout(function(){OUTWORLD.REFRESH_AD=true;refreshAdvertisement()},a)}};