var MAIN_DATA=undefined;var APP_URL="http://profile.myspace.com/Modules/Applications/Pages/Canvas.aspx?appId=104903";var APP_CANVAS_URL=
"http://profile.myspace.com/Modules/Applications/Pages/Canvas.aspx?appId=104903&";var IMAGES_PROD_URL="http://cdn1.slicezero.com/oyf_prod/images";var CUR_NEWSFEED=undefined;var POST_AS_STRING=false;
var IE=(navigator.userAgent.indexOf("MSIE")>=0);var MAIN_STATUS_DIV=undefined;var OYF={};OYF.MAINTENANCE=false;OYF.NETWORK_MYSPACE=1;OYF.NETWORK_HI5=2;OYF.network_current=OYF.NETWORK_MYSPACE;
OYF.APP_NOT_INSTALLED=0;OYF.APP_INSTALLED=1;OYF.APP_JUST_INSTALLED=2;OYF.app_install_state=OYF.APP_INSTALLED;OYF.FORCE_SEND=true;OYF.BUY_FORCE_SEND=false;OYF.GIFT_FORCE_SEND=false;OYF.VIEWER_PROFILE=
undefined;OYF.VIEWER_FRIEND_CACHE=undefined;OYF.VIEWER_FRIEND_APPUSERS_CACHE=undefined;OYF.FETCH_USER_ACTION_MAP=undefined;OYF.ACTIVITY_SENT=false;OYF.TAB_HOME="Home";OYF.TAB_PET_FINDER="Pet Finder";
OYF.TAB_BUY_FRIENDS="Buy Friends";OYF.TAB_GIVE_GIFT="Give a Gift";OYF.TAB_MORE_MONEY="More Money";OYF.TAB_INVITE="Invite";OYF.WELCOME_MESSAGE=
"<span style='font-size:20px; margin:0 10 0 0'> Welcome to <b>Own Your Friends</b>!</span>";OYF.INTRO_MESSAGE="<br><span style='font-size: 16px;'>Using <b>Own Your Friends</b>, you can:</span><br>"+
"<ul>"+"<li>Buy and sell your friends as 'pets'.</li>"+"<li>Send comments!</li>"+"<li>Change your pets' status messages to whatever you want! </li>"+
"<li><b>Hint:</b> Click on someone's name or photo to view their profile!</li>"+"</ul>"+"<span style='font-size: 16px;'>Make Money by:</span><br>"+"<ul>"+
"<li><b>Being bought!</b> You earn half the profit everytime you are bought. If you're a hot commodity, you'll be rich! ;-)</li>"+
"<li><b>Having your pets bought.</b> You earn half the profit when someone buys your pet.</li>"+"<li><b>Receiving comments.</b> You earn half the profit when you or your pet receives a comment.</li>"+
"<li><b>Logging in every 8 hours.</b> You earn money for logging in, but only once every 8 hours.</li>"+
"<li><b>Hint:</b> Use the <a href='#' onclick='OYF_gotoBargains(); return false;'>My Bargains</a> feature. Find hot deals on cheap friends, then sell them to profit!</li>"+"</ul>"+
"<b><a href='#' onclick='toFAQTab(OYF.mainTabs.getContentDiv()); return false;'>Visit the help tab for more information!</a></b>";OYF.HOT_TIP_TOP="<span style='font-size:20px'>Hot Tip!</span><p>";
OYF.HOT_TIP=new Array("Did you know that if your pets receive comments you get money? Go to anybody's details page to send comments. Both the person you comment on and their owner will be rewarded!",
"Did you know that comments between owners and pets are free? Go to your pets' details page to show them some love!",
"Did you know you can show your owner how you feel about them by choosing a mood on the side of your homepage? Tell them whether you're happy, gloomy or content with them!",
"Did you know that you can do more than just poke other people? You can hug, kiss, smack, pinch, cheer at, high five, thank, tickle, wink at and whistle at others. You can also have your pets do these things to each other!",
"Did you know that if you don't want a pet anymore, you give them as a gift to someone and earn money at it? You can also \"put them on sale\" to make them more affordable to others!",
"Do you want to find out right away when someone buys you? Sign up for email updates on the <a href='#' onclick='OYF.mainTabs.switchToTab(OYF.TAB_MORE_MONEY)'>More Money tab</a>.<p>You will receive a <span style='color:#09460F; font-weight:bold;'>$10,000</span> bonus for confirming your email!")
;function OYF_showUserDetails(bg,a_which){f(a_which);window.open(APP_CANVAS_URL+"appParams=%7B%22showProfileUserId%22%3A%22"+bg+"%22%7D&source=details");return false;};
function OYF_getShowUserDetailsLink(bg){return APP_CANVAS_URL+"appParams=%7B%22showProfileUserId%22%3A%22"+bg+"%22%7D&source=ni_copyp..._link...._BuyMe..._v5";};function OYF_gotoBargains(){if(!g(
OYF.FETCH_USER_ACTION_MAP)){OYF.FETCH_USER_ACTION_MAP=new aS(MAIN_DATA.A(),v.MY_TOP_FRIENDS,aS.FRIENDS_AND_GLOBAL);}OYF.FETCH_USER_ACTION_MAP.jx(v.MY_BARGAINS);OYF.mainTabs.switchToTab(
OYF.TAB_BUY_FRIENDS);};function pad(str,len){for(var i=0;i<len&&str.length<len;i++){str+=".";}str=str.substr(0,len);return str;};function OYF_appendAppParams(eG,a_rsrc){var result=eG+
"&appParams={\"rsrc\":\""+a_rsrc+"\"}";return result;};function OYF_appendSourceToken(eG,it,na,ia,qJ,rE){var rx=2;var ry=8;var rz=8;var rw=8;var sg=8;var result=eG+"&track=";if(it!=undefined){result+=
pad(it,rx);if(na!=undefined){result+="_"+pad(na,ry);if(ia!=undefined){result+="_"+pad(ia,rz);if(qJ!=undefined){result+="_"+pad(qJ,rw);if(rE!=undefined){result+="_"+pad(rE,sg);}}}}}return result;};
var ABTEST_DESTINATION_URL="http://fremont02.youplusplus.com";function abTest(userId,testName){try{U(ABTEST_DESTINATION_URL+"/abtest?userId="+userId+"&app=oyf&abTestName="+testName);}catch(e){f(
'abTest failed '+userId+" "+testName)};};if(! !(window.attachEvent&& !window.opera)){try{__revertCreateTextNode();}catch(err){};};function extendClass(a_subClass,a_baseClass){function l_inheritance(){
};l_inheritance.prototype=a_baseClass.prototype;a_subClass.prototype=new l_inheritance();a_subClass.prototype.constructor=a_subClass;a_subClass.baseConstructor=a_baseClass;a_subClass.superClass=
a_baseClass.prototype;a_subClass.prototype.superClass=a_baseClass.prototype;};function U(eG,al,cr,ta){if(g(cr)){try{var rO=0;if(g(cr.user_id))rO+=parseInt(cr.user_id)%123431;if(g(cr.from_user_id))rO+=
parseInt(cr.from_user_id)%123431;if(g(cr.to_user_id))rO+=parseInt(cr.to_user_id)%123431;if(g(cr.owner_id))rO+=parseInt(cr.owner_id)%123431;if(g(cr.pet_id))rO+=parseInt(cr.pet_id)%123431;cr.session_id=
hex_sha1(""+rO);}catch(err){cr.session_id="none";}}var sX=ta;if(!g(sX)){sX=aO.MAX_RETRIES;}XML_REQUEST_QUEUE.gj(aO.DO_GET,eG,al,cr,sX);};var XML_REQUEST_QUEUE=new aO();aO.DO_POST=1;aO.DO_GET=2;
aO.MAX_RETRIES=1;aO.MAX_TIMEOUT=20000;aO.PREEMPT_REQUESTS=false;function aO(){var lP=0;var fT=new Array();var aQ=new Array();var gp=new Array();var fW=new Array();var cw=new Array();var sU=new Array()
;var gP=new Array();var cp=undefined;var an=undefined;var dJ=undefined;var at=undefined;var dG=undefined;var sO=undefined;var ca=0;var bv= -1;var kd=true;this.gj=gj;this.timeoutRequest=timeoutRequest;
function gj(bS,eG,al,cr,ta){if(aO.PREEMPT_REQUESTS&&kd&&g(dG)){f("Request to "+an+" has been pre-empted by "+eG);fT.push(cp);aQ.push(an);gp.push(dJ);fW.push(at);sU.push(sO);cw.push(ca);gP.push(bv);ey(
);}lP+=1;fT.push(bS);aQ.push(eG);gp.push(al);fW.push(cr);sU.push(ta);cw.push(0);gP.push(lP);ep();};function ep(){if(aQ.length==0){return;}if(dG!=undefined){return;}cp=fT.pop();an=aQ.pop();dJ=gp.pop();
at=fW.pop();dG=(new Date()).getTime();sO=sU.pop();ca=cw.pop();bv=gP.pop();if(ca>sO){var L=dJ;ey();if(as(L))L(undefined);ep();}else{gq();}};function dR(){ca+=1;f("retrying "+an+" "+ca+" retries");
fT.unshift(cp);aQ.unshift(an);gp.unshift(dJ);fW.unshift(at);sU.unshift(sO);cw.unshift(ca);gP.unshift(bv);ey();ep();};function timeoutRequest(aR){if(bv!=aR){f(
"Timeout request is already over for request with id: "+aR);return;}f("Timeout for request with id: "+bv);dR();};function gq(){window.setTimeout("XML_REQUEST_QUEUE.timeoutRequest(parseInt("+bv+"));",
aO.MAX_TIMEOUT);if(cp==aO.DO_GET){oO(bv);}else if(cp==aO.DO_POST){oy(bv);}else{f("UNRECOGNIZED REQUEST TYPE!!! "+cp);ey();ep();}};function oO(aR){var f_curFinishFunction=function(response){fA(
response,aR);};var es="?";if(an.indexOf("?")> -1){es="&";}var rN=an;if(g(at)){var aU="";for(var aj in at){if(typeof(at[aj])=="number"||typeof(at[aj])=="string"||typeof(at[aj])=="boolean"){aU+=aj+"="+
at[aj]+"&";}}if(aU.length>0&&aU.lastIndexOf('&')==aU.length-1){aU=aU.substr(0,aU.length-1);}rN+=es+aU;}es="?";if(rN.indexOf("?")> -1){es="&";}var qk=new Date().getTime();rN=[rN,es,"nocache=",qk].join(
"");var k={};k['METHOD']='GET';k['CONTENT_TYPE']=gadgets.io.ContentType.DOM;k[gadgets.io.RequestParameters.AUTHORIZATION]=gadgets.io.AuthorizationType.SIGNED;f("GET request with id "+aR+" sent to "+
rN);gadgets.io.makeRequest(rN,f_curFinishFunction,k);};function oy(aR){var f_curFinishFunction=function(response){fA(response,aR);};if(g(GBL.POST_AS_STRING)&&GBL.POST_AS_STRING){var aU="";for(
var aj in at){if(typeof(at[aj])=="number"||typeof(at[aj])=="string"||typeof(at[aj])=="boolean"){aU+=aj+"="+at[aj]+"&";}}aU+="nocache="+new Date().getTime();var k={};
k[gadgets.io.RequestParameters.POST_DATA]=aU;k[gadgets.io.RequestParameters.METHOD]=gadgets.io.MethodType.POST;k[gadgets.io.RequestParameters.CONTENT_TYPE]=gadgets.io.ContentType.DOM;
k[gadgets.io.RequestParameters.AUTHORIZATION]=gadgets.io.AuthorizationType.SIGNED;f("POST string request with id "+aR+" sent to "+an+" with param "+aU);gadgets.io.makeRequest(an,f_curFinishFunction,k)
;}else{at.nocache=new Date().getTime();var k={};k[gadgets.io.RequestParameters.POST_DATA]=at;k[gadgets.io.RequestParameters.METHOD]=gadgets.io.MethodType.POST;
k[gadgets.io.RequestParameters.CONTENT_TYPE]=gadgets.io.ContentType.DOM;k[gadgets.io.RequestParameters.AUTHORIZATION]=gadgets.io.AuthorizationType.SIGNED;f("POST object request with id "+aR+
" sent to "+an+" with param "+at);gadgets.io.makeRequest(an,f_curFinishFunction,k);}};function fA(J,aR){if(bv!=aR){f(" OUT of order request came back with id: "+aR);return;}kd=false;if(cp==aO.DO_GET){
f(" GET request with id "+aR+" cameback for "+an+" after "+ca+" num retries in "+((new Date()).getTime()-dG)+" >>> "+J);}else{f(" POST request with id "+aR+" cameback for "+an+" after "+ca+
" num retries in "+((new Date()).getTime()-dG)+" >>> "+J);}if(!g(J.data)&& !g(J.text)){f(" response is not valid");dR();}else{var L=dJ;ey();if(as(L)){L(J);}ep();}kd=true;};function ey(){cp=undefined;
an=undefined;dJ=undefined;at=undefined;dG=undefined;sO=XML_REQUEST_QUEUE.MAX_RETRIES;ca=0;bv= -1;}};function bc(J){if(!g(J)){ac(
"unfortunately there was an unknown error, please check back later: unknown error");return undefined;}else if(!g(J.data)){ac("unfortunately there was an unknown error, please check back later: "+
J.errors);return undefined;}return J.data;};function oH(J){if(!g(J)){ac("unfortunately there was an unknown error, please check back later: unknown error");return undefined;}else if(!g(J.text)){f(
"unfortunately there was no text, please check back later: "+J.errors);return undefined;}return J.text;};function rq(aK){if(typeof DOMParser!="undefined"){return(new DOMParser()).parseFromString(aK,
"application/xml");}else if(typeof ActiveXObject!="undefined"){var doc=new ActiveXObject("Microsoft.XMLDOM");doc.async="false";doc.loadXML(aK);return doc;}else{var ew="data:text/xml;charset=utf-8,"+
encodeURIComponent(aK);var hD=new XMLHttpRequest();hD.open("GET",ew,false);hD.send(null);return hD.responseXML;}};function K(kp,fk){var bH=kp.getElementsByTagName(fk);if(g(bH)&&bH.length>0&&g(
bH[0].firstChild)&&g(bH[0].firstChild.nodeValue)){return bH[0].firstChild.nodeValue;}else{return undefined;}};function bp(oe,fk){try{var bH=oe.getElementsByTagName(fk);if(g(bH)&&bH.length>0&&g(bH[0]))
{return bH[0];}else{return undefined;}}catch(ee){return undefined;}};function jo(kp,fk){var mP=K(kp,fk);if(mP==undefined)return undefined;else{return decodeURIComponent(mP);}};cI.REQUESTS=new Object()
;cI.TIMEOUT=5000;cI.MAX_RETRIES=3;function cI(pJ,iK,al){var ev=iK;var nr=pJ;var eJ=al;var cw=0;var mk=false;this.dR=dR;gq();function gq(){f("Doing request with key: "+ev);cI.REQUESTS[ev]=dR;nr.send(
fA);window.setTimeout("cI.REQUESTS['"+ev+"']();",cI.TIMEOUT);};function dR(){f("Retrying request with key "+ev+" num retries already: "+cw);cw+=1;if(cw>cI.MAX_RETRIES){fA(undefined);}else{gq();}};
function fA(data){f("Finished request with key: "+ev);if(!mk){eJ(data);}mk=true;}};function aG(aM,eF,eD){if(aM.addEventListener){aM.addEventListener(eF,eD,false);return true;}else if(aM.attachEvent){
var hz=aM.attachEvent("on"+eF,eD);return hz;}else{return false;}};function aE(aM,eF,eD,cr){if(aM.addEventListener){aM.addEventListener(eF,function(){eD(cr);return false;},false);return true;}else if(
aM.attachEvent){var hz=aM.attachEvent("on"+eF,function(){eD(cr);return false;});return hz;}else{return false;}};function qX(qP){var ci=document.getElementById("messageBox");if(ci==undefined||ci==null)
{f("can't find messageBox");return;}ci.style.color="#aa0000";ci.innerHTML=qP;ci.style.display="block";};function qT(){var ci=document.getElementById("messageBox");if(ci==undefined||ci==null){f(
"can't find messageBox");return;}ci.innerHTML="";ci.style.display="none";};function g(aM){return(aM!=undefined&&aM!=null);};function as(aM){return g(aM)&&(typeof(aM)=='function');};function jw(){try{
return(g(GLOBAL_DEBUGGING)&&GLOBAL_DEBUGGING);}catch(err){return false;}};function f(aK){try{if(jw()){var hV=document.getElementById('debugOutput');if(g(hV)&&g(hV.style)&&hV.style.display!="none"){
var l_newDebugSpan=document.createElement("span");l_newDebugSpan.innerHTML=aK+'<br/>';hV.appendChild(l_newDebugSpan);}}}catch(err){};};function ac(aK){try{if(jw()){alert(aK);}}catch(err){};};
function nX(cU,gS){if(!g(cU)){return cU;}if(cU.length<gS+1){return cU;}var gG=0;var l_j=0;while(l_j<cU.length&&gG<gS){gG++;if(cU[l_j]!="&"){l_j++;}else{if(l_j+1<cU.length&&cU[l_j+1]==" "){l_j+=2;gG++;
continue;}var sN=cU.indexOf(";",l_j);if(sN>0&&sN-l_j<9)l_j=sN;else break;}}if(l_j<cU.length)return cU.substring(0,l_j)+"..";else return cU.substring(0,l_j);};function bo(aK){return "cstm_"+
encodeURIComponent(aK).replace(/%/g,"@");};function nR(py){var hG=py.replace("<","&lt;");hG=hG.replace(">","&gt;");return hG;};function decodeHtmlString(py){var l_str=py.replace(/&#60;/g,'<').replace(
/&#62;/g,'>');l_str=l_str.replace(/&amp;/g,'&').replace(/&lt;/g,'<').replace(/&gt;/g,'>');return l_str;};function encodeHtmlString(py){var l_str=py.replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(
/>/g,'&gt;');return l_str;};var TIME={};TIME.MILLIS_IN_MINUTE=60*1000;TIME.MILLIS_IN_HOUR=60*60*1000;TIME.MILLIS_IN_DAY=24*60*60*1000;TIME.MILLIS_IN_WEEK=7*24*60*60*1000;TIME.MILLIS_IN_MONTH=30*24*60*
60*1000;TIME.MONTH=["January","February","March","April","May","June","July","August","September","October","November","December"];function lB(tk){var bl=Math.abs(new Date().getTime()-tk);if(bl<
TIME.MILLIS_IN_MINUTE){return Math.ceil(bl/1000)+"&nbsp;seconds&nbsp;ago";}else if(bl<TIME.MILLIS_IN_MINUTE*2){return "1&nbsp;minute&nbsp;ago";}else if(bl<TIME.MILLIS_IN_HOUR){return Math.floor(bl/
TIME.MILLIS_IN_MINUTE)+"&nbsp;minutes&nbsp;ago";}else if(bl<TIME.MILLIS_IN_HOUR*2){return "1&nbsp;hour&nbsp;ago";}else if(bl<TIME.MILLIS_IN_DAY){return Math.floor(bl/TIME.MILLIS_IN_HOUR)+
"&nbsp;hours&nbsp;ago";}else if(bl<TIME.MILLIS_IN_DAY*2){return "Yesterday";}else{var sY=new Date();sY.setTime(tk);return TIME.MONTH[sY.getMonth()]+"&nbsp;"+sY.getDate();}};function jd(aK,qn,qE){
var kC=new RegExp(qE);var hE="";var ec=aK;var fE=kC.exec(ec);while(fE!=null){hE+=ec.substring(0,fE.index)+fE+" ";ec=ec.substr(fE.index+qn);fE=kC.exec(ec);}hE+=ec;return hE;};var rG=0;var rC=8;
function hex_sha1(s){return binb2hex(core_sha1(str2binb(s),s.length*rC));};function core_sha1(x,len){x[len>>5]|=0x80<<(24-len%32);x[((len+64>>9)<<4)+15]=len;var w=Array(80);var a=1732584193;var b= -
271733879;var c= -1732584194;var d=271733878;var e= -1009589776;for(var i=0;i<x.length;i+=16){var olda=a;var oldb=b;var oldc=c;var oldd=d;var olde=e;for(var j=0;j<80;j++){if(j<16)w[j]=x[i+j];
else w[j]=rol(w[j-3]^w[j-8]^w[j-14]^w[j-16],1);var t=safe_add(safe_add(rol(a,5),sha1_ft(j,b,c,d)),safe_add(safe_add(e,w[j]),sha1_kt(j)));e=d;d=c;c=rol(b,30);b=a;a=t;}a=safe_add(a,olda);b=safe_add(b,
oldb);c=safe_add(c,oldc);d=safe_add(d,oldd);e=safe_add(e,olde);}return Array(a,b,c,d,e);};function sha1_ft(t,b,c,d){if(t<20)return(b&c)|((~b)&d);if(t<40)return b^c^d;if(t<60)return(b&c)|(b&d)|(c&d);
return b^c^d;};function sha1_kt(t){return(t<20)?1518500249:(t<40)?1859775393:(t<60)? -1894007588: -899497514;};function safe_add(x,y){var lsw=(x&0xFFFF)+(y&0xFFFF);var msw=(x>>16)+(y>>16)+(lsw>>16);
return(msw<<16)|(lsw&0xFFFF);};function rol(num,cnt){return(num<<cnt)|(num>>>(32-cnt));};function str2binb(str){var bin=Array();var mask=(1<<rC)-1;for(var i=0;i<str.length*rC;i+=rC)bin[i>>5]|=(
str.charCodeAt(i/rC)&mask)<<(32-rC-i%32);return bin;};function binb2hex(binarray){var hex_tab=rG?"0123456789ABCDEF":"0123456789abcdef";var str="";for(var i=0;i<binarray.length*4;i++){str+=
hex_tab.charAt((binarray[i>>2]>>((3-i%4)*8+4))&0xF)+hex_tab.charAt((binarray[i>>2]>>((3-i%4)*8))&0xF);}return str;};function oG(bV){if(bV.name){return bV.name;}var hX=bV.toString();var ng=
hX.substring(hX.indexOf('function')+8,hX.indexOf('('));if(ng)return ng;return "anonymous";};function pi(bV){var eY=oG(bV);eY+="(";for(var fX=0;g(bV.arguments)&&fX<bV.arguments.length;fX++){var ga=
bV.arguments[fX];if(ga.length>30)ga=ga.substring(0,30)+"...";eY+="'"+ga+"'";if(fX<bV.arguments.length-1)eY+=", ";}eY+=")";return eY;};function ce(pr){f("============================");f(
"Stack trace:");var fY=pr;while(fY){f(pi(fY));;fY=fY.caller;}};function addCommas(tg){tg+='';var fX=tg.split('.');var l_x1=fX[0];var l_x2=fX.length>1?'.'+fX[1]:'';var l_rgx=/(\d+)(\d{3})/;while(
l_rgx.test(l_x1)){l_x1=l_x1.replace(l_rgx,'$1'+','+'$2');}return l_x1+l_x2;};function id(name){return document.getElementById(name);};function dump(aM){var outputList=new Array();outputList.push(
"<P>");for(var name in aM){outputList.push(name+":  "+aM[name]);}f(outputList.join("<br>"));};function formatNumberWithCommas(a_number){a_number+='';var l_numberParts=a_number.split('.');
var l_beforeDecimal=l_numberParts[0];var l_afterDecimal=l_numberParts.length>1?'.'+l_numberParts[1]:'';var rgx=/(\d+)(\d{3})/;while(rgx.test(l_beforeDecimal)){l_beforeDecimal=l_beforeDecimal.replace(
rgx,'$1'+','+'$2');}return l_beforeDecimal+l_afterDecimal;};function formatString(py,a_args){for(var i in a_args){if(g(a_args[i])){py=py.replaceAll("\\${"+i+"}",a_args[i]);}}return py;};
String.prototype.replaceAll=function(pcFrom,pcTo){var kC=new RegExp(pcFrom,'g');return this.replace(kC,pcTo);};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+$/,"");};Function.prototype.bind=function(aM){var l_self=this;var l_args=
[];for(var i=1;i<arguments.length;++i)l_args.push(arguments[i]);return function(){var l_callArgs=l_args.slice(0);for(var i=0;i<arguments.length;++i)l_callArgs.push(arguments[i]);return l_self.apply(
aM,l_callArgs);}};function array_permute(a){var l_len=a.length;for(var i=0;i<l_len;++i){var j=Math.floor(Math.random()*l_len);var temp=a[i];a[i]=a[j];a[j]=temp;}return a;};function array_push_array(
a1,a2){for(var i=0;i<a2.length;++i){a1.push(a2[i]);}};function EventDispatcher(){this.m_handlers={};};EventDispatcher.prototype.bind=function(bS,eD){if(!this.m_handlers[bS]){this.m_handlers[bS]={}}
this.m_handlers[bS][$guid(eD)]=eD;return this;};EventDispatcher.prototype.unbind=function(bS,eD){try{delete this.m_handlers[bS][$guid(eD)];}catch(err){}return this;};EventDispatcher.prototype.trigger=
function(bS,a_opt_data1,a_opt_data2,a_etc){var l_handlers=this.m_handlers[bS];if(!l_handlers){return;}var args=[];for(var i=1;i<arguments.length;++i)args.push(arguments[i]);for(var guid in l_handlers)
{l_handlers[guid].apply(this,args);}return this;};EventDispatcher.prototype.declareEvent=function(bS){this.m_handlers[bS]={};return this;};var __GUID=1;function $guid(obj){if(!obj._guid){obj._guid=
__GUID++;}return obj._guid;};function GUIDMap(){this.m_map={}};GUIDMap.prototype.put=function(key,value){this.m_map[$guid(key)]=value;};GUIDMap.prototype.get=function(key){return this.m_map[$guid(key)
];};GUIDMap.prototype.remove=function(key){delete this.m_map[$guid(key)];};GUIDMap.prototype.contains=function(key){return g(this.m_map[$guid(key)]);};GUIDMap.prototype.clear=function(){this.m_map={};
};var idSpecUtil={};idSpecUtil.viewer=function(){var k={};k[opensocial.IdSpec.Field.USER_ID]=opensocial.IdSpec.PersonId.VIEWER;return opensocial.newIdSpec(k);};idSpecUtil.owner=function(){var k={};
k[opensocial.IdSpec.Field.USER_ID]=opensocial.IdSpec.PersonId.OWNER;return opensocial.newIdSpec(k);};idSpecUtil.viewerFriends=function(a_optGroup){var k={};k[opensocial.IdSpec.Field.USER_ID]=
opensocial.IdSpec.PersonId.VIEWER;if(!g(a_optGroup)){k[opensocial.IdSpec.Field.NETWORK_DISTANCE]=1}else{k[opensocial.IdSpec.Field.NETWORK_DISTANCE]=1;k[opensocial.IdSpec.Field.GROUP_ID]=a_optGroup;}
return opensocial.newIdSpec(k);};idSpecUtil.ownerFriends=function(a_optGroup){var k={};k[opensocial.IdSpec.Field.USER_ID]=opensocial.IdSpec.PersonId.OWNER;if(!g(a_optGroup)){
k[opensocial.IdSpec.Field.GROUP_ID]=opensocial.IdSpec.GroupId.FRIENDS;}else{k[opensocial.IdSpec.Field.NETWORK_DISTANCE]=1;k[opensocial.IdSpec.Field.GROUP_ID]=a_optGroup;}return opensocial.newIdSpec(k)
;};function Data(){Data.baseConstructor.call(this);this.m_start=0;this.m_end=0;};extendClass(Data,EventDispatcher);Data.prototype.watchRange=function(a_start,a_end,a_optTrigger){this.m_start=a_start;
this.m_end=a_end;if(a_optTrigger){this.triggerUpdate(a_start,a_end);}};Data.prototype.getStart=function(){return this.m_start};Data.prototype.getEnd=function(){return this.m_end};
Data.prototype.bindCountCallback=function(al){this.bind("count",al);this.requestCount(al);};Data.prototype.bindUpdateCallback=function(al){this.bind("update",al);this.requestData(this.m_start,
this.m_end,al);};Data.prototype.requestCount=function(al){al(this.getCurCount(),this.countDone());};Data.prototype.triggerCount=function(){this.trigger("count",this.getCurCount(),this.countDone());};
Data.prototype.requestData=function(a_start,a_end,al){var l_items=this.getCurData(a_start,a_end);var l_done=this.dataDone(a_start,a_end);al(a_start,a_end,l_items,l_done);};
Data.prototype.triggerUpdate=function(a_start,a_end){a_start=Math.max(a_start,this.m_start);a_end=Math.min(a_end,this.m_end);if(a_start<a_end){var l_data=this.getCurData(a_start,a_end);var l_done=
this.dataDone(a_start,a_end);this.trigger("update",a_start,a_end,l_data,l_done);}};Data.prototype.triggerBoth=function(a_start,a_end){this.triggerCount();this.triggerUpdate(a_start,a_end);};
Data.prototype.getCurCount=function(){f('ERROR: getCurCount not implemented');};Data.prototype.countDone=function(){f('ERROR: countDone not implemented');};Data.prototype.getCurData=function(a_start,
a_end){f('ERROR: getCurData not implemented');};Data.prototype.dataDone=function(a_start,a_end){f('ERROR: dataDone not implemented');};Data.prototype.allDone=function(a_start,a_end){
return this.countDone()&&this.dataDone(0,this.getCurCount());};Data.prototype.paged=function(a_pageSize){a_pageSize=a_pageSize||20;return new PagedData(this,a_pageSize);};Data.prototype.randomized=
function(){return new RandomizedData(this);};Data.prototype.filtered=function(a_predicate){return new FilteredData(this,a_predicate);};Data.prototype.lazyBucketed=function(a_bucketFunc,a_batchSize){
return new LazyBucketSortedData(this,a_bucketFunc,a_batchSize);};Data.prototype.consoleDebug=function(a_tag){this.bindCountCallback(function(a_count,a_done){try{console.log(a_tag+"- count="+a_count+
" done="+a_done);}catch(err){}});this.bindUpdateCallback(function(a_start,a_end,a_items,a_done){try{console.log(a_tag+"- start="+a_start+" end="+a_end+" done="+a_done);console.log(a_items);}catch(err)
{}});var oldRequestData=this.requestData;this.requestData=function(a_start,a_end,al){console.log(a_tag+" requestData start="+a_start+" end="+a_end);var l_newCallback=function(a_start,a_end,a_items,
a_done){console.log(a_tag+" requestData result start="+a_start+" end="+a_end+" done="+a_done);console.log(a_items);if(al)al(a_start,a_end,a_items,a_done);};oldRequestData.call(this,a_start,a_end,
l_newCallback);};return this;};function ArrayData(a_array){ArrayData.baseConstructor.call(this);if(!g(a_array))a_array=[];this.setArray(a_array);};extendClass(ArrayData,Data);
ArrayData.prototype.setArray=function(a_array){this.m_array=a_array;this.triggerBoth(0,a_array.length);};ArrayData.prototype.getCurCount=function(){return this.m_array.length;};
ArrayData.prototype.countDone=function(){return true;};ArrayData.prototype.dataDone=function(){return true;};ArrayData.prototype.getCurData=function(a_start,a_end){return this.m_array.slice(a_start,
a_end)};function RemoteData(eG,a_parseFunc){RemoteData.baseConstructor.call(this,[]);this.m_done=false;this.m_parseData=a_parseFunc;U(eG,this.handleResponse.bind(this),{},0);};extendClass(RemoteData,
ArrayData);RemoteData.prototype.handleResponse=function(J){var F=bc(J);if(!g(F)){new ModalDialog(
"Unfortunately there was an error, the technical team has been notified.  Thank you for your patience!").showDialog();return false;}this.m_done=true;this.setArray(this.m_parseData(F));};
RemoteData.prototype.countDone=RemoteData.prototype.dataDone=function(){return this.m_done;};function DataOperator(ot){DataOperator.baseConstructor.call(this,[]);this.m_subData=ot;
this.m_subData.bindCountCallback(this.handleSubCount.bind(this));this.m_subData.bindUpdateCallback(this.handleSubData.bind(this));};extendClass(DataOperator,Data);
DataOperator.prototype.handleSubCount=function(a_count,a_done){this.m_subData.watchRange(0,a_count);this.triggerCount();};DataOperator.prototype.getCurCount=function(){
return this.m_subData.getCurCount();};DataOperator.prototype.countDone=function(){return this.m_subData.countDone();};function RandomizedData(ot){this.m_curIdx=0;this.m_itemIdxMap=new GUIDMap();
this.m_compare=this.compareFunc.bind(this);this.m_baseArray=[];this.m_randomArray=[];RandomizedData.baseConstructor.call(this,ot);};extendClass(RandomizedData,DataOperator);
RandomizedData.prototype.handleSubCount=function(a_count,a_done){if(a_count<this.m_baseArray.length){this.invalidate(a_count,this.m_baseArray.length);this.m_baseArray=this.m_baseArray.slice(0,a_count)
;}RandomizedData.superClass.handleSubCount.call(this,a_count,a_done);};RandomizedData.prototype.handleSubData=function(a_start,a_end,a_items,a_done){var l_minChanged=this.invalidate(a_start,a_end);
for(var i=0;i<a_items.length;++i){this.m_baseArray[i+a_start]=a_items[i];}l_minChanged=Math.min(l_minChanged,this.insert(a_items));this.triggerBoth(l_minChanged,this.m_subData.getCurCount());};
RandomizedData.prototype.reset=function(){this.m_itemIdxMap.clear();this.m_subData.requestData(0,this.m_subData.getCurCount(),this.handleSubData.bind(this));};RandomizedData.prototype.assignRandomIdx=
function(a_items){var l_noIdx=[];for(var i=0;i<a_items.length;++i){if(!this.m_itemIdxMap.contains(a_items[i])){l_noIdx.push(a_items[i]);}}var l_idx=[];for(var i=0;i<l_noIdx.length;++i){l_idx.push(
this.m_curIdx++);}array_permute(l_idx);for(var i=0;i<l_noIdx.length;++i){this.m_itemIdxMap.put(l_noIdx[i],l_idx[i]);}};RandomizedData.prototype.compareFunc=function(a_item1,a_item2){var idx1=
this.m_itemIdxMap.get(a_item1);var idx2=this.m_itemIdxMap.get(a_item2);return idx1-idx2;};RandomizedData.prototype.invalidate=function(a_start,a_end){var l_minIndex=this.m_baseArray.length;
var l_eraseItems=this.m_baseArray.slice(a_start,a_end).sort(this.m_compare);var ri,ei;ri=ei=0;for(;ri<this.m_randomArray.length&&ei<l_eraseItems.length;){var l_comp=this.compareFunc(
this.m_randomArray[ri],l_eraseItems[ei]);if(l_comp<0){ri++;}else if(l_comp==0){l_minIndex=Math.min(l_minIndex,ri);this.m_randomArray.splice(ri,1);ei++;}else{ei++;}}return l_minIndex;};
RandomizedData.prototype.insert=function(a_items){this.assignRandomIdx(a_items);var l_minIndex=this.m_baseArray.length;var l_addItems=a_items.slice(0).sort(this.m_compare);var ri,ai;ri=ai=0;for(;ri<
this.m_randomArray.length&&ai<l_addItems.length;){var l_comp=this.compareFunc(this.m_randomArray[ri],l_addItems[ai]);if(l_comp<0){ri++;break;}else{l_minIndex=Math.min(l_minIndex,ri);
this.m_randomArray.splice(ri,0,l_addItems[ai]);ai++;ri++;}}array_push_array(this.m_randomArray,l_addItems.slice(ai));return l_minIndex;};RandomizedData.prototype.getCurData=function(a_start,a_end){
return this.m_randomArray.slice(a_start,a_end);};RandomizedData.prototype.dataDone=function(a_start,a_end){return this.m_subData.allDone();};function FilteredData(ot,m_predicate){this.m_predicate=
m_predicate;this.reset();FilteredData.baseConstructor.call(this,ot);};extendClass(FilteredData,DataOperator);FilteredData.prototype.setPredicate=function(predicate){this.m_predicate=predicate;
this.dirtyPredicate();};FilteredData.prototype.reset=function(){this.m_bitmap=[];this.m_filterDone=false;};FilteredData.prototype.dirtyPredicate=function(){this.reset();var l_subCount=
this.m_subData.getCurCount();this.m_subData.requestData(0,l_subCount,this.handleSubData.bind(this));};FilteredData.prototype.handleSubCount=function(a_count,a_done){if(a_count<this.m_bitmap.length){
this.m_bitmap=this.m_bitmap.slice(0,a_count);}FilteredData.superClass.handleSubCount.call(this,a_count,a_done);};FilteredData.prototype.handleSubData=function(a_start,a_end,a_items,a_done){
var l_before=0;for(var i=0;i<a_start;++i){if(this.m_bitmap[i])l_before++;}var l_kept=0;for(var i=0;i<a_items.length;++i){var l_keep=undefined;if(g(a_items[i])){l_keep=this.m_predicate(a_items[i]);
this.m_bitmap[a_start+i]=l_keep;if(l_keep)l_kept+=1;}else{delete this.m_bitmap[a_start+i];}}if(a_done&&a_end==this.m_subData.getCurCount()){this.m_filterDone=true;}this.triggerBoth(l_before,l_before+
l_kept);};FilteredData.prototype.getCurCount=function(){var l_count=0;for(var i=0;i<this.m_bitmap.length;++i){if(this.m_bitmap[i]==1)l_count++;}return l_count;};FilteredData.prototype.countDone=
function(){return this.m_filterDone;};FilteredData.prototype.getCurData=function(a_start,a_end){var l_result=[];var l_len=this.m_bitmap.length;var l_array=this.m_subData.getCurData(0,l_len);var fi= -
1;for(var i=0;i<l_len&&fi<a_end;++i){if(this.m_bitmap[i]){fi++;if(fi>=a_start&&fi<a_end){l_result.push(l_array[i]);}}}return l_result;};FilteredData.prototype.dataDone=function(){
return this.countDone()||this.getCurCount()>=this.m_end;};function LazyBucketSortedData(ot,a_bucketFunc,a_batchSize){this.m_bucketFunc=a_bucketFunc;this.m_handleBucketCallback=this.handleBucket.bind(
this);this.m_batchSize=a_batchSize||40;this.m_baseArray=[];this.m_bucket=[];this.m_bucketedCount=0;this.m_fetching=false;LazyBucketSortedData.baseConstructor.call(this,ot);};extendClass(
LazyBucketSortedData,DataOperator);LazyBucketSortedData.prototype.handleSubCount=function(a_count,a_done){if(a_count<this.m_baseArray.length){this.invalidate(a_count,this.m_baseArray.length);
this.m_baseArray=this.m_baseArray.slice(0,a_count);for(var i=a_count;i<this.m_bucket.length;++i){if(g(this.m_bucket[i])){this.m_bucketedCount--;}}this.m_bucket=this.m_bucket.slice(0,a_count);}
LazyBucketSortedData.superClass.handleSubCount.call(this,a_count,a_done);};LazyBucketSortedData.prototype.handleSubData=function(a_start,a_end,a_items,a_done){var l_minChanged=this.invalidate(a_start,
a_end);for(var i=0;i<a_items.length;++i){this.m_baseArray[i+a_start]=a_items[i];}this.checkBuckets();};LazyBucketSortedData.prototype.watchRange=function(a_start,a_end,a_optTrigger){
LazyBucketSortedData.superClass.watchRange.call(this,a_start,a_end,a_optTrigger);this.checkBuckets();};LazyBucketSortedData.prototype.getCurData=function(a_start,a_end){var allDone=this.allDone();
var outputIdx= -1;var l_result=[];var maxBucket=this.maxBucket();for(var bucketIdx=0;outputIdx<a_end&&bucketIdx<=maxBucket;++bucketIdx){for(var i=0;outputIdx<a_end-1&&i<this.m_bucket.length;++i){if(
this.m_bucket[i]==bucketIdx){outputIdx++;if(outputIdx>=a_start&&outputIdx<a_end){l_result.push(this.m_baseArray[i])}}}if(!allDone)break;}return l_result;};LazyBucketSortedData.prototype.dataDone=
function(a_start,a_end){var allDone=this.allDone();var readyCount=0;for(var i=0;i<this.m_bucket.length;++i){if(g(this.m_bucket[i])){if(allDone||this.m_bucket[i]==0){readyCount++;}}else{break;}}
return readyCount>=a_end;};LazyBucketSortedData.prototype.allDone=function(){return this.m_subData.countDone()&&this.m_subData.getCurCount()==this.m_bucketedCount;};
LazyBucketSortedData.prototype.removeItem=function(i){if(g(this.m_bucket[i])){this.m_bucketedCount--;}delete this.m_bucket[i];};LazyBucketSortedData.prototype.bucketItem=function(i,a_bucket){if(!g(
this.m_bucket[i])){this.m_bucketedCount++;}this.m_bucket[i]=a_bucket;};LazyBucketSortedData.prototype.hasBucket=function(i){return g(this.m_baseArray[i])&&g(this.m_bucket[i]);};
LazyBucketSortedData.prototype.maxBucket=function(){var result= -1;for(var i=0;i<this.m_bucket.length;++i){if(!g(this.m_bucket[i]))continue;result=Math.max(result,this.m_bucket[i]);}return result;};
LazyBucketSortedData.prototype.invalidate=function(a_start,a_end){for(var i=a_start;i<a_end;++i){this.removeItem(i);}};LazyBucketSortedData.prototype.checkBuckets=function(){if(this.dataDone(
this.m_start,this.m_end))return;if(this.m_fetching)return;var a_start;var a_end;var a_items=[];var a_indices=[];var a_count=0;for(var i=0;a_count<this.m_batchSize&&i<this.m_baseArray.length;++i){if(!
this.hasBucket(i)){a_count++;a_items.push(this.m_baseArray[i]);a_indices.push(i);}}if(a_items.length>0){this.m_fetching=true;this.m_bucketFunc(a_indices,a_items,this.m_handleBucketCallback);}};
LazyBucketSortedData.prototype.handleBucket=function(a_indices,a_items,a_buckets){this.m_fetching=false;for(var i=0;i<a_items.length;++i){if(g(a_items[i])&&g(a_buckets[i])){this.bucketItem(
a_indices[i],a_buckets[i]);}}this.triggerBoth(0,this.m_bucketedCount);this.checkBuckets();};function PagedData(ot,a_pageSize){PagedData.baseConstructor.call(this);this.m_data=ot;this.m_pageSize=
a_pageSize;this.setPage(1);this.m_data.bindCountCallback(this.handleCount.bind(this));this.m_data.bindUpdateCallback(this.handleUpdate.bind(this));};extendClass(PagedData,EventDispatcher);
PagedData.prototype.setPage=function(a_page){this.m_page=a_page;this.m_data.watchRange(this._startIdx(),this._endIdx(),true);this.triggerPage();};PagedData.prototype.getPage=function(){
return this.m_page;};PagedData.prototype._startIdx=function(a_page){a_page=a_page||this.m_page;return(a_page-1)*this.m_pageSize;};PagedData.prototype._endIdx=function(a_page){a_page=a_page||
this.m_page;return a_page*this.m_pageSize;};PagedData.prototype._idxToPage=function(i){return Math.ceil((i+1)/this.m_pageSize);};PagedData.prototype.getCurPageCount=function(){return Math.ceil(
this.m_data.getCurCount()/this.m_pageSize);};PagedData.prototype.bindCountCallback=function(al){this.bind("count",al);this.requestCount(al);};PagedData.prototype.bindPageCallback=function(al){
this.bind("page",al);this.requestPage(this.m_page,al);};PagedData.prototype.handleCount=function(a_count,a_done){if(this.m_page>this.getCurPageCount()){this.setPage(1);}this.triggerCount();};
PagedData.prototype.triggerCount=function(){this.trigger("count",this.getCurPageCount(),this.m_data.countDone());};PagedData.prototype.requestCount=function(al){var l_count=this.getCurPageCount();
var l_done=this.m_data.countDone();al(l_count,l_done);};PagedData.prototype.handleUpdate=function(a_start,a_end,a_items,a_done){var sP=this._idxToPage(a_start);var sN=this._idxToPage(a_end);
var l_page=this.m_page;if(sP<=l_page&&l_page<=sN){this.triggerPage();}};PagedData.prototype.triggerPage=function(){this.trigger("page",this.m_page,this.getCurPage(this.m_page),this.pageDone(
this.m_page));};PagedData.prototype.getCurPage=function(a_page){var sP=this._startIdx(a_page);var sN=this._endIdx(a_page);return this.m_data.getCurData(sP,sN);};PagedData.prototype.pageDone=function(
a_page){var sP=this._startIdx(a_page);var sN=this._endIdx(a_page);return this.m_data.dataDone(sP,sN);};PagedData.prototype.requestPage=function(a_page,al){al(a_page,this.getCurPage(a_page),
this.pageDone(a_page));};var InviteUtil={};InviteUtil.REQUEST_URL=REQUEST_DESTINATION_URL+"/ffs/";InviteUtil.sendInvite=function(aF,a_message,al,a_source){var kT=[];kT.push(aF);
InviteUtil.sendMultipleInvites(kT,a_message,al,a_source);};InviteUtil.sendMultipleInvites=function(jD,a_message,al,a_source){var T=opensocial.newMessage(a_message);var l_ids=[];for(var i=0;i<
jD.length;++i){var l_targetUserId=jD[i].B===undefined?jD[i]:jD[i].B();l_ids.push(l_targetUserId);}InviteUtil.addInvites(l_ids,a_source,function(a_inviteIds){var T=opensocial.newMessage(a_message);
var l_wrappedCallback=InviteUtil.handleRequestShareApp(a_inviteIds,jD,al);opensocial.requestShareApp(l_ids,T,l_wrappedCallback);})};InviteUtil.getUsersInviteState=function(lQ,al){var l_query_ids=[];
for(var i=0;i<lQ.length;++i){l_query_ids.push(lQ[i].B());}var l_query=InviteUtil.REQUEST_URL+"get_users_invite_state?";l_query+="user_id="+MAIN_DATA.A().B();l_query+="&query_ids="+l_query_ids.join(
",");var l_callback=InviteUtil.handleGetUsersInviteState.bind(null,lQ,al);U(l_query,l_callback);};InviteUtil.addInvites=function(a_toUserIds,a_source,al){var query=InviteUtil.REQUEST_URL+"add_invite";
var k={};k["from_id"]=MAIN_DATA.A().B();k["to_ids"]=a_toUserIds.join();k["source"]=a_source;U(query,InviteUtil.handleAddInvites.bind(null,a_toUserIds,al),k);};InviteUtil.handleAddInvites=function(
a_toUserIds,al,J){var F=bc(J);if(!g(F)){f('Failed to add invites');return;}var l_ids=[];$(F).find("invite").each(function(){l_ids.push(parseInt($(this).find("id").text()));});if(l_ids.length>0&&al){
al(l_ids);}};InviteUtil.registerInviteBlocked=function(a_toIds){U(InviteUtil.REQUEST_URL+"register_invite_blocked?from_user_id="+MAIN_DATA.A().B()+"&to_user_ids="+a_toIds.join(),null);};
InviteUtil.cancelInvite=function(a_inviteIds){U(InviteUtil.REQUEST_URL+"cancel_invite?invite_ids="+a_inviteIds.join(),null);};InviteUtil.handleRequestShareApp=function(a_inviteIds,a_toUsers,al){
return function(J){if(J.hadError()){for(var i=0;i<a_toUsers.length;++i){var l_ids=[];if(a_toUsers[i].setInviteBlocked!==undefined){a_toUsers[i].setInviteBlocked();l_ids.push(a_toUsers[i].getId());}
else l_ids.push(a_toUsers[i]);}InviteUtil.registerInviteBlocked(l_ids);}else if(g(J.getData())&&J.getData()==0){InviteUtil.cancelInvite(a_inviteIds);}else if(g(J.getData())&&J.getData()==1){for(var i=
0;i<a_toUsers.length;++i){if(a_toUsers[i].getId)a_toUsers[i].setAlreadyInvited(true);}}if(al){al(J);}}};InviteUtil.handleGetUsersInviteState=function(lQ,al,J){var F=bc(J);if(!g(F)){f(
'Failed to get invite state');return;}$(F).find("user").each(function(i,a_userState){var bg=K(a_userState,"user_id");if(lQ[i].B()==bg){lQ[i].fillUserStateFromXML(a_userState);}else{f(
'not good dude, this should never happen')}});if(g(al)){al(lQ);}};InviteUtil.lazyBucketFunc=function(a_indices,lQ,al){var l_fetch_users=[];for(var i=0;i<lQ.length;++i){if(!lQ[i].hasInviteState()){
l_fetch_users.push(lQ[i]);}}var l_callback=function(){var a_buckets=[];for(var i=0;i<lQ.length;++i){var hasApp=lQ[i].getHasAppFromCache();var l_bucket=0;if(hasApp){l_bucket=3;}else if(
lQ[i].getInviteBlocked()){l_bucket=2;}else if(lQ[i].getAlreadyInvited()){l_bucket=1;}a_buckets.push(l_bucket);}al(a_indices,lQ,a_buckets);};if(l_fetch_users.length>0){InviteUtil.getUsersInviteState(
l_fetch_users,l_callback);}else{l_callback();}};var V_LIBRARY_OS_CONTAINER=opensocial.Container.get();var MS_OS_TOKEN=MyOpenSpace.MySpaceContainer.OSToken;var OYF_NOTIFICATION_BUTTON_URL_CANVAS=
MyOpenSpace.NotificationButton.UrlTypes.CANVAS;var OYF_GIF_TYPE={};OYF_GIF_TYPE.NONE=0;OYF_GIF_TYPE.RANDOM=1;OYF_GIF_TYPE.GIFT=2;OYF_GIF_TYPE.LOGO=3;OYF_GIF_TYPE.SALE=4;function iL(){var I=(
Math.random()*4);I=Math.floor(I);if(I==0){return "http://cdn1.slicezero.com/oyf_prod/images/ffs_money1_myspace.gif";}else if(I==1){
return "http://cdn1.slicezero.com/oyf_prod/images/ffs_money2_myspace.gif";}else if(I==2){return "http://cdn1.slicezero.com/oyf_prod/images/ffs_money3_myspace.gif";}else{
return "http://cdn1.slicezero.com/oyf_prod/images/ffs_money4_myspace.gif";}};function oF(){var I=(Math.random()*4);I=Math.floor(I);if(I==0){
return "http://cdn1.slicezero.com/oyf_prod/images/promotional/oyf_green_gift.PNG";}else if(I==1){return "http://cdn1.slicezero.com/oyf_prod/images/promotional/oyf_red_gift.PNG";}else if(I==2){
return "http://cdn1.slicezero.com/oyf_prod/images/promotional/oyf_blue_gift.PNG";}else{return "http://cdn1.slicezero.com/oyf_prod/images/promotional/oyf_gold_gift.PNG";}};function oE(){
return "http://cdn1.slicezero.com/oyf_prod/images/promotional/oyf_for_sale.jpg";};function oD(){return "http://cdn1.slicezero.com/oyf_prod/images/ffs_directory.png";};function getGiftImage(au){if(g(
au)){if(au==OYF_GIF_TYPE.RANDOM){return "<img src='"+iL()+"' border='0' />";}else if(au==OYF_GIF_TYPE.GIFT){return "<img src='"+oF()+"' border='0' />";}else if(au==OYF_GIF_TYPE.LOGO){
return "<img src='"+oD()+"' border='0' />";}else if(au==OYF_GIF_TYPE.SALE){return "<img src='"+oE()+"' border='0' />";}else if(au==OYF_GIF_TYPE.NONE){return "";}else{return "<img src='"+iL()+
"' border='0' />";}}return "<img src='"+iL()+"' border='0' />";};function el(au){if(g(au)){if(au==OYF_GIF_TYPE.RANDOM){return "<br/><br/><a href='"+OYF_appendSourceToken(APP_URL,'ni','appended',
'img1','random','v1')+"'><img src='"+iL()+"' border='0' /></a><br/>";}else if(au==OYF_GIF_TYPE.GIFT){return "<br/><br/><a href='"+OYF_appendSourceToken(APP_URL,'ni','appended','img1','gift','v1')+
"'><img src='"+oF()+"' border='0' /></a><br/>";}else if(au==OYF_GIF_TYPE.LOGO){return "<br/><br/><a href='"+OYF_appendSourceToken(APP_URL,'ni','appended','img1','logo','v1')+"'><img src='"+oD()+
"' border='0' /></a><br/>";}else if(au==OYF_GIF_TYPE.SALE){return "<br/><br/><a href='"+OYF_appendSourceToken(APP_URL,'ni','appended','img1','sale','v1')+"'><img src='"+oE()+
"' border='0' /></a><br/>";}else if(au==OYF_GIF_TYPE.NONE){return "";}else{return "<br/><br/><a href='"+OYF_appendSourceToken(APP_URL,'ni','appended','img1','random','v1')+"'><img src='"+iL()+
"' border='0' /></a><br/>";}}return "<br/><br/><a href='"+OYF_appendSourceToken(APP_URL,'ni','appended','img1','random','v1')+"'><img src='"+iL()+"' border='0' /></a><br/>";};function mA(
a_targetUserId,eU,bn,bI,au){var T;T=opensocial.newMessage(bn+el(au));T.setField(opensocial.Message.Field.TITLE,eU);T.setField(opensocial.Message.Field.TYPE,opensocial.Message.Type.PRIVATE_MESSAGE);cC(
);opensocial.requestSendMessage(a_targetUserId,T,bI);};function sJ(a_targetUserId,bn,bI){var T;T=opensocial.newMessage(bn);T.setField(opensocial.Message.Field.TYPE,
opensocial.Message.Type.PUBLIC_MESSAGE);cC();opensocial.requestSendMessage(a_targetUserId,T,bI);};function sendNotification(a_targetUserId,bn,a_buttons,bI){var l_buttons=[];for(var i=0;i<
a_buttons.length;i++){var gE=MyOpenSpace.newNotificationButton(a_buttons[i].url,a_buttons[i].text,a_buttons[i].appParams?a_buttons[i].appParams:{});l_buttons.push(gE);}var k={};
k[MyOpenSpace.Notification.Field.BODY]=bn;k[MyOpenSpace.Notification.Field.BUTTONS]=l_buttons;var l_mediaItemArray=[];l_mediaItemArray.push(opensocial.newMediaItem("",
MyOpenSpace.MediaItemHelper.PROFILE_PICTURE));k[MyOpenSpace.Notification.Field.MEDIA_ITEMS]=l_mediaItemArray;var notification=MyOpenSpace.newNotification(k);MyOpenSpace.requestCreateNotification(
a_targetUserId,notification,bI);};function iB(a_targetUserId,bn,bI,au){var T;T=opensocial.newMessage(bn+el(au));T.setField(opensocial.Message.Field.TYPE,opensocial.Message.Type.PUBLIC_MESSAGE);
opensocial.requestSendMessage(a_targetUserId,T,bI);};function rs(a_targetUserId,bn,bI,au){var T;T=opensocial.newMessage(bn+el(au));T.setField(opensocial.Message.Field.TYPE,
MyOpenSpace.PostTo.Targets.PROFILE);cC();opensocial.requestSendMessage(a_targetUserId,T,bI);};function rr(a_targetUserId,eU,bn,bI,au){var T;T=opensocial.newMessage(bn+el(au));T.setField(
opensocial.Message.Field.TITLE,eU);T.setField(opensocial.Message.Field.TYPE,MyOpenSpace.PostTo.Targets.BLOG);cC();opensocial.requestSendMessage(a_targetUserId,T,bI);};function cB(a_targetUserId,eU,bn,
bI,au){var T;var ru=bn+el(au);T=opensocial.newMessage(ru);T.setField(opensocial.Message.Field.TITLE,eU);T.setField(opensocial.Message.Field.TYPE,opensocial.Message.Type.NOTIFICATION);cC();
opensocial.requestSendMessage(a_targetUserId,T,bI);};function sendPokeFriendNotification(rc,aF){var l_buttons=[];l_buttons.push({url:OYF_NOTIFICATION_BUTTON_URL_CANVAS,text:"View Poke",appParams:{
rsrc:"not_poke_friend"}});sendNotification(aF.getId(),rc.getName()+" has just poked you in Own Your Friends. Click \"View Poke\" to see what they did to you!",l_buttons);};
function sendPokeFriendComment(rc,aF,al){sJ(aF.getId(),rc.getName()+" has just poked you in Own Your Friends. <br/><a href='"+OYF_appendAppParams(APP_URL,'comment_poke_friend')+
"'>Click here to see what they did to you!</a>"+"<br/><br/><a href='"+OYF_appendAppParams(APP_URL,'comment_poke_friend')+"'><img src='"+"http://cdn1.slicezero.com/oyf_prod/images/ffs_directory.png"+
"' border='0' /></a><br/>",al);};function notifyPokeFriendInvite(rc,aF,al){InviteUtil.sendInvite(aF,"Hey "+aF.getName()+", "+rc.getName()+
" has just poked you in Own Your Friends!\nAdd Own Your Friends to see what they did to you!",al,"invite_poke_friend");};function sendPokeFriendActivity(aF,mf,al){var params={};
params[opensocial.Activity.Field.TITLE_ID]="Poke_friend";params[opensocial.Activity.Field.TEMPLATE_PARAMS]={"memberid":aF.B(),"poketype":mf};var mediaItemArray=[];mediaItemArray.push(
opensocial.newMediaItem("","http://api.myspace.com/v1/users/"+aF.B()));params[opensocial.Activity.Field.MEDIA_ITEMS]=mediaItemArray;var activity=opensocial.newActivity(params);
opensocial.requestCreateActivity(activity,opensocial.CreateActivityPriority.HIGH,al);};function sendPokeWithPetNotification(rc,aF,a_pet){var l_buttons=[];l_buttons.push({url:
OYF_NOTIFICATION_BUTTON_URL_CANVAS,text:"View Poke",appParams:{rsrc:"not_poke_friend_with_pet"}});sendNotification(aF.getId(),rc.getName()+" has just poked you in Own Your Friends with pet "+
a_pet.getName()+". Click \"View Poke\" to see what they did to you!",l_buttons);};function sendPokeWithPetComment(rc,aF,a_pet,al){sJ(aF.getId(),rc.getName()+
" has just poked you in Own Your Friends with pet "+a_pet.getName()+". <br/><a href='"+OYF_appendAppParams(APP_URL,'comment_poke_friend_with_pet')+"'>Click here to see what they did to you!</a>"+
"<br/><br/><a href='"+OYF_appendAppParams(APP_URL,'comment_poke_friend_with_pet')+"'><img src='"+"http://cdn1.slicezero.com/oyf_prod/images/ffs_directory.png"+"' border='0' /></a><br/>",al);};
function notifyPokeWithPetInvite(rc,aF,a_pet,al){InviteUtil.sendInvite(aF,"Hey "+aF.getName()+", "+rc.getName()+" has just poked you in Own Your Friends with pet "+a_pet.getName()+
"!\nAdd Own Your Friends to see what they did to you!",al,"invite_poke_friend_with_pet");};function sendBuyPetNotification(qU,dE,al,lN){var l_buttons=[];l_buttons.push({url:
OYF_NOTIFICATION_BUTTON_URL_CANVAS,text:"See My Worth",appParams:{rsrc:"not_buy_pet"}});sendNotification(dE.getId(),qU.getName()+" has just bought you as their pet. "+
"Click \"See My Worth\" to see how much they think you're worth!",l_buttons,al,OYF_GIF_TYPE.NONE);};function sendBuyPetComment(qU,dE,al,lN){sJ(dE.getId(),"Hey "+dE.getName()+
", I just bought you as my PET! <br/><a href='"+OYF_appendAppParams(APP_URL,'comment_buy_pet')+"'>Click here to find out how much I think you're WORTH!</a>"+"<br/><br/><a href='"+OYF_appendAppParams(
APP_URL,'comment_buy_pet')+"'><img src='"+"http://cdn1.slicezero.com/oyf_prod/images/ffs_directory.png"+"' border='0' /></a><br/>",al);};function notifyBuyPetInvite(qU,dE,al,lN){InviteUtil.sendInvite(
dE,"Hey "+dE.getName()+", I just bought you as my PET! Add Own Your Friends to find out how much I think you're WORTH!",al,"invite_buy_pet");};function notifyBuyPetIdInvite(qU,a_boughtUserId,al,lN,
a_name){InviteUtil.sendInvite(a_boughtUserId,"Hey "+a_name+", I just bought you as my PET! Add Own Your Friends to find out how much I think you're WORTH!",al,"invite_buy_pet");};
function sendBuyPetActivity(dE,lN,al){var k={};var l_useImage=true;var l_rsrc="activity_buy_pet"+(l_useImage?"_use_image":"");k[opensocial.Activity.Field.TITLE_ID]="Buy_pet2";
k[opensocial.Activity.Field.TEMPLATE_PARAMS]={"username":dE.getDisplayName(),"userid":dE.B(),"rsrc":l_rsrc};var mediaItemArray=[];if(l_useImage)mediaItemArray.push(opensocial.newMediaItem("",
"http://api.myspace.com/v1/users/357827779/albums/290118/photos/11223412"));k[opensocial.Activity.Field.MEDIA_ITEMS]=mediaItemArray;var activity=opensocial.newActivity(k);
opensocial.requestCreateActivity(activity,opensocial.CreateActivityPriority.HIGH,al);};function sendGiftItemFriendNotification(ky,a_gift,aF,al){var l_buttons=[];l_buttons.push({url:
OYF_NOTIFICATION_BUTTON_URL_CANVAS,text:"View Gift",appParams:{rsrc:"not_send_gift_item_friend"}});sendNotification(aF.getId(),ky.getName()+
" has just sent you a gift in Own Your Friends. Click \"View Gift\" to see what they sent you.",l_buttons,al);};function sendGiftItemFriendComment(ky,a_gift,aF,al){sJ(aF.getId(),"Hey "+aF.getName()+
", I just gave you a gift! <br/><a href='"+OYF_appendAppParams(APP_URL,'comment_send_gift_item_friend')+"'>Click here to unwrap your gift!</a><br/><br/><a href='"+OYF_appendAppParams(APP_URL,
'comment_send_gift_item_friend')+"'>"+getGiftImage(OYF_GIF_TYPE.GIFT)+"</a><br/>",al);};function notifyGiftItemFriendInvite(ky,a_gift,aF,al){InviteUtil.sendInvite(aF,"Hey "+aF.getName()+
", I just gave you a gift!\nAdd Own Your Friends so you can see what it is!",al,"invite_gift_item");};function sendGiftItemFriendActivity(aF,al){var params={};
params[opensocial.Activity.Field.TITLE_ID]="Give_gift";params[opensocial.Activity.Field.TEMPLATE_PARAMS]={"memberid":aF.B()};var activity=opensocial.newActivity(params);
opensocial.requestCreateActivity(activity,opensocial.CreateActivityPriority.HIGH,al);};function sendGiftPetFriendNotification(ky,qf,aF,al){var l_buttons=[];l_buttons.push({url:
OYF_NOTIFICATION_BUTTON_URL_CANVAS,text:"View Gift",appParams:{rsrc:"not_send_gift_pet_friend"}});sendNotification(aF.getId(),ky.getName()+
" has just sent you a gift in Own Your Friends. Click \"View Gift\" to see what they sent you.",l_buttons,al);};function sendGiftPetFriendComment(ky,qf,aF,al){sJ(aF.getId(),"Hey "+aF.getName()+
", I just gave you a human gift! <br/><a href='"+OYF_appendAppParams(APP_URL,'comment_send_gift_pet_friend')+"'>Click here to unwrap your human and see who it is!</a><br/><br/><a href='"+
OYF_appendAppParams(APP_URL,'comment_send_gift_pet_friend')+"'>"+getGiftImage(OYF_GIF_TYPE.GIFT)+"</a><br/>",al);};function notifyGiftPetFriendInvite(ky,qf,aF,al){InviteUtil.sendInvite(aF,"Hey "+
aF.getName()+", I just gave you a human gift!\nAdd Own Your Friends so you can unwrap your human and see who it is!",al,"invite_gift_pet");};function sendMakePetPokeNotification(ky,rb,pZ,mf){
var l_buttons=[];l_buttons.push({url:OYF_NOTIFICATION_BUTTON_URL_CANVAS,text:"View Poke",appParams:{rsrc:"not_make_pet_poke"}});sendNotification(rb.getId(),ky.getName()+" made you poke "+pZ.getName()+
" in Own Your Friends. Click \"View Poke\" to see what they made you do.",l_buttons);};function notifyMakePetPokeInvite(ky,rb,pZ,al){InviteUtil.sendInvite(rb.getId(),ky.getName()+" made you poke "+
pZ.getName()+" in Own Your Friends. \nAdd Own Your Friends to see what poke they made you do!",al,"invite_make_pet_poke");};function sendChangeStatusMessageNotification(ky,pZ,qZ){var l_buttons=[];
l_buttons.push({url:OYF_NOTIFICATION_BUTTON_URL_CANVAS,text:"View Status",appParams:{rsrc:"not_change_status_message"}});sendNotification(pZ.getId(),ky.getName()+
" has just changed your status message in Own Your Friends. Click \"View Status\" to see what they changed it to.",l_buttons);};function sendWriteCommentNotification(V,aF){var l_buttons=[];
l_buttons.push({url:OYF_NOTIFICATION_BUTTON_URL_CANVAS,text:"View Message",appParams:{rsrc:"not_write_comment"}});sendNotification(aF.getId(),V.getName()+
" just left you a message in Own Your Friends. Click \"View Message\" to see what they sent you!",l_buttons);};function nY(mg,qF){cB(opensocial.IdSpec.PersonId.VIEWER,"\""+mg+"\" is for SALE!",
"I'm putting my PET \""+mg+"\" on sale. <br/><a href='"+OYF_getShowUserDetailsLink(qF)+"'><span style='font-size:larger;'>Click here to check them out!</span></a>",undefined,OYF_GIF_TYPE.SALE);};
function sendRaiseMyWorthBulletin(qY,qA){cB(opensocial.IdSpec.PersonId.VIEWER,"Come buy me and I'll be your PET!!!","<a href='"+OYF_getShowUserDetailsLink(qA)+
"'><span style='font-size:larger;'>Click here to buy me on Own Your Friends!</span></a>",undefined,OYF_GIF_TYPE.SALE);};function rn(){};function pe(bU){sJ(bU.getId(),"Hey "+bU.getName()+
", I just bought you as my PET! <br/><a href='"+OYF_appendSourceToken(APP_URL,'ni','comment','link','pokeInvite','v5')+"'>Click here to find out how much I think you're WORTH!</a>"+
"<br/><br/><a href='"+OYF_appendSourceToken(APP_URL,'ni','comment','img1','pokeInvite','v5')+"'><img src='"+"http://cdn1.slicezero.com/oyf_prod/images/ffs_directory.png"+"' border='0' /></a><br/>",
undefined);};function rj(bU){var onSentMessage=function(aV){if(g(OYF.FORCE_SEND)&&OYF.FORCE_SEND&&aV<=0){f("send message failed");}else{f("Send message succeeded");var k={};k.user_id=MAIN_DATA.A().B()
;k.invite_id=bU.B();k.invite_display_name=bo(bU.getName());U(REQUEST_DESTINATION_URL+"/ffs/saveinvite",undefined,k,true);}};mA(bU.getId(),"I OWN you!",
"<span style='font-size:20px; font-weight:bold'>Hey "+bU.getName()+", I just bought you as my PET! <a href='"+OYF_appendSourceToken(APP_URL,'in','message','link','pokeWorth','v5')+
"'><span style='font-size:larger;'>Click here</span></a> to find out how much I think you're $$WORTH$$!</span>",onSentMessage);};function initializeGA(a_code){try{_uacct=a_code;OYF.PAGE_TRACKER=
_gat._getTracker(a_code);OYF.PAGE_TRACKER._trackPageview();}catch(e){f(e);}f('GA: initialized '+a_code+" (_gat is not defined means we're using old urchin tracker, and all is fine)");};
function gaTrackPageview(opt_url){try{if(urchinTracker){urchinTracker(opt_url);f('GA-urchin: track page view '+opt_url);}}catch(e){f('gaTrackPageview Error: '+e);}try{if(OYF.PAGE_TRACKER){
OYF.PAGE_TRACKER._trackPageview.call(OYF.PAGE_TRACKER,opt_url);f('GA: track page view '+opt_url);}}catch(e){f('gaTrackPageview Error: '+e);}};function gaTrackEvent(category,action,opt_label,opt_value)
{try{if(urchinTracker){var loc="";for(var i=0;i<arguments.length;++i)loc+="/"+arguments[i];urchinTracker(loc);f('GA-urchin: track event page view '+loc);}}catch(e){f('gaTrackEvent Error: '+e);}try{if(
OYF.PAGE_TRACKER){var loc="";for(var i=0;i<arguments.length;++i)loc+="/"+arguments[i];OYF.PAGE_TRACKER._trackEvent.apply(OYF.PAGE_TRACKER,arguments);f('GA: track event '+loc);}}catch(e){f(
'gaTrackEvent Error: '+e);}};var NON_APP_USER="<div class='notinstalledtag' title='This person does not have Own Your Friends installed.'></div>";function setStyle(kp,a_style){if(g(a_style)){for(
var i in a_style){kp.style[i]=a_style[i];}}return kp;};function makeElement(a_tag,a_parent,a_style){var l_result=document.createElement(a_tag);if(a_parent)a_parent.appendChild(l_result);
return setStyle(l_result,a_style);};function makeElementId(a_tag,a_parent,oi,a_style){var result=makeElement(a_tag,a_parent,a_style);result.id=oi;return result;};var $elmid=makeElementId;
function makeElementClass(a_tag,a_parent,a_class,a_style){var l_result=makeElement(a_tag,a_parent,a_style);l_result.className=a_class;return l_result;};var $elcl=makeElementClass;var $elid=
makeElementId;var $el=makeElement;var $divcl=function(a_parent,a_class,a_style){return makeElementClass("div",a_parent,a_class,a_style);};var $divid=function(a_parent,oi,a_style){return makeElementId(
"div",a_parent,oi,a_style);};var $div=function(a_parent,a_style){return makeElement("div",a_parent,a_style);};function kX(bs){bs.style.borderStyle="solid";bs.style.borderWidth="1";
bs.style.borderColor="#cccccc";};function az(bs){bs.style.borderBottomStyle="solid";bs.style.borderBottomWidth="1";bs.style.borderBottomColor="#cccccc";};function kY(bs){bs.style.borderBottomStyle=
"solid";bs.style.borderBottomWidth="1";bs.style.borderBottomColor="#7f93bc";};function cC(){location.href="#mainFrameTop";};function GrayButton(rA,fn,al){var pL=rA;var ez=fn;var eJ=al;this.qh=qh;if(
pL!=undefined){qh(pL);}function qh(_a_parentDiv){pL=_a_parentDiv;var aH=document.createElement("a");aH.className="blueButton";aH.style.backgroundColor="#aaaaaa";aH.href="#";aH.appendChild(
document.createTextNode(ez));aG(aH,"click",eJ);var aN=document.createElement("span");aN.setAttribute("style","text-align:center;");aN.className="blueButton";aN.style.background="#aaaaaa";
aN.appendChild(aH);pL.appendChild(aN);}};function aJ(rA,fn,al){var pL=rA;var ez=fn;var eJ=al;this.qh=qh;if(pL!=undefined){qh(pL);}function qh(_a_parentDiv){pL=_a_parentDiv;var aH=
document.createElement("a");aH.className="blueButton";aH.href="javascript:void(0);";aH.appendChild(document.createTextNode(ez));aG(aH,"click",eJ);var aN=document.createElement("span");aN.setAttribute(
"style","text-align:center;");aN.className="blueButton";aN.appendChild(aH);pL.appendChild(aN);}};function ld(rA,fn,al){var pL=rA;var ez=fn;var eJ=al;this.qh=qh;if(pL!=undefined){qh(pL);}function qh(
_a_parentDiv){pL=_a_parentDiv;var aH=document.createElement("a");aH.className="bigBlueButton";aH.href="#";aH.appendChild(document.createTextNode(ez));aG(aH,"click",eJ);var aN=document.createElement(
"span");aN.style.textAlign="CENTER";aN.className="bigBlueButton";aN.appendChild(aH);pL.appendChild(aN);}};function rk(rA,fn,op){var pL=rA;var ez=fn;this.qh=qh;if(pL!=undefined){qh(pL);}function qh(
_a_parentDiv){pL=_a_parentDiv;var aH=document.createElement("a");aH.className="blueButton";aH.href=op;aH.appendChild(document.createTextNode(ez));var aN=document.createElement("span");aN.setAttribute(
"style","text-align:center;");aN.className="blueButton";aN.appendChild(aH);pL.appendChild(aN);}};function DivButton(rA,sj,al,nc){var pL=rA;var ez=sj;var eJ=al;var bu=undefined;this.qh=qh;this.aL=aL;
if(nc==undefined){nc="#3b5998";}if(pL!=undefined){qh(pL);}function qh(rA){pL=rA;var gE=document.createElement("div");gE.innerHTML=ez;gE.style.backgroundColor=nc;gE.style.color="white";
gE.style.textAlign="center";gE.style.fontWeight="bold";gE.style.cursor="pointer";gE.style.padding="10";gE.style.borderBottomStyle="solid";gE.style.borderBottomWidth="2";gE.style.borderBottomColor=
"#cccccc";gE.style.borderRightStyle="solid";gE.style.borderRightWidth="2";gE.style.borderRightColor="#cccccc";bu=gE;pL.appendChild(gE);aG(gE,"click",eJ);};function aL(){return bu;}};function bG(rA){
var pL=rA;var l=undefined;var bu=undefined;this.qh=qh;this.aL=aL;this.oM=oM;this.ad=ad;if(pL!=undefined&&pL!=null){qh(pL);}function qh(_a_parentDiv){pL=_a_parentDiv;l=document.createElement("div");
pL.appendChild(l);l.style.margin="3px 10px 5px 10px";l.style.padding="0";l.style.border="1px solid #0e1f5b";l.style.width="520px";var G=document.createElement("div");l.appendChild(G);
G.style.textAlign="RIGHT";G.style.padding="3px 10px 3px 10px";G.style.color="#FFFFFF";G.style.fontWeight="BOLD";G.style.backgroundColor="#7f93bc";var cS=document.createElement("a");G.appendChild(cS);
cS.href="javascript:void(0);";cS.style.color="WHITE";cS.style.fontWeight="BOLD";cS.style.textDecoration="none";cS.innerHTML="x";aG(cS,"click",oM);bu=document.createElement("div");l.appendChild(bu);
bu.style.padding="6";};function aL(){return bu;};function oM(){l.style.display="none";return false;};function ad(){return l;}};function EmailSubmissionDiv(rA){var pL=rA;var l=undefined;var fL=
undefined;var rR=false;var rI=undefined;var rJ=undefined;var rK=undefined;this.qh=qh;if(pL!=undefined){qh(pL);}function qh(_a_parentDiv){pL=_a_parentDiv;l=document.createElement("div");pL.appendChild(
l);l.style.backgroundColor="#f7f7f7";l.style.textAlign="left";l.style.margin="5px";l.style.padding="5px 5px 5px 10px";l.style.color="#333333";l.style.borderStyle="solid";l.style.borderWidth="1px";
l.style.borderColor="#7f93bc";var sd= !g(MAIN_DATA.A().getEmail());createExpandableInterface(sd);createEmailInterface();};function createExpandableInterface(rF){var sf=document.createElement("div");
l.appendChild(sf);var lu=new dI(l);var cz=lu.by();cz.innerHTML="<b>Get Email Notifications</b>";var aY=lu.bf();aY.style.paddingLeft="10px";if(rF){aY.innerHTML=
"<span style='font-size:10px;color:blue;text-decoration:underline;'> [Hide] </span>";}else{aY.innerHTML="<span style='font-size:10px;color:blue;text-decoration:underline;'> [Show] </span>";}
aY.style.cursor="pointer";aG(aY,"click",function(){rR= !rR;if(rR){rI.style.display="none";aY.innerHTML="<span style='font-size:10px;color:blue;text-decoration:underline;'> [Show] </span>";}else{
rI.style.display="block";aY.innerHTML="<span style='font-size:10px;color:blue;text-decoration:underline;'> [Hide] </span>";}});rI=document.createElement("div");l.appendChild(rI);rI.style.paddingLeft=
"15px";if(!rF){rI.style.display="none";rR=true;}};function createEmailInterface(){var rS=document.createElement("div");rI.appendChild(rS);rS.style.marginTop="5px";rS.style.marginBottom="5px";
rS.innerHTML="To get e-mail notifications when you get bought, enter your e-mail below and click \"Save Email\"!";var lu=new dI(rI);var cz=lu.by();var aY=lu.bf();var rU=document.createElement("form");
rU.onsubmit=saveEmail;try{rJ=document.createElement("<input type='text'/>");}catch(error){rJ=document.createElement("input");rJ.type="text";}rJ.style.marginTop="16px";if(g(MAIN_DATA.A().getEmail())){
rJ.value=MAIN_DATA.A().getEmail();}rU.appendChild(rJ);cz.appendChild(rU);new aJ(aY,"Save Email",saveEmail);var l_incentDiv=document.createElement("div");l_incentDiv.innerHTML=
"Own Your Friends will send a confirmation email to your address.<br><b>You will receive $10,000 bonus when you confirm your address!</b>";rI.appendChild(l_incentDiv);rK=document.createElement("div");
rI.appendChild(rK);rK.style.marginTop="5px";rK.style.marginBottom="5px";rK.style.paddingLeft="10px";};function saveEmail(){if(!validateEmail(rJ.value)){rK.innerHTML=
"<span style='color:#ff0000;'> Please enter a valid email address.</span>";return false;}rK.innerHTML="<span style='color:#777777;'> Saving...</span>";var k={};k.user_id=MAIN_DATA.A().B();k.email=
rJ.value;U(REQUEST_DESTINATION_URL+"/ffs/saveemail",function(J){rK.innerHTML="<span style='color:#333333;'> Thank you! Your email address "+rJ.value+" has been saved.</span>";if(rJ.value.indexOf(
"yahoo.co")>0){rK.innerHTML+="<br><span style='color:#333333;'><b>Yahoo users:</b> please check your spam folder to receive our response.<br>"+"Mark the message as not-spam!</span>";}},k);
return false;};function validateEmail(rD){var sc=/^([a-zA-Z0-9_\.\-\+])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;return sc.test(rD);}};function eb(rA,po,qs,kb,iI,nc,tu,sM,a_showZoom,a_resizeImage)
{this.pL=rA;this.nv=po;this.nx=qs;this.jY=kb?parseInt(kb):64;this.iy=iI?parseInt(iI):64;this.sH=nc||"#EEEEEE";this.tl=tu;this.tp=sM;this.m_showZoom=g(a_showZoom)?a_showZoom:true;this.m_resizeImage=g(
a_resizeImage)?a_resizeImage:false;this.m_frameDiv=null;this.m_image=null;this.m_overlay=null;if(this.pL!=undefined){this.qh();}};eb.prototype.qh=function(){var l_self=this;this.m_frameDiv=
makeElementClass("div",this.pL,"imgDivFrame",{width:this.jY+"px",height:this.iy+"px",overflow:"hidden",textAlign:"center",backgroundColor:this.sH,position:"relative",left:"0px",top:"0px"});if(
this.m_resizeImage){this.m_image=makeElement("img",this.m_frameDiv);this.m_image.style.width=this.jY+"px";this.m_image.src=this.nx;}else{setStyle(this.m_frameDiv,{backgroundImage:"url('"+this.nx+"')",
backgroundPosition:"top center",backgroundRepeat:"no-repeat"});}this.m_overlay=makeElement("div",this.m_frameDiv,{position:"absolute",left:"0px",top:"0px",width:this.jY,height:this.iy});if(g(this.tl))
this.m_overlay.innerHTML=this.tl;if(this.m_showZoom){appendZoomButton(this.m_overlay,this.nx,this.tp);}};eb.prototype.ad=function(){return this.m_frameDiv;};eb.prototype.oS=function(){return this.nv;}
;function appendZoomButton(rA,sR,sM){if(sR.indexOf("/s_")>0||sR.indexOf("_s.jpg")>0||sR.indexOf("_s.gif")>0){var dH=sR.replace("/s_","/l_").replace("_s.jpg","_l.jpg").replace("_s.gif","_l.gif");
var sQ=document.createElement("div");sQ.className="zoomButton";sQ.title="Click to zoom.";if(g(sM)){sQ.scrollAncestor=sM}sQ.onclick=function(e){if(!e)var e=window.event;e.cancelBubble=true;if(
e.stopPropagation)e.stopPropagation();var xy=findPos(this);zoomIntoImage(dH,xy[1]-250);};rA.appendChild(sQ);}};function findPos(obj){var curleft=curtop=0;var stack=new Array();if(obj.scrollAncestor){
curtop-=obj.scrollAncestor.scrollTop;}if(obj.offsetParent){do{curleft+=obj.offsetLeft;curtop+=obj.offsetTop;stack.push(obj.offsetTop);}while(obj=obj.offsetParent);}return[curleft,curtop];};
function findMousePos(e){var posx=0;var posy=0;if(!e)var e=window.event;if(e.pageX||e.pageY){posx=e.pageX;posy=e.pageY;}else if(e.clientX||e.clientY){posx=e.clientX+document.body.scrollLeft+
document.documentElement.scrollLeft;posy=e.clientY+document.body.scrollTop+document.documentElement.scrollTop;}return[posx,posy];};function zoomIntoImage(qq,iI){var tm=document.getElementById(
"OYFpopupcontainer");tm.innerHTML=
"<div style='background: white url(http://cdn0.supercomment.com/kissme/images/ajax-loader.gif) no-repeat scroll center center; margin: 20px; padding: 10px; border: 2px solid gray; font-size: 11px;'"+
" onclick='document.getElementById(\"OYFpopupcontainer\").innerHTML=\"\"'><center>Click to close<br>&nbsp;<br><img src='"+qq+"'><br>&nbsp;<br>Click to close</center></div>";tm.style.top=iI;};
function lw(cc){switch(cc){case "happy":return IMAGE_SOURCE_URL+"/favicons/moods/happy.gif";case "content":return IMAGE_SOURCE_URL+"/favicons/moods/content.gif";case "gloomy":return IMAGE_SOURCE_URL+
"/favicons/moods/gloomy.gif";}return undefined;};function pn(rA){var pL=rA;var l=undefined;var cn=undefined;var gJ={};if(pL!=undefined){qh(pL);}function qh(_a_parentDiv){pL=_a_parentDiv;l=
document.createElement("div");pL.appendChild(l);kX(l);l.style.marginTop="3px";l.style.marginBottom="15px";var G=document.createElement("div");l.appendChild(G);G.style.padding="6px";G.innerHTML=
"<span style='font-size:12px;'>How do you feel about your owner?</span>";cn=document.createElement("form");l.appendChild(cn);cn.style.marginTop="0px";cn.style.marginBottom="5px";var bi=
document.createElement("div");cn.appendChild(bi);bi.style.textAlign="center";var aa=document.createElement("table");bi.appendChild(aa);aa.style.cellSpacing="0px";aa.style.borderCollapse="collapse";
aa.style.marginLeft="auto";aa.style.marginRight="auto";var af=document.createElement("tbody");aa.appendChild(af);af.appendChild(kv("happy","Happy"));af.appendChild(kv("content","Content"));
af.appendChild(kv("gloomy","Gloomy"));var bb=document.createElement("div");l.appendChild(bb);bb.style.paddingTop="10px";bb.style.paddingBottom="15px";bb.style.textAlign="center";new aJ(bb,"Save Mood",
nZ);};function kv(cc,qK){var o=document.createElement("tr");var gK=document.createElement("td");o.appendChild(gK);gK.style.paddingTop="3px";gK.style.paddingBottom="3px";var cA=undefined;try{cA=
document.createElement("<input type='RADIO' name='pickMood' value='"+cc+"'/>");}catch(error){cA=document.createElement("input");cA.type="radio";cA.name="pickMood";cA.value=cc;}gK.appendChild(cA);
var lX=MAIN_DATA.A().gb();if(g(lX)&&lX==cc){cA.checked=true;}var bX=document.createElement("td");o.appendChild(bX);bX.style.paddingTop="3px";bX.style.paddingBottom="3px";bX.style.fontSize="11px";
bX.style.fontWeight="bold";bX.innerHTML="<img style='margin-right:10px; vertical-align:middle;' src='"+lw(cc)+"'/>"+qK;bX.style.cursor="pointer";aE(bX,"click",nK,cA);var cs=document.createElement(
"div");bX.appendChild(cs);cs.style.color="#AAAAAA";cs.style.fontSize="10px";cs.style.fontStyle="italic";gJ[cc]=cs;return o;};function nK(kt){if(kt.checked){kt.checked=false;}else{kt.checked=true;}
return false;};function ph(){for(var gG=0;gG<cn.pickMood.length;gG++){if(cn.pickMood[gG].checked){return cn.pickMood[gG].value;}}return undefined;};function nZ(){var gD=ph();if(!g(gD)){f(
"invalid mood Id");return;}for(var aj in gJ){gJ[aj].innerHTML="";}var nj=gJ[gD];nj.innerHTML="<span style='color:#666666; font-size:10px; font-weight:bold; font-style:italic;'> Saving... </span>";
var k={};k.user_id=MAIN_DATA.A().B();k.mood=gD;U(REQUEST_DESTINATION_URL+"/ffs/savemood",function(J){nS(J,gD,nj);},k);};function nS(J,pG,qI){f("mood saved");qI.innerHTML=
"<span style='color:#666666; font-size:10px; font-weight:bold; font-style:italic;'> Saved! </span>";MAIN_DATA.A().iY(pG);OYF.VIEWER_PROFILE.refresh();NEWSFEED_CACHE.av();if(g(CUR_NEWSFEED)){
CUR_NEWSFEED.eh();}}};function mN(rA,qG,kf,ou,iP,a_showEnd){this.pL=rA;this.bd=undefined;this.dB=kf;this.ay=ou;this.lT=iP;this.fr=qG;this.m_showEnd=g(a_showEnd)?a_showEnd:true;if(g(this.pL)){this.qh()
;}};mN.prototype.qh=function(){this.bd=makeElementClass("span",this.pL,"paginationDiv");this.pL.appendChild(this.bd);if(this.dB<1)return;if(this.dB>1&&this.ay>1){var fI=document.createElement("a");
fI.href="javascript:void(0);";fI.className="paginationProgressionLink";fI.appendChild(document.createTextNode("prev <<"));this.bd.appendChild(fI);aE(fI,"click",this.fr,this.ay-1);}this.bd.appendChild(
document.createTextNode("  "));var pQ=Math.max(Math.ceil(this.lT/2),this.lT-(this.dB-this.ay));var ls=Math.max(1,this.ay-pQ);var pR=Math.max(Math.ceil(this.lT/2),this.lT-this.ay);var mr=Math.min(
this.dB,this.ay+pR);if(ls>1){var aC=document.createElement("a");aC.appendChild(document.createTextNode("1"));this.bd.appendChild(aC);aC.href="javascript:void(0);";aC.className="paginationPageNum";
this.bd.appendChild(document.createTextNode("..."));aE(aC,"click",this.fr,1);}for(var dX=ls;dX<=mr;dX++){if(dX!=this.ay){var aC=document.createElement("a");aC.href="javascript:void(0);";aC.className=
"paginationPageNum";aC.appendChild(document.createTextNode(dX));this.bd.appendChild(aC);aE(aC,"click",this.fr,dX);}else{var ic=document.createElement("span");this.bd.appendChild(ic);ic.className=
"paginationCurPageNum";ic.appendChild(document.createTextNode(dX));}}if(mr<this.dB){this.bd.appendChild(document.createTextNode("..."));if(this.m_showEnd){var aC=document.createElement("a");
aC.appendChild(document.createTextNode(this.dB));aC.href="javascript:void(0);";aC.className="paginationPageNum";this.bd.appendChild(aC);aE(aC,"click",this.fr,this.dB);}}if(this.dB>1&&this.ay<this.dB){
var fq=document.createElement("a");fq.href="javascript:void(0);";fq.className="paginationProgressionLink";fq.appendChild(document.createTextNode("next >>"));this.bd.appendChild(fq);aE(fq,"click",
this.fr,this.ay+1);}};function ks(rA,qy){var pL=rA;var l=undefined;var fs=undefined;var gm=new Array();this.qh=qh;this.dP=dP;if(pL!=undefined&&pL!=null){qh(pL);}function qh(_a_parentDiv){pL=
_a_parentDiv;f("fp: qh");l=document.createElement("div");pL.appendChild(l);l.style.width="150px";fs=document.createElement("select");l.appendChild(fs);var pN=MAIN_DATA.ar(v.MY_PETS);pN.aX(0,30,oT);};
function oT(mh){for(var r=0;r<mh.length;r++){var ab=mh[r];if(r==0){fs.appendChild(bF(ab.D(),ab.B(),true));}else{fs.appendChild(bF(ab.D(),ab.B(),false));}}if(g(qy)){fs.appendChild(bF("You",MAIN_DATA.A(
).B(),false));}};function bF(aK,kc,jJ){var bq=document.createElement("OPTION");bq.innerHTML=aK;bq.value=kc;bq.selected=jJ;gm.push(bq);return bq;};function dP(){for(var r=0;r<gm.length;r++){if(
gm[r].selected){return gm[r].value;}}return undefined;}};function fp(rA){var pL=rA;var l=undefined;var cj=undefined;var gh=new Array();this.qh=qh;this.ff=ff;this.getSelectedPokePastTense=
getSelectedPokePastTense;if(pL!=undefined&&pL!=null){qh(pL);}function qh(_a_parentDiv){pL=_a_parentDiv;f("fp: qh");l=document.createElement("div");pL.appendChild(l);l.style.width="80px";cj=
document.createElement("select");l.appendChild(cj);cj.appendChild(bF("poke","poke",false));cj.appendChild(bF("hug","hug",true));cj.appendChild(bF("kiss","kiss",false));cj.appendChild(bF("smack",
"smack",false));cj.appendChild(bF("pinch","pinch",false));cj.appendChild(bF("cheer","cheer",false));cj.appendChild(bF("high five","high five",false));cj.appendChild(bF("thank","thank",false));
cj.appendChild(bF("tickle","tickle",false));cj.appendChild(bF("wink at","wink at",false));cj.appendChild(bF("whistle at","whistle at",false));};function bF(aK,kc,jJ){var bq=document.createElement(
"OPTION");bq.appendChild(document.createTextNode(aK));bq.value=kc;bq.selected=jJ;gh.push(bq);return bq;};function ff(){for(var r=0;r<gh.length;r++){if(gh[r].selected){return gh[r].value;}}
return undefined;};function getSelectedPokePastTense(getSelectedPokePastTense){var l_currentPoke=ff();if(l_currentPoke){var dW="";if(l_currentPoke==="hug"){dW="hugged";}else if(l_currentPoke=="poke"){
dW="poked";}else if(l_currentPoke=="high five"){dW="high fived";}else if(l_currentPoke=="wink at"){dW="winked at";}else if(l_currentPoke=="whistle at"){dW="whistled at";}else if(l_currentPoke==
"tickle"){dW="tickled";}else{dW=l_currentPoke+"ed";}return dW;}return l_currentPoke;}};function dI(rA,on){var pL=rA;var l=undefined;var nl=on;var m_table=undefined;var iw=undefined;var iW=undefined;
this.qh=qh;this.getTable=getTable;this.by=by;this.bf=bf;if(pL!=undefined){qh(pL);}function qh(_a_parentDiv){pL=_a_parentDiv;l=document.createElement("div");pL.appendChild(l);m_table=
document.createElement("table");l.appendChild(m_table);var af=document.createElement("tbody");m_table.appendChild(af);var o=document.createElement("tr");af.appendChild(o);iw=document.createElement(
"td");o.appendChild(iw);iW=document.createElement("td");o.appendChild(iW);if(nl){l.style.textAlign="center";m_table.style.marginLeft="auto";m_table.style.marginRight="auto";}};function getTable(){
return m_table;};function by(){return iw;};function bf(){return iW;}};function nN(rA){var pL=rA;var l=undefined;this.qh=qh;this.fK=fK;if(pL!=undefined){qh(pL);}function qh(_a_parentDiv){pL=
_a_parentDiv;l=document.createElement("div");pL.appendChild(l);l.style.textAlign="right";l.style.paddingRight="20px";l.style.marginBottom="8px";};function fK(or){l.innerHTML=
"<span style='font-size:11px; color:gray;'> You have: </span> <span style='font-size:18px; font-weight:bold; color:#09460F;'>$"+addCommas(or)+"</span>";}};function jb(rA,pK,pw,pv,of,qa,pH,ob){var pL=
rA;var lq=pK;var nm=pw;var nt=pv;var nz=of;var da= -1;var kj=qa;var nu=pH;var ny=ob;var gV=new Array();var l=undefined;var ha=undefined;var bu=undefined;this.qh=qh;this.switchToTab=switchToTab;
this.mB=mB;this.aL=aL;if(pL!=undefined&&pL!=null){qh(pL);}function qh(_a_parentDiv){pL=_a_parentDiv;f("jb: qh");l=makeElementClass('div',pL,'tabs_div');ha=makeElementClass('div',l,'tabs');kO();bu=
document.createElement("div");l.appendChild(bu);bu.className="tabContentFrame";switchToTab(lq[nz]);};function kO(){f("jb: kO");ha.innerHTML="";var ed=document.createElement("table");ha.appendChild(ed)
;ed.style.borderCollapse="collapse";ed.style.cellSpacing="0px";ed.style.width="760px";ed.style.margin="0px";var kU=document.createElement("tbody");ed.appendChild(kU);var o=document.createElement("tr")
;kU.appendChild(o);var dK=makeElementClass("td",o,"left_tabs");dK.style.textAlign="left";dK.style.width="560px";dK.style.paddingTop="10px";dK.style.paddingBottom="5px";var dV=makeElementClass("td",o,
"right_tabs");dV.style.textAlign="right";dV.style.width="200px";dV.style.paddingTop="10px";dV.style.paddingBottom="0px";for(var eV=0;eV<lq.length;eV++){var bW=document.createElement("span");if(
nt[eV]=="right"){dV.appendChild(bW);}else{dK.appendChild(bW);}gV.push(bW);bW.className=kj;var eT=document.createElement("a");bW.appendChild(eT);eT.href="#";eT.className=ny;eT.appendChild(
document.createTextNode(lq[eV]));aE(eT,"click",switchToTab,lq[eV]);}};function switchToTab(a_tabName){if(PetFinderOperationManager.invokeOperationInterval)clearInterval(
PetFinderOperationManager.invokeOperationInterval);var eV= -1;for(var i=0;i<lq.length;++i){if(lq[i]==a_tabName){eV=i;break;}}if(eV== -1){f("Cannot switch to tab "+a_tabName+
" because it doesn't exist");return false;}try{gaTrackPageview("canvas/"+a_tabName);}catch(err){f(err);}if(da>=0){var bW=gV[da];bW.className=kj;}da=eV;var pP=gV[da];pP.className=nu;bu.innerHTML="";
var ql=nm[da];ql(bu);cC();return false;};function mB(){if(da>=0){var bW=gV[da];bW.className=kj;}da= -1;cC();};function aL(){return bu;}};function nM(rA,gO){var pL=rA;var dN=gO;var H=null;var dZ=null;
this.qh=qh;this.cq=cq;if(pL!=undefined){qh(pL);}function qh(_a_parentDiv){pL=_a_parentDiv;f("nM: qh");H=document.createElement("div");H.setAttribute("style","overflow:auto;");pL.appendChild(H);dZ=
document.createElement("textarea");dZ.setAttribute("rows",4);dZ.setAttribute("cols",30);if(dN!=undefined&&dN!=null){dZ.appendChild(document.createTextNode(dN));}H.appendChild(dZ);};function cq(){
return dZ.value;}};function mQ(rA,gO,size,maxLength){var pL=rA;var dN=gO;var H=null;var co=null;var lm=size;var nC=maxLength;this.qh=qh;this.cq=cq;if(pL!=undefined){qh(pL);}function qh(_a_parentDiv){
pL=_a_parentDiv;f("mQ: qh");H=document.createElement("div");pL.appendChild(H);try{co=document.createElement("<input type='text' size='"+lm+"' maxlength='"+nC+"'/>");}catch(error){co=
document.createElement("input");co.type="text";co.size=lm;co.maxLength=maxLength;}if(dN!=undefined&&dN!=null){co.value=gO;}H.appendChild(co);};function cq(){return co.value;}};function jX(rA,iO,kb){
var pL=rA;var iE=iO;var jY=kb;var fL=null;var H=null;this.qh=qh;this.iC=iC;if(pL!=undefined){qh(pL);}function qh(_a_parentDiv){pL=_a_parentDiv;f("jX: qh");fL=document.createElement("div");
pL.appendChild(fL);fL.style.textAlign="center";H=document.createElement("div");fL.appendChild(H);H.style.backgroundColor="#f7f7f7";H.style.marginLeft="auto";H.style.marginRight="auto";H.style.width=
jY;H.style.padding="5px 5px 5px 10px";H.style.color="#333333";H.style.borderStyle="solid";H.style.borderWidth="1px";H.style.borderColor="#7f93bc";H.innerHTML=iE;};function iC(){return H;}};
function cN(rA,iO){var pL=rA;var iE=iO;var H=null;this.qh=qh;this.ad=ad;if(pL!=undefined){qh(pL);}function qh(_a_parentDiv){pL=_a_parentDiv;f("HTMLDiv: qh");H=document.createElement("div");
pL.appendChild(H);H.style.backgroundColor="#fff9d7";H.style.margin="5px 10px 10px 10px";H.style.padding="5px 5px 5px 10px";H.style.color="#333333";H.style.borderStyle="solid";H.style.borderWidth=
"1px";H.style.borderColor="#e2c822";H.innerHTML=iE;};function ad(){return H;}};function useGIF(){return(jQuery.browser.version=='6.0'&&jQuery.browser.msie);};ModalDialog.ERROR=0;ModalDialog.WARNING=1;
ModalDialog.INFO=2;ModalDialog.QUESTION=3;function ModalDialog(text,title,buttons_and_callbacks,dialogType){this.type=ModalDialog.ERROR;this.button_n_params=buttons_and_callbacks;this.title=null;
this.text=text;this.hederImage=null;this.iconImage=null;this.height=200;this.width=500;this.wrapper=null;this.moveOnResze=false;this.autoHide=true;if(dialogType!=null&&dialogType!=undefined){
this.type=dialogType;}if(title==null||title==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=title;}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.setIconImage=function(eG){this.iconImage=eG;};ModalDialog.prototype.moveOnResize=function(bool){var _self=this;
_self.moveOnResze=bool;if(_self.moveOnResze){function _private_ModalDialog_move_dialog(){var topPosition=(document.body.clientHeight-_self.height)/2;var leftPosition=(document.body.clientWidth-
_self.width)/2;$(_self.wrapper).css({top:topPosition+"px",left:leftPosition+"px"});};window.onresize=_private_ModalDialog_move_dialog;}else{var leftPosition=(document.body.clientWidth-_self.width)/2;
$(_self.wrapper).css({top:"100px",left:leftPosition+"px"});cC();}};ModalDialog.prototype.setDimensions=function(height,width){this.height=height;this.width=width;};ModalDialog.prototype.showDialog=
function(){var _self=this;var overlay=document.createElement("div");overlay.setAttribute("id","modal_overlay_id");var overlay_color="#f4f4f4";var overlay_height=2000;if(document.getElementById(
"mainFrame")!=null&&document.getElementById("mainFrame").clientHeight!=null){overlay_height=document.getElementById("mainFrame").clientHeight;}$(overlay).css({position:"absolute",left:"0px",top:"0px",
height:overlay_height+"px",width:"100%",zIndex:"10010",backgroundColor:overlay_color,opacity:"0.5",margin:"0px auto",textAlign:"center"});this.wrapper=document.createElement("div");var topPosition=(
document.body.clientHeight-_self.height)/2;var leftPosition=(document.body.clientWidth-_self.width)/2;$(this.wrapper).css({padding:"0px",margin:"auto",top:topPosition+"px",left:leftPosition+"px",
height:_self.height+"px",width:_self.width+"px",backgroundColor:"#fff",verticalAlign:"top",border:"5px solid #E5E5E5",zIndex:"10011",opacity:"1",position:"absolute"});this.wrapper.setAttribute("id",
"modal_dialog_id");document.body.appendChild(overlay);document.body.appendChild(this.wrapper);var table=document.createElement("table");$(table).css({width:"100%",height:"100%",border:
"2px solid #999",padding:"0px",margin:"0px",zIndex:"10012"});var tbody=document.createElement("tbody");table.appendChild(tbody);var top_tr=document.createElement("tr");var top_td=
document.createElement("td");top_tr.appendChild(top_td);tbody.appendChild(top_tr);$(top_td).css({background:"transparent url("+_self.headerImage+") repeat scroll left top",height:"14px"});
var content_tr=document.createElement("tr");var content_td=document.createElement("td");content_tr.appendChild(content_td);$(content_td).css({textAlign:"center"});$(content_td).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;">'+_self.title+'</td></tr><tr><td><div id="modal_content_div">'+_self.text+
'</div></td></tr></table>');tbody.appendChild(content_tr);var button_tr=makeElementClass("tr",null,"button_div");var button_td=document.createElement("td");button_tr.appendChild(button_td);
tbody.appendChild(button_tr);$(button_td).css({textAlign:"center"});for(var buttontext in _self.button_n_params){button_td.appendChild(_self.constructButton(buttontext,
_self.button_n_params[buttontext]));}_self.wrapper.appendChild(table);_self.moveOnResize(_self.moveOnResze);};ModalDialog.prototype.constructButton=function(label,callback){var _self=this;if(
callback==null){callback=_self.hideModaDialog;}var button=document.createElement("button");$(button).html(label);var fnc=function(){if(_self.autoHide)_self.hideModaDialog();if(callback){if(!
_self.autoHide){var l_return=callback();if(!l_return)_self.hideModaDialog();}else{callback();}}};$(button).click(fnc);$(button).css({marginRight:"10px"});return button;};
ModalDialog.prototype.setAutoHide=function(a_autoHide){this.autoHide=a_autoHide;};ModalDialog.prototype.ad=function(){return document.getElementById("modal_content_div");};
ModalDialog.prototype.hideModaDialog=function(){$("#modal_dialog_id").remove();$("#modal_overlay_id").remove();};function HelpfulInput(a_parent,a_helpMessage){var l_self=this;this.m_input=
makeElementClass("input",a_parent,"helpful_input");this.m_help=a_helpMessage;this.m_hasText=false;$(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).addClass('helpful_input_blank');}};
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;};function LimitedTextArea(rA,a_title,a_maxMessageLength){this.m_maxMessageLength=g(
a_maxMessageLength)?a_maxMessageLength:300;this.pL=rA;this.m_title=a_title;this.qh();};extendClass(LimitedTextArea,EventDispatcher);LimitedTextArea.prototype.qh=function(){this.l=$divcl(this.pL,
"limited_text_area");this.m_header=$divcl(this.l,"header");this.m_headerTitle=$divcl(this.m_header,"title");$(this.m_headerTitle).html(this.m_title);this.m_headerCount=$divcl(this.m_header,"count");$(
this.m_headerCount).html(this.m_maxMessageLength);$divcl(this.m_header,"clearall");this.m_textarea=$el("textarea",this.l);this.m_resetLink=$elcl("a",this.l,"standardLink");$divcl(this.l,"clearall");$(
this.m_resetLink).click(this.reset.bind(this));$(this.m_textarea).keyup(this.change.bind(this));this.change();};LimitedTextArea.prototype.setWidth=function(kb){$(this.m_header).css('width',kb);$(
this.m_textarea).css('width',kb);};LimitedTextArea.prototype.setHeight=function(iI){$(this.m_textarea).css('height',iI);};LimitedTextArea.prototype.cq=function(){return $(this.m_textarea).val();};
LimitedTextArea.prototype.setText=function(aK){$(this.m_textarea).val(aK);this.change();};LimitedTextArea.prototype.reset=function(){$(this.m_textarea).val("");this.change();};
LimitedTextArea.prototype.change=function(){var text=$(this.m_textarea).val();if(text.length>this.m_maxMessageLength){text=text.substring(0,this.m_maxMessageLength-1);$(this.m_headerCount).addClass(
'over_limit');$(this.m_textarea).val(text);}var charLeft=this.m_maxMessageLength-text.length;$(this.m_headerCount).html(charLeft+"");};function ModalPopup(aT,a_buttons_and_callbacks,a_buttonDiv){
this.bu=aT;this.m_button_n_params=a_buttons_and_callbacks;this.m_buttonDiv=a_buttonDiv;this.m_hasButtonDiv=g(this.m_buttonDiv);this.m_wrapper=null;this.m_moveOnResize=false;if(this.m_button_n_params==
undefined||this.m_button_n_params==null){this.m_button_n_params={"Close":null};}};ModalPopup.prototype.updatePosition=function(a_moveOnResize){var l_w=$(this.m_wrapper).width();var l_h=$(
this.m_wrapper).height();if(this.m_moveOnResize){var topPosition=(document.body.clientHeight-l_h)/2;var leftPosition=(document.body.clientWidth-l_w)/2;$(this.m_wrapper).css({top:topPosition+"px",left:
leftPosition+"px"});}else{var leftPosition=(document.body.clientWidth-l_w)/2;$(this.m_wrapper).css({top:"100px",left:leftPosition+"px"});cC();}};ModalPopup.prototype.setDimensions=function(kb,iI){$(
this.wrapper).css({width:kb,height:iI})};ModalPopup.prototype.show=function(){this.m_overlay=$divid(null,"modal_overlay");var overlay_height=2000;var mainFrame=$("#mainFrame");if(mainFrame.length>0){
overlay_height=mainFrame.height();}$(this.m_overlay).css({height:overlay_height+"px",opacity:0.5});this.m_wrapper=$divid(null,"modal_wrapper");this.m_wrapper.appendChild(this.bu);if(!
this.m_hasButtonDiv){this.m_buttonDiv=$divid(this.m_wrapper,"button");}for(var buttontext in this.m_button_n_params){this.constructButton(buttontext,this.m_button_n_params[buttontext])}
document.body.appendChild(this.m_overlay);document.body.appendChild(this.m_wrapper);this.updatePosition();$(this.m_wrapper).resize(this.updatePosition.bind(this));};
ModalPopup.prototype.constructButton=function(a_label,al){var l_self=this;var button=$el("button",this.m_buttonDiv);$(button).html(a_label).click(function(){l_self.hide();if(al){al();}})};
ModalPopup.prototype.hide=function(){$(this.m_wrapper).remove();$(this.m_overlay).remove();};function SelectionModel(){SelectionModel.baseConstructor.call(this);this.declareEvent("select")
.declareEvent("unselect");};extendClass(SelectionModel,EventDispatcher);SelectionModel.prototype.toggle=function(a_item){f('implement toggle');};SelectionModel.prototype.select=function(a_item){f(
'implement select');};SelectionModel.prototype.deselect=function(a_item){f('implement deselect');};SelectionModel.prototype.clear=function(){f('implement clear');};
SelectionModel.prototype.getSelected=function(){f('implement getSelected');};SelectionModel.prototype.isSelected=function(a_item){f('implement isSelected');};function SingleSelectionModel(){
SingleSelectionModel.baseConstructor.call(this);this.m_item=null;};extendClass(SingleSelectionModel,SelectionModel);SingleSelectionModel.prototype.toggle=function(a_item){return this.select(a_item);};
SingleSelectionModel.prototype.select=function(a_item){if(this.m_item==a_item){return;}if(this.m_item){this.trigger("unselect",this.m_item);}if(a_item!=this.m_item){this.m_item=a_item;this.trigger(
"select",this.m_item);}else{this.m_item=null;}};SingleSelectionModel.prototype.clear=function(){if(this.m_item){this.trigger("unselect",this.m_item);this.m_item=null;}};
SingleSelectionModel.prototype.deselect=function(a_item){if(this.m_item==a_item){this.clear();}};SingleSelectionModel.prototype.getSelected=function(){return g(this.m_item)?[this.m_item]:[];};
SingleSelectionModel.prototype.getSelectedItem=function(){return this.m_item;};SingleSelectionModel.prototype.isSelected=function(a_item){return a_item==this.m_item;};function MultiSelectionModel(){
MultiSelectionModel.baseConstructor.call(this);this.m_selected={};};extendClass(MultiSelectionModel,SelectionModel);MultiSelectionModel.prototype.toggle=function(a_item){var l_guid=$guid(a_item);if(
this.m_selected[l_guid]){delete this.m_selected[l_guid];this.trigger("unselect",a_item);}else{this.m_selected[l_guid]=a_item;this.trigger("select",a_item);}};MultiSelectionModel.prototype.select=
function(a_item){if(!this.isSelected(a_item)){this.toggle(a_item);}};MultiSelectionModel.prototype.deselect=function(a_item){if(this.isSelected(a_item)){this.toggle(a_item);}};
MultiSelectionModel.prototype.clear=function(){var l_selected=this.m_selected;this.m_selected={};for(var guid in l_selected){this.trigger("unselect",l_selected[guid]);}};
MultiSelectionModel.prototype.getSelected=function(){var l_result=[];for(var guid in this.m_selected){l_result.push(this.m_selected[guid]);}return l_result;};MultiSelectionModel.prototype.isSelected=
function(a_item){return this.m_selected[$guid(a_item)];};MultiSelectionModel.prototype.getCount=function(){var l_count=0;for(var guid in this.m_selected){l_count+=1;}return l_count;};
function ItemListDiv(rA,a_class,a_itemData){this.pL=rA;this.m_class=a_class;this.m_itemData=undefined;this.m_enableLoading=false;this.m_showLastPage=false;this.m_showPagination=true;this.m_filtered=
false;this.qh();this.setItemData(a_itemData);};ItemListDiv.prototype.setShowPagination=function(a_showPagination){if(this.m_showPagination!=a_showPagination){this.m_showPagination=a_showPagination;
this.updatePagination();}return this;};ItemListDiv.prototype.setWidth=function(kb){$(this.ag).width(kb);};ItemListDiv.prototype.setHeight=function(iI){$(this.ag).height(iI);};ItemListDiv.prototype.qh=
function(){this.l=$divcl(this.pL,this.m_class);$(this.l).css({position:"relative",left:"0px",top:"0px"});this.ag=$divcl(this.l,"item_list");$divcl(this.l,"clearall");this.m_paginationContainer=$divcl(
this.l,"item_pagination");this.m_loader=$divcl(this.l,"loading_overlay");$(this.m_loader).css('display','none');this.m_loader_background=$divcl(this.m_loader,"background");$(this.m_loader_background)
.css('opacity',0.1);this.m_loader_image=$divcl(this.m_loader,"icon");};ItemListDiv.prototype.setItemData=function(a_itemData){this.m_itemData=a_itemData;if(g(a_itemData)){a_itemData.bindCountCallback(
this.handlePageCount.bind(this));a_itemData.bindPageCallback(this.handleItems.bind(this));}else{f('ERROR! ItemListDiv.setItemData called with bad a_itemData')}};ItemListDiv.prototype.handlePageCount=
function(a_pageCount){this.m_pageCount=a_pageCount;this.updatePagination(this.m_itemData.getPage());};ItemListDiv.prototype.enableLoading=function(a_enable){this.m_enableLoading=a_enable;};
ItemListDiv.prototype.showLoading=function(){if(!this.m_enableLoading)return;$(this.m_loader).css('display','block');$(this.m_loader_background).fadeTo('fast',0.9);};ItemListDiv.prototype.hideLoading=
function(){if(!this.m_enableLoading)return;var l_self=this;$(this.m_loader_background).fadeTo(100,0.1).queue(function(){$(l_self.m_loader).css('display','none');$(this).dequeue();})};
ItemListDiv.prototype.switchToPage=function(a_page){this.showLoading();this.m_itemData.setPage(a_page);this.updatePagination(a_page);};ItemListDiv.prototype.updatePagination=function(a_page){$(
this.m_paginationContainer).html("");if(this.m_showPagination){this.m_paginationDiv=new mN(this.m_paginationContainer,this.switchToPage.bind(this),this.m_pageCount,a_page,5,this.m_showLastPage);
$divcl(this.m_paginationContainer,"clearall");}};ItemListDiv.prototype.handleItems=function(a_page,a_items,a_done){if(a_done){this.hideLoading();}else{this.showLoading();}this.m_items=a_items;
this.redraw(a_done);};ItemListDiv.prototype.redraw=function(a_done){var l_self=this;var l_items=[];this.clear();$.each(this.m_items,function(i,a_item){l_self.drawItem(a_item);});$divcl(this.ag,
"clearall");};ItemListDiv.prototype.clear=function(rA,a_item){$(this.ag).html("");};ItemListDiv.prototype.drawItem=function(rA,a_item){f('ItemListDiv.drawItem not implemented! doh!');};
ItemListDiv.prototype.getItems=function(){return this.m_items;};ItemListDiv.prototype.setIsFiltered=function(a_filtered){this.m_filtered=a_filtered;};ItemListDiv.prototype.hide=function(){$(this.l)
.css({"display":"none"});};ItemListDiv.prototype.show=function(){$(this.l).css({"display":"block"});};function SelectableItemListDiv(rA,a_class,a_itemData,a_selectionModel,a_emptyItemsDiv){
this.m_selection=a_selectionModel;this.m_emptyItemsDiv=a_emptyItemsDiv;this.m_itemDiv={};SelectableItemListDiv.baseConstructor.call(this,rA,a_class,a_itemData);this.m_selection.bind("select",
this.onSelect.bind(this)).bind("unselect",this.onUnselect.bind(this));};extendClass(SelectableItemListDiv,ItemListDiv);SelectableItemListDiv.prototype.redraw=function(a_done){var l_self=this;
var l_items=[];this.clear();this.m_itemDiv={};$.each(this.m_items,function(i,a_item){l_self.m_itemDiv[$guid(a_item)]=l_self.drawItem(a_item);});if(g(a_done)&&a_done&& !this.m_filtered&&$(this.m_items)
.length<=0&&g(this.m_emptyItemsDiv)){$(this.ag).html("");this.ag.appendChild(this.m_emptyItemsDiv);$(this.pL).find(".friend_filter").remove();}$divcl(this.ag,"clearall");};
SelectableItemListDiv.prototype.click=function(sz,a_item){this.m_itemDiv[$guid(a_item)]=sz;this.m_selection.toggle(a_item);};SelectableItemListDiv.prototype.onSelect=function(a_item){var l_itemDiv=
this.m_itemDiv[$guid(a_item)];$(l_itemDiv).addClass('selected');};SelectableItemListDiv.prototype.onUnselect=function(a_item){var l_guid=$guid(a_item);var l_itemDiv=this.m_itemDiv[l_guid];$(l_itemDiv)
.removeClass('selected');};SelectableItemListDiv.prototype.getItemDiv=function(a_item){return this.m_itemDiv[$guid(a_item)];};var NEWSFEED_CACHE=new pk();var NEWSFEED_FILTER="All";
var GIFT_RECEIVED_CACHE=new ArrayData();var GIFT_RECEIVED_EMPTY=true;function lp(bS,iS,iD,a_newsfeedId){var cQ=bS;var gv=iS;var gr=iD;var m_newsfeedId=a_newsfeedId;this.cR=cR;this.cW=cW;this.cY=cY;
this.kk=kk;this.getNewsfeedId=getNewsfeedId;function cR(){return cQ;};function cW(){return gv;};function cY(){return gr;};function getNewsfeedId(){return m_newsfeedId;};function kk(jS){cQ=K(jS,"type")
;gv=decodeURIComponent(K(jS,"message"));gv=replaceYouInNewsfeed(gv);gr=K(jS,"created_on_in_mill");m_newsfeedId=K(jS,"id");}};function pk(){var bj=undefined;var cx=new Array();this.iZ=iZ;this.jW=jW;
this.av=av;var fo=undefined;this.iv=iv;var gX=undefined;this.iz=iz;function iZ(fQ){bj=fQ;};function jW(od){cx.push(od);};function av(){f("invalidate newsfeed cache");bj=undefined;cx=new Array();};
function iv(al){if(g(bj)){al(bj);return;}fo=al;var l_typeFilter="";if(g(NEWSFEED_FILTER)){l_typeFilter="&type="+NEWSFEED_FILTER;}U(REQUEST_DESTINATION_URL+"/ffs/getnumnewsfeeds?epicenter_id="+
MAIN_DATA.A().B()+l_typeFilter,pb);};function pb(J){var F=bc(J);if(F==undefined){fo(undefined);return;}try{bj=F.getElementsByTagName("num")[0].firstChild.nodeValue;}catch(err){ac("num entries: "+err);
}if(as(fo)){var L=fo;fo=undefined;L(bj);}};function iz(ku,md,bz){if(cx.length>=bj||cx.length>=(ku+md-1)){bz(cx);return;}var eK=Math.min(cx.length,ku);var pO=(ku+md)-eK+10;gX=bz;var l_typeFilter="";if(
g(NEWSFEED_FILTER)){l_typeFilter="&type="+NEWSFEED_FILTER;}U(REQUEST_DESTINATION_URL+"/ffs/getnewsfeed?epicenter_id="+MAIN_DATA.A().B()+"&start="+eK+"&num="+pO+l_typeFilter,kL);};function kL(eQ){
var F=bc(eQ);if(F!=undefined){try{var bP=F.getElementsByTagName("newsfeed");if(g(bP)&&bP.length>0){for(var r=0;r<bP.length;r++){var bE=bP[r];var Q=bE.getElementsByTagName("type")
[0].firstChild.nodeValue;var hC=decodeURIComponent(bE.getElementsByTagName("message")[0].firstChild.nodeValue);var ie=bE.getElementsByTagName("created_on_in_mill")[0].firstChild.nodeValue;var aj=
bE.getElementsByTagName("id")[0].firstChild.nodeValue;hC=replaceYouInNewsfeed(hC);var im=new lp(Q,hC,ie,aj);cx.push(im);}}}catch(err){ac("kL "+err);}}if(as(gX)){var L=gX;gX=undefined;L(cx);}}};
function be(lU){var ap=undefined;var bx=undefined;var dO=undefined;var en=undefined;var eS=undefined;var dF=undefined;var jU=undefined;var jL=undefined;var gw=undefined;var kl=undefined;this.hh=hh;
this.bT=bT;this.fillFFSInfoFromUserNode=fillFFSInfoFromUserNode;this.B=B;this.getName=getName;this.D=D;this.cv=cv;this.eP=eP;this.kS=kS;this.lv=lv;this.dT=dT;this.lf=lf;this.gl=gl;this.fV=fV;this.dh=
dh;var aI=undefined;var eC=undefined;var sT=undefined;var sS=undefined;var fG=undefined;var du=undefined;var m_numThumbsup=undefined;var fu=undefined;var jr=undefined;var rX=undefined;var eI=
undefined;var m_fillGiftPointsCallback=undefined;var m_giftPoints=undefined;var iA=undefined;var m_nameIsImg=undefined;this.resetValuesToNAN=resetValuesToNAN;this.kQ=kQ;this.fillGiftPoints=
fillGiftPoints;this.ct=ct;this.gs=gs;this.jf=jf;this.ea=ea;this.getStatusMessageChanger=getStatusMessageChanger;this.getStatusMessageChangeDate=getStatusMessageChangeDate;this.bw=bw;this.setWorth=
setWorth;this.fZ=fZ;this.eg=eg;this.getNumThumbsup=getNumThumbsup;this.setNumThumbsup=setNumThumbsup;this.lA=lA;this.gb=gb;this.iY=iY;this.getEmail=getEmail;this.setEmail=setEmail;this.getGiftPoints=
getGiftPoints;this.setGiftPoints=setGiftPoints;this.iM=iM;if(g(lU)){hh(lU);}function hh(cb){ap=cb.getField(opensocial.Person.Field.ID);if(g(ap)){ap=parseInt((""+ap).split(':').pop());}bx=
cb.getDisplayName();decodeNameImage();dO=cb.getField(opensocial.Person.Field.THUMBNAIL_URL);en=cb.getField(opensocial.Person.Field.PROFILE_URL);try{eS=cb.getField(opensocial.Person.Field.AGE);dF=
cb.getField(opensocial.Person.Field.GENDER);jL=cb.getField("CITY");gw=cb.getField(opensocial.Person.Field.CURRENT_LOCATION).getField(opensocial.Address.Field.REGION);kl=cb.getField(
opensocial.Person.Field.CURRENT_LOCATION).getField(opensocial.Address.Field.POSTAL_CODE);;}catch(err){f("hh: "+err);}fG=Number.NaN;fu=Number.NaN;du=Number.NaN;m_giftPoints=Number.NaN;};
function resetValuesToNAN(){du=Number.NaN;fG=Number.NaN;fu=Number.NaN;};function decodeNameImage(){if(g(bx)&&bx.indexOf("&lt;img")==0&&(bx.indexOf("&gt;")==bx.length-4)){m_nameIsImg=true;bx=
decodeHtmlString(bx);}if(g(bx)&&bx.indexOf("&#60;img")==0&&(bx.indexOf("&#62;")==bx.length-5)){m_nameIsImg=true;bx=decodeHtmlString(bx);}};function bT(ae){fG=Number.NaN;fu=Number.NaN;du=Number.NaN;
m_giftPoints=Number.NaN;m_numThumbsup=Number.NaN;try{ap=K(ae,"user_id");}catch(err){f("bT user_id "+ae+" "+err);};try{bx=jo(ae,"display_name");}catch(err){f("bT name "+ae+" "+err+" "+ap);};
decodeNameImage();try{dO=K(ae,"thumbnail_url");}catch(err){f("bT thumbnail "+ae+" "+err+" "+ap);};try{en=K(ae,"profile_url");}catch(err){f("bT profile "+ae+" "+err+" "+ap);};try{eC=jo(ae,
"status_message");}catch(err){f("bT status "+ae+" "+err+" "+ap);};try{sT=jo(ae,"status_message_changer");}catch(err){f("createXMLUser status changer"+ae+" "+err+" "+ap);};try{sS=jo(ae,
"status_message_change_date");}catch(err){f("createXMLUser status change date"+ae+" "+err+" "+ap);};try{fG=parseInt(K(ae,"worth"));}catch(err){f("bT worth "+ae+" "+err+" "+ap);};try{m_numThumbsup=
parseInt(K(ae,"num_thumbs_up"));}catch(err){};try{fu=parseInt(K(ae,"purchase_price"));}catch(err){f("bT price "+ae+" "+err+" "+ap);};try{du=parseInt(K(ae,"cash"));}catch(err){f("bT cash "+ae+" "+err+
" "+ap);};try{jr=K(ae,"mood");}catch(err){};try{var ip=K(ae,"show_bulletin");if(g(ip)&&parseInt(ip)>0){iA=true;f("showing bulletins..."+ip);}}catch(err){ac("2 error in bT: "+ae+" "+err);}try{var ib=K(
ae,"status");if(g(ib)){if(ib=='ACTIVE')jU=true;if(ib=='REQ')jU=false;}}catch(err){ac("4 error in bT: "+ae+" "+err);};};function dh(){var k={};k.user_id=ap||gadgets.views.getParams().viewerid;if(g(dO))
k.thumbnail_url=dO;if(g(en))k.profile_url=en;if(g(bx))k.display_name=bo(bx);if(g(eS))k.age=eS;if(g(dF))k.gender=dF;if(g(jL))k.city=bo(jL);if(g(gw))k.region=bo(gw);if(g(kl))k.postalCode=kl;return k;};
function iM(kh,mS){ap=ap||gadgets.views.getParams().viewerid;if(g(ap)){var k=dh();k.include_counts="true";k.include_newsfeeds="true";k.include_top="true";k.include_pets="true";k.include_region="true";
k.include_invited="true";k.include_top_friends="true";k.include_email="true";k.include_gifts="true";if(g(mS)&&mS){k.sign_in="true";}U(REQUEST_DESTINATION_URL+"/ffs/getinfo",kh,k,true);}};
function fillFFSInfoFromUserNode(ae){try{eC=jo(ae,"status_message");}catch(err){};try{sT=jo(ae,"status_message_changer");}catch(err){};try{sS=jo(ae,"status_message_change_date");}catch(err){};try{fG=
parseInt(K(ae,"worth"));}catch(err){};try{fu=parseInt(K(ae,"purchase_price"));}catch(err){};try{du=parseInt(K(ae,"cash"));}catch(err){};try{jr=K(ae,"mood");}catch(err){};try{var ib=K(ae,"status");if(
g(ib)){if(ib=='ACTIVE')jU=true;if(ib=='REQ')jU=false;}}catch(err){ac("4 error in createXMLUser: "+ae+" "+err);};};function kQ(kh){if(eI!=undefined){ac(
"Another query is still in progress!! but continuing anyway.");}eI=kh;U(REQUEST_DESTINATION_URL+"/ffs/getuserinfo?user_id="+ap+"&action=query_user_info",ko);};function ko(aA){var F=bc(aA);if(F!=
undefined){try{var fz=F.getElementsByTagName("user")[0];try{eC=jo(fz,"status_message");try{sT=jo(fz,"status_message_changer");sS=jo(fz,"status_message_change_date");}catch(e){};fG=parseInt(K(fz,
"worth"));du=parseInt(K(fz,"cash"));fu=parseInt(K(fz,"purchase_price"));}catch(err){ac("error in ko: "+fz+" "+err);};var hR=F.getElementsByTagName("owner");if(g(hR)&&hR.length>0){aI=new be(undefined);
aI.bT(hR[0]);aI.fV();}}catch(err){ac("ko: "+err);}}fV();if(as(eI)){var L=eI;eI=undefined;L();}};function fillGiftPoints(kh){if(m_fillGiftPointsCallback!=undefined){ac(
"Another gift point query is still in progress!! but continuing anyway.");}m_fillGiftPointsCallback=kh;U(REQUEST_DESTINATION_URL+"/ffs/getusergiftpoints?user_id="+ap,onFillGiftPoints);};
function onFillGiftPoints(aA){var F=bc(aA);if(F!=undefined){try{m_giftPoints=parseInt(K(F,"gift_points"));}catch(err){ac("onFillGiftPoints: "+err);}}if(as(m_fillGiftPointsCallback)){var L=
m_fillGiftPointsCallback;m_fillGiftPointsCallback=undefined;L(m_giftPoints);}};function B(){return ap;};function ro(userId){ap=userId;};function lv(){return dF;};function lf(){return jU;};function kS(
){return eS;};function cv(){return dO;};function getName(name){bx=name;};function getName(){return bx;};function getNumThumbsup(){return m_numThumbsup;};function setNumThumbsup(a_numThumbsup){
m_numThumbsup=a_numThumbsup;};function D(){if(m_nameIsImg)return bx;return nX(bx,12);};function eP(){return en;};function ct(){return aI;};function gs(fd){aI=fd;};function gl(){return gw;};
function jf(qL){eC=qL;};function ea(){return eC;};function getStatusMessageChanger(){return sT;};function getStatusMessageChangeDate(){return sS;};function bw(){return fG;};function setWorth(sk){fG=
sk;};function dT(){return fu;};function fZ(cash){du=cash;};function eg(){return du;};function lA(){if(!g(iA)){return false;}return iA;};function gb(){return jr;};function iY(cc){jr=cc;};
function getGiftPoints(){return m_giftPoints;};function setGiftPoints(a_giftPoints){m_giftPoints=a_giftPoints;};function getEmail(){return rX;};function setEmail(rD){rX=rD;};function fV(){f(
"userId: "+ap);f("name: "+bx);f("gender: "+dF);f("status message: "+eC);};var lD=false;var lC=false;this.getDisplayName=getDisplayName;this.getField=getField;this.getId=getId;this.isOwner=isOwner;
this.jc=jc;this.isViewer=isViewer;this.je=je;function getDisplayName(){return bx;};function getField(iK){switch(iK){case opensocial.Person.Field.ID:return ap;case opensocial.Person.Field.NAME:
return bx;case opensocial.Person.Field.AGE:return eS;case opensocial.Person.Field.GENDER:return dF;case opensocial.Person.Field.THUMBNAIL_URL:return dO;case opensocial.Person.Field.PROFILE_URL:
return en;}return undefined;};function getId(){return ap;};function isOwner(){return lD;};function jc(qu){lD=qu;};function isViewer(){return lC;};function je(qx){lC=qx;}};
be.prototype.fillUserStateFromXML=function(a_xmlState){this.m_hasApp=g(K(a_xmlState,"has_app"));this.m_alreadyInvited=g(K(a_xmlState,"already_invited"));this.m_inviteBlocked=g(K(a_xmlState,
"invite_blocked"));this.m_hasInviteState=true;};be.prototype.getHasApp=function(){return this.m_hasApp};be.prototype.getHasAppFromCache=function(){if(!g(OYF.VIEWER_FRIEND_APPUSERS_CACHE))
return this.m_hasApp;this.m_hasApp=OYF.VIEWER_FRIEND_APPUSERS_CACHE.hasUserId(this.B());return this.m_hasApp;};be.prototype.getAlreadyInvited=function(){return this.m_alreadyInvited;};
be.prototype.setAlreadyInvited=function(a_alreadyInvited){this.m_alreadyInvited=a_alreadyInvited;};be.prototype.getInviteBlocked=function(){return this.m_inviteBlocked;};be.prototype.setInviteBlocked=
function(){this.m_inviteBlocked=true;};be.prototype.hasInviteState=function(){return this.m_hasInviteState;};v.GLOBAL=1;v.MY_TOP_FRIENDS=2;v.MY_FRIENDS=3;v.MY_PETS=4;v.MY_REGION=5;v.MY_BARGAINS=6;
v.getUserTypeName=function(et){switch(et){case v.GLOBAL:return "Everyone";case v.MY_TOP_FRIENDS:return "Most Valuable Friends";case v.MY_FRIENDS:return "All Friends";case v.MY_PETS:return "My Pets";
case v.MY_REGION:if(!g(MAIN_DATA.A().gl())){return "My Region (none)";}else{return "My Region ("+MAIN_DATA.A().gl()+")";}case v.MY_BARGAINS:return "My Bargains";default:ac(
"Unrecognized category code "+et);return undefined;}};function v(fd,bS){var cQ=bS;var aI=fd;var aD=undefined;var O=new Array();var bN=new Object();this.jg=jg;this.ka=ka;this.removeUser=removeUser;
this.av=av;var bY=undefined;this.aB=aB;this.jR=jR;var bm=undefined;this.aX=aX;this.getCurrentUsers=getCurrentUsers;this.cF=cF;this.bM=bM;function jg(pW){aD=pW;};function ka(V){O.push(V);bN[V.B()]=V;};
function av(){f("invalidate user cache");aD=undefined;O=new Array();bN=new Object();};function aB(bz){if(aD!=undefined){bz(aD);return;}bY=bz;U(REQUEST_DESTINATION_URL+"/ffs/getnumuserinfo?user_id="+
aI.B()+kR(cQ),jR);};function jR(eQ){var F=bc(eQ);if(F!=undefined){try{aD=K(F,"num");}catch(err){ac(err);}}if(as(bY)){var L=bY;bY=undefined;L(aD);}};function getCurrentUsers(){return O;};function aX(
ba,db,dy){if(O.length>=aD||O.length>=(ba+db-1)){dy(O);return;}var eK=Math.min(O.length,ba);var pB=(ba+db)-eK;bm=dy;U(REQUEST_DESTINATION_URL+"/ffs/getuserinfo?start="+eK+"&num="+pB+"&user_id="+aI.B()+
kR(cQ),cF);};function cF(requestData){var F=bc(requestData);if(F!=undefined){var bB=F.getElementsByTagName("user");if(g(bB)&&bB.length>0){for(var r=0;r<bB.length;r++){var fS=new be(undefined);fS.bT(
bB[r]);O.push(fS);bN[fS.B()]=fS;}}}if(as(bm)){var L=bm;bm=undefined;L(O);}};function bM(oi){return bN[oi];};function kR(et){switch(et){case v.GLOBAL:return "&action=query_top";case v.MY_TOP_FRIENDS:
return "&action=query_top_friends";case v.MY_PETS:return "&action=query_pets";case v.MY_REGION:return "&action=query_region";default:ac("Unrecognized category code "+et);return undefined;}};
function removeUser(V){bN[V.getId()]=undefined;for(var i=0;i<O.length;i++){if(O[i].getId()==V.getId()){O.splice(i,1);aD--;}}}};function fx(fd){var aI=fd;var aD=undefined;var O=undefined;var bN=
new Object();this.av=av;var bY=undefined;this.aB=aB;var bm=undefined;this.aX=aX;this.bM=bM;function av(){f("invalidate fx cache");aD=undefined;O=new Array();bN=new Object();};function aB(bz){f(
"fx: aB");if(g(aD)){bz(aD);return;}bY=bz;var ak=opensocial.newDataRequest();ak.add(ak.newFetchPeopleRequest(idSpecUtil.viewerFriends(),{}),'numFriends');ak.send(kH);};function kH(J){f("fx: kH");try{
aD=parseInt(J.get('numFriends').getData().getTotalSize())}catch(err){aD=undefined;f(err);}O=new Array();for(var r=0;r<aD;r++){O.push(undefined);}if(as(bY)){var L=bY;bY=undefined;L(aD);}};function aX(
ba,db,dy){f("fx: aX start "+ba+" num "+db);if(db%20!=0){ac("Can only handle indices in multiples of 20, since myspace pages friends");}if(!g(aD)){aB(function(){aX(ba,db,dy);});return;}var he=Math.min(
ba+db,aD);f("he: "+he);var eW=true;if(O.length>=he){for(var r=ba;eW&&r<he;r++){eW=g(O[r]);}}f("eW: "+eW);if(eW){dy(O);}else{bm=dy;lx(ba);}};function lx(ba){f("lx: "+ba);var ao={};
ao[opensocial.DataRequest.PeopleRequestFields.FIRST]=ba+1;ao[opensocial.DataRequest.PeopleRequestFields.MAX]=20;var ak=opensocial.newDataRequest();ak.add(ak.newFetchPeopleRequest(
idSpecUtil.viewerFriends(),ao),'viewerFriends');ak.send(function(bt){gZ(ba,bt);});};function gZ(ma,bt){f("gZ: "+ma);var cu=false;var lZ=ma;var fH="";try{var fP=bt.get('viewerFriends').getData();if(g(
fP)){cu=true;fP.each(function(eO){var cK=new be(eO);if(!g(bN[cK.B()])){fH+=cK.B()+",";}O[lZ]=cK;bN[cK.B()]=cK;lZ+=1;});}}catch(err){cu=false;f("gZ "+err);}f("gZ: success="+cu+"  queryIdString="+fH);
if(!cu){f("Getting OS Users failed, should I retry?");}else{if(g(fH)&&fH.length>0){var k={};k.viewer_id=MAIN_DATA.A().B();k.query_ids=fH;U(REQUEST_DESTINATION_URL+"/ffs/getappusers",jQ,k,true);return;
}}var L=bm;bm=undefined;L(O);};function jQ(eQ){f("jQ");var F=bc(eQ);if(F!=undefined){var de=F.getElementsByTagName("user");if(g(de)&&de.length>0){for(var r=0;r<de.length;r++){try{var qp=K(de[r],
"user_id");var ab=bN[qp];if(g(ab)){ab.fillFFSInfoFromUserNode(de[r]);}}catch(err){f("jQ: "+err);}}}}if(as(bm)){var L=bm;bm=undefined;L(O);}};function bM(id){return bN[id];}};
CachedBargainList.MAX_USERS=120;CachedBargainList.MAX_PRICE=1250;function CachedBargainList(){var rM=undefined;var rP=new Array();var rV={};this.av=av;var bY=undefined;this.aB=aB;var bm=undefined;
this.aX=aX;this.bM=bM;if(!g(OYF.VIEWER_FRIEND_CACHE)){OYF.VIEWER_FRIEND_CACHE=new jz();}function av(){f("invalidate user cache");rM=undefined;rP=new Array();rV={};};function aB(bz){if(rM!=undefined){
bz(rM);return;}bY=bz;OYF.VIEWER_FRIEND_CACHE.fh(CachedBargainList.MAX_USERS,onLoadCachedFriends)};function aX(ba,db,dy){var sb=OYF.VIEWER_FRIEND_CACHE.getNumCachedUsers();if((g(rM)&&sb>=rM)||sb>=
Math.min(CachedBargainList.MAX_USERS,ba+db-1)){dy(rP);return;}bm=dy;OYF.VIEWER_FRIEND_CACHE.fh(CachedBargainList.MAX_USERS,onLoadCachedFriends)};function onLoadCachedFriends(lQ){var sa=new Array();
for(var r=0;r<lQ.length;r++){sa.push(lQ[r].B());}var k={};k.viewer_id=MAIN_DATA.A().B();k.max_purchase_price=CachedBargainList.MAX_PRICE;k.query_ids=sa.join(",");U(REQUEST_DESTINATION_URL+
"/ffs/getappusers",onGetBargains,k,true);};function onGetBargains(rH){var F=bc(rH);if(F!=undefined){var de=F.getElementsByTagName("user");if(g(de)&&de.length>0){for(var r=0;r<de.length;r++){try{
var qp=K(de[r],"user_id");var ab=OYF.VIEWER_FRIEND_CACHE.bM(qp);if(g(ab)){ab.fillFFSInfoFromUserNode(de[r]);rP.push(ab);rV[qp]=ab;}}catch(err){f("onLoadAppFriends: "+err);}}}}rM=rP.length;if(as(bY)){
var L=bY;bY=undefined;L(rM);}if(as(bm)){var L=bm;bm=undefined;L(rP);}};function bM(oi){return rV[oi];}};function jz(sG){var fW=g(sG)?sG:{};var bR=undefined;var O=new Array();var bN={};
this.getNumCachedUsers=getNumCachedUsers;this.ar=ar;this.bM=bM;this.hasUserId=hasUserId;var cX=undefined;var eo=undefined;var m_partialUserCallback=undefined;this.fh=fh;fh(1000,function(){});
function getNumCachedUsers(){return O.length;};function ar(){return O;};function bM(oi){return bN[oi];};function hasUserId(oi){return g(bN[oi]);};function fh(qd,al,a_partialCallback){f("jz fh");if(
O.length>=qd||(g(bR)&&O.length>=bR)){al(O);return;}cX=qd;eo=al;m_partialUserCallback=a_partialCallback;oU(O.length);};function oU(qV){if(O.length>=cX){f("OnGetSomeUsers finished");var L=eo;eo=
undefined;cX=undefined;L(O);}else{kq();}};function kq(){f("jz: kq");var ao={};for(var i in fW)ao[i]=fW[i];ao[opensocial.DataRequest.PeopleRequestFields.FIRST]=O.length+1;
ao[opensocial.DataRequest.PeopleRequestFields.MAX]=100;var ak=opensocial.newDataRequest();ak.add(ak.newFetchPeopleRequest(idSpecUtil.viewerFriends(),ao),'viewerFriends');ak.send(mI);};function mI(bt){
if(!g(bR)){try{bR=parseInt(bt.get('viewerFriends').getData().getTotalSize());}catch(err){f("mI "+err);}}var cu=false;try{var nD=bt.get('viewerFriends').getData();nD.each(function(eO){cu=true;var ab=
new be(eO);O.push(ab);bN[ab.B()]=ab;});}catch(err){cu=false;f(err);}cX=Math.min(cX,bR);f("Current num cached: "+O.length+" upperLimit: "+cX);if(m_partialUserCallback)m_partialUserCallback(O);if(cu&&
O.length<cX){setTimeout(kq,100);}else{if(as(eo)){var L=eo;eo=undefined;L(O);}}}};function getAppUsersCache(){var ao={};ao[opensocial.DataRequest.PeopleRequestFields.FILTER]=
opensocial.DataRequest.FilterType.HAS_APP;return new jz(ao);};gd.FETCH_CHUNK_SIZE=40;function gd(){var km=undefined;var iJ=undefined;var rh=new Array();var lY=0;var lO=new Array();this.kN=kN;
function kN(oc,bz){km=oc;iJ=bz;mK();};function mK(){var ao={};ao[opensocial.DataRequest.PeopleRequestFields.FIRST]=lY;ao[opensocial.DataRequest.PeopleRequestFields.MAX]=gd.FETCH_CHUNK_SIZE;lY+=
gd.FETCH_CHUNK_SIZE;var ak=opensocial.newDataRequest();ak.add(ak.newFetchPeopleRequest(idSpecUtil.viewerFriends(),ao),'viewerFriends');ak.send(oY);};function oY(bt){var hL=0;try{var fP=bt.get(
'viewerFriends').getData();fP.each(function(eO){hL+=1;var ab=new be(eO);lO.push(ab);});}catch(err){f(err);}f("num fetched: "+hL);km(lO);if(hL>=gd.FETCH_CHUNK_SIZE){mK();}else{var L=iJ;iJ=undefined;km=
undefined;if(as(L)){L();}}}};function ViewerFriendsCacheData(a_friendCache,a_count){ViewerFriendsCacheData.baseConstructor.call(this,[]);this.m_done=false;a_friendCache.fh(a_count,
this.doneHandler.bind(this),this.partialHandler.bind(this));this.m_lastLength=0;};extendClass(ViewerFriendsCacheData,ArrayData);ViewerFriendsCacheData.prototype.doneHandler=function(a_array){
this.m_done=true;this.sendTriggers(a_array);};ViewerFriendsCacheData.prototype.partialHandler=function(a_array){this.sendTriggers(a_array);};ViewerFriendsCacheData.prototype.sendTriggers=function(
a_array){this.m_array=g(a_array)?a_array:[];this.triggerCount();this.triggerUpdate(this.m_lastLength,a_array.length);this.m_lastLength=a_array.length;};ViewerFriendsCacheData.prototype.getCurCount=
function(){return this.m_array.length;};ViewerFriendsCacheData.prototype.countDone=ViewerFriendsCacheData.prototype.dataDone=function(){return this.m_done;};
ViewerFriendsCacheData.prototype.getCurData=function(a_start,a_end){return this.m_array.slice(a_start,a_end)};function oL(oh,oj){window.MAIN_DATA=this;var mn=oh;var gT=oj;var aP=undefined;var aI=
undefined;var jG=undefined;var jM=undefined;var jZ=undefined;var jE=undefined;var rW=undefined;var gL=undefined;var ht=new Object();var m_assets=undefined;this.kx=kx;this.cF=cF;this.lj=lj;this.ct=ct;
this.A=A;this.ar=ar;this.ji=ji;this.dx=dx;this.getAssets=getAssets;var gf=undefined;var kg=undefined;var ke=undefined;this.er=er;this.fg=fg;this.eZ=eZ;kx();function kx(){f("loadUsers");var ak=
opensocial.newDataRequest();f("creating Param");var ao={};ao[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];ak.add(ak.newFetchPersonRequest(
opensocial.IdSpec.PersonId.OWNER,ao),'owner');ak.add(ak.newFetchPersonRequest(opensocial.IdSpec.PersonId.VIEWER,ao),'viewer');ak.send(cF);};function cF(bt){f("load user called");try{var pD=bt.get(
'owner').getData();aI=new be(pD);aI.jc(true);}catch(err){f(err);aI=null;}try{var nA=bt.get('viewer').getData();aP=new be(nA);aP.je(true);aP.resetValuesToNAN();f("I can has output?");aP.iM(nQ,true);}
catch(err){f(err);f("Do this thing here before the other thing");aP.iM(nQ,true);aP=null;mn();}f("Got to this place right here.");};function nQ(J){if(oH(J).indexOf("opted out of playing")>0){
var optouttext="You have opted out of playing Own Your Friends.<p>";optouttext+="To remove this application, go to the<br>\n<strong>";optouttext+=
"<a href='http://www.myspace.com/own_your_friends' target='_top'>Own Your Friends Profile</a></strong><br>";optouttext+=" page and click on the big orange \"Remove this App\" button.<p>";optouttext+=
"Alternately, you may reactivate your account and play Own Your Friends again using the button below.<p>";document.getElementById("mainFrame").innerHTML=optouttext;var button=document.createElement(
"button");button.innerHTML="Reactivate my profile in OYF";button.onclick=doOptBackIn;document.getElementById("mainFrame").appendChild(button);return;}else if(oH(J).indexOf("been banned from playing")>
0){var optouttext="You have been banned from playing Own Your Friends for violating Playdom's Terms of Service.<p>";optouttext+="If you feel this ban is in error, you may file a complaint ";
optouttext+="<a href='http://playdom.zendesk.com/forums/96340-playdom-policies/entries' target='_top'>here</a>.<p>";document.getElementById("mainFrame").innerHTML=optouttext;return;}jG=new v(aP,
v.MY_PETS);jM=new v(aP,v.MY_TOP_FRIENDS);jZ=new v(aP,v.GLOBAL);jE=new v(aP,v.MY_REGION);rW=new CachedBargainList();gL=new fx(aP);var qO=bc(J);pg(qO);};function doOptBackIn(){U(REQUEST_DESTINATION_URL+
"/ffs/optbackin?user_id="+MAIN_DATA.A().B(),onOptBackInLoad);};function onOptBackInLoad(eQ){var me=oH(eQ);if(me!=undefined){try{document.getElementById("mainFrame").innerHTML=me;}catch(err){ac(
"onPrivacyBlockLoad "+err);}}};function pg(bh){var hx=bp(bh,"viewer");if(g(hx)){var ms=bp(hx,"user");if(g(ms)){aP.bT(ms);}var mi=bp(hx,"owner");if(g(mi)){var cy=new be(undefined);cy.bT(mi);aP.gs(cy);}
}var l_isActivitySent=K(bh,"is_activity_sent");l_isActivitySent=(l_isActivitySent=="true");OYF.ACTIVITY_SENT=l_isActivitySent;try{var l_assets=K(bh,"assets");if(g(l_assets)){m_assets=l_assets;}}catch(
sA){};try{var st=jo(bh,"announce_mesg");if(g(st)){var sp=decodeURIComponent(st);sp=sp.replace(/\+/g," ");qX(sp);}}catch(sA){};try{var rZ=jo(bh,"email");if(g(rZ)){aP.setEmail(rZ);}}catch(err){};try{
var l_invitedUser=bp(bh,"invited");OYF.invitableId=jo(l_invitedUser,"id");OYF.invitableName=jo(l_invitedUser,"name");OYF.invitableThumb=jo(l_invitedUser,"thumb");OYF.invitableCost=jo(l_invitedUser,
"cost");var mv=K(bh,"invited");if(g(mv)){var jT=mv.split(",");f("gotten already invited: "+jT.length);for(var hP=0;hP<jT.length;hP++){var pp=jT[hP];ht[pp]=1;}}}catch(err){}var fF= -1;try{fF=parseInt(
K(bh,"num_newsfeeds"));}catch(err){fF= -1;}if(fF>=0){NEWSFEED_CACHE.iZ(fF);}var bE=bp(bh,"feeds");if(fF>0&&g(bE)){var nf=bE.getElementsByTagName("newsfeed");for(var is=0;is<nf.length;is++){var nb=
new lp(undefined,undefined,undefined);nb.kk(nf[is]);NEWSFEED_CACHE.jW(nb);}}gU(bh,jG,"num_pets","pets");gU(bh,jZ,"num_top","top");gU(bh,jM,"num_top_friends","top_friends");gU(bh,jE,"num_region",
"region");var l_giftsArray=giftsFromXML(bh,"gifts gift");GIFT_RECEIVED_CACHE.setArray(l_giftsArray);GIFT_RECEIVED_EMPTY=l_giftsArray.length==0;var hf=bp(bh,"trigger");if(g(hf)){try{gf=parseFloat(K(hf,
"pb"));kg=K(hf,"sb");ke=K(hf,"tt");}catch(err){f(err);}}mn();if(as(gT)){gT();}};function gU(bh,lV,qM,qb){var fJ= -1;try{fJ=parseInt(K(bh,qM));}catch(err){fJ= -1;}if(fJ>0){lV.jg(fJ);}var kV=bp(bh,qb);
if(fJ>0&&g(kV)){var de=kV.getElementsByTagName("user");for(var r=0;r<de.length;r++){var ab=new be(undefined);ab.bT(de[r]);lV.ka(ab);}}};function ct(){return aI;};function A(){return aP;};function lj()
{return(aI!=undefined||aP!=undefined);};function ar(bS){switch(bS){case v.MY_PETS:return jG;case v.MY_TOP_FRIENDS:return jM;case v.MY_FRIENDS:return gL;case v.GLOBAL:return jZ;case v.MY_REGION:
return jE;case v.MY_BARGAINS:return rW;}return undefined;};function getAssets(){return m_assets;};function ji(bg){ht[bg]=bg;};function dx(bg){return g(ht[bg]);};function er(){if(g(gf)&&g(kg)&&g(ke)){
var kF=Math.random();f(kF+" "+gf);if(kF<gf){return true;}}return false;};function fg(){return decodeURIComponent(kg);};function eZ(){return decodeURIComponent(ke);}};function pf(bS,iS,iD){var cQ=bS;
var gv=iS;var gr=iD;this.cR=cR;this.cW=cW;this.cY=cY;function cR(){return cQ;};function cW(){return gv;};function cY(){return gr;}};function lh(rA,ok,iI,kb){var pL=rA;var iQ=ok;var iy=iI;var jY=kb;
var ah=null;this.qh=qh;if(pL!=undefined&&pL!=null){qh(pL);}function qh(_a_parentDiv){pL=_a_parentDiv;f("lh: qh");ah=document.createElement("div");pL.appendChild(ah);ah.style.height=iy;
ah.style.overflow="auto";if(iQ.length<=0){ah.innerHTML="None...";return;}ah.innerHTML="";var bk=document.createElement("table");ah.appendChild(bk);bk.style.width=jY;bk.style.cellSpacing="0px";
bk.style.borderCollapse="collapse";var fb=document.createElement("tbody");bk.appendChild(fb);for(var cV=0;cV<iQ.length;cV++){var fa=jB(iQ[cV]);if(fa!=undefined){fb.appendChild(fa);}}};function jB(dg){
var Q=dg.cR();var P=dg.cW();var hn="white";var R="<img style='margin:0px 5px 0px 0px; width:16px; height:16px; float: right;' ";if(Q=='EARN'){R+="src='"+IMAGE_SOURCE_URL+"/favicons/oyf_money.gif'/> ";
}else if(Q=='STOLEN'){R+="src='"+IMAGE_SOURCE_URL+"/favicons/oyf_stolen.gif'/> ";}else if(Q=='PURCHASE'||Q=='BOUGHT'){R+="src='"+IMAGE_SOURCE_URL+"/favicons/oyf_purchase.gif'/> ";}else if(Q=='POKE'){
R+="src='"+IMAGE_SOURCE_URL+"/favicons/oyf_poke.gif'/> ";}else if(Q=='STATUS'){R+="src='"+IMAGE_SOURCE_URL+"/favicons/oyf_status.gif'/> ";hn="#f0f0f0";}else if(Q=='COMMENT'){var sP=P.indexOf("<img");
var sN=P.indexOf(">",sP)+1;R=P.slice(sP,sN);P=P.slice(sN);hn="#f0f0f0";}else if(Q=='SENT'){R+="src='"+IMAGE_SOURCE_URL+"/favicons/status.png'/> ";hn="#f0f0f0";}else if(Q=='HGIFT_P'){R+="src='"+
IMAGE_SOURCE_URL+"/favicons/oyf_gift.gif'/> ";}else if(Q=='HGIFT_R'){R+="src='"+IMAGE_SOURCE_URL+"/favicons/oyf_gift.gif'/> ";}else if(Q=='HGIFT_S'){R+="src='"+IMAGE_SOURCE_URL+
"/favicons/oyf_gift.gif'/> ";}else if(Q=='REMOVE_PET'){R+="src='"+IMAGE_SOURCE_URL+"/favicons/oyf_delete.png'/> ";}else if(Q=='GIFT_ITEM_S'||Q=='GIFT_ITEM_R'||Q=='GIFT_ITEM_D'||Q=='GIFT_ITEM_ANON_R'||
Q=='GIFT_ITEM_S_MSG'||Q=='GIFT_ITEM_R_MSG'||Q=='GIFT_ITEM_ANON_R_MSG'){var sP=P.indexOf("ItemId");var sN=P.indexOf("dImetI",sP);var l_itemId=P.slice(sP+6,sN);P=P.slice(sN+6);R="<img src='"+
Gift.getImageURLFromItemId(l_itemId,true)+"' class='gift_in_feed'/> ";hn="#f0f0f0";}else if(Q=='HAPPY'){R+="src='"+IMAGE_SOURCE_URL+"/favicons/moods/happy.gif'/> ";}else if(Q=='CONTENT'){R+="src='"+
IMAGE_SOURCE_URL+"/favicons/moods/content.gif'/> ";}else if(Q=='GLOOMY'){R+="src='"+IMAGE_SOURCE_URL+"/favicons/moods/gloomy.gif'/> ";}else if(Q=='DISCOUNT'||Q=='SALE'){R+="src='"+IMAGE_SOURCE_URL+
"/favicons/oyf_discount.gif'/> ";}else if(Q=='BLOCKED'){R+="src='"+IMAGE_SOURCE_URL+"/favicons/block.gif'/> ";}else{R+="src='"+IMAGE_SOURCE_URL+"/favicons/error.png'/> ";}var o=document.createElement(
"tr");var cJ=document.createElement("td");o.appendChild(cJ);cJ.style.margin="0px";cJ.style.paddingTop="3px";cJ.style.paddingBottom="3px";cJ.style.width="15px";o.style.background=hn;az(cJ);
cJ.innerHTML=R;var fy="<span style='color:#333333; font-size:11px;'>"+P+"</span>";cJ=document.createElement("td");o.appendChild(cJ);cJ.style.margin="0px";cJ.style.paddingTop="3px";
cJ.style.paddingBottom="3px";az(cJ);cJ.innerHTML=fy;cJ=document.createElement("td");o.appendChild(cJ);cJ.style.textAlign="right";cJ.style.verticalAlign="bottom";cJ.style.color="gray";
cJ.style.fontSize=10;az(cJ);cJ.innerHTML=lB(dg.cY());return o;}};function oK(rA,qe,pA,qN){var pL=rA;var gB=qe;var ns=pA;var nB=qN;var l=null;var rp=undefined;this.qh=qh;this.kw=kw;if(pL!=undefined){
qh(pL);}function qh(_a_parentDiv){pL=_a_parentDiv;f("CondensedPetsDiv: qh");l=document.createElement("div");pL.appendChild(l);if(!g(gB)||gB.length==0){l.innerHTML="None...";return;}l.innerHTML="";
var hq=document.createElement("table");l.appendChild(hq);hq.style.borderSpacing="2px";var hZ=document.createElement("tbody");hq.appendChild(hZ);var aW=document.createElement("tr");hZ.appendChild(aW);
var cD=0;var mC=0;for(var r=0;r<gB.length;r++){if(cD>=nB){aW=document.createElement("tr");hZ.appendChild(aW);cD=0;mC+=1;}var ab=gB[r];aW.appendChild(kw(ab));cD+=1;}if(mC>=2){l.style.height=ns;
l.style.overflow="auto";}};function kw(V){var cJ=document.createElement("td");cJ.className="pickFriend";cJ.style.textAlign="CENTER";cJ.style.width="88px";cJ.style.maxWidth="88px";var gH=new eb(cJ,0,
V.cv(),"80px","80px","white",V.lf()?null:NON_APP_USER,l);gH.ad().style.cursor="pointer";aE(gH.ad(),"click",OYF_showUserDetails,V.B());var M=document.createElement("div");cJ.appendChild(M);M.innerHTML=
"<span style='font-size:12px; font-weight:bold;'>"+V.D()+"</span>";M.style.cursor="pointer";aE(M,"click",OYF_showUserDetails,V.B());var fm=document.createElement("div");cJ.appendChild(fm);
fm.innerHTML="<span style='color:#09460F; font-size:12px; font-weight:bold;'> $"+addCommas(V.bw())+"</span>";if(g(V.ea())){var cs=document.createElement("div");cJ.appendChild(cs);var ef=V.ea();if(
ef.length>100)ef=ef.substring(0,98)+"...";ef=jd(ef,15,/\S{15}/);cs.innerHTML="<span style='color:red; font-size:10px; width: 80px; max-width: 80px; overflow: hidden;'> \""+ef+"\"</span>";}return cJ;}}
;function lo(rA,bg,qC,qr,sy){var pL=rA;var ap=bg;var np=qC;var gM=qr;var sD=sy;var m=undefined;var l=undefined;var m_newsfeed_filter="All";var kA;this.kA=kA;if(g(rA)){qh(rA);}function qh(_a_parentDiv)
{pL=_a_parentDiv;l=document.createElement("div");pL.appendChild(l);l.innerHTML="Loading...";U(REQUEST_DESTINATION_URL+"/ffs/getotheruser?user_id="+ap+"&type="+m_newsfeed_filter,kA);};function kA(ot){
var F=bc(ot);var cy=undefined;var iq=new Array();var hS=new Array();var l_giftArray=new Array();if(F!=undefined){try{var ti=bp(F,"error");if(g(ti)){l.innerHTML=
"The details of this user can't be displayed for the following reason:<br>\n"+ti.firstChild.nodeValue;showBlockUserLink();return;}}catch(ee){}try{var il=bp(F,"ffs_user");if(g(il)){var qt=bp(il,"user")
;m=new be(undefined);m.bT(qt);var kZ=bp(il,"owner");if(g(kZ)){var cy=new be(undefined);cy.bT(kZ);m.gs(cy);}}var bP=F.getElementsByTagName("newsfeed");if(g(bP)&&bP.length>0){for(var r=0;r<bP.length;r++
){var bE=bP[r];var Q=bE.getElementsByTagName("type")[0].firstChild.nodeValue;var hC=decodeURIComponent(bE.getElementsByTagName("message")[0].firstChild.nodeValue);var ie=bE.getElementsByTagName(
"created_on_in_mill")[0].firstChild.nodeValue;hC=replaceYouInNewsfeed(hC);var im=new pf(Q,hC,ie);iq.push(im);}}var hO=F.getElementsByTagName("pets");if(g(hO)&&hO.length>0){var qD=hO[0];var de=
qD.getElementsByTagName("user");if(g(de)&&de.length>0){for(var hj=0;hj<de.length;hj++){var kI=new be();kI.bT(de[hj]);hS.push(kI);}}}l_giftArray=giftsFromXML(F,"gifts gift");}catch(err){ac("kA "+err);}
}else{l.innerHTML="No response from server. Please try again in a few minutes!";return;}l.innerHTML="";var so;if(sD){var dY=document.createElement("table");l.appendChild(dY);var kJ=
document.createElement("tbody");dY.appendChild(kJ);var hJ=document.createElement("tr");kJ.appendChild(hJ);var su;var gu=document.createElement("td");hJ.appendChild(gu);var eR=document.createElement(
"div");l.appendChild(eR);su=new am(gu,m,"<span style='color:#333333;'>"+m.D()+"</span>",am.LINK_TO_USER_PROFILE,null,true,eR);gu.style.width="450px";var sn=document.createElement("td");
sn.style.verticalAlign="top";hJ.appendChild(sn);so=sn;}else{var fN=document.createElement("div");l.appendChild(fN);fN.style.fontSize=16;fN.style.fontWeight="bold";fN.style.color="#0e1f5b";
fN.style.cursor="pointer";fN.innerHTML="Details for "+m.getDisplayName()+":";aE(fN,"click",OYF_showUserDetails,m.B());so=l;}if(g(cy)){var mJ=new am(so,cy,
"<span style='color:#333333;'> Owned by ... </span>",am.LINK_TO_USER_DETAILS_TAB);}if(true||m.lf()){var sV=document.createElement("div");l.appendChild(sV);var l_comment_cost="(cost: $2,000)";try{if(
m.B()==MAIN_DATA.A().ct().B())l_comment_cost="<i>(comments to your owner are FREE)</i>";}catch(ee){}try{if(m.ct().B()==MAIN_DATA.A().B())l_comment_cost="<i>(comments to your pets are FREE)</i>";}
catch(ee){}try{if(m.B()==MAIN_DATA.A().B())l_comment_cost="<i>(comments to yourself are FREE)</i>";}catch(ee){}sV.innerHTML=
"<span style='font-size:12px;'><b>Write a comment</b> on <span style='color:#3b5998; font-weight:bold;'>"+m.D()+"</span>'s newsfeed "+l_comment_cost+":</span>";var lJ=document.createElement("div");
sV.appendChild(lJ);var sK;var gE=document.createElement("button");gE.onclick=onSendComment;gE.disabled=true;gE.innerHTML="Send!";try{sK=document.createElement(
"<input type='text' size='60' maxlength='100'/>");}catch(error){sK=document.createElement("input");sK.type="text";sK.size=60;sK.maxLength=100;}sK.onkeydown=function(){gE.disabled=false;};
lJ.appendChild(sK);lJ.appendChild(gE);var sL=document.createElement("div");sL.style.display="none";sL.style.border="1px solid black";sL.style.padding="8px";sL.style.marginTop="8px";lJ.appendChild(sL);
}function onSendComment(){var tj=undefined;gE.disabled=true;gE.value="Sending ...";try{tj=sK.value;}catch(err){f(err);}var k={};k.from_user_id=MAIN_DATA.A().B();k.to_user_id=m.B();k.comment=bo(tj);U(
REQUEST_DESTINATION_URL+"/ffs/sendcomment",function(J){var respText=oH(J);if(respText!=undefined&&respText.indexOf("<SUCCESS>true</SUCCESS>")>=0){var F=bc(J);var dk=K(F,"sender_cash");if(g(dk)){try{
MAIN_DATA.A().fZ(parseInt(dk));}catch(err){f(err);};try{MAIN_STATUS_DIV.fK(dk);}catch(err){f(err);};}sendWriteCommentNotification(MAIN_DATA.A(),m);NEWSFEED_CACHE.av();if(g(CUR_NEWSFEED))
CUR_NEWSFEED.eh();U(REQUEST_DESTINATION_URL+"/ffs/getotheruser?user_id="+ap,kA);}else{var F=bc(J);var sZ;if(!g(F)){sZ="Got no response from the server!";}else{sZ=K(F,"error");}gE.value="Send!";
sL.innerHTML="Your comment could not be sent for the following reason:<br>\n"+sZ;sL.style.display="block";}},k,0);return false;};if(iq.length>0){var fR=document.createElement("div");l.appendChild(fR);
az(fR);fR.style.marginTop="10px";fR.innerHTML="<span style='font-weight:bold;'> Mini Feed (latest 20 entries) </span>";var ge=document.createElement("div");ge.style.height="25px";l.appendChild(ge);az(
ge);if(m_newsfeed_filter==undefined){m_newsfeed_filter="All";}var l_typePicker=document.createElement("div");l_typePicker.style.fontSize="12px";var l_typeAll=document.createElement("a");
l_typeAll.innerHTML="Show all";l_typeAll.style.marginRight="10px";if(m_newsfeed_filter=="All"){l_typeAll.className="selectedFeed";}else{l_typeAll.className="unselectedFeed";l_typeAll.onclick=function(
){m_newsfeed_filter="All";pL.innerHTML="";qh(pL);}}l_typePicker.appendChild(l_typeAll);var l_typeAll=document.createElement("a");l_typeAll.innerHTML="Show messages only";l_typeAll.style.marginRight=
"10px";if(m_newsfeed_filter=="Msg"){l_typeAll.className="selectedFeed";}else{l_typeAll.className="unselectedFeed";l_typeAll.onclick=function(){m_newsfeed_filter="Msg";pL.innerHTML="";qh(pL);}}
l_typePicker.appendChild(l_typeAll);l_typePicker.style.marginTop="5px";ge.appendChild(l_typePicker);var qR=new lh(l,iq,300,sD?650:480);}if(l_giftArray.length>0){var l_giftsHeaderDiv=
document.createElement("div");l.appendChild(l_giftsHeaderDiv);az(l_giftsHeaderDiv);l_giftsHeaderDiv.style.marginTop="10px";l_giftsHeaderDiv.innerHTML="<span style='font-weight:bold;'>Gifts </span>";
var l_giftData=new ArrayData(l_giftArray).paged(sD?8:6);var l_giftsReceived=new GiftsReceivedDiv(l,l_giftData);}if(hS.length>0){var hi=document.createElement("div");l.appendChild(hi);az(hi);
hi.style.marginTop="10px";hi.innerHTML="<span style='font-weight:bold;'> Pets (top 24) </span>";var rg=new oK(l,hS,sD?820:500,np);}showBlockUserLink();};function showBlockUserLink(){if((MAIN_DATA.A()
.B()!=ap)&&sD){var qc=document.createElement("div");l.appendChild(qc);qc.style.textAlign="center";qc.innerHTML="<hr>";var hv=document.createElement("span");hv.style.textAlign="center";hv.onclick=
showBlockUser;if(g(m))hv.innerHTML="Block "+m.getDisplayName();else hv.innerHTML="Block this user";hv.style.cursor="pointer";qc.appendChild(hv);}};var sC;function showBlockUser(){var sC=new bG(l);
var name;if(g(m))name=m.getDisplayName();else name="this user";sC.aL().innerHTML="Are you sure you want to block "+name+"?<p>\n"+
"This user will not be allowed to purchase you or send you comments if you block them.<p>\n&nbsp;<br>";sC.aL().style.height=100;var sB=new aJ(sC.aL(),"Block",function(){U(REQUEST_DESTINATION_URL+
"/ffs/blockuser?user_id="+MAIN_DATA.A().B()+"&blocked_id="+ap,function(sv){onBlockUser(sC,sv)})});};function onBlockUser(sz,ot){var F=bc(ot);if(F!=undefined){var hC=decodeURIComponent(
F.getElementsByTagName("info")[0].firstChild.nodeValue);sz.aL().innerHTML=hC+"<P>";}}};function pm(qg){var ag=qg;var ra=undefined;this.jK=jK;function jK(V){ag.innerHTML="";var aq=new bG(ag);var qQ=
new lo(aq.aL(),V.B(),4,false,false);}};am.NO_LINK=0;am.LINK_TO_USER_DETAILS_TAB=1;am.LINK_TO_EXPANSION_AREA=2;am.LINK_TO_USER_PROFILE=3;function am(rA,V,pV,qw,qz,sx,ov,a_showMyPets){var pL=rA;var m=V;
var ix=pV;var lG=qw;var mU=qz;var sF=sx;var ax=ov;var l=null;var m_showMyPets=a_showMyPets;this.qh=qh;this.ad=ad;this.refresh=refresh;if(pL!=undefined){qh(pL);}function ad(){return l;};
function refresh(){l.innerHTML="";lc();};function qh(_parentDiv){pL=_parentDiv;l=document.createElement("div");pL.appendChild(l);lc();};function lc(){if(g(ix)){var G=document.createElement("div");
l.appendChild(G);kY(G);G.innerHTML=ix;if(ix.indexOf("</span>")<0){G.className="ElementHeader";}}var kE=document.createElement("div");l.appendChild(kE);var kz=document.createElement("table");
kE.appendChild(kz);var kK=document.createElement("tbody");kz.appendChild(kK);var hB=document.createElement("tr");kK.appendChild(hB);var ck=document.createElement("td");hB.appendChild(ck);
ck.setAttribute("style","vertical-align: top;");ck.style.verticalAlign="top";var gH,tc;if(sF){gH=document.createElement("div");gH.style.position="relative";tc=document.createElement("img");tc.src=
m.cv().replace("/s_","/m_").replace("_s.jpg","_m.jpg");if(!m.lf())gH.innerHTML=NON_APP_USER;gH.appendChild(tc);appendZoomButton(gH,m.cv());ck.appendChild(gH);nk(gH);}else{gH=new eb(ck,0,m.cv(),90,90,
"white",m.lf()?null:NON_APP_USER);nk(gH.ad());}if(m_showMyPets&&g(MAIN_DATA.ar(v.MY_PETS))){if(MAIN_DATA.ar(v.MY_PETS).bM(m.getId())){var l_myPetDiv=$divcl(ck,"myPetDiv");var l_roundtopDiv=$divcl(
l_myPetDiv,"roundtop");var l_imgTopLeft=$elcl("img",l_roundtopDiv,"corner");l_imgTopLeft.width="6";l_imgTopLeft.height="6";l_imgTopLeft.src=IMAGES_PROD_URL+"/tl.gif";$(l_imgTopLeft).css({display:
"none"});var l_petTextDiv=$divcl(l_myPetDiv,"myPetText");l_petTextDiv.innerHTML="My Pet";var l_roundbuttomDiv=$divcl(l_myPetDiv,"roundbottom");var l_imgBottomLeft=$elcl("img",l_roundbuttomDiv,
"corner");l_imgBottomLeft.width="6";l_imgBottomLeft.height="6";l_imgBottomLeft.src=IMAGES_PROD_URL+"/bl.gif";$(l_imgBottomLeft).css({display:"none"});}}var dC=document.createElement("td");
hB.appendChild(dC);dC.style.paddingLeft="5";var M=document.createElement("div");dC.appendChild(M);M.style.margin="0px 0px 5px 0px";M.style.fontSize="14px";M.style.fontWeight="bold";M.style.color=
"#0e1f5b";var kW=m.gb();if(g(kW)){M.innerHTML="<img style='margin-right:5px; vertical-align:middle;' src='"+lw(kW)+"'/>"+m.D();}else{M.innerHTML=m.D();}nk(M);var ej=document.createElement("div");
dC.appendChild(ej);ej.style.fontSize="12px";ej.style.color="#CC2222";ej.id="ProfileMessage_"+m.B();var gc=m.ea();if(g(gc)){gc=jd(gc,20,/\S{20}/);ej.appendChild(document.createTextNode(gc));
ej.style.marginBottom="5px";var tx=m.getStatusMessageChanger();var tw=m.getStatusMessageChangeDate();if(g(m.getStatusMessageChanger())){ej.title="Created by "+tx+" on "+tw;}}var fm=
document.createElement("div");dC.appendChild(fm);fm.innerHTML="<span style='color:#888888; font-size:12px;'> Worth: </span> <span id='ProfileWorth_"+m.B()+
"' style='color:#09460F; font-size:12px; font-weight:bold;'> $"+addCommas(m.bw())+"</span>";var lM=document.createElement("div");dC.appendChild(lM);lM.innerHTML=
"<span style='color:#888888; font-size:12px;'> Cash: </span> <span style='color:#09460F; font-size:12px; font-weight:bold;'> $"+addCommas(m.eg())+"</span>";if(m.B()==MAIN_DATA.A().B()){
var l_assetsDiv=document.createElement("div");dC.appendChild(l_assetsDiv);l_assetsDiv.innerHTML=
"<span style='color:#888888; font-size:12px;'> Assets: </span> <span style='color:#09460F; font-size:12px; font-weight:bold;'> $"+addCommas(MAIN_DATA.getAssets())+"</span>";}if(sF){var hu=new aw(
aw.GLOBAL_CONTROL,m,ax,false);dC.appendChild(hu.gg());}};function nk(dL){if(!g(lG)){return;}switch(lG){case am.NO_LINK:break;case am.LINK_TO_USER_DETAILS_TAB:dL.style.cursor="pointer";aE(dL,"click",
OYF_showUserDetails,m.B());break;case am.LINK_TO_EXPANSION_AREA:if(g(mU)){dL.style.cursor="pointer";aE(dL,"click",mU.jK,m);}else{f(
"Request link to expansion area, but optionalMiniProfileList is not set");}break;case am.LINK_TO_USER_PROFILE:if(m.eP()){if(OYF.network_current==OYF.NETWORK_HI5&&m.eP().indexOf("hi5.com")>=0||
OYF.network_current==OYF.NETWORK_MYSPACE&&m.eP().indexOf("myspace.com")>=0){dL.style.cursor="pointer";aE(dL,"click",window.open,m.eP());}}break;}}};var GLOBAL_NUM_NEWSFEED_ENTRIES_PER_PAGE=5;
function replaceYouInNewsfeed(hC){var ss=MAIN_DATA.A().getDisplayName();var tf=""+MAIN_DATA.A().B();var hp=hC.indexOf("onclick=\"OYF_showUserDetails("+tf+");\">"+ss+"<");if(hp> -1){var sq="You";
var sm=hp+ss.length+33+tf.length;hp=hC.lastIndexOf('<',hp);sm=hC.indexOf('>',sm);if(hp>0&&hC.slice(0,5)!="<img "&&hC.slice(0,6)!="ItemId")sq="you";var correctedString=hC.substring(0,hp)+sq+
hC.substring(sm+1);correctedString=correctedString.replace("you's","your");correctedString=correctedString.replace("you''s","your");correctedString=correctedString.replace("you is","you are");
correctedString=correctedString.replace("You's","Your");correctedString=correctedString.replace("You is","You are");correctedString=correctedString.replace("you was","You were");correctedString=
correctedString.replace("settings and is no longer","settings and are no longer");return correctedString;}else{return hC;}};function ln(rA){var pL=rA;var bj=undefined;var ay=1;var ag=undefined;
this.qh=qh;this.eh=eh;this.jI=jI;this.bK=bK;this.bQ=bQ;if(pL!=undefined&&pL!=null){qh(pL);}function qh(_a_parentDiv){pL=_a_parentDiv;f("ln: qh");var G=document.createElement("div");pL.appendChild(G);
G.className="ElementHeader";G.style.margin="0px 0px 0px 0px";az(G);G.innerHTML="Newsfeed";ag=document.createElement("div");pL.appendChild(ag);ag.innerHTML="Loading Newsfeeds...";eh();};function eh(
a_pageToJumpTo){if(a_pageToJumpTo)ay=a_pageToJumpTo;else ay=1;NEWSFEED_CACHE.iv(jI);};function jI(fQ){bj=fQ;if(fQ==undefined){ag.innerHTML="Error fetching newsfeed entries, please refresh.";return;}
bK(ay);};function bK(eN){f("newsfeed jump to page "+eN);ay=eN;ag.innerHTML="";if(bj==0){var dm=document.createElement("div");ag.appendChild(dm);dm.style.margin="15px 0px 15px 0px";dm.innerHTML=
"<span style='font-size:14px; color:red; font-weight:600;'> <br> No entries, very sad... </span>";}else{var l_totalNumPages=Math.ceil(bj/GLOBAL_NUM_NEWSFEED_ENTRIES_PER_PAGE);if(ay>l_totalNumPages)ay=
l_totalNumPages;bQ(ag,true);new jh(ag,ay);bQ(ag);}};function bQ(rA,a_showTypePicker){var ge=document.createElement("div");ge.style.height="25px";rA.appendChild(ge);if(g(a_showTypePicker)){if(
NEWSFEED_FILTER==undefined){NEWSFEED_FILTER="All";}var l_typePicker=document.createElement("span");l_typePicker.style.fontSize="12px";var l_typeAll=document.createElement("a");l_typeAll.innerHTML=
"Show all";l_typeAll.style.marginRight="10px";if(NEWSFEED_FILTER=="All"){l_typeAll.className="selectedFeed";}else{l_typeAll.className="unselectedFeed";l_typeAll.onclick=function(){NEWSFEED_FILTER=
"All";NEWSFEED_CACHE.av();eh();}}l_typePicker.appendChild(l_typeAll);var l_typeAll=document.createElement("a");l_typeAll.innerHTML="Show messages only";l_typeAll.style.marginRight="10px";if(
NEWSFEED_FILTER=="Msg"){l_typeAll.className="selectedFeed";}else{l_typeAll.className="unselectedFeed";l_typeAll.onclick=function(){NEWSFEED_FILTER="Msg";NEWSFEED_CACHE.av();eh();}}
l_typePicker.appendChild(l_typeAll);l_typePicker.style.marginTop="5px";ge.appendChild(l_typePicker);l_typePicker.style.cssFloat="left";}var hM=Math.ceil(bj/GLOBAL_NUM_NEWSFEED_ENTRIES_PER_PAGE);
new mN(ge,bK,hM,ay,6);}};function jh(rA,jO){var pL=rA;var bL=(jO-1)*GLOBAL_NUM_NEWSFEED_ENTRIES_PER_PAGE;var m_startPage=jO;var ah=null;this.qh=qh;if(pL!=undefined&&pL!=null){qh(pL);}function qh(
_a_parentDiv){pL=_a_parentDiv;f("jh: qh");ah=document.createElement("div");pL.appendChild(ah);ah.innerHTML="Loading entries...";NEWSFEED_CACHE.iz(bL,GLOBAL_NUM_NEWSFEED_ENTRIES_PER_PAGE,kB);};
function kB(iu){f("jh: kB");if(iu.length<=bL){ah.innerHTML="<div class='messageBox'> No entries... yet! </div>";return;}ah.innerHTML="";var bk=document.createElement("table");ah.appendChild(bk);
bk.style.width="550px";bk.style.cellSpacing="0px";bk.style.borderCollapse="collapse";bk.style.borderTop="1px solid #cccccc";var fb=document.createElement("tbody");bk.appendChild(fb);var pU=Math.min(
iu.length,bL+GLOBAL_NUM_NEWSFEED_ENTRIES_PER_PAGE);for(var cV=bL;cV<pU;cV++){var fa=jB(iu[cV]);if(fa!=undefined){fb.appendChild(fa);}}};function jB(dg){var Q=dg.cR();var P=dg.cW();var hn="white";
var R="<img style='margin:0px 5px 0px 0px; width:16px; height:16px; float: right;' ";if(Q=='EARN'){R+="src='"+IMAGE_SOURCE_URL+"/favicons/oyf_money.gif'/> ";}else if(Q=='STOLEN'){R+="src='"+
IMAGE_SOURCE_URL+"/favicons/oyf_stolen.gif'/> ";}else if(Q=='PURCHASE'||Q=='BOUGHT'){R+="src='"+IMAGE_SOURCE_URL+"/favicons/oyf_purchase.gif'/> ";}else if(Q=='POKE'){R+="src='"+IMAGE_SOURCE_URL+
"/favicons/oyf_poke.gif'/> ";}else if(Q=='STATUS'){R+="src='"+IMAGE_SOURCE_URL+"/favicons/oyf_status.gif'/> ";hn="#f0f0f0";}else if(Q=='COMMENT'){var sP=P.indexOf("<img");var sN=P.indexOf(">",sP)+1;R=
P.slice(sP,sN);P=P.slice(sN);hn="#f0f0f0";}else if(Q=='SENT'){R+="src='"+IMAGE_SOURCE_URL+"/favicons/status.png'/> ";hn="#f0f0f0";}else if(Q=='HGIFT_P'){R+="src='"+IMAGE_SOURCE_URL+
"/favicons/oyf_gift.gif'/> ";}else if(Q=='HGIFT_R'){R+="src='"+IMAGE_SOURCE_URL+"/favicons/oyf_gift.gif'/> ";}else if(Q=='HGIFT_S'){R+="src='"+IMAGE_SOURCE_URL+"/favicons/oyf_gift.gif'/> ";}else if(
Q=='REMOVE_PET'){R+="src='"+IMAGE_SOURCE_URL+"/favicons/oyf_delete.png'/> ";}else if(Q=='GIFT_ITEM_S'||Q=='GIFT_ITEM_R'||Q=='GIFT_ITEM_D'||Q=='GIFT_ITEM_ANON_R'||Q=='GIFT_ITEM_S_MSG'||Q==
'GIFT_ITEM_R_MSG'||Q=='GIFT_ITEM_ANON_R_MSG'){var sP=P.indexOf("ItemId");var sN=P.indexOf("dImetI",sP);var l_itemId=P.slice(sP+6,sN);P=P.slice(sN+6);R="<img src='"+Gift.getImageURLFromItemId(l_itemId,
true)+"' class='gift_in_feed'/> ";hn="#f0f0f0";}else if(Q=='HAPPY'){R+="src='"+IMAGE_SOURCE_URL+"/favicons/moods/happy.gif'/> ";}else if(Q=='CONTENT'){R+="src='"+IMAGE_SOURCE_URL+
"/favicons/moods/content.gif'/> ";}else if(Q=='GLOOMY'){R+="src='"+IMAGE_SOURCE_URL+"/favicons/moods/gloomy.gif'/> ";}else if(Q=='DISCOUNT'||Q=='SALE'){R+="src='"+IMAGE_SOURCE_URL+
"/favicons/oyf_discount.gif'/> ";}else if(Q=='BLOCKED'){R+="src='"+IMAGE_SOURCE_URL+"/favicons/block.gif'/> ";}else{R+="src='"+IMAGE_SOURCE_URL+"/favicons/error.png'/> ";}var o=document.createElement(
"tr");var cJ=document.createElement("td");o.appendChild(cJ);cJ.style.margin="0px";cJ.style.paddingTop="3px";cJ.style.paddingBottom="3px";cJ.style.width="15px";o.style.background=hn;az(cJ);
cJ.innerHTML=R;var fy="<span style='color:#333333; font-size:11px;'>"+P+"</span>";cJ=document.createElement("td");o.appendChild(cJ);cJ.style.margin="0px";cJ.style.paddingTop="3px";
cJ.style.paddingBottom="3px";az(cJ);cJ.innerHTML=fy;cJ=document.createElement("td");o.appendChild(cJ);cJ.style.textAlign="right";cJ.style.verticalAlign="bottom";cJ.style.color="gray";
cJ.style.fontSize=10;az(cJ);cJ.innerHTML=lB(dg.cY());cJ=$el("td",o,{textAlign:"right",verticalAlign:"bottom",paddingRight:"3px",paddingBottom:"3px",width:"20px"});az(cJ);var l_delNewsfeedLink=$el("a",
cJ,{textDecoration:"none"});l_delNewsfeedLink.href="javascript:void(0)";$(l_delNewsfeedLink).click(confirmDelete.bind(null,dg));var l_delNewsfeedImg=$el("img",l_delNewsfeedLink,{border:"none"});
l_delNewsfeedImg.src=IMAGE_SOURCE_URL+"/remove_newsfeed.gif";l_delNewsfeedImg.title="Delete the newsfeed item";return o;};function confirmDelete(dg){var l_buttons={};gaTrackEvent("newsfeed",
"show_dialog","confirm_delete_dialog");l_buttons["Confirm Delete"]=function(){var k=MAIN_DATA.A().dh();U(REQUEST_DESTINATION_URL+"/ffs/deletenewsfeed?user_id="+MAIN_DATA.A().B()+"&delete_entry_id="+
dg.getNewsfeedId(),onDeleteNewsfeedDone,k);};l_buttons["Cancel"]=function(){gaTrackEvent("newsfeed","click","confirm_delete_dialog/cancel");};var l_dialog=new ModalDialog(
"Are you sure you want to delete the newsfeed item?","Confirm Delete",l_buttons,ModalDialog.WARNING);l_dialog.showDialog();};function onDeleteNewsfeedDone(J){f(oH(J));var F=bc(J);if(!g(F)){
new ModalDialog("Unfortunately there was an error.  Please try again.","Error",null,ModalDialog.ERROR).showDialog();return false;}var l_info=K(F,"info");if(g(l_info)){new ModalDialog(
decodeURIComponent(l_info),"Error",null,ModalDialog.ERROR).showDialog();return false;}l_info=K(F,"error");if(g(l_info)){new ModalDialog(decodeURIComponent(l_info),"Error",null,ModalDialog.ERROR)
.showDialog();return false;}NEWSFEED_CACHE.av();if(g(CUR_NEWSFEED)){CUR_NEWSFEED.eh(m_startPage);}return true;}};aS.PETS=1;aS.FRIENDS_AND_GLOBAL=2;function aS(rd,os,oq){var fe=oq;var dc=new Array();
var cP=os;this.jp=jp;this.cZ=cZ;this.jx=jx;this.iX=iX;this.iF=iF;this.jn=jn;this.jq=jq;this.iT=iT;this.aB=aB;this.aX=aX;this.jt=jt;this.getActionType=getActionType;jp();function jp(){switch(fe){
case aS.PETS:dc.push(v.MY_PETS);break;case aS.FRIENDS_AND_GLOBAL:dc.push(v.GLOBAL);dc.push(v.MY_REGION);dc.push(v.MY_TOP_FRIENDS);dc.push(v.MY_FRIENDS);dc.push(v.MY_BARGAINS);break;}};function cZ(){
switch(fe){case aS.PETS:return 10;case aS.FRIENDS_AND_GLOBAL:if(cP==v.MY_FRIENDS){return 20;}else{return 15;}}return undefined;};function aB(callback){MAIN_DATA.ar(cP).aB(callback);};function aX(
startIndex,num,callback){MAIN_DATA.ar(cP).aX(startIndex,num,callback);};function jq(){switch(fe){case aS.PETS:return "500px";case aS.FRIENDS_AND_GLOBAL:return "550px";default:return "500px";}};
function iT(){var dM=document.createElement("div");dM.className="explanationBox";switch(cP){case v.MY_PETS:dM.innerHTML=
"<h1> Your Pet List </h1> You don't own any friends yet! <a href='#' onclick='OYF.mainTabs.switchToTab(OYF.TAB_BUY_FRIENDS)'>Click here</a> to buy some of your friends!<br><br>When you buy your friends, they will show up here as pets.";
break;case v.MY_FRIENDS:case v.MY_TOP_FRIENDS:dM.innerHTML="<h1> Your Friends </h1> This is where your friends that are on sale show up.<p>"+
"Unfortunately, we had an old copy of your friends list.<br>Please reload this page to ensure your friends list is up-to-date.";break;case v.MY_REGION:dM.innerHTML=
"<h1> People from your region </h1> Perhaps you didn't specify a region? or invite more friends from your region!";break;case v.MY_BARGAINS:dM.innerHTML=
"<h1> Bargains </h1> Unfortunately, you don't have any bargains... Your friends are all worth too much!";break;case v.GLOBAL:dM.innerHTML="<h1> Everyone </h1> This shouldn't be empty.";break;}
return dM;};function jt(user,a_userListRow){if(fe==aS.PETS){return new aw(aw.PET_CONTROL,user,a_userListRow.getControlContentDiv(),false,a_userListRow);}else if(fe==aS.FRIENDS_AND_GLOBAL){switch(cP){
case v.MY_FRIENDS:case v.MY_TOP_FRIENDS:case v.MY_BARGAINS:return new aw(aw.FRIEND_CONTROL,user,a_userListRow.getControlContentDiv(),false,a_userListRow);case v.MY_REGION:return new aw(
aw.GLOBAL_CONTROL,user,a_userListRow.getControlContentDiv(),false,a_userListRow);case v.GLOBAL:return new aw(aw.GLOBAL_CONTROL,user,a_userListRow.getControlContentDiv(),false,a_userListRow);default:
return new aw(aw.GLOBAL_CONTROL,user,a_userListRow.getControlContentDiv(),false,a_userListRow);}}else{return undefined;}};function jx(userType){cP=userType;};function iX(){return cP;};function iF(){
return dc.length;};function jn(){return dc;};function getActionType(){return fe;}};function fv(rA,fetchMap){var pL=rA;var bD=fetchMap;var bR=undefined;var ay=1;var ag=undefined;this.qh=qh;this.ad=ad;
this.ft=ft;this.bK=bK;this.gA=gA;this.jF=jF;this.bQ=bQ;if(pL!=undefined&&pL!=null){qh(pL);}function qh(_a_parentDiv){pL=_a_parentDiv;ag=document.createElement("div");pL.appendChild(ag);ag.innerHTML=
"Loading Users...";bD.aB(ft);};function ad(){return ag;};function ft(mo){f("fv: ft: "+mo);if(mo==0&&bD.iX()==v.MY_TOP_FRIENDS){}bR=mo;bK(1);};function bK(eN){f("fv: bK "+eN);ay=eN;ag.innerHTML="";
bD.aB(kG);};function kG(mb){f("kG: "+mb);bR=mb;jF(ag);if(!g(bR)||bR==0){var dm=document.createElement("div");ag.appendChild(dm);dm.appendChild(bD.iT());}else{bQ(ag);new jA(ag,bD,ay);bQ(ag);}};
function gA(lW){f("fv: gA "+lW);bD.jx(lW);bD.aB(ft);};function jF(rA){var hI=bD.iF();if(hI==undefined||hI==null||hI<2){return;}var mw=bD.jn();var pM=bD.iX();var gQ=document.createElement("div");
rA.appendChild(gQ);for(var aj=0;aj<mw.length;aj++){if(aj>0){gQ.appendChild(document.createTextNode(" | "));}var hk=mw[aj];var lF=v.getUserTypeName(hk);if(hk==pM){var ig=document.createElement("span");
ig.style.fontWeight="700";ig.appendChild(document.createTextNode(lF));gQ.appendChild(ig);}else{var gy=document.createElement("a");gy.href="#";gy.appendChild(document.createTextNode(lF));aE(gy,"click",
gA,hk);gQ.appendChild(gy);}}};function bQ(rA,qW){var hM=Math.ceil(bR/bD.cZ());var l_pager=document.createElement("div");l_pager.style.height="28px";l_pager.style.margin="0px";rA.appendChild(l_pager);
new mN(l_pager,bK,hM,ay,15);}};function jA(rA,om,jO){var pL=rA;var cT=om;var bL=(jO-1)*cT.cZ();var ah=null;this.qh=qh;this.gN=gN;if(pL!=undefined&&pL!=null){qh(pL);}function qh(_a_parentDiv){pL=
_a_parentDiv;f("UserListTableDiv: createDiv ");ah=document.createElement("div");pL.appendChild(ah);ah.style.textAlign="center";ah.innerHTML=
"<br><font color='red'><b>[Loading Users... Please wait.]</b></font>";cT.aX(bL,cT.cZ(),gN);};function gN(userCache){f("jA: gN");if(userCache.length<=bL){ah.innerHTML=
"<div class='messageBox'> No users... yet! </div>";return;}ah.innerHTML="";var gn=document.createElement("table");ah.appendChild(gn);gn.style.marginLeft="auto";gn.style.marginRight="auto";var la=
document.createElement("tbody");gn.appendChild(la);f("start Index "+bL);var mj=Math.min(userCache.length,bL+cT.cZ());f("end index "+mj+" cache length: "+userCache.length+"  num users per page: "+
cT.cZ());var hs=bL;for(;hs<mj;hs++){new UserListRow(gn,userCache[hs],cT);}}};function UserListRow(a_parentTable,V,om){var l_self=this;var m_parentTable=a_parentTable;var m=V;var cT=om;
var m_userRowTable=undefined;var m_miniProfileList;var m_controlConentDiv;this.redraw=redraw;this.createUserRow=createUserRow;this.getControlContentDiv=getControlContentDiv;oP();function oP(){var o=
m_parentTable.insertRow(m_parentTable.rows.length);var cJ=document.createElement("td");o.appendChild(cJ);cJ.style.padding="5px 0px 5px 0px";az(cJ);m_userRowTable=document.createElement("table");
cJ.appendChild(m_userRowTable);m_userRowTable.style.width=cT.jq();var kD=document.createElement("tbody");m_userRowTable.appendChild(kD);m_controlConentDiv=document.createElement("div");cJ.appendChild(
m_controlConentDiv);var ni=document.createElement("div");cJ.appendChild(ni);m_miniProfileList=new pm(ni);createUserRow();};function createUserRow(){var bZ=m_userRowTable.insertRow(0);var hA=
document.createElement("td");bZ.appendChild(hA);hA.style.width="240px";var l_showMyPets=false;if(cT)l_showMyPets= !(cT.getActionType()==aS.PETS);new am(hA,m,undefined,am.LINK_TO_EXPANSION_AREA,
m_miniProfileList,false,undefined,l_showMyPets);var hu=cT.jt(m,l_self);var gi=document.createElement("td");gi.setAttribute("style","text-align:right;");gi.align="RIGHT";bZ.appendChild(gi);
gi.appendChild(hu.gg());};function getControlContentDiv(){return m_controlConentDiv;};function redraw(){m_userRowTable.deleteRow(0);createUserRow();}};function showCloseButton(sl,si,al){var ge=$div(
si);var gE=new DivButton(ge,"Close",al).aL();gE.style.width="180px";gE.style.marginLeft="auto";gE.style.marginRight="auto";};function commentOrNot(sl,si,al){var sh=new dI(si);var rf=sh.by();
rf.style.width="180px";var pI=sh.bf();pI.style.width="180px";new DivButton(rf,"Send Comment!",al);new DivButton(pI,"No, thanks",function(){sl.parentNode.style.display="none";},"#aaaaaa");};
function inviteOrNot(sl,si,al){var sh=new dI(si);var rf=sh.by();rf.style.width="180px";var pI=sh.bf();pI.style.width="180px";new DivButton(rf,"Send Invite!",al);new DivButton(pI,"No, thanks",function(
){sl.parentNode.style.display="none";},"#aaaaaa");};aw.FRIEND_CONTROL=1;aw.PET_CONTROL=2;aw.GLOBAL_CONTROL=3;function aw(ow,V,ov,pY,a_userListRow){var kr=ow;var m=V;var ax=ov;var eL=undefined;var hg=
pY;var m_userListRow=a_userListRow;this.jH=jH;this.gg=gg;this.ja=ja;this.ki=ki;this.jl=jl;this.showDiscountPet=showDiscountPet;jH();function jH(){if(kr==aw.FRIEND_CONTROL){bC(true);}else if(kr==
aw.PET_CONTROL){oQ();}else if(kr==aw.GLOBAL_CONTROL){bC(false);}};function gg(){return eL;};function bC(includeGiftPet){eL=document.createElement("div");var cg=document.createElement("table");
eL.appendChild(cg);cg.style.marginLeft="auto";cg.style.marginRight="0px";var bJ=document.createElement("tbody");cg.appendChild(bJ);var o=document.createElement("tr");bJ.appendChild(o);var cJ=
document.createElement("td");o.appendChild(cJ);cJ.style.padding="5px";cJ.style.textAlign="right";az(cJ);var dQ=document.createElement("a");cJ.appendChild(dQ);dQ.href="javascript:void(0);";
dQ.className="userControl";dQ.innerHTML="Poke "+m.D();aG(dQ,"click",ja);df(cJ,dQ);o=document.createElement("tr");bJ.appendChild(o);cJ=document.createElement("td");o.appendChild(cJ);cJ.style.padding=
"5px";cJ.style.textAlign="right";az(cJ);var aZ=document.createElement("a");cJ.appendChild(aZ);aZ.href="javascript:void(0);";aZ.className="userControl";aZ.innerHTML="Poke "+m.D()+" with a pet!";aG(aZ,
"click",nF);df(cJ,aZ);if(includeGiftPet){o=document.createElement("tr");bJ.appendChild(o);cJ=document.createElement("td");o.appendChild(cJ);cJ.style.padding="5px";cJ.style.textAlign="right";az(cJ);
var aZ=document.createElement("a");cJ.appendChild(aZ);aZ.href="javascript:void(0);";aZ.className="userControl";aZ.innerHTML="Give "+m.D()+
" a human gift and earn <span style='color:#09460F; font-weight:bold;'>$1,250!</span>";aG(aZ,"click",function(){giveGift("human");});df(cJ,aZ);}var l_showBuyFriends=true;if(g(MAIN_DATA.ar(v.MY_PETS)))
{if(MAIN_DATA.ar(v.MY_PETS).bM(m.getId()))l_showBuyFriends=false;}if(l_showBuyFriends){o=document.createElement("tr");bJ.appendChild(o);cJ=document.createElement("td");o.appendChild(cJ);
cJ.style.padding="5px";cJ.style.textAlign="right";az(cJ);var dq=document.createElement("a");cJ.appendChild(dq);dq.href="javascript:void(0);";dq.className="userControl";dq.innerHTML="Buy "+m.D()+
" for <span style='color:#09460F; font-weight:bold;'>$"+addCommas(m.dT())+"</span>";aG(dq,"click",oN);df(cJ,dq);}addGiveGift(bJ);};function oQ(){eL=document.createElement("div");var cg=
document.createElement("table");eL.appendChild(cg);cg.style.marginLeft="auto";cg.style.marginRight="0px";var bJ=document.createElement("tbody");cg.appendChild(bJ);var o=document.createElement("tr");
bJ.appendChild(o);var cJ=document.createElement("td");o.appendChild(cJ);cJ.style.padding="5px";cJ.style.textAlign="right";cJ.align="RIGHT";az(cJ);var dp=document.createElement("a");cJ.appendChild(dp);
dp.href="javascript:void(0);";dp.className="userControl";dp.innerHTML="Make "+m.D()+" poke another pet";aG(dp,"click",nH);df(cJ,dp);o=document.createElement("tr");bJ.appendChild(o);cJ=
document.createElement("td");o.appendChild(cJ);cJ.style.padding="5px";cJ.style.textAlign="right";az(cJ);cJ.align="RIGHT";var ds=document.createElement("a");cJ.appendChild(ds);ds.href=
"javascript:void(0);";ds.className="userControl";ds.innerHTML="Edit "+m.D()+"'s status message";aG(ds,"click",jl);df(cJ,ds);o=document.createElement("tr");bJ.appendChild(o);cJ=document.createElement(
"td");o.appendChild(cJ);cJ.style.padding="5px";cJ.style.textAlign="right";az(cJ);cJ.align="RIGHT";var ek=document.createElement("a");cJ.appendChild(ek);ek.href="javascript:void(0);";ek.className=
"userControl";ek.innerHTML="Put "+m.D()+" on sale";aG(ek,"click",showDiscountPet);df(cJ,ek);o=document.createElement("tr");bJ.appendChild(o);cJ=document.createElement("td");o.appendChild(cJ);
cJ.style.padding="5px";cJ.style.textAlign="right";az(cJ);cJ.align="RIGHT";var ek=document.createElement("a");cJ.appendChild(ek);ek.href="javascript:void(0);";ek.className="userControl";ek.innerHTML=
"Sell "+m.D();aG(ek,"click",nG);df(cJ,ek);addGiveGift(bJ);o=document.createElement("tr");bJ.appendChild(o);cJ=document.createElement("td");o.appendChild(cJ);cJ.style.padding="5px";cJ.style.textAlign=
"right";az(cJ);cJ.align="RIGHT";var l_removeA=document.createElement("a");cJ.appendChild(l_removeA);l_removeA.href="javascript:void(0);";l_removeA.className="userControl";l_removeA.innerHTML=
"Remove "+m.D()+" from your pets";$(l_removeA).click(showRemovePet);df(cJ,l_removeA);};function addGiveGift(bJ){var o=document.createElement("tr");bJ.appendChild(o);var cJ=document.createElement("td")
;o.appendChild(cJ);cJ.style.padding="5px";cJ.style.textAlign="right";az(cJ);cJ.align="RIGHT";var l_giftA=document.createElement("a");cJ.appendChild(l_giftA);l_giftA.href="javascript:void(0);";
l_giftA.className="userControl";l_giftA.innerHTML="Give "+m.D()+" a gift";aG(l_giftA,"click",function(){giveGift("item");});df(cJ,l_giftA);};function df(jC,qv){var hb=new Object();hb.changeTd=jC;
hb.changeLink=qv;aE(jC,"mouseover",pj,hb);aE(jC,"mouseout",pl,hb);};function pj(fC){fC.changeTd.style.backgroundColor="#3b5998";fC.changeLink.style.color="WHITE";};function pl(fC){
fC.changeTd.style.backgroundColor="WHITE";fC.changeLink.style.color="#3b5998";};function createSideBySideBox(){var fc=new dI(C);var cz=fc.by();new eb(cz,0,m.cv(),80,80,"#FFFFFF");var M=
document.createElement("div");cz.appendChild(M);M.innerHTML="<span style='font-size:11px; font-weight:bold;'>"+m.D()+"</span>";var aY=fc.bf();aY.style.width="400px";aY.style.textAlign="center";
return fc;};function displayCommentBox(a_commentCallback){var fc=createSideBySideBox();if(kr==aw.FRIEND_CONTROL){commentOrNot(C,fc.bf(),a_commentCallback);}else{showCloseButton(C,fc.bf(),function(){
ax.innerHTML="";});}};function displayInviteBox(a_inviteCallback){var fc=createSideBySideBox();inviteOrNot(C,fc.bf(),a_inviteCallback);};var C=undefined;var jy=undefined;var dv=undefined;function ja()
{ax.innerHTML="";var aq=new bG(ax);C=aq.aL();var aa=document.createElement("table");C.appendChild(aa);var af=document.createElement("tbody");aa.appendChild(af);var o=document.createElement("tr");
af.appendChild(o);var cJ=document.createElement("td");o.appendChild(cJ);jy=new fp(cJ);cJ=document.createElement("td");o.appendChild(cJ);cJ.innerHTML="<span style='color:#3b5998; font-weight:bold;'>"+
m.D()+"</span>";cJ=document.createElement("td");o.appendChild(cJ);cJ.style.paddingLeft="20px";new aJ(cJ,"Do It!",oV);return false;};function oV(){if(!g(jy))return;dv=jy.ff();C.innerHTML="Poking...";
var k={};k.from_user_id=MAIN_DATA.A().B();k.to_user_id=m.B();k.to_display_name=bo(m.getName());k.poke_type=dv;U(REQUEST_DESTINATION_URL+"/ffs/pokeuser",nU,k,true);return false;};function mW(eA){
var dW="";if(eA==="hug"){dW="hugged";}else if(eA=="poke"){dW="poked";}else if(eA=="high five"){dW="high fived";}else if(eA=="wink at"){dW="winked at";}else if(eA=="whistle at"){dW="whistled at";}
else if(eA=="tickle"){dW="tickled";}else{dW=eA+"ed";}return dW;};function nU(pS){var F=bc(pS);if(F!=undefined){var bA=F.getElementsByTagName("user_without_app");if(g(bA)&&bA.length>0&& !MAIN_DATA.dx(
m.B())){C.innerHTML="";new cN(C,"Unfortunately "+m.D()+" doesn't have this app yet! Invite them by sending a comment so they know they've been poked.");displayInviteBox(function(){
notifyPokeFriendInvite(MAIN_DATA.A(),m,function(){ax.innerHTML="";});});}else{var T="You've just "+mW(dv)+" "+m.D()+".";if(kr==aw.FRIEND_CONTROL)T+=
" Why not click below and leave them a comment to let them know you poked them?";C.innerHTML=T;sendPokeFriendNotification(MAIN_DATA.A(),m,dv);displayCommentBox(function(){sendPokeFriendComment(
MAIN_DATA.A(),m,function(){ax.innerHTML="";});});}}else{C.innerHTML=
"An error occured retrieving the data in Own Your Friends. OYF might be temporarily down for maintenance... <br>We appologize for this inconvenience and thank you for your patience.";}
NEWSFEED_CACHE.av();dv=undefined;return false;};var mF=undefined;var mE=undefined;var cG=undefined;var cE=undefined;var jN=undefined;function pa(kn){jN=kn;f("user has: "+jN+" pets.");};function nF(){
ax.innerHTML="";var aq=new bG(ax);C=aq.aL();var aa=document.createElement("table");C.appendChild(aa);var af=document.createElement("tbody");aa.appendChild(af);var o=document.createElement("tr");
af.appendChild(o);if(g(MAIN_DATA.ar(v.MY_PETS))){MAIN_DATA.ar(v.MY_PETS).aB(pa);}if(!g(MAIN_DATA.ar(v.MY_PETS))||jN==0){var cJ=document.createElement("td");o.appendChild(cJ);cJ.innerHTML=
"To poke a user with a pet, you must own at least one pet!";}else{var cJ=document.createElement("td");o.appendChild(cJ);cJ.innerHTML="Make";cJ=document.createElement("td");o.appendChild(cJ);mF=new ks(
cJ);cJ=document.createElement("td");o.appendChild(cJ);mE=new fp(cJ);cJ=document.createElement("td");o.appendChild(cJ);cJ.innerHTML="<span style='color:#3b5998; font-weight:bold;'>"+m.D()+"</span>";cJ=
document.createElement("td");o.appendChild(cJ);cJ.style.paddingLeft="20px";new aJ(cJ,"Do It!",oA);}return false;};function oA(){var fB=mF.dP();cG=MAIN_DATA.ar(v.MY_PETS).bM(fB);cE=mE.ff();C.innerHTML=
"Making "+cG.D()+" "+cE+" "+m.D()+" ...";var k={};k.owner_id=MAIN_DATA.A().B();k.from_user_id=cG.B();k.to_user_id=m.B();k.to_display_name=bo(m.getName());k.poke_type=cE;U(REQUEST_DESTINATION_URL+
"/ffs/pokeuser",nT,k,true);return false;};function nT(aA){var F=bc(aA);var l_ppf_selectedPetUser=cG;if(F!=undefined){var bA=F.getElementsByTagName("user_without_app");if(g(bA)&&bA.length>0&& !
MAIN_DATA.dx(m.B())){C.innerHTML="";new cN(C,"Unfortunately "+m.D()+" doesn't have this app yet! Invite them by sending a comment so they know they've been poked.");displayInviteBox(function(){
notifyPokeWithPetInvite(MAIN_DATA.A(),m,l_ppf_selectedPetUser,function(pE){ax.innerHTML="";});});}else{var T="You've just made "+l_ppf_selectedPetUser.D()+" "+cE+" "+m.D()+".";if(kr==
aw.FRIEND_CONTROL)T+=" Why not click below and leave them a comment to let them know they were poked?";C.innerHTML=T;sendPokeWithPetNotification(MAIN_DATA.A(),m,l_ppf_selectedPetUser);
displayCommentBox(function(){sendPokeWithPetComment(MAIN_DATA.A(),m,l_ppf_selectedPetUser,function(pE){ax.innerHTML="";});});}}else{C.innerHTML=
"An error occured retrieving the data in Own Your Friends. OYF might be temporarily down for maintenance... <br>We appologize for this inconvenience and thank you for your patience.";}
NEWSFEED_CACHE.av();cG=undefined;cE=undefined;return false;};var iR=undefined;var bO=undefined;var iU=undefined;function pd(kn){iU=kn;f("user has: "+iU+" pets.");};function oN(){ax.innerHTML="";
var aq=new bG(ax);C=aq.aL();if(MAIN_DATA.A().eg()<m.dT()){C.innerHTML="<span style='color:#FF2222;'> Unfortunately you need a little more $$$ to buy "+m.D()+
"</span>. <a href='#' onclick='OYF.mainTabs.switchToTab(OYF.TAB_MORE_MONEY);return false;'>Click here</a> to earn more money...";return false;}C.style.paddingBottom="20px";var hl=
document.createElement("div");hl.innerHTML="<span style='font-size:14px;'> Purchasing "+m.D()+" will cost <span style='color:red; font-weight:bold;'> $"+addCommas(m.dT())+
"</span>. You currently have <span style='color:#09460F; font-weight:bold;'> $"+addCommas(MAIN_DATA.A().eg())+"</span>.<span><br><br>";C.appendChild(hl);var mR=document.createElement("span");
hl.appendChild(mR);new aJ(mR,"Buy "+m.D()+"!",ki);return false;};function ki(){ax.innerHTML="";var aq=new bG(ax);C=aq.aL();C.innerHTML="Purchasing "+m.D();var k=m.dh();k.from_user_id=MAIN_DATA.A().B()
;k.to_user_id=m.B();var eq=false;U(REQUEST_DESTINATION_URL+"/ffs/purchaseuser",function(aA){gY(aA,eq);},k,0);return false;};function gY(aA,eE){f("gY force_msg:"+eE);var F=bc(aA);if(!g(F)){C.innerHTML=
"Unfortunately there was an error, the technical team has been notified. Thank you for your patience!";return false;}var hm=bp(F,"target_user_without_app");C.innerHTML="";var rQ=jo(F,"info");if(g(rQ))
{C.innerHTML=rQ;return false;}if(g(hm)){new cN(C,m.D()+" doesn't have this app yet. Please click below and leave them an invite to let them know that you OWN them!");displayInviteBox(function(){
notifyBuyPetInvite(MAIN_DATA.A(),m,function(pE){ax.innerHTML="";},m.dT());});}else{var T="You've just bought "+m.D()+" for "+m.dT()+".";if(kr==aw.FRIEND_CONTROL)T+=
" Why not click below and leave them a comment to let them know that you OWN them?";new cN(C,T);sendBuyPetNotification(MAIN_DATA.A(),m,function(){},m.dT());if(!OYF.ACTIVITY_SENT)sendBuyPetActivity(m,
m.dT(),function(J){if(J.getData()==1){var k=MAIN_DATA.A().dh();U(REQUEST_DESTINATION_URL+"/ffs/setactivitysent?user_id="+MAIN_DATA.A().B(),function(){},k,0);OYF.ACTIVITY_SENT=true;}});
displayCommentBox(function(){sendBuyPetComment(MAIN_DATA.A(),m,function(pE){ax.innerHTML="";},m.dT());});}var dk=K(F,"buyer_cash");if(g(dk)){try{MAIN_DATA.A().fZ(parseInt(dk));}catch(err){f(err);};
try{MAIN_STATUS_DIV.fK(dk);}catch(err){f(err);};}var l_petWorth=K(F,"pet_worth");if(g(l_petWorth)){m.setWorth(parseInt(l_petWorth));}var l_petCash=K(F,"pet_cash");if(g(l_petCash)){m.fZ(parseInt(
l_petCash));}NEWSFEED_CACHE.av();if(!MAIN_DATA.ar(v.MY_PETS).bM(m.getId())){MAIN_DATA.ar(v.MY_PETS).ka(m);MAIN_DATA.ar(v.MY_PETS).aB(function(a_count){MAIN_DATA.ar(v.MY_PETS).jg(a_count+1);});}if(
m_userListRow)m_userListRow.redraw();return false;};var mL=undefined;var my=undefined;var fw=undefined;var cH=undefined;function nH(){ax.innerHTML="";var aq=new bG(ax);C=aq.aL();var aa=
document.createElement("table");C.appendChild(aa);var af=document.createElement("tbody");aa.appendChild(af);var o=document.createElement("tr");af.appendChild(o);var cJ=document.createElement("td");
o.appendChild(cJ);cJ.innerHTML="Make <span style='color:#3b5998; font-weight:bold;'>"+m.D()+"... </span>";cJ=document.createElement("td");o.appendChild(cJ);mL=new fp(cJ);cJ=document.createElement(
"td");o.appendChild(cJ);my=new ks(cJ,true);cJ=document.createElement("td");o.appendChild(cJ);cJ.style.width="70px";new aJ(cJ,"Do It!",oX);return false;};function oX(){fw=mL.ff();var lg=my.dP();if(lg==
MAIN_DATA.A().B()){cH=MAIN_DATA.A();}else{cH=MAIN_DATA.ar(v.MY_PETS).bM(lg);}var k={};k.owner_id=MAIN_DATA.A().B();k.from_user_id=m.B();k.from_display_name=bo(m.getName());k.to_user_id=cH.B();
k.to_display_name=bo(cH.getName());k.poke_type=fw;U(REQUEST_DESTINATION_URL+"/ffs/pokeuser",ox,k,true);return false;};function ox(aA){var F=bc(aA);if(F!=undefined){var bA=F.getElementsByTagName(
"user_without_app");if(g(bA)&&bA.length>0&& !MAIN_DATA.dx(m.B())){C.innerHTML="";for(var r=0;r<bA.length;r++){var nq=bA[r];var nn=K(nq,"user_id");var nh=MAIN_DATA.ar(v.MY_PETS).bM(nn);new cN(C,
"Unfortunately "+nh.D()+" doesn't have this app yet!<br />Invite them by sending a comment so they know they've been poked.");displayInviteBox(function(){notifyMakePetPokeInvite(MAIN_DATA.A(),m,cH,
function(pE){ax.innerHTML="";});});}}else{C.innerHTML="You've just made "+m.D()+" "+fw+" "+cH.D();sendMakePetPokeNotification(MAIN_DATA.A(),m,cH,fw);}}else{C.innerHTML=
"An error occured retrieving the data in Own Your Friends. OYF might be temporarily down for maintenance... <br>We appologize for this inconvenience and thank you for your patience.";}
NEWSFEED_CACHE.av();if(g(CUR_NEWSFEED))CUR_NEWSFEED.eh();return false;};function showDiscountPet(){ax.innerHTML="";var aq=new bG(ax);C=aq.aL();var kM=document.createElement("div");C.appendChild(kM);
if(V.bw()<=1500){kM.innerHTML="Only pets worth more than $1500 may be put on sale.";return false;}var iH=Math.floor((V.bw()*4)/5);if(iH<1500)iH=1500;kM.innerHTML=
"This will <b>reduce</b> <span style='color:#3b5998; font-weight:bold;'>"+V.D()+"</span>'s worth<p/>"+"from <span style='color:#09460F; font-weight:bold;'> $"+V.bw()+"</span> "+
"to <span style='color:red; font-weight:bold;'> $"+iH+"</span><p/>"+"Are you sure you want to put <span style='color:#3b5998; font-weight:bold;'>"+V.D()+"</span> on sale?";var hT=
document.createElement("div");C.appendChild(hT);hT.style.padding="10";new aJ(hT,"Put My Pet On Sale!",onDiscountPet);return false;};function onDiscountPet(){C.innerHTML=m.D()+" has been put on sale!";
var k={};k.from_user_id=MAIN_DATA.A().B();k.to_user_id=m.B();U(REQUEST_DESTINATION_URL+"/ffs/discountuser",function(J){f("<p/>&nbsp;<p/>"+oH(J));onDiscountPetCallback(J);},k,true);};
function onDiscountPetCallback(J){NEWSFEED_CACHE.av();if(g(CUR_NEWSFEED))CUR_NEWSFEED.eh();var F=bc(J);var rQ=jo(F,"info");if(g(rQ)){C.innerHTML=rQ;return false;}var iH=parseInt(K(F,"newworth"));f(
"<p/>New worth: "+iH+"<p/>");m.setWorth(iH);f("ProfileWorth_"+m.B());document.getElementById("ProfileWorth_"+m.B()).innerHTML=" $"+iH;return false;};var gz=undefined;function jl(){ax.innerHTML="";
var aq=new bG(ax);C=aq.aL();var kM=document.createElement("div");C.appendChild(kM);kM.innerHTML="Change <span style='color:#3b5998; font-weight:bold;'>"+V.D()+
"</span> status message (max 300 characters):";var lJ=document.createElement("div");C.appendChild(lJ);gz=new mQ(lJ,V.ea(),60,300);var hT=document.createElement("div");C.appendChild(hT);
hT.style.padding="10";new aJ(hT,"Change!",oW);return false;};function showRemovePet(){ax.innerHTML="";var aq=new bG(ax);C=aq.aL();var kM=document.createElement("div");C.appendChild(kM);kM.innerHTML=
"You are about to remove <span style='color:#3b5998; font-weight:bold;'>"+V.D()+"</span> from your pets. If you remove pets you lose possesion of them and you will not get "+
"any money for them. Would you like to Proceed?";var hT=document.createElement("div");C.appendChild(hT);hT.style.padding="10";new aJ(hT,"Remove Pet",onRemovePet);new aJ(hT,"Cancel",function(){
ax.removeChild(aq.ad());});return false;};function onRemovePet(){C.innerHTML="Removing "+m.D()+" from your pets. Please wait...";var k={};k.user_id=MAIN_DATA.A().B();k.pet_id=m.B();U(
REQUEST_DESTINATION_URL+"/ffs/removepet",function(J){f(oH(J));var F=bc(J);if(!g(F)){new ModalDialog("Unfortunately there was an error.  Please try again.","Error",null,ModalDialog.ERROR).showDialog();
C.innerHTML="Error occured removing your pet.";return false;}var l_info=K(F,"info");if(g(l_info)){new ModalDialog(decodeURIComponent(l_info),"Error",null,ModalDialog.ERROR).showDialog();C.innerHTML=
"Error occured removing your pet.";return false;}l_info=K(F,"error");if(g(l_info)){new ModalDialog(decodeURIComponent(l_info),"Error",null,ModalDialog.ERROR).showDialog();C.innerHTML=
"Error occured removing your pet.";return false;}NEWSFEED_CACHE.av();if(g(CUR_NEWSFEED))CUR_NEWSFEED.eh();MAIN_DATA.ar(v.MY_PETS).removeUser(V);new MyPetsDiv($("#myPetsDiv").parentNode,"myPetsDiv",m);
},k,true);return false;};function oW(){var hK=undefined;try{hK=nR(gz.cq());}catch(err){f(err);}document.getElementById("ProfileMessage_"+m.B()).innerHTML=jd(hK,35,/\S{35}/);m.jf(hK);C.innerHTML=m.D()+
"'s status message has been changed!";var k={};k.changer_id=MAIN_DATA.A().B();k.user_id=m.B();k.status_message=bo(gz.cq());U(REQUEST_DESTINATION_URL+"/ffs/saveuser",function(J){f(oH(J));
sendChangeStatusMessageNotification(MAIN_DATA.A(),m,gz.cq());NEWSFEED_CACHE.av();if(g(CUR_NEWSFEED))CUR_NEWSFEED.eh();},k,true);return false;};function nG(){ax.innerHTML="";var aq=new bG(ax);C=aq.aL()
;C.innerHTML=
"To sell your pet, you need to find a buyer! You can do this by either: <ol><li><b>Sending a Bulletin</b> out to your friends telling them your pet is for sale. <a href='#' onclick='nY(\""+m.getName()
+"\",\""+m.getId()+"\")'>Click here to send a Bulletin Now!</a></li>"+
"<li><b>Send or Post a Direct Link</b> to your Pet's details page. E-mail it to your friends! Post it to our forums! Just click in the text box below and press ctrl+C to copy and paste the link.<br>"+
"<div align='CENTER' style='margin: 5px 5px 5px 5px; text-align:center'>"+'<textarea id="raiseLinkTextArea" rows="2" cols="35" onclick="raiseLinkTextArea.select();">&lt;a href=&quot;'+
OYF_getShowUserDetailsLink(m.getId())+'&quot;&gt; &lt;font size="3"&gt; &lt;b&gt; Buy '+m.getName()+'! &lt;/b&gt; &lt;/font&gt; &lt;/a&gt; </textarea>'+"</div>"+"</li></ol>";return false;};
function giveGift(bS){OYF.GIFT_RECIPIENT=V;OYF.GIFT_TYPE=bS;OYF.mainTabs.switchToTab(OYF.TAB_GIVE_GIFT);}};var EARN_NEWSFEED_CACHE=new pk();function AdvertisingDiv(rA){var pL=rA;var l=null;this.qh=qh;
if(pL!=undefined){qh(pL);}function qh(_a_parentDiv){pL=_a_parentDiv;l=document.createElement("div");pL.appendChild(l);l.style.textAlign="center";new SponsorAppInstalls(l);new EmailSubmissionDiv(l);
new EarnNewsfeedDiv(l);new OffersDiv(l);}};function EarnNewsfeedDiv(rA){var pL=rA;var l=null;var ah=null;this.qh=qh;if(pL!=undefined){qh(pL);}function qh(_a_parentDiv){pL=_a_parentDiv;l=
document.createElement("div");pL.appendChild(l);l.style.textAlign="left";l.style.margin="5px";l.style.padding="0px";l.style.backgroundColor="#ffffff";l.style.borderStyle="solid";l.style.borderWidth=
"1px";l.style.borderColor="black";l.innerHTML=
"<div style='background-color: #ccddff; padding: 5px 10px 5px 12px; font-weight: bold; font-size: 16px; border-bottom: 1px solid #6688cc;'>More Money Bonuses:</div>";ah=document.createElement("div");
l.appendChild(ah);ah.style.height=150;ah.style.overflow="auto";ah.style.padding=20;ah.innerHTML="Loading entries...";U(REQUEST_DESTINATION_URL+"/ffs/getnewsfeed?epicenter_id="+MAIN_DATA.A().B()+
"&start=0&num=1000&type=Offer",onOfferFeedLoad);};function onOfferFeedLoad(eQ){var F=bc(eQ);var iq=new Array();if(F!=undefined){try{var bP=F.getElementsByTagName("newsfeed");if(g(bP)&&bP.length>0){
for(var r=0;r<bP.length;r++){var bE=bP[r];var hC=decodeURIComponent(bE.getElementsByTagName("message")[0].firstChild.nodeValue);var ie=bE.getElementsByTagName("created_on_in_mill")
[0].firstChild.nodeValue;hC=replaceYouInNewsfeed(hC);iq.push("<tr><td style='font-size: 11px; padding: 6px 10px 3px 10px; border-bottom: 1px solid #CCCCCC;'>"+hC+
"</td><td style='width: 80px; text-align: right; font-size: 10px; color: gray; padding-left: 10px; border-bottom: 1px solid #CCCCCC;'>"+lB(ie)+"</td></tr>");}}}catch(err){ac("onCacheLoad "+err);}}if(
iq.length==0){l.style.display="none";ah.style.display="none";return;}ah.style.padding=0;ah.innerHTML="<table style='padding: 10px; width: 680px; border-collapse: collapse;'>"+iq.join("")+"</table>";}}
;function InstallLinkDiv(rA){var pL=rA;var l=null;this.qh=qh;if(pL!=undefined){qh(pL);}function qh(_a_parentDiv){pL=_a_parentDiv;l=document.createElement("div");pL.appendChild(l);l.style.textAlign=
"center";var ir=document.createElement("div");l.appendChild(ir);ir.style.margin="5px";ir.style.padding="10px 5px 5px 5px";ir.style.backgroundColor="#DFFFBF";ir.style.borderStyle="solid";
ir.style.borderWidth="1px";ir.style.borderColor="#24B300";var hN=document.createElement("div");ir.appendChild(hN);hN.style.paddingLeft="10px";hN.style.textAlign="left";hN.innerHTML=
"<span style='font-weight:bold;font-size:14px;'>Earn <font color='red'>$5,000</font> for each of your friends that joins the application through this link!</span><br/> E-mail it to your friends! Post it on your blog! Just click in the text box below and press ctrl+C to copy and paste the link. </span>";
var hy=document.createElement("textarea");ir.appendChild(hy);hy.style.marginTop="15px";hy.style.marginLeft="auto";hy.style.marginRight="auto";hy.cols="70";hy.rows="3";hy.innerHTML="&lt;a href=&quot;"+
APP_URL+"&refer="+MAIN_DATA.A().B()+"&source=refer&quot;&gt;Find out how much I think you're WORTH!&lt;/a&gt;";aG(hy,"focus",function(){hy.select();});aG(hy,"click",function(){hy.select();});}};
function OffersDiv(rA,a_message,a_srcUrl,a_helpUrl){a_message=g(a_message)?a_message:"Earn additional $OYF cash and help sponsor this application by completing offers!";a_srcUrl=g(a_srcUrl)?a_srcUrl:
"http://pub.myofferpal.com/8a136dd47a62bee391771db52fca1264/showoffers.action?";a_helpUrl=g(a_helpUrl)?a_helpUrl:"http://pub.myofferpal.com/8a136dd47a62bee391771db52fca1264/userstatus.action?";var pL=
rA;var l=null;this.qh=qh;if(pL!=undefined){qh(pL);}function qh(_a_parentDiv){pL=_a_parentDiv;l=makeElementClass("div",pL,"offers_div");l.style.textAlign="center";var ab=MAIN_DATA.A();a_srcUrl+=
"snuid="+(ab.B()*3+1);a_helpUrl+="snuid="+(ab.B()*3+1);if(g(ab.kS())){var jV=undefined;try{jV=parseInt(ab.kS());}catch(err){jV=undefined;}if(g(jV)){a_srcUrl+="&dob=01-Jan-"+(2008-jV);}}if(g(ab.lv())){
a_srcUrl+="&gender="+ab.lv();}var l_html="<div style=\"text-align: left; background-color: #DFFFBF; border: 1px solid #24B300; margin: 5px; padding: 10px;\">";if(a_message!=""){l_html+=
"<span style='font-size:14px; font-weight:bold;'>"+a_message+"</span><br>";}l_html+="<b>Note:</b> Offers are provided by third party advertisers and are not affiliated with MySpace.<p>"+"<a href=\""+
a_helpUrl+"\" target=\"new_offerpal\">"+"To view your offers in progress or report problems with an offer, click here! </a></div>"+
"<iframe style='width:650px; height: 2300px; margin-left:auto; margin-right:auto; overflow:auto; border:none;' frameborder='0' src='"+a_srcUrl+"'>";l.innerHTML=l_html;}};function viewerGender(){try{
var l_gender=MAIN_DATA.A().lv().substring(0,1).toUpperCase();if(l_gender=="M"||l_gender=="F")return l_gender;}catch(e){dump(e)}return "U";};SponsorAppInstalls.sponsors=new Array();
SponsorAppInstalls.sponsors.push({appName:"Mobsters: Overdrive",appCode:"racing",appFaviconURL:"http://c1.ac-images.myspacecdn.com/images02/30/l_3c10d552cba84ec78c53da8396c9a680.gif",appBigImageURL:
"http://c4.ac-images.myspacecdn.com/images02/52/l_668c48e240b54d248244e856ae239487.gif",appProfileURL:"http://profile.myspace.com/Modules/Applications/Pages/Canvas.aspx?appId=123192&track=in_oyf",
appBlurb:"Join Mobsters: Overdrive and rule the streets of MySpace!<br>",appCash:
"<span style='font-size: 140%'>Up to $37,500 bonus!</span><br>($7,500 on install, PLUS $30,000 bonus on reaching level 12!)",appBulletinSubject:"",appBulletinContent:"",shown:function(){return(
viewerGender()!="F");}});SponsorAppInstalls.sponsors.push({appName:"Mobsters",appCode:"mob",appFaviconURL:"http://cdn0.mobwarsapp.com/mob/images/promotional/favicon.png",appBigImageURL:
"http://cdn0.mobwarsapp.com/mob/images/promotional/M3.jpg",appProfileURL:"http://profile.myspace.com/Modules/Applications/Pages/Canvas.aspx?appId=104283&track=in_oyf",appBlurb:
"Start a Mob with your friends. Rise from a petty thief to Mafia Don. Rule MySpace!<br>",appCash:
"<span style='font-size: 140%'>Up to $37,500 bonus!</span><br>($7,500 on install, PLUS $30,000 bonus on reaching level 5!)",appBulletinSubject:"",appBulletinContent:"",shown:function(){return(
viewerGender()!="F");}});SponsorAppInstalls.sponsors.push({appName:"Poker Palace",appCode:"poker",appFaviconURL:"http://cdn0.mobwarsapp.com/mob/images/promotional/favicon.png",appBigImageURL:
"http://cdn0.pokerpartyapp.com/prod_poker/img/js/logo_64x64.gif",appProfileURL:
"http://profile.myspace.com/Modules/Applications/Pages/Canvas.aspx?appId=109588&appParams=%7B%22src%22%3A%22oyf%22%7D&track=in_oyf",appBlurb:
"Poker Palace - Play for FREE in the best poker game on MySpace! Fun &amp; Easy!<br>",appCash:
"<span style='font-size: 140%'>Up to $37,500 bonus!</span><br>($7,500 on install, PLUS $30,000 bonus<br/>&nbsp; on collecting 20,000 poker chips)",appBulletinSubject:"",appBulletinContent:"",shown:
function(){return(viewerGender()!="F");}});SponsorAppInstalls.sponsors.push({appName:"Bloodlines",appCode:"vampires",appFaviconURL:
"http://c1.ac-images.myspacecdn.com/images02/44/l_a3ddfe697bd24a68b8ecb04709b14790.gif",appBigImageURL:"http://c1.ac-images.myspacecdn.com/images02/1/l_ef6e7f9a0b534910b9189375363004cc.jpg",
appProfileURL:"http://profile.myspace.com/Modules/Applications/Pages/Canvas.aspx?appId=123150&track=in_oyf",appBlurb:
"Get Bitten! Add Bloodlines to become a Vampire and explore the undead underworld of MySpace...<br>",appCash:
"<span style='font-size: 140%'>Up to $37,500 bonus!</span><br>($7,500 on install, PLUS $30,000 bonus on reaching level 12)",appBulletinSubject:"",appBulletinContent:"",shown:function(){return(
viewerGender()!="M");}});SponsorAppInstalls.sponsors.push({appName:"Sorority Life",appCode:"sorority",appFaviconURL:
"http://c1.ac-images.myspacecdn.com/images02/63/l_97f14c6363594e3ea7644ddee1c05a2c.gif",appBigImageURL:"http://c4.ac-images.myspacecdn.com/images02/3/l_4d74196a121148d4ac3d9bd7953b58a7.gif",
appProfileURL:"http://profile.myspace.com/Modules/Applications/Pages/Canvas.aspx?appId=113384&track=in_oyf",appBlurb:"A life of glitz and glam on MySpace!<br>",appCash:
"<span style='font-size: 140%'>Up to $37,500 bonus!</span><br>($7,500 on install, PLUS $30,000 bonus on reaching level 12)",appBulletinSubject:"",appBulletinContent:"",shown:function(){return(
viewerGender()!="M");}});function SponsorAppInstalls(rA){var pL=rA;var l=null;var m_timeout=null;this.qh=qh;if(pL!=undefined){qh(pL);}function qh(_a_parentDiv){pL=_a_parentDiv;l=
document.createElement("div");pL.appendChild(l);l.style.textAlign="center";l.style.marginTop="20px";try{U(ABTEST_DESTINATION_URL+"/apps?user_id="+MAIN_DATA.A().B(),drawSponsoredAppsDiv);m_timeout=
setTimeout(drawSponsoredAppsDiv,3000);}catch(e){f('could not retrieve list of apps installed!')};};function drawSponsoredAppsDiv(J){try{clearTimeout(m_timeout);}catch(e){};var l_appsInstalled="";
var F=bc(J);if(F!=undefined){try{l_appsInstalled=jo(F,"apps");}catch(e){f("Error retrieving list of installed apps: "+e);l_appsInstalled="";}}if(!g(l_appsInstalled))l_appsInstalled="";var l_sponsors=
new Array();var l_sponsors2=new Array();var sY=new Date();var l_randomvalue=(MAIN_DATA.A().B()+sY.getDate()*24+sY.getHours())*227;for(var fO=0;fO<SponsorAppInstalls.sponsors.length;fO++){var l_s=
SponsorAppInstalls.sponsors[fO];if(l_appsInstalled.indexOf(l_s.appCode)== -1){if((!l_s.shown||l_s.shown())&&l_randomvalue%4>0)l_sponsors.push(l_s);else l_sponsors2.push(l_s);l_randomvalue=Math.floor(
l_randomvalue/4);}}l_sponsors=l_sponsors.concat(l_sponsors2);if(l_sponsors.length==0)return;if(l_sponsors.length>3)l_sponsors=l_sponsors.slice(0,3);var ci=document.createElement("div");l.appendChild(
ci);ci.className="greenBox";ci.style.textAlign="left";ci.style.padding="10px";ci.innerHTML=
"<span style='font-size:14px; font-weight:bold;'> For a limited time, earn some more money by installing our sponsor's apps! </span>"+
"<br>Having trouble getting the bonus from installing a sponsored app? "+"Check the newsfeed below first to make sure you haven't already got it! <br>If it isn't there "+
"<a style='cursor: pointer; text-decoration: underline;' onclick='toFAQTab(OYF.mainTabs.getContentDiv()); showSupportIframe(); return false;'>Contact Peter</a>"+
" and choose the category More Money Offers.";var bi=document.createElement("div");l.appendChild(bi);bi.className="greenBox";bi.style.marginTop="5px";var aa=document.createElement("table");
bi.appendChild(aa);aa.style.marginLeft="auto";aa.style.marginRight="auto";var af=document.createElement("tbody");aa.appendChild(af);for(var fO=0;fO<l_sponsors.length;fO++){var l_s=l_sponsors[fO];
var rv=createSponsorLinks(l_sponsors[fO]);af.appendChild(rv);}};function createSponsorLinks(rB){var o=document.createElement("tr");o.style.height="120px";var fU=document.createElement("td");
o.appendChild(fU);fU.style.width="90px";var l_imgContainer=document.createElement("div");l_imgContainer.style.width=90;l_imgContainer.style.height=90;l_imgContainer.style.background="white url("+
rB.appBigImageURL+") no-repeat center center";fU.appendChild(l_imgContainer);var dU=document.createElement("td");o.appendChild(dU);dU.style.width="600px";var M=document.createElement("div");
dU.appendChild(M);M.style.paddingLeft="10px";M.innerHTML="<span style='font-weight:bold;font-size:18px;'>"+rB.appName+"</span>";var hY=document.createElement("div");hY.style.paddingLeft="10px";
dU.appendChild(hY);hY.innerHTML="<span style='font-size:11px;'>"+rB.appBlurb+"</span>";var qm=new dI(dU,false);var gk=qm.by();gk.style.width="250px";var dn=document.createElement("div");
gk.appendChild(dn);dn.style.textAlign="center";dn.style.paddingTop="10px";dn.style.paddingBottom="10px";new DivButton(dn,"Install "+rB.appName,function(){onClickThroughInstall(rB);});var sr=qm.bf();
sr.style.paddingLeft=20;sr.innerHTML="<span style='font-size:10px; font-weight:bold; color:red'>"+rB.appCash+"</span>";return o;};function onClickThroughInstall(rB){window.open(rB.appProfileURL);}};
function FriendChooserDiv(rA,a_friendData,a_randomize,a_bucketFunc,a_selectionModel,a_pageSize,a_emptyItemsDiv){if(a_selectionModel==null)alert('fuck');this.l=$divcl(rA,"friend_chooser");
this.m_selection=a_selectionModel;this.m_filterDiv=$divcl(this.l,"friend_filter");this.m_searchInput=new HelpfulInput(this.m_filterDiv,"Search by name...").getInput();$(this.m_searchInput).keyup(
this.delayedFilter.bind(this));this.m_curQuery="";this.m_pageSize=g(a_pageSize)?a_pageSize:21;this.ag=new FriendListDiv(this.l,null,this.m_selection,a_emptyItemsDiv);this.setupData(a_friendData,
a_randomize,a_bucketFunc);$divcl(this.l,"clearall");};FriendChooserDiv.prototype.DEBUG_MAGIC="peterpan";FriendChooserDiv.prototype.setupData=function(a_friendData,a_randomize,a_bucketFunc,a_batchSize)
{var l_data=a_friendData;if(g(a_randomize)&&a_randomize){this.m_randomizedData=l_data=l_data.randomized();}else{this.m_randomizedData=null;}this.m_filterData=l_data=l_data.filtered(
this.__curFilter.bind(this));if(g(a_bucketFunc)){l_data=l_data.lazyBucketed(a_bucketFunc,a_batchSize);}this.m_itemData=l_data;this.m_pagedItemData=this.m_itemData.paged(this.m_pageSize);
this.ag.setItemData(this.m_pagedItemData);};FriendChooserDiv.prototype.randomizeAgain=function(){if(g(this.m_randomizedData)){this.m_randomizedData.reset();}};FriendChooserDiv.prototype.getArray=
function(a_sizeLimit){return this.m_itemData.getCurData(0,a_sizeLimit);};FriendChooserDiv.prototype.hide=function(){$(this.m_filterDiv).css({display:"none"});this.ag.hide();};
FriendChooserDiv.prototype.show=function(){$(this.m_filterDiv).css({display:"block"});this.ag.show();};FriendChooserDiv.prototype.delayedFilter=function(){var l_query=$(this.m_searchInput).val().trim(
).toLowerCase();if(l_query==this.DEBUG_MAGIC){this.ag.enableDebug();}if(l_query==this.m_curQuery)return;this.m_curQuery=l_query;if(this.m_curQuery=="")this.ag.setIsFiltered(false);
else this.ag.setIsFiltered(true);if(this.m_delayTimeout){clearTimeout(this.m_delayTimeout);}this.ag.showLoading();this.m_delayTimeout=setTimeout(this.updateFilter.bind(this),100);};
FriendChooserDiv.prototype.__curFilter=function(dA){var l_query=this.m_curQuery;if(l_query=="")return true;var ng=dA.getName();if(!g(ng))return false;ng=ng.toLowerCase();return ng.indexOf(
this.m_curQuery)>=0;};FriendChooserDiv.prototype.updateFilter=function(){this.m_filterData.dirtyPredicate();};FriendChooserDiv.prototype.getFilterDiv=function(){return this.m_filterDiv;};
FriendChooserDiv.prototype.getFriendList=function(){return this.ag;};function FriendListDiv(rA,a_itemData,a_selectionModel,a_emptyItemsDiv){if(a_selectionModel==null)alert('fuck');this.m_iconSize=64;
this.m_showName=true;this.m_showZoom=true;this.m_resizeImage=false;this.m_debugMode=false;FriendListDiv.baseConstructor.call(this,rA,"friend_list",a_itemData,a_selectionModel,a_emptyItemsDiv);};
extendClass(FriendListDiv,SelectableItemListDiv);FriendListDiv.prototype.setIconSize=function(a_iconSize){this.m_iconSize=a_iconSize;return this;};FriendListDiv.prototype.setShowName=function(
a_showName){this.m_showName=a_showName;return this;};FriendListDiv.prototype.setShowZoom=function(a_showZoom){this.m_showZoom=a_showZoom;return this;};FriendListDiv.prototype.setResizeImage=function(
a_resizeImage){this.m_resizeImage=a_resizeImage;return this;};FriendListDiv.prototype.enableDebug=function(){this.m_debugMode=true;};FriendListDiv.prototype.drawItem=function(dA){if(!g(dA))return;
var l_self=this;var l_friendDiv=$divcl(this.ag,"item");var l_imageFrame=$divcl(l_friendDiv,"frame");var l_img=new eb(l_imageFrame,0,dA.cv(),this.m_iconSize,this.m_iconSize,null,null,this.ag,
this.m_showZoom,this.m_resizeImage);if(this.m_showName){var M=$divcl(l_friendDiv,"name");$(M).html(dA.getName());}if(this.m_debugMode){var debug_suffix=" app="+dA.getHasApp();debug_suffix+=" inv="+
dA.getAlreadyInvited();debug_suffix+=" blk="+dA.getInviteBlocked();$(l_friendDiv)[0].title=dA.getName()+debug_suffix;}else{$(l_friendDiv)[0].title=dA.getName();}if(this.m_selection.isSelected(dA)){$(
l_friendDiv).addClass('selected');}$(l_friendDiv).hover(function(){$(this).addClass('highlighted');},function(){$(this).removeClass('highlighted');}).click(this.click.bind(this,l_friendDiv,dA));
return l_friendDiv;};fl.NO_OWNER_HTML=
"<font size='2'><font color='red'>No one has bought you yet. Very sad...</font><br>Try <a href='#' onclick='OYF.mainTabs.switchToTab(OYF.TAB_INVITE); return false;'>inviting</a> your friends!</font>";
function fl(rA,V){var pL=rA;var m=V;var l=undefined;this.qh=qh;this.ad=ad;if(pL!=undefined){qh(pL);}function qh(_a_parentDiv){pL=_a_parentDiv;f("fl: qh");l=document.createElement("div");
pL.appendChild(l);var ho=new cN(l,OYF.WELCOME_MESSAGE);var di=document.createElement("a");var dj=document.createElement("a");var fj=document.createElement("div");fj.innerHTML=OYF.INTRO_MESSAGE;
var l_showPetFinderPromo=Math.random();if(l_showPetFinderPromo<0.7){var l_newPetFinderDiv=new bG(l);l_newPetFinderDiv.ad().style.width=730;l_newPetFinderDiv.aL().innerHTML=
"<table><tr><td style='vertical-align: top;'><img src='"+IMAGES_PROD_URL+"/new.gif'></td><td>"+
"<h1 style='padding-left:5px'>Pet Finder!</h1> <p> Make new friends and make some OYF $!!!  Try the new <a href='javascript:void(0);' onclick='OYF.mainTabs.switchToTab(OYF.TAB_PET_FINDER);return false;'>Pet Finder</a> and <strong>earn up to $30,000 every 24 hours! </strong></p>";
}else{var l_hotTipDiv=new bG(l);l_hotTipDiv.ad().style.width=730;if(g(OYF.invitableName)){l_hotTipDiv.aL().innerHTML="<table><tr><td><img src='"+OYF.invitableThumb+"'></td><td>"+OYF.HOT_TIP_TOP+
"Your friend <strong>"+OYF.invitableName+"</strong> is a bargain at $"+"<span style='color:#09460F; font-weight:bold;'>"+addCommas(OYF.invitableCost)+"</span><p>"+
"<a href='#' onclick='tipBuyConfirmation()'>Click here to buy them now!</a>"+"</td></tr></table><div id='friendbuycontrol'></div>";OYF.invitableDiv=l_hotTipDiv.aL();}else{l_hotTipDiv.oM();}}
di.onclick=function(){fj.style.display='block';dj.style.display='inline';di.style.display='none'};dj.onclick=function(){fj.style.display='none';dj.style.display='none';di.style.display='inline'};
di.href="#";dj.href="#";di.innerHTML="[show help]";dj.innerHTML="[hide help]";var l_forumLink=document.createElement("a");l_forumLink.href="http://forum.ownyourfriendsapp.com/";l_forumLink.target=
"forum";l_forumLink.innerHTML=" [visit the forum]";ho.ad().appendChild(di);ho.ad().appendChild(dj);ho.ad().appendChild(fj);ho.ad().appendChild(l_forumLink);ho.ad().style.position="relative";
l_forumLink.style.position="absolute";l_forumLink.style.right="25px";l_forumLink.style.top="13px";if(OYF.app_install_state==OYF.APP_JUST_INSTALLED){di.style.display='none';}else{fj.style.display=
'none';dj.style.display='none';}var hF=document.createElement("table");l.appendChild(hF);hF.style.width="740px";var lE=document.createElement("tbody");hF.appendChild(lE);var hH=document.createElement(
"tr");lE.appendChild(hH);var cO=document.createElement("td");hH.appendChild(cO);cO.style.paddingRight="10";cO.style.width=560;cO.width=560;cO.style.verticalAlign="top";var cl=new dI(cO);cl.by()
.style.verticalAlign="top";cl.by().style.width=280;cl.bf().style.verticalAlign="top";cl.bf().style.width=280;OYF.VIEWER_PROFILE=new am(cl.by(),m,"Me",am.LINK_TO_USER_PROFILE);var mc="My Owner";if(!g(
m.ct())){var G=document.createElement("div");G.className="ElementHeader";kY(G);G.innerHTML=mc;cl.bf().appendChild(G);new cN(cl.bf(),fl.NO_OWNER_HTML);}else{var mJ=new am(cl.bf(),m.ct(),mc,
am.LINK_TO_USER_DETAILS_TAB);}CUR_NEWSFEED=new ln(cO);var l_giftsHeader=$divcl(cO,"ElementHeader");l_giftsHeader.innerHTML="My Gifts";if(GIFT_RECEIVED_EMPTY){var dM=makeElementClass("div",cO,
"explanationBox");dM.innerHTML=
"<h1>My Gifts</h1> When your friends send you gifts, they will appear here. <a href='#' onclick='OYF.mainTabs.switchToTab(OYF.TAB_GIVE_GIFT)'>Click here</a> to send gifts to your friends.";}else{
new GiftsReceivedDiv(cO,GIFT_RECEIVED_CACHE.paged(7),true);}new MyPetsDiv(cO,"myPetsDiv",m);var eB=document.createElement("td");hH.appendChild(eB);eB.style.width="150px";eB.style.verticalAlign="top";
if(g(m.ct())){new pn(eB);}var l_sideAd=document.createElement("div");l_sideAd.id="rubicon-23114-9";eB.appendChild(l_sideAd);if(as(kP)){var rm=new kP(eB);}var l_advertiseYourself=$div(eB);$(
l_advertiseYourself).css({marginTop:"10px",paddingLeft:"2px"});var l_advertiseYourselfLink=$elid("a",l_advertiseYourself,"advertiseyourselflink");l_advertiseYourselfLink.href="javascript:void(0);";$(
l_advertiseYourselfLink).html("Advertise yourself");var l_advertiseMessage=
"<span style='font-size:13px'>You can get people to buy you by: <ol><li style='padding:5px'><b>Sending a Bulletin</b> out to your friends telling them to buy you. <a href='#' onclick='sendRaiseMyWorthBulletin(\""+
MAIN_DATA.A().getName()+"\",\""+MAIN_DATA.A().getId()+"\")'>Click here to send a Bulletin Now!</a></li>"+
"<li style='padding:5px'><b>Send or Post a Direct Link</b> to your details page. E-mail it to your friends! Post it to our forums! Just click in the text box below and press ctrl+C to copy and paste the link.<br>"+
"<div align='CENTER' style='margin: 5px 5px 5px 5px; text-align:center'>"+"<textarea id='raiseLinkTextArea' rows='1' cols='30' onclick='raiseLinkTextArea.select();'>"+OYF_getShowUserDetailsLink(
MAIN_DATA.A().getId())+"</textarea>"+"</div>"+"</li></ol></span>";$(l_advertiseYourselfLink).click(function(){var l_dialog=new ModalDialog(l_advertiseMessage,"Advertise yourself",null,
ModalDialog.INFO);l_dialog.setDimensions(300,500);l_dialog.showDialog();});var l_searchDiv=document.createElement("div");l_searchDiv.innerHTML=FRIEND_SEARCH_HTML;eB.appendChild(l_searchDiv);try{
init_ad();}catch(e){}};function ad(){return l;}};function MyPetsDiv(a_parent,id,V){var m_parent=a_parent;var m=V;var m_petDiv=undefined;jp();function jp(){m_petDiv=document.getElementById(id);if(!
m_petDiv){m_petDiv=$divid(m_parent,id);m_parent.appendChild(m_petDiv);}redraw();};function redraw(){m_petDiv.innerHTML="";var dS=$divcl(m_petDiv,"ElementHeader");dS.style.margin="20px 0px 0px 0px";az(
dS);dS.innerHTML="My Pets";var mG=new aS(m,v.MY_PETS,aS.PETS);if(g(MAIN_DATA.ar(v.MY_PETS))){var fD=undefined;mG.aB(function(qB){fD=qB;if(g(fD)&&fD>0&&fD<=100){dS.innerHTML="My Pets ("+fD+")";}});}
new fv(m_petDiv,mG);}};function tipBuyConfirmation(){if(MAIN_DATA.A().eg()<OYF.invitableCost){OYF.invitableDiv.innerHTML=
"<span style='color:#FF2222;'> Unfortunately you need a little more $$$ to buy "+OYF.invitableName+
"</span>. <a href='#' onclick='OYF.mainTabs.switchToTab(OYF.TAB_MORE_MONEY);return false;'>Click here</a> to earn more money...";return false;}OYF.invitableDiv.style.paddingBottom="20px";var hl=
document.createElement("div");hl.innerHTML="<span style='font-size:14px;'> Purchasing "+OYF.invitableName+" will cost <span style='color:red; font-weight:bold;'> $"+addCommas(OYF.invitableCost)+
"</span>. You currently have <span style='color:#09460F; font-weight:bold;'> $"+addCommas(MAIN_DATA.A().eg())+"</span>.<span><br><br>";OYF.invitableDiv.appendChild(hl);var mR=document.createElement(
"span");hl.appendChild(mR);new aJ(mR,"Buy "+OYF.invitableName+"!",tipBuy);return false;};function tipBuy(){OYF.invitableDiv.innerHTML="Purchasing "+OYF.invitableName;var k={};k.user_id=
OYF.invitableId;k.thumbnail_url=OYF.invitableThumb;k.display_name=bo(OYF.invitableName);k.from_user_id=MAIN_DATA.A().B();k.to_user_id=OYF.invitableId;U(REQUEST_DESTINATION_URL+"/ffs/purchaseuser",
function(aA){gY(aA,OYF.invitableDiv);},k,true);return false;};function gY(aA,a_hotTipDiv){var F=bc(aA);if(!g(F)){a_hotTipDiv.innerHTML=
"Unfortunately there was an error, the technical team has been notified. Thank you for your patience!";return false;}var hm=bp(F,"target_user_without_app");a_hotTipDiv.innerHTML="";var rQ=jo(F,"info")
;if(g(rQ)){a_hotTipDiv.innerHTML=rQ;return false;}if(g(hm)){var dk=K(F,"buyer_cash");if(g(dk)){try{MAIN_DATA.A().fZ(parseInt(dk));}catch(err){f(err);};try{MAIN_STATUS_DIV.fK(dk);}catch(err){f(err);};}
new cN(a_hotTipDiv,"You've just bought "+OYF.invitableName+"!<p>"+OYF.invitableName+" doesn't have this app yet. Please click below and leave them an invite to let them know that you OWN them! :-)");}
else{new cN(a_hotTipDiv,"You've just bought "+OYF.invitableName+".");}var fc=new dI(a_hotTipDiv);var cz=fc.by();new eb(cz,0,OYF.invitableThumb,80,80);var M=document.createElement("div");
cz.appendChild(M);M.innerHTML="<span style='font-size:11px; font-weight:bold;'>"+OYF.invitableName+"</span>";var aY=fc.bf();aY.style.width="400px";aY.style.textAlign="center";if(g(hm)){inviteOrNot(
a_hotTipDiv,aY,function(){notifyBuyPetIdInvite(MAIN_DATA.A(),OYF.invitableId,function(pE){a_hotTipDiv.parentNode.style.display="none";},OYF.invitableCost,OYF.invitableName);})}var dk=K(F,"buyer_cash")
;if(g(dk)){try{MAIN_DATA.A().fZ(parseInt(dk));}catch(err){f(err);};try{MAIN_STATUS_DIV.fK(dk);}catch(err){f(err);};}NEWSFEED_CACHE.av();if(g(CUR_NEWSFEED))CUR_NEWSFEED.eh();MAIN_DATA.ar(v.MY_PETS).av(
);new MyPetsDiv($("#myPetsDiv").parentNode,"myPetsDiv",MAIN_DATA.A());OYF.invitableName=null;return false;};var OS=opensocial.Container.get();APP_USERS=new Object();APP_USERS.PER_PAGE=100;
function loadAllAppUsers(){APP_USERS.userlist=new Array();APP_USERS.hasapp=new Object();loadAppUsersPage(1)};function loadAppUsersPage(a_start){MyOpenSpace.DefaultPageSize=APP_USERS.PER_PAGE;var ao={
FILTER:"HAS_APP",FIRST:a_start,GET_ONLINE:true};var ak=OS.newDataRequest();ak.add(ak.newFetchPeopleRequest(idSpecUtil.viewerFriends(),ao),"viewerfriends");ak.send(onLoadPageOfAppUsers);};
function onLoadPageOfAppUsers(bt){f("Read one page of app users.");var l_friends=bt.get("viewerfriends").getData();APP_USERS.numUsers=parseInt(l_friends.getTotalSize());l_friends.each(function(eO){
APP_USERS.userlist.push(eO);APP_USERS.hasapp[eO.getField(opensocial.Person.Field.ID)]=true;});if(APP_USERS.userlist.length<APP_USERS.numUsers){loadAppUsersPage(APP_USERS.userlist.length);}else{f(
"Finished loading all "+APP_USERS.numUsers+" app-users.")}};function Gift(jS){this.m_xmlNode=jS;var fX=$(this.m_xmlNode);this.m_gift_id=this._field("gift_id");this.m_item_id=this._field("item_id");
this.bx=this._field("name");this.m_name_with_article=this._field("name_with_article");this.m_cost=parseInt(this._field("cost"));this.m_giftPoints=parseInt(this._field("gift_points"));
this.m_launchedOn=this._field("launched_on",false);this.m_itemLimit=this._intField("item_limit",0);this.m_itemRemaining=this._intField("item_remaining",0);this.m_purchaseLimit=this._intField(
"purchase_limit",0);this.m_timeLimit=this._field("time_limit");this.m_timeLeft=this._field("time_left");this.m_soldOut=this._boolField("sold_out",false);this.m_animated=this._boolField("animated",
false);var l_fromNodes=fX.find("from");var l_toNodes=fX.find("to");if(l_fromNodes.length>0){this.m_from=new be();this.m_from.bT(l_fromNodes[0]);}if(l_toNodes.length>0){this.m_to=new be();this.m_to.bT(
l_toNodes[0]);}this.gr=this._field("created_on");this.m_message=this._field("message","");};Gift.prototype._field=function(iK,a_defaultValue){var l_result=$(this.m_xmlNode).find(iK);if(
l_result.length==0)return a_defaultValue;return l_result.text();};Gift.prototype._intField=function(iK,a_defaultValue){var l_result=$(this.m_xmlNode).find(iK);if(l_result.length==0)
return a_defaultValue;return parseInt(l_result.text());};Gift.prototype._boolField=function(iK,a_defaultValue){var l_result=$(this.m_xmlNode).find(iK);if(l_result.length==0)return a_defaultValue;
return l_result.text()=="true";};Gift.prototype.baseImageUrl="http://cdn1.slicezero.com/oyf_prod/images/gifts/";Gift.prototype.getSendParams=function(fromUser,toUser,message){var k={};k["from_id"]=
fromUser.getId();k["message"]=bo(message);k["item_id"]=this.getItemId();k["user_id"]=toUser.getId();k["display_name"]=bo(toUser.getDisplayName());k["thumbnail_url"]=toUser.cv();k["profile_url"]=
toUser.eP();k["age"]=toUser.kS();k["gender"]=toUser.lv();return k;};Gift.prototype.getGiftId=function(){return this.m_gift_id;};Gift.prototype.getItemId=function(){return this.m_item_id;};
Gift.prototype.getName=function(){return this.bx;};Gift.prototype.getNameWithArticle=function(){return this.m_name_with_article;};Gift.prototype.getImageURL=function(){
return Gift.getImageURLFromItemId(this.m_item_id,this.isAnimated());};Gift.getImageURLFromItemId=function(item_id,is_animated){is_animated=g(is_animated)?is_animated:true;var l_usegif=useGIF()||
is_animated;return Gift.prototype.baseImageUrl+item_id+(l_usegif?".gif":".png");};Gift.prototype.getCost=function(){return this.m_cost;};Gift.prototype.getGiftPoints=function(){return g(
this.m_giftPoints)?this.m_giftPoints:0;};Gift.prototype.getItemLimit=function(){return this.m_itemLimit;};Gift.prototype.getItemRemaining=function(){return this.m_itemRemaining;};
Gift.prototype.getTimeLimit=function(){return this.m_timeLimit;};Gift.prototype.getTimeLeft=function(){return this.m_timeLeft;};Gift.prototype.isSoldOut=function(){return this.m_soldOut;};
Gift.prototype.isAnimated=function(){return this.m_animated;};Gift.prototype.getFrom=function(){return this.m_from;};Gift.prototype.setFrom=function(V){this.m_from=V;};Gift.prototype.getTo=function(){
return this.m_to;};Gift.prototype.setTo=function(V){this.m_to=V;};Gift.prototype.cY=function(){return this.gr;};Gift.prototype.getMessage=function(){return this.m_message;};Gift.prototype.setMessage=
function(a_message){this.m_message=a_message;};function giftsFromXML(bh,a_selector){var l_result=[];$(bh).find(a_selector).each(function(i,giftNode){l_result.push(new Gift(giftNode));});
return l_result;};function GiftsReceivedDiv(rA,ot,a_deleteGift){this.m_deleteGift=false;if(a_deleteGift)this.m_deleteGift=a_deleteGift;GiftsReceivedDiv.baseConstructor.call(this,rA,"gifts_received",
ot);};extendClass(GiftsReceivedDiv,ItemListDiv);GiftsReceivedDiv.prototype.onDeleteDone=function(a_gift,eQ){var F=bc(eQ);if(!g(F)){new ModalDialog(
"Unfortunately there was an error.  Please try again.","Error",null,ModalDialog.ERROR).showDialog();return false;}var l_info=K(F,"info");if(g(l_info)){new ModalDialog(decodeURIComponent(l_info),
"Error",null,ModalDialog.ERROR).showDialog();return false;}l_info=K(F,"error");if(g(l_info)){new ModalDialog(decodeURIComponent(l_info),"Error",null,ModalDialog.ERROR).showDialog();return false;}
NEWSFEED_CACHE.av();if(g(CUR_NEWSFEED))CUR_NEWSFEED.eh();var gift_to_remove_index;var l_current_data_array=GIFT_RECEIVED_CACHE.getCurData(0,GIFT_RECEIVED_CACHE.getCurCount());for(var i=0;i<
l_current_data_array.length;++i){if(l_current_data_array[i].getGiftId()==a_gift.getGiftId()){gift_to_remove_index=i;break;}}if(gift_to_remove_index<GIFT_RECEIVED_CACHE.getCurCount()&&
gift_to_remove_index>=0)l_current_data_array.splice(gift_to_remove_index,1);GIFT_RECEIVED_CACHE.setArray(l_current_data_array);GIFT_RECEIVED_EMPTY=l_current_data_array.length==0;this.setItemData(
GIFT_RECEIVED_CACHE.paged(this.m_itemData.m_pageSize));this.redraw();};GiftsReceivedDiv.prototype.deleteGift=function(a_gift){var k=a_gift.getTo().dh();k.gift_id=a_gift.getGiftId();if(a_gift.getFrom()
&&a_gift.getFrom().B())k.from_user_id=a_gift.getFrom().B();U(REQUEST_DESTINATION_URL+"/ffs/deletegift",this.onDeleteDone.bind(this,a_gift),k,true);};GiftsReceivedDiv.prototype.confirmDelete=function(
a_gift){var l_buttons={};gaTrackEvent("gift","show_dialog","confirm_delete_dialog");l_buttons["Confirm Delete"]=this.deleteGift.bind(this,a_gift);l_buttons["Cancel"]=function(){gaTrackEvent("gift",
"click","confirm_delete_dialog/cancel");};var fromUser="Anonymous User";if(a_gift.getFrom()&&a_gift.getFrom().D())fromUser=a_gift.getFrom().D();var l_dialog=new ModalDialog(
"Are you sure you want to delete "+a_gift.getName()+" given to you by "+fromUser+"?","Confirm Delete",l_buttons,ModalDialog.WARNING);l_dialog.setIconImage(a_gift.getImageURL());l_dialog.showDialog();}
;GiftsReceivedDiv.prototype.drawItem=function(a_gift){var l_self=this;var l_giftDiv=$divcl(this.ag,"item");var tm=makeElementClass("div",l_giftDiv,"icon",{width:"64px",height:"64px",overflow:"hidden",
textAlign:"center",backgroundColor:"white",right:"0px",top:"0px",backgroundImage:"url('"+a_gift.getImageURL()+"')",backgroundPosition:"top center",backgroundRepeat:"no-repeat"});var l_fromDiv=$divcl(
l_giftDiv,"from");var l_fromText="from ";var l_popupFrom="";if(!a_gift.getFrom()){l_fromText="Anonymous";l_popupFrom="an anonymous friend";}else{l_fromText=a_gift.getFrom().D();l_popupFrom=
a_gift.getFrom().getName();$(l_fromDiv).click(OYF_showUserDetails.bind(null,a_gift.getFrom().B()));$(l_fromDiv).css({color:"#0E1F5B",textDecoration:"underline",cursor:"pointer"})}$(l_fromDiv).html(
l_fromText);if(this.m_deleteGift){var l_overlayDiv=makeElementClass("div",tm,"overlay",{position:"relative",right:"0px",top:"0px",width:"64px",height:"64px"});var l_deleteGiftDiv=makeElementClass(
"div",l_overlayDiv,"deleteImg");$(l_deleteGiftDiv).click(this.confirmDelete.bind(this,a_gift));l_deleteGiftDiv.title="Delete gift "+a_gift.getName()+" from "+l_popupFrom;}var popupMessage=
decodeURIComponent(a_gift.getMessage()).replace(/&nbsp;/g,' ').replace(/&quot;/g,'"');l_giftDiv.title=a_gift.getName()+" from "+l_popupFrom+". "+popupMessage;l_fromDiv.title=l_popupFrom;
return l_giftDiv;};var sampleGiftXML='<?xml version="1.0" encoding="UTF-8"?>\
<xml>\
<gift><item_id>1</item_id><name>Red Rose</name><cost>100</cost></gift>\
<gift><item_id>2</item_id><name>Kiss</name><cost>1000</cost><item_limit>5</item_limit><item_remaining>5</item_remaining></gift>\
<gift><item_id>3</item_id><name>Yellow Rose</name><cost>10000</cost><item_limit>100000</item_limit><item_remaining>99000</item_remaining></gift>\
<gift><item_id>4</item_id><name>Birthday Cake</name><cost>0</cost><sold_out>1</sold_out></gift>\
<gift><item_id>5</item_id><name>Shot Glass</name><cost>1000</cost></gift>\
<gift><item_id>6</item_id><name>Beer</name><cost>500</cost></gift>\
<gift><item_id>7</item_id><name>Diamond Ring</name><cost>50000</cost><item_limit>100000</item_limit><item_remaining>100000</item_remaining></gift>\
</xml>';var sampleReceivedXML='<?xml version="1.0" encoding="UTF-8"?>\
<xml>\
<gift><item_id>1</item_id><name>Red Rose</name><cost>100</cost><from><user_id>6221</user_id><display_name>Petra</display_name></from><message>Do I know you from somewhere</message><created_on>11/25/08</created_on></gift>\
<gift><item_id>6</item_id><name>Beer</name><cost>500</cost><from><user_id>6221</user_id><display_name>Petra</display_name></from><message>Can I get you a drink?</message></gift>\
<gift><item_id>2</item_id><name>Kiss</name><cost>1000</cost><from><user_id>6221</user_id><display_name>Petra</display_name></from><message>I like your butt.</message></gift>\
<gift><item_id>5</item_id><name>Shot Glass</name><cost>1000</cost><from><user_id>6221</user_id><display_name>Petra</display_name></from><message>Can I get you another drink?</message></gift>\
<gift><item_id>2</item_id><name>Kiss</name><cost>1000</cost><from><user_id>6221</user_id><display_name>Petra</display_name></from><message>I\'d look good on you</message></gift>\
<gift><item_id>6</item_id><name>Beer</name><cost>500</cost><from><user_id>6221</user_id><display_name>Petra</display_name></from><message>Is it hot in here, or is it just you?</message></gift>\
<gift><item_id>6</item_id><name>Beer</name><cost>500</cost><from><user_id>6221</user_id><display_name>Petra</display_name></from><message>Bond. James Bond.</message></gift>\
<gift><item_id>6</item_id><name>Beer</name><cost>500</cost><from><user_id>6221</user_id><display_name>Petra</display_name></from><message>I like it shaken, not stirred.</message></gift>\
<gift><item_id>7</item_id><name>Diamond Ring</name><cost>50000</cost><message>How was heaven when you left it?</message></gift>\
</xml>';function formatGiftPoints(a_giftPoints,a_addSuffix){var l_giftPointIconUrl="http://cdn1.slicezero.com/oyf_prod/images/gp"+(useGIF()?".gif":".png");var l_result="<span class='giftPoints'>"+
formatNumberWithCommas(a_giftPoints)+"<img src='"+l_giftPointIconUrl+"' style='height:11px;'></img>";if(a_addSuffix){l_result+=" gift points"}l_result+="</span>";return l_result;};
function getGiftsAvailableData(a_pageSize){var a_requestUrl=REQUEST_DESTINATION_URL+"/ffs/getitems";var a_parseFunc=function(bh){return giftsFromXML(bh,"items item");};return new RemoteData(
a_requestUrl,a_parseFunc).paged(a_pageSize);};GiveGiftsDiv.ITEM_GIFT=1;GiveGiftsDiv.HUMAN_GIFT=2;function GiveGiftsDiv(rA){this.pL=rA;this.m_giftSelectionModel=new SingleSelectionModel().bind(
"select",this.onSelectGift.bind(this));this.m_humanGiftSelectionModel=new SingleSelectionModel().bind("select",this.onSelectHumanGift.bind(this));this.m_friendSelectionModel=new SingleSelectionModel()
.bind("select",this.onSelectRecipient.bind(this));this.m_giftType=GiveGiftsDiv.ITEM_GIFT;this.m_tabSelected=GiveGiftsDiv.ITEM_GIFT;this.qh();};GiveGiftsDiv.prototype.addHeader=function(a_containerDiv,
a_label){var tq=$divcl(a_containerDiv,"ElementHeader");az(tq);$(tq).html(a_label);return tq;};GiveGiftsDiv.prototype.qh=function(){var l_self=this;var l_container=this.l=$divcl(this.pL,"give_gifts");
var l_tipDiv=$divcl(l_container,"explanationBox");l_tipDiv.innerHTML="<h1> Give a Gift </h1> Buy a gift and send it to a friend, or give them one of your pets as a human gift. ";
this.m_recipientHeader=this.addHeader(this.l,"<span id='prefix'></span> <span id='name'></span> <a href='javascript:void(0)' id='cancel'>(pick someone else)</a>");$(this.m_recipientHeader).find(
'#cancel').click(this.showChooser.bind(this));this.m_recipientContainerDiv=$divcl(l_container,'recipient');if(OYF.GIFT_RECIPIENT){this.m_friendSelectionModel.toggle(OYF.GIFT_RECIPIENT);
OYF.GIFT_RECIPIENT=undefined;if(OYF.GIFT_TYPE=="human")this.m_tabSelected=GiveGiftsDiv.HUMAN_GIFT;}else{this.showChooser();}$divcl(l_container,"clearall");this.m_giftHeader=this.addHeader(this.l,
"<span id='prefix'>Choose a gift:</span> <span id='name'></span>");this.m_giftPointStatus=$divcl(this.l,"status");this.fetchGiftPointStatus();var l_giftTabbedBarDiv=$divcl(this.l,"giftTabbedBar");$(
l_giftTabbedBarDiv).css({marginTop:"10px",marginBottom:"5px"});var l_tabUnorderedList=$el("ul",l_giftTabbedBarDiv);this.m_tabGifts=$el("li",l_tabUnorderedList);var l_tabGiftsAction=$el("a",
this.m_tabGifts);l_tabGiftsAction.href="javascript:void(0);";l_tabGiftsAction.title="Gifts";$(l_tabGiftsAction).html("<img src=\""+IMAGES_PROD_URL+
"/favicons/oyf_gift.gif\"  border=0></img>&nbsp;&nbsp;Gifts").click(this.switchGiftChooser.bind(this,GiveGiftsDiv.ITEM_GIFT));this.m_tabPets=$el("li",l_tabUnorderedList);var l_tabPetsAction=$el("a",
this.m_tabPets);l_tabPetsAction.href="javascript:void(0);";l_tabPetsAction.title="Pets";$(l_tabPetsAction).html("<img src=\""+IMAGES_PROD_URL+
"/favicons/people.gif\" valign=center border=0></img>&nbsp;Pets").click(this.switchGiftChooser.bind(this,GiveGiftsDiv.HUMAN_GIFT));this.m_giftChooserDiv=new GiftChooserDiv(l_container,
this.m_giftSelectionModel);this.m_humanGiftContainerDiv=$divcl(l_container,'human_gift');this.createPetChooser();this.displaySelectedTab();this.m_messageDiv=$divcl(l_container,"message");
this.m_messageHeader=this.addHeader(this.m_messageDiv,"Add a message (optional):");this.iE=new LimitedTextArea(this.m_messageDiv,"",300);this.iE.setWidth("440px");$divcl(l_container,"clearall");
var l_sendButton=makeElementClass("button",l_container,"send_gift_btn");$(l_sendButton).html("Send Gift!").click(this.sendGift.bind(this));};GiveGiftsDiv.prototype.fetchGiftPointStatus=function(al){
var l_self=this;MAIN_DATA.A().fillGiftPoints(function(a_giftPoints){l_self.updateCashStatus();if(al)al(a_giftPoints);});};GiveGiftsDiv.prototype.updateCashStatus=function(){var l_cash=MAIN_DATA.A()
.eg();var l_giftPoints=MAIN_DATA.A().getGiftPoints();$(this.m_giftPointStatus).html("You have <span class='dollars'>$"+formatNumberWithCommas(l_cash)+"</span> and "+formatGiftPoints(l_giftPoints,true)
+" ");var l_getMoreLink=makeElementId("a",this.m_giftPointStatus,"get_more_gift_points");l_getMoreLink.href="#";$(l_getMoreLink).click(this.showOfferDialog.bind(this,false)).html("(get more)");};
GiveGiftsDiv.prototype.switchGiftChooser=function(bS){if(bS==GiveGiftsDiv.ITEM_GIFT){this.m_tabSelected=GiveGiftsDiv.ITEM_GIFT;}else{this.m_tabSelected=GiveGiftsDiv.HUMAN_GIFT;}
this.displaySelectedTab();};GiveGiftsDiv.prototype.setGiftEveryone=function(a_giftEveryone){this.m_giftEveryone=a_giftEveryone;};GiveGiftsDiv.prototype.displaySelectedTab=function(){if(
this.m_tabSelected==GiveGiftsDiv.ITEM_GIFT){this.m_tabGifts.className="selected";this.m_giftChooserDiv.show();this.m_tabPets.className="";this.m_humanGiftChooserDiv.hide();}else{
this.m_tabGifts.className="";this.m_giftChooserDiv.hide();this.m_tabPets.className="selected";this.m_humanGiftChooserDiv.show();}};GiveGiftsDiv.prototype.onSelectHumanGift=function(V){var tq=$(
this.m_giftHeader);tq.find("#prefix").html("Selected gift: ");tq.find("#name").html(V.getDisplayName());this.m_giftSelectionModel.clear();this.m_giftType=GiveGiftsDiv.HUMAN_GIFT;};
GiveGiftsDiv.prototype.onSelectGift=function(a_gift){var tq=$(this.m_giftHeader);tq.find("#prefix").html("Selected gift: ");tq.find("#name").html(a_gift.getName());
this.m_humanGiftSelectionModel.clear();this.m_giftType=GiveGiftsDiv.ITEM_GIFT;};GiveGiftsDiv.prototype.clear=function(){var tq=$(this.m_giftHeader);tq.find("#prefix").html("Choose a gift: ");tq.find(
"#name").html("");this.m_giftSelectionModel.clear();this.m_humanGiftSelectionModel.clear();if(this.m_giftType==GiveGiftsDiv.HUMAN_GIFT)this.createPetChooser();};GiveGiftsDiv.prototype.clearMessage=
function(){this.iE.setText("");};GiveGiftsDiv.prototype.onSelectRecipient=function(dA){var l_self=this;var tq=$(this.m_recipientHeader);tq.find('#prefix').html("You are giving a gift to ");tq.find(
'#name').html(dA.getName());tq.find('#cancel').show();$(this.m_recipientContainerDiv).html("");dA.kQ(function(){new am(l_self.m_recipientContainerDiv,dA,null,am.LINK_TO_USER_DETAILS_TAB);})};
GiveGiftsDiv.prototype.showChooser=function(){this.m_friendSelectionModel.clear();var tq=$(this.m_recipientHeader);tq.find('#prefix').html("Choose a recipient:");tq.find('#name').html("");tq.find(
'#cancel').hide();$(this.m_recipientContainerDiv).html("");var l_friendsArray=OYF.VIEWER_FRIEND_CACHE.ar().slice();var l_petsArray=MAIN_DATA.ar(v.MY_PETS).getCurrentUsers();for(
var l_key in l_petsArray){if(!OYF.VIEWER_FRIEND_CACHE.hasUserId(l_petsArray[l_key].B())){l_friendsArray.push(l_petsArray[l_key]);}}new FriendChooserDiv(this.m_recipientContainerDiv,new ArrayData(
l_friendsArray),true,InviteUtil.lazyBucketFunc,this.m_friendSelectionModel,18);};GiveGiftsDiv.prototype.createPetChooser=function(){$(this.m_humanGiftContainerDiv).html("");var l_petsArray=
MAIN_DATA.ar(v.MY_PETS).getCurrentUsers();var dM=document.createElement("div");dM.className="explanationBox";dM.innerHTML=
"<h1> Your Pet List </h1> You don't own any friends to give away as pets yet! <a href='#' onclick='OYF.mainTabs.switchToTab(OYF.TAB_BUY_FRIENDS)'>Click here</a> to buy some of your friends!<br><br>When you buy your friends, they will show up here as pets.";
this.m_humanGiftChooserDiv=new FriendChooserDiv(this.m_humanGiftContainerDiv,new ArrayData(l_petsArray),false,null,this.m_humanGiftSelectionModel,18,dM);};GiveGiftsDiv.prototype.sendGift=function(){
this.m_recipient=this.m_friendSelectionModel.getSelectedItem();this.m_gift=this.m_giftSelectionModel.getSelectedItem();this.m_humanGift=this.m_humanGiftSelectionModel.getSelectedItem();this.m_message=
this.iE.cq();if(!g(this.m_recipient)){gaTrackEvent("gift","show_dialog","no_recipient");var dialog=new ModalDialog(this.MSG_MISSING_FRIEND,"Choose Recipient",null,ModalDialog.ERROR);dialog.showDialog(
);return;}if(this.m_giftType==GiveGiftsDiv.ITEM_GIFT){if(!g(this.m_gift)){gaTrackEvent("gift","show_dialog","no_gift");new ModalDialog(this.MSG_MISSING_GIFT,"Choose Gift",null,ModalDialog.ERROR)
.showDialog();return;}this.checkCanPay();}else{if(!g(this.m_humanGift)){gaTrackEvent("gift","show_dialog","no_human_gift");new ModalDialog(this.MSG_MISSING_HUMAN_GIFT,"Choose Human Gift",null,
ModalDialog.ERROR).showDialog();return;}this.showConfirmHumanGiftDialog();}};GiveGiftsDiv.prototype.dialogTemplateFields=function(){var l_cash=MAIN_DATA.A().eg();var l_userGiftPoints=MAIN_DATA.A()
.getGiftPoints();var l_gift=this.m_gift;var l_humanGift=this.m_humanGift;if(g(l_gift)){return{giftName:l_gift.getName(),giftNameWithArticle:l_gift.getNameWithArticle(),giftIcon:l_gift.getImageURL(),
cost:formatNumberWithCommas(l_gift.getCost()),cash:formatNumberWithCommas(l_cash),neededCash:formatNumberWithCommas(l_gift.getCost()-l_cash),giftPoints:formatGiftPoints(l_gift.getGiftPoints(),true),
userGiftPoints:formatGiftPoints(l_userGiftPoints),neededGiftPoints:formatGiftPoints(l_gift.getGiftPoints()-l_userGiftPoints),recipient:this.m_recipient.getName()}}else{var l_worth=addCommas(
l_humanGift.bw());return{petName:l_humanGift.getDisplayName(),petWorth:l_worth,recipient:this.m_recipient.getName()}}};GiveGiftsDiv.prototype.makeDialog=function(a_okText,a_okCallback,a_msg,a_title,
a_gaTag,bS,a_showGift,a_showCancel){var l_buttons={};gaTrackEvent("gift","show_dialog",a_gaTag);l_buttons[a_okText]=function(){gaTrackEvent("gift","click",a_gaTag+"/"+a_okText);a_okCallback();};if(!g(
a_showCancel)||a_showCancel){l_buttons["Cancel"]=function(){gaTrackEvent("gift","click",a_gaTag+"/cancel");};}var l_dialog=new ModalDialog(formatString(a_msg,this.dialogTemplateFields()),a_title,
l_buttons,bS);if(a_showGift){if(g(this.m_gift))l_dialog.setIconImage(this.m_gift.getImageURL());else l_dialog.setIconImage(this.m_humanGift.cv());}l_dialog.showDialog();};
GiveGiftsDiv.prototype.MSG_MISSING_FRIEND="Please pick a friend to give a gift to.";GiveGiftsDiv.prototype.MSG_MISSING_GIFT="Please pick a gift to send.";GiveGiftsDiv.prototype.MSG_MISSING_HUMAN_GIFT=
"Please pick a human gift to give to your friend.";GiveGiftsDiv.prototype.MSG_LOW_CASH=
"You are sending ${giftNameWithArticle} to ${recipient}.<br/>It costs <span class='dollars'>$${cost}</span><br/><br/>You only have <span class='dollars'>$${cash}</span> and need <span class='dollars'>$${neededCash}</span> more";
GiveGiftsDiv.prototype.MSG_CONFIRM_CASH=
"You are sending ${giftNameWithArticle} to ${recipient}.<br/>It costs <span class='dollars'>$${cost}</span><br/><br/>You have <span class='dollars'>$${cash}</span>";GiveGiftsDiv.prototype.MSG_LOW_GP=
"You are sending ${giftNameWithArticle} to ${recipient}.<br/>It costs ${giftPoints}<br/><br/>You only have <span class='giftPoints'>${userGiftPoints}</span> and need ${neededGiftPoints} more";
GiveGiftsDiv.prototype.MSG_CONFIRM_GP="You are sending ${giftNameWithArticle} to ${recipient}.<br/>It costs ${giftPoints}<br/><br/>You have <span class='giftPoints'>${userGiftPoints}</span>";
GiveGiftsDiv.prototype.MSG_CONFIRM_HUMAN_GIFT=
"Your pet ${petName} is worth <span style='color:red; font-weight:bold;'> $${petWorth}</span>. Are you sure you want to gift them away to ${recipient} for $1,250.";
GiveGiftsDiv.prototype.MSG_WAIT_FOR_GP=
"You need ${giftPoints} to buy ${giftNameWithArticle} but only have ${userGiftPoints}.<br/><br/>  Gift points may not appear immediately.  Check your newsfeed for updates.";
GiveGiftsDiv.prototype.MSG_GP_OFFER='<table style="font-family:Georgia, Aria, sans-serif;">'+'<tr><td style="vertical-align:top;width:50px" rowspan="2">'+
'<img src="${giftIcon}" style="height:64px;width:64px;" />'+'</td><td style="border-bottom:1px solid #ccc;font-weight:bold;">${giftName}</td></tr><tr><td>'+GiveGiftsDiv.prototype.MSG_LOW_GP+
'<br/><br/> Earn additional gift points and help sponsor this application by completing an offer below!'+'</td></tr></table>';GiveGiftsDiv.prototype.MSG_GP_OFFER_GET_MORE=
'<table style="font-family:Georgia, Aria, sans-serif;">'+'<tr><td style="vertical-align:top;width:50px" rowspan="2">'+
'<img src="http://cdn1.slicezero.com/oyf_prod/images/promotional/oyf_blue_gift.PNG" style="height:64px;width:64px;" />'+
'</td><td style="border-bottom:1px solid #ccc;font-weight:bold;">Gift Points</td></tr><tr><td>'+
'Earn additional gift points and help sponsor this application by completing an offer below!<br/>Check your newsfeed to see when offers are completed.'+'</td></tr></table>';
GiveGiftsDiv.prototype.checkCanPay=function(){var l_cost=this.m_gift.getCost();var l_cash=MAIN_DATA.A().eg();var l_giftPoints=this.m_gift.getGiftPoints();var l_userGiftPoints=MAIN_DATA.A()
.getGiftPoints();if(l_cost>0){if(l_cash<l_cost){this.showNeedMoneyDialog();}else{this.showConfirmMoneyDialog();}}else{if(l_userGiftPoints<l_giftPoints){this.showNeedGiftPointsDialog();}else{
this.showConfirmGiftPointsDialog();}}};GiveGiftsDiv.prototype.showNeedMoneyDialog=function(){this.makeDialog("Get More Money",function(){OYF.mainTabs.switchToTab(OYF.TAB_MORE_MONEY)},
this.MSG_LOW_CASH,"Not Enough Cash","need_money_dialog",ModalDialog.ERROR);};GiveGiftsDiv.prototype.showConfirmMoneyDialog=function(){var l_dialog=this.makeDialog("Send Gift",
this.sendGiftRequest.bind(this),this.MSG_CONFIRM_CASH,"Confirm Gift","confirm_money_dialog",ModalDialog.INFO,true);};GiveGiftsDiv.prototype.showConfirmHumanGiftDialog=function(){var l_dialog=
this.makeDialog("Send Human Gift",this.sendHumanGiftRequest.bind(this),this.MSG_CONFIRM_HUMAN_GIFT,"Confirm Human Gift","confirm_human_gift_dialog",ModalDialog.INFO,true);};
GiveGiftsDiv.prototype.showNeedGiftPointsDialog=function(){this.makeDialog("Get Gift Points",this.showOfferDialog.bind(this,true),this.MSG_LOW_GP,"Insufficient Gift Points","need_gp_dialog",
ModalDialog.ERROR)};GiveGiftsDiv.prototype.showConfirmGiftPointsDialog=function(){this.makeDialog("Send Gift",this.sendGiftRequest.bind(this),this.MSG_CONFIRM_GP,"Confirm Gift","confirm_gp_dialog",
ModalDialog.INFO,true)};GiveGiftsDiv.prototype.showOfferDialog=function(a_showGift){var l_contentDiv=$divcl(null,"gift_offer_dialog");var l_buttons=null;if(a_showGift){$(l_contentDiv).html(
formatString(GiveGiftsDiv.prototype.MSG_GP_OFFER,this.dialogTemplateFields()));l_buttons={"Continue (Done Offer)":this.onOfferDone.bind(this),"Cancel":function(){gaTrackEvent("gift","click",
"gift_offer_dialog/cancel");}}}else{$(l_contentDiv).html(GiveGiftsDiv.prototype.MSG_GP_OFFER_GET_MORE);l_buttons={"Close":function(){gaTrackEvent("gift","click","gift_offer_dialog_get_more/close");}}}
var bb=$divcl(l_contentDiv,"button_div");var T="";var mT="http://pub.myofferpal.com/18b1cbdbb2acd55b2d3809b29c8113e5/showoffers.action?";var tn=
"http://pub.myofferpal.com/18b1cbdbb2acd55b2d3809b29c8113e5/userstatus.action?";var l_offerDiv=new OffersDiv(l_contentDiv,T,mT,tn);var l_dialog=new ModalPopup(l_contentDiv,l_buttons,bb);l_dialog.show(
);};GiveGiftsDiv.prototype.onOfferDone=function(){gaTrackEvent("gift","click","gift_offer_dialog/offer_done");this.fetchGiftPointStatus(this.checkGiftPoints.bind(this));};
GiveGiftsDiv.prototype.checkGiftPoints=function(){var l_giftPoints=this.m_gift.getGiftPoints();var l_userGiftPoints=MAIN_DATA.A().getGiftPoints();this.updateCashStatus();if(l_userGiftPoints<
l_giftPoints){this.showWaitForPointsDialog();}else{this.showConfirmGiftPointsDialog();}};GiveGiftsDiv.prototype.showWaitForPointsDialog=function(){var l_self=this;var l_buttons={"Get Gift Points":
function(){gaTrackEvent("gift","click","wait_for_points_dialog/get_gift_points");l_self.showOfferDialog(true);},"Close":function(){gaTrackEvent("gift","click","wait_for_points_dialog/close");}};
var l_dialog=new ModalDialog(formatString(GiveGiftsDiv.prototype.MSG_WAIT_FOR_GP,this.dialogTemplateFields()),"Insufficient Gift Points",l_buttons,ModalDialog.INFO);l_dialog.setIconImage(
this.m_gift.getImageURL());l_dialog.showDialog();};GiveGiftsDiv.prototype.sendGiftRequest=function(){try{gaTrackEvent("gift","send",this.m_gift.getName());gaTrackEvent("gift","message_length","",
this.m_message.length);}catch(err){f(err);}var k=this.m_gift.getSendParams(MAIN_DATA.A(),this.m_recipient,this.m_message);if(this.m_giftEveryone)k.pf_num_gifts_sent=1;U(REQUEST_DESTINATION_URL+
"/ffs/giftitem",this.onSendGift.bind(this),k,0);};GiveGiftsDiv.prototype.sendHumanGiftRequest=function(){try{gaTrackEvent("human_gift","send",this.m_humanGift.getName());gaTrackEvent("human_gift",
"message_length","",this.m_message.length);}catch(err){f(err);}var k=this.m_recipient.dh();k.owner_id=MAIN_DATA.A().B();k.pet_id=this.m_humanGift.B();U(REQUEST_DESTINATION_URL+"/ffs/giftpet",
this.onSendGift.bind(this),k,true);};GiveGiftsDiv.prototype.onSendGift=function(J){var F=bc(J);if(!g(F)){new ModalDialog("Unfortunately there was an error.  Please try again.","Error",null,
ModalDialog.ERROR).showDialog();return false;}var l_info=K(F,"info");if(g(l_info)){new ModalDialog(decodeURIComponent(l_info),"Error",null,ModalDialog.ERROR).showDialog();return false;}var dk=K(F,
"giver_cash");this.updateViewerCash(dk);var l_giftPoints=K(F,"giver_gift_points");this.updateViewerGiftPoints(l_giftPoints);NEWSFEED_CACHE.av();if(this.m_giftType==GiveGiftsDiv.HUMAN_GIFT){
MAIN_DATA.ar(v.MY_PETS).removeUser(this.m_humanGift);}var rY=g(K(F,"target_user_without_app"));var l_isBannedFromCommenting=g(K(F,"banned_from_submitting_comments"));this.showSuccessDialog(rY,
l_isBannedFromCommenting);};GiveGiftsDiv.prototype.showSuccessDialog=function(a_recipientWithoutApp,a_isBannedFromCommenting){var l_self=this;var l_doneCallback=this.reset.bind(this);if(
a_recipientWithoutApp){var T=this.m_recipient.D()+" doesn't have this app yet. Click below to send them an invite to let them know they've got a gift!";inviteOrNotDialog(T,"Gift Sent!",function(){if(
l_self.m_giftType==GiveGiftsDiv.ITEM_GIFT)notifyGiftItemFriendInvite(MAIN_DATA.A(),l_self.m_gift,l_self.m_recipient,l_doneCallback);else notifyGiftPetFriendInvite(MAIN_DATA.A(),l_self.m_humanGift,
l_self.m_recipient,l_doneCallback);},l_doneCallback);}else{var T="You've successfully sent "+this.m_recipient.D()+" a gift.<br/><br/>";if(l_self.m_giftType==GiveGiftsDiv.ITEM_GIFT)
sendGiftItemFriendNotification(MAIN_DATA.A(),l_self.m_gift,l_self.m_recipient,l_doneCallback);else sendGiftPetFriendNotification(MAIN_DATA.A(),l_self.m_humanGift,l_self.m_recipient,l_doneCallback);if(
a_isBannedFromCommenting){T+="However, you are banned from sending messages, so the message you tried to submit with the gift was not sent.<br/>";successDialog(T,"Gift Sent!",l_doneCallback);}else if(
this.m_giftEveryone){successDialog(T,"Gift Sent!",l_doneCallback);}else{T+="Why not send them a comment letting them know they've got a gift?";commentOrNotDialog(T,"Gift Sent!",function(){if(
l_self.m_giftType==GiveGiftsDiv.ITEM_GIFT)sendGiftItemFriendComment(MAIN_DATA.A(),l_self.m_gift,l_self.m_recipient,l_doneCallback);else sendGiftPetFriendComment(MAIN_DATA.A(),l_self.m_gift,
l_self.m_recipient,l_doneCallback);},l_doneCallback);}}};GiveGiftsDiv.prototype.updateViewerCash=function(a_cashLeft){if(g(a_cashLeft)){try{MAIN_DATA.A().fZ(parseInt(a_cashLeft));}catch(err){f(err);};
try{MAIN_STATUS_DIV.fK(a_cashLeft);}catch(err){f(err);};this.updateCashStatus();}};GiveGiftsDiv.prototype.updateViewerGiftPoints=function(a_giftPoints){if(g(a_giftPoints)){try{MAIN_DATA.A()
.setGiftPoints(parseInt(a_giftPoints));}catch(err){f(err);};this.updateCashStatus();}};GiveGiftsDiv.prototype.reset=function(){this.clear();this.clearMessage();this.showChooser();};
function GiftChooserDiv(rA,a_selectionModel){var l_itemData=getGiftsAvailableData(27);GiftChooserDiv.baseConstructor.call(this,rA,"gift_chooser",l_itemData,a_selectionModel);};extendClass(
GiftChooserDiv,SelectableItemListDiv);GiftChooserDiv.prototype.drawItem=function(a_gift){var l_self=this;var l_giftDiv=$divcl(this.ag,"item");var l_img=$elcl("img",l_giftDiv,"icon");l_img.src=
a_gift.getImageURL();var l_cost=a_gift.getCost();var l_giftPoints=a_gift.getGiftPoints();if(l_giftPoints>0){var l_gpDiv=$divcl(l_giftDiv,"gift_points");var l_gpText=formatGiftPoints(l_giftPoints);$(
l_gpDiv).html(l_gpText);}else{var l_costDiv=$divcl(l_giftDiv,"cost");var l_costText="Free";if(l_cost>0){l_costText="$"+formatNumberWithCommas(l_cost);}$(l_costDiv).html(l_costText);}var l_limitDiv=
$divcl(l_giftDiv,"limit");var l_limitText="&nbsp;";var l_itemLimit=a_gift.getItemLimit();if(a_gift.isSoldOut()){l_limitText="Sold Out";$(l_giftDiv).addClass('sold_out');}else if(l_itemLimit){
var l_itemRemaining=a_gift.getItemRemaining();l_limitText=formatNumberWithCommas(l_itemRemaining)+" left";}$(l_limitDiv).html(l_limitText);if(this.m_selection.isSelected(a_gift)){$(l_giftDiv)
.addClass('selected');}$(l_giftDiv).hover(function(){if(!a_gift.isSoldOut())$(this).addClass('highlighted');},function(){$(this).removeClass('highlighted');}).click(function(){if(a_gift.isSoldOut())
return;l_self.click(l_giftDiv,a_gift);});return l_giftDiv};function inviteOrNotDialog(a_message,a_title,al,a_cancelCallback){new ModalDialog(a_message,a_title,{"Send Invite!":al,"No, thanks":
a_cancelCallback},ModalDialog.INFO).showDialog();};function successDialog(a_message,a_title,al){new ModalDialog(a_message,a_title,{"OK":al},ModalDialog.INFO).showDialog();};
function commentOrNotDialog(a_message,a_title,al,a_cancelCallback){new ModalDialog(a_message,a_title,{"Send Comment!":al,"No, thanks":a_cancelCallback},ModalDialog.INFO).showDialog();};function ly(rA)
{gaTrackEvent("invite","show","new_page");var pL=rA;var l=undefined;if(pL!=undefined){qh(pL);}function qh(_a_parentDiv){pL=_a_parentDiv;f("ly: qh");l=document.createElement("div");pL.appendChild(l);
var l_bulletinDiv=makeElementClass("div",l,"inviteInstructionBox",{padding:"2px",margin:"0px"});var G=makeElement("div",l_bulletinDiv,{padding:"5px",fontSize:"16px"});G.innerHTML=
"Think this is fun? <b>Invite your friends with a bulletin!</b> ";var bb=makeElement("button",G,{fontSize:"16px",fontWeight:"bold"});var cd="I'm worth $"+MAIN_DATA.A().bw()+
". How much are YOU worth?";var cf="I'm worth $"+MAIN_DATA.A().bw()+". <br/><a href='"+OYF_appendSourceToken(APP_URL,'ni','bulletin','link','worth','v5')+
"'> Click here to find out how much YOU are worth!</a> ";$(bb).html("Send Bulletin!").click(function(){gaTrackEvent("invite","click","new_send_bulletin");if(OYF.network_current==OYF.NETWORK_MYSPACE&&
MAIN_DATA.er()){cB(opensocial.IdSpec.PersonId.VIEWER,MAIN_DATA.fg(),MAIN_DATA.eZ(),undefined,OYF_GIF_TYPE.NONE);}else{cB(opensocial.IdSpec.PersonId.VIEWER,cd,cf,undefined,OYF_GIF_TYPE.LOGO);}});
var dD=makeElementClass("div",l,"ElementHeader",{marginTop:"10px"});az(dD);$(dD).html("Choose Friends to Invite:");new lz(l);}};function lz(rA){this.m_selectLimit=20;this.pL=rA;this.m_selection=
new MultiSelectionModel().bind("select",this.onSelect.bind(this)).bind("unselect",this.onRemove.bind(this));this.m_chosenSelection=new SingleSelectionModel().bind("select",
this.onRemoveFromChosen.bind(this));if(this.pL!=undefined){this.qh();}};lz.SendButtonTxt="Send Invites!";lz.NoFriendSelectedMsg="Please click on some friends to invite.";lz.InviteMsg=
"Hey [recipient], I just bought you as my PET! Add \"Own Your Friends\" to find out how much I think you're WORTH!";lz.prototype.qh=function(){f("InviteFriendsDiv: createDiv");this.l=makeElementClass(
"div",this.pL,"friendInviter");if(!g(OYF.VIEWER_FRIEND_CACHE)){OYF.VIEWER_FRIEND_CACHE=new jz();}this.mx();};lz.prototype.mx=function(lQ){this.l.innerHTML="";this.m_selection.clear();
this.m_sideBySide=new dI(this.l);this.m_pickerDiv=this.m_sideBySide.by();$(this.m_pickerDiv).addClass("picker");this.m_rightCell=this.m_sideBySide.bf();$(this.m_rightCell).css("vertical-align","top");
this.m_chosenDiv=makeElementClass("div",this.m_rightCell,"chosen");$(this.m_chosenDiv).addClass("chosen");this.m_friendData=new ViewerFriendsCacheData(OYF.VIEWER_FRIEND_CACHE,1000);
this.m_friendChooser=new FriendChooserDiv(this.m_pickerDiv,this.m_friendData,true,InviteUtil.lazyBucketFunc,this.m_selection,21);var l_filterDiv=this.m_friendChooser.getFilterDiv();var kF=
makeElementClass("a",l_filterDiv,"chooseLink",{marginLeft:"120px"});kF.href="javascript:void(0)";$(kF).html("Send Invites to "+this.m_selectLimit+" Friends").click(this.selectRandom.bind(this));
var l_clear=makeElementClass("a",l_filterDiv,"chooseLink",{marginLeft:"20px"});l_clear.href="javascript:void(0)";$(l_clear).html("Clear Selected").click(this.le.bind(this));this.m_chosenHeader=
makeElementClass("div",this.m_chosenDiv,"header");$(this.m_chosenHeader).html("Selected Friends");this.m_chosenData=new ArrayData();this.m_selectedFriend=new FriendListDiv(this.m_chosenDiv,
this.m_chosenData.paged(this.m_selectLimit),this.m_chosenSelection);this.m_selectedFriend.setIconSize(32).setShowName(false).setShowPagination(false).setShowZoom(false).setResizeImage(true);
this.m_inviteBtn=makeElementClass("button",this.m_chosenDiv,"inviteButton");$(this.m_inviteBtn).html(lz.SendButtonTxt).click(this.sendInvites.bind(this));};lz.prototype.onSelect=function(dA){
this.updateSelectedDiv();if(this.m_selection.getCount()>=this.m_selectLimit){this.sendInvites();}};lz.prototype.onRemove=function(dA){this.updateSelectedDiv();};lz.prototype.onRemoveFromChosen=
function(dA){this.m_selection.deselect(dA);this.updateSelectedDiv();};lz.prototype.updateSelectedDiv=function(){var l_selected=this.m_selection.getSelected();var l_count=l_selected.length;var l_text=
"Selected Friends:";if(l_count>1){l_text="Selected "+l_count+" Friends";}this.m_chosenHeader.innerHTML=l_text;this.m_chosenData.setArray(l_selected);};lz.prototype.le=function(){gaTrackEvent("invite",
"click","new_clear");this.m_selection.clear();};lz.prototype.selectRandom=function(){gaTrackEvent("invite","click","new_random10");this.m_selection.clear();var l_items=this.m_friendChooser.getArray(
200);if(l_items.length<=this.m_selectLimit){for(var i=0;i<l_items.length;i++){this.m_selection.select(l_items[i]);}return;}while(this.m_selection.getCount()<this.m_selectLimit){var i=Math.floor(
Math.random()*l_items.length);var l_randItem=l_items[i];this.m_selection.select(l_randItem);}};lz.prototype.sendInvites=function(){var l_self=this;var kT=this.m_selection.getSelected();if(kT.length==
0){gaTrackEvent("invite","click","send_fail_no_friend");new ModalDialog(lz.NoFriendSelectedMsg,"Choose a Friend",null,ModalDialog.ERROR).showDialog();return;}gaTrackEvent("invite","click",
"new_send_invites",kT.length);cC();InviteUtil.sendMultipleInvites(kT,lz.InviteMsg,function(){l_self.mx();},"invite_friends_tab");};function jv(qH,V){var m=V;var l=undefined;var fM=qH;var re=
"mailto:?subject="+escape("hey")+"&body="+escape("boo");this.qh=qh;if(fM!=undefined){qh(fM);}function qh(_a_parentElement){fM=_a_parentElement;l=document.createElement("div");fM.appendChild(l);var eH=
document.createElement("table");l.appendChild(eH);eH.style.borderSpacing="2px";eH.style.border="none";eH.style.margin="0px";var lL=document.createElement("tbody");eH.appendChild(lL);var hU=
document.createElement("tr");lL.appendChild(hU);var ck=document.createElement("td");ck.style.verticalAlign="top";hU.appendChild(ck);new eb(ck,0,m.cv(),80,80);var gW=document.createElement("td");
gW.style.width="400px";gW.style.verticalAlign="top";hU.appendChild(gW);commentOrNot(qH,gW,function(){pe(m);});var M=document.createElement("div");l.appendChild(M);M.style.textAlign="left";
M.style.margin="0px 0px 0px 5px";M.innerHTML="<span style='font-size:11px; font-weight:bold;'>"+m.D()+"</span>";};function mA(jP){var ew=
"http://messaging.myspace.com/index.cfm?fuseaction=mail.message&friendID="+jP;window.open(ew,'BulletinsWin','top=200, screenY=200, scrollbars=yes, resizable=yes');};function sJ(jP){var ew=
"http://comment.myspace.com/index.cfm?fuseaction=user.viewProfile_commentForm&friendID="+jP;window.open(ew,'BulletinsWin','top=200, screenY=200, scrollbars=yes, resizable=yes');}};var UI_VERSION=0;
function init_ad(){var l_user_id="";try{l_user_id=MAIN_DATA.A().getId();}catch(e){}document.getElementById('rubicon-23114-9').innerHTML=
'<iframe src="http://optimized-by.rubiconproject.com/a/7921/12723/23114-9.html?uid='+l_user_id+'" frameborder="0" marginwidth="0" marginheight="0" scrolling="NO" width="160" height="600"></iframe>';
document.getElementById('rubicon-23114-2').innerHTML='<iframe src="http://optimized-by.rubiconproject.com/a/7921/12723/23114-2.html?uid='+l_user_id+
'" frameborder="0" marginwidth="0" marginheight="0" scrolling="NO" width="728" height="90"></iframe>';};function init(){f("init called");document.getElementById("mainFrame").style.marginTop="0px";
document.getElementById("mainFrame").style.paddingTop="0px";document.getElementById("mainFrame").style.height="3500px";try{initializeGA("UA-4182330-1");}catch(err){f("urchin tracking error: "+err);}
if(jw()){gadgets.window.adjustHeight(3900);}else{gadgets.window.adjustHeight(3800);}var k=gadgets.views.getParams();for(var aj in k){f(aj+" >>> "+k[aj]);}try{var pq=k["installState"];switch(pq){
case "0":OYF.app_install_state=OYF.APP_NOT_INSTALLED;break;case "1":OYF.app_install_state=OYF.APP_INSTALLED;break;case "2":OYF.app_install_state=OYF.APP_JUST_INSTALLED;break;default:
OYF.app_install_state=OYF.APP_INSTALLED;break;}}catch(err){OYF.app_install_state=OYF.APP_INSTALLED;}f("App install state: "+OYF.app_install_state);if(OYF.app_install_state==OYF.APP_NOT_INSTALLED){nJ()
;}else if(g(OYF.MAINTENANCE)&&OYF.MAINTENANCE){var ps=new jX(document.getElementById("mainFrame"),
"<span style='font-weight:bold;'> I am currently performing routine maintenance, please check back in 1 hour. <br/><br/> Thank you for your patience! </span> <br/> <span style='font-weight:500; font-style:italic;'> -Peter</span>",
"360px");ps.iC().style.textAlign="left";}else{new jX(document.getElementById("mainFrame"),
"<span style='font-weight:bold;'> Waiting for server to respond... </span> <br/> <span style='font-size:10px;'> (Refreshing the page may help...) </span>","300px");MAIN_DATA=new oL(oR);if(!g(
OYF.VIEWER_FRIEND_CACHE)){OYF.VIEWER_FRIEND_APPUSERS_CACHE=getAppUsersCache();OYF.VIEWER_FRIEND_APPUSERS_CACHE.fh(1000,function(){OYF.VIEWER_FRIEND_CACHE=new jz();})}}};function nJ(){var hc=
document.getElementById("mainFrame");var hN=document.createElement("div");hc.appendChild(hN);var l_arrowleft=390;if(navigator.userAgent.indexOf("MSIE")>=0)l_arrowleft=300;hN.innerHTML="<center>"+
"<img src='"+IMAGE_SOURCE_URL+"/preview/oyf_bw_screen.JPG' style='width: 461; height: 531; position: absolute; left:260; top: 60; z-index: 0'>"+"</center>"+
"<div id='uninstalled'><div class='uninstalled_button'><a class='uninstalled_button' href='http://profile.myspace.com/Modules/Applications/Pages/Canvas.aspx?appId="+gadgets.views.getParams().appid+
"&autoInitiateInstall=true'><div style='width:314px; height:62px; cursor:pointer'></div></a></div></div>";return false;};function oR(){var hQ=document.getElementById("mainFrame");hQ.innerHTML=
"<div id='OYFpopupcontainer' style='z-index: 10000; width: 100%; position: absolute; left: 0px; top: 100px;'></div>"+"<div id='rubicon-23114-2'></div>";var qp=MAIN_DATA.A().B();if(qp%2==0){UI_VERSION=
0;}else{UI_VERSION=1;}MAIN_STATUS_DIV=new nN(hQ);MAIN_STATUS_DIV.fK(MAIN_DATA.A().eg());var cL=new Array();cL.push(OYF.TAB_HOME);cL.push(OYF.TAB_PET_FINDER);cL.push(OYF.TAB_BUY_FRIENDS);cL.push(
OYF.TAB_GIVE_GIFT);cL.push(OYF.TAB_MORE_MONEY);cL.push(OYF.TAB_INVITE);var dr=new Array();dr.push(mX);dr.push(toPetFinder);dr.push(mY);dr.push(toGiveGiftsTab);dr.push(toEarnMoneyTab);dr.push(mV);
var dw=new Array();dw.push("left");dw.push("left");dw.push("left");dw.push("left");dw.push("left");dw.push("left");var hW= -1;var mp=0;try{var l_gadgetParams=gadgets.views.getParams();var l_rsrc2=
l_gadgetParams.rsrc;var l_rsrc=l_gadgetParams.rsrc;if(!g(l_rsrc)){l_rsrc="none";}var l_install_state=["not_installed","installed","just_installed"][OYF.app_install_state];var l_trackTag=l_rsrc+"_"+
l_install_state;abTest(MAIN_DATA.A().B(),l_trackTag);gaTrackPageview("/rsrc/"+l_trackTag);}catch(err){f(err)}var k=gadgets.views.getParams();if(g(k)&&g(k["showProfileUserId"])){try{hW=parseInt(
k["showProfileUserId"]);}catch(err){f(err)};if(hW>0){cL.push("Details");var qo=function(contentDiv){nL(hW,contentDiv);};dr.push(qo);dw.push("left");mp=cL.length-1;}}OYF.mainTabs=new jb(hQ,cL,dr,dw,mp,
"unSelectedTab","selectedTab","tab");initLinks();};function initLinks(){var l_ul=$elcl("ul",null,"rhs_tab_links");var l_privacyOption=$el("li",l_ul);var l_privacyLink=$el("a",l_privacyOption);
l_privacyLink.href="#";l_privacyLink.innerHTML="Privacy";$(l_privacyLink).click(function(){toPrivacyTab(OYF.mainTabs.aL());});var l_helpOption=$el("li",l_ul);var l_helpLink=$el("a",l_helpOption);
l_helpLink.href="#";l_helpLink.innerHTML="Help";$(l_helpLink).click(function(){mZ(OYF.mainTabs.aL());});$(".right_tabs").append(l_ul);};function mX(aT){f("mX");aT.innerHTML="";new fl(aT,MAIN_DATA.A())
;};function toPetFinder(aT){f("toPetFinder");aT.innerHTML="";new PetFinderDiv(aT,MAIN_DATA.A());};function mY(aT){f("mY");aT.innerHTML="";if(!g(OYF.FETCH_USER_ACTION_MAP)){if(OYF.app_install_state==
OYF.APP_JUST_INSTALLED){OYF.FETCH_USER_ACTION_MAP=new aS(MAIN_DATA.A(),v.MY_FRIENDS,aS.FRIENDS_AND_GLOBAL);}else{OYF.FETCH_USER_ACTION_MAP=new aS(MAIN_DATA.A(),v.MY_FRIENDS,aS.FRIENDS_AND_GLOBAL);}}
new fv(aT,OYF.FETCH_USER_ACTION_MAP);};function mV(aT){f("mV");aT.innerHTML="";new ly(aT);};function toEarnMoneyTab(aT){f("toEarnMoneyTab");aT.innerHTML="";new AdvertisingDiv(aT);};
function toGiveGiftsTab(aT){f("toGiveGiftsTab");aT.innerHTML="";new GiveGiftsDiv(aT);};function toPrivacyTab(aT){OYF.mainTabs.mB();try{gaTrackPageview("canvas/Privacy");}catch(err){f(err);}f(
"toPrivacyTab");aT.innerHTML="";new PrivacyDiv(aT);};function mZ(aT){OYF.mainTabs.mB();try{gaTrackPageview("canvas/Help");}catch(err){f(err);}var a_initialized=false;f("mZ");if(!a_initialized){
aT.innerHTML="";var tv="";tv+=
"<font size=\"3\">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.</font><br>";
new oz(aT,"oyf",tv);}};function oz(rA,a_gameName,a_faqText){this.pL=rA;this.l=undefined;this.m_gameName=a_gameName;this.m_faqText=a_faqText;this.jp();this.qh();};oz.prototype.jp=function(){};
oz.prototype.qh=function(){this.l=makeElementClass("div",this.pL,"faq");this.l.innerHTML=this.m_faqText;$(this.l).append("<div id='supportIFrameDiv'></div>");$("#supportIFrameDiv").css({'padding-top':
'15px'});//@todo move to styles.js
this.showSupportIFrame();};oz.prototype.showSupportIFrame=function(){var game_name=this.m_gameName;var user_id=MAIN_DATA.A().B();var mob_name=MAIN_DATA.A().getDisplayName();var reward_page='myspace';
var base_url='http://support-lb.myspacegamingapps.com/';if(REQUEST_DESTINATION_URL.search(/qa|127\.0\.0\.1/)!= -1)base_url='http://74.86.60.37:8080/';var site=base_url+game_name+'/support_n?user_id='+
user_id+'&amp;user_name='+mob_name+'&amp;reward_page='+reward_page;$('#supportIFrameDiv').html("<iframe id='supportIFrame' frameborder='0' src ='"+site+"'></iframe>");$('#supportIFrame').css({
//@todo move to styles.js
"border":"none 0px","width":"762px","height":"1850px"});cC();};function PrivacyDiv(rA){var pL=rA;var l=undefined;if(pL!=undefined){qh(pL);}function qh(_a_parentDiv){pL=_a_parentDiv;l=
document.createElement("div");l.id="privacycontrol_div";l.innerHTML="Loading your privacy settings ...";pL.appendChild(l);U(REQUEST_DESTINATION_URL+"/ffs/getblocks?user_id="+MAIN_DATA.A().B(),
onPrivacyBlockLoad);}};function onPrivacyBlockLoad(eQ){var me=oH(eQ);if(me!=undefined){try{var tq="<div class=\"ElementHeader\">Own Your Friends Privacy Controls</div><br>"+
"If you do not want to included in Own Your Friends, <a href=\"javascript:showPrivacyOptOutDiv();\">Click here</a><br>&nbsp;<br>"+"<div id=\"privacyOptOutDiv\"></div>";document.getElementById(
"privacycontrol_div").innerHTML=tq+me;}catch(err){ac("onPrivacyBlockLoad "+err);}}};function privacyUnblockUser(bg){U(REQUEST_DESTINATION_URL+"/ffs/getblocks?user_id="+MAIN_DATA.A().B()+
"&unblock_id="+bg,onPrivacyBlockLoad);};function privacyToggleFriendsOnly(){var ts=document.getElementById("onlyfriendscanownme_checkbox").checked;U(REQUEST_DESTINATION_URL+"/ffs/getblocks?user_id="+
MAIN_DATA.A().B()+"&only_friends="+ts,onPrivacyBlockLoad);};function showPrivacyOptOutDiv(){var l_privacyOptOutDiv=document.getElementById("privacyOptOutDiv");if(!l_privacyOptOutDiv.firstChild){
var tz=new bG(l_privacyOptOutDiv);l_privacyOptOutDiv.closableDiv=tz;var ty="<font size=+1><strong>Opt-out of Own Your Friends</strong></font><p>"+
"If you don't want to be a part of Own Your Friends, you can opt-out of the game. "+"You will no longer be owned by anyone. Your pets will be transferred to Tom. "+
"Your account will no longer be visible to others, or available for purchase.<p>"+"If you want to start playing again later, just go back to this page and click "+
" the link in the same place; however, the owner and pets you had before CANNOT be restored.<p>"+"<button onclick=\"initiateOptOutAction();\">Remove me from Own Your Friends</button>";tz.aL()
.innerHTML=ty;}else{l_privacyOptOutDiv.closableDiv.ad().style.display="block";}};function initiateOptOutAction(){U(REQUEST_DESTINATION_URL+"/ffs/optout?user_id="+MAIN_DATA.A().B(),onOptOutLoad);};
function onOptOutLoad(eQ){var me=oH(eQ);if(me!=undefined){try{document.getElementById("mainFrame").innerHTML=me;}catch(err){ac("onPrivacyBlockLoad "+err);}}};function nL(bg,aT){f("toUserProfileTab");
aT.innerHTML="";var ge=document.createElement("div");aT.appendChild(ge);ge.style.width="700px";ge.style.marginLeft="30px";new lo(ge,bg,6,true,true);};function kP(rA){var pL=rA;var l=undefined;this.ad=
ad;if(g(rA)){qh(rA);}function qh(_a_parentDiv){pL=_a_parentDiv;l=document.createElement("div");l.style.marginTop=8;pL.appendChild(l);l.style.backgroundColor="#FFFFFF";kX(l);var G=
document.createElement("div");l.appendChild(G);G.style.padding="5px";az(G);G.innerHTML="<span style='color:#333333; font-size:12px;'> Other Great Apps! </span>";var bi=document.createElement("div");
l.appendChild(bi);var aa=document.createElement("table");bi.appendChild(aa);var af=document.createElement("tbody");aa.appendChild(af);af.appendChild(oJ("Overdrive","Dario",
"http://c1.ac-images.myspacecdn.com/images02/30/l_3c10d552cba84ec78c53da8396c9a680.gif","http://profile.myspace.com/Modules/Applications/Pages/Canvas.aspx?appId=123192&track=ni_oyf"));af.appendChild(
oJ("Bloodlines","G A I L","http://c1.ac-images.myspacecdn.com/images02/44/l_a3ddfe697bd24a68b8ecb04709b14790.gif",
"http://profile.myspace.com/Modules/Applications/Pages/Canvas.aspx?appId=123150&track=ni_oyf"));af.appendChild(oJ("Mobsters","The Godfather",
"http://cdn0.mobwarsapp.com/mob/images/promotional/favicon.png","http://profile.myspace.com/Modules/Applications/Pages/Canvas.aspx?appId=104283&track=ni_oyf"));af.appendChild(oJ("Poker Palace",
"Lucky","http://a923.ac-images.myspacecdn.com/images01/127/l_55b4e5b5be4ab7b5dfb7439813fef69a.gif","http://profile.myspace.com/Modules/Applications/Pages/Canvas.aspx?appId=109588&track=ni_oyf"));
af.appendChild(oJ("Sorority Life","Carol","http://c1.ac-images.myspacecdn.com/images02/63/l_97f14c6363594e3ea7644ddee1c05a2c.gif",
"http://profile.myspace.com/Modules/Applications/Pages/Canvas.aspx?appId=113384&track=ni_oyf"));};function oJ(qi,og,qq,qj){var o=document.createElement("tr");var cJ=document.createElement("td");
o.appendChild(cJ);cJ.style.padding="5px";cJ.innerHTML="<img style='margin-left:5px; margin-right:5px; vertical-align:middle;' src='"+qq+"'/> <span style='color:#3b5998; font-size:11px;'><b>"+qi+
"</b><br/><span style='padding-left:32px;'> (by "+og+")</span></span>";cJ.style.cursor="pointer";aE(cJ,"click",window.open,qj);return o;};function createTrackedLink(qi,og,qq,qj,sI){var o=
document.createElement("tr");var cJ=document.createElement("td");o.appendChild(cJ);cJ.style.padding="5px";cJ.innerHTML="<img style='margin-left:5px; margin-right:5px; vertical-align:middle;' src='"+
qq+"'/> <span style='color:#3b5998; font-size:11px;'><b>"+qi+"</b><br/><span style='padding-left:32px;'> (by "+og+")</span></span>";cJ.style.cursor="pointer";var k=new Object();k.url=qj;k.trackingTag=
sI;aE(cJ,"click",openTrackedURL,k);return o;};function openTrackedURL(sG){window.open(sG.url);abTest(MAIN_DATA.A().B(),sG.trackingTag);};function ad(){return l;}};var FRIEND_SEARCH_HTML=
"<div id='searchspot'>Search your friends!<br> \
<input id='inputsearchfield' type='text' size='20' onkeyup='inputSearchChange()' onchange='doFriendSearch()'></input> \
<button id='friendsearchbutton' onclick='doFriendSearch()' disabled>Search</button><br> \
<div id='friendsearchresults'><div id='closer'><a onclick='hideFriendSearchResults()'>X</a></div><div id='friendsearchcontent'></div></div> \
</div> \
";var SEARCHABLE_FRIENDS;function inputSearchKeyDown(){hideFriendSearchResults();if(window.event&&window.event.keyCode){var keyCode=window.event.keyCode;if(keyCode==13){doFriendSearch();}}};
function inputSearchChange(){id("inputsearchfield").onkeydown=inputSearchKeyDown;if(id("inputsearchfield").value.length>0){id("friendsearchbutton").disabled=false;}else if(id("friendsearchbutton")
.innerHTML=="Search"){id("friendsearchbutton").disabled=true;}};function doFriendSearch(){var l_prefix=id("inputsearchfield").value;if(l_prefix.length<1)return;id("friendsearchbutton").innerHTML=
"Searching ...";id("friendsearchbutton").disabled=true;var matches_exact=new Array();var matches_substr=new Array();var matches_folded=new Array();var l_lower=l_prefix.toLowerCase();var l_folded=
l_lower.replace(/[^a-z0-9]/g,'');var sP=(new Date()).getTime();var l_last=sP;var l_alreadyAdded={};SEARCHABLE_FRIENDS=MAIN_DATA.ar(v.MY_PETS).getCurrentUsers().concat(OYF.VIEWER_FRIEND_CACHE.ar());
for(var i=0;i<SEARCHABLE_FRIENDS.length&&matches_exact.length<10;i++){var name=SEARCHABLE_FRIENDS[i].getName().toLowerCase();if(!g(l_alreadyAdded[SEARCHABLE_FRIENDS[i].B()])){if(name.indexOf(l_lower)
==0){matches_exact.push(i);l_alreadyAdded[SEARCHABLE_FRIENDS[i].B()]=1;}else if(name.indexOf(l_lower)>0){matches_substr.push(i);l_alreadyAdded[SEARCHABLE_FRIENDS[i].B()]=1;}else if(name.replace(
/[^a-z0-9]/g,'').indexOf(l_folded)>=0){matches_folded.push(i);l_alreadyAdded[SEARCHABLE_FRIENDS[i].B()]=1;}}if(i%1000==0){var l_cur=(new Date()).getTime();if(l_cur-l_last>500){f(
"drawing intermediate friend search results");drawFriendSearchResults(matches_exact.concat(matches_substr,matches_folded));l_last=l_cur;}}}var sN=(new Date()).getTime();f(
"Elapsed time for name search of "+SEARCHABLE_FRIENDS.length+" friends: "+(sN-sP)+"ms");drawFriendSearchResults(matches_exact.concat(matches_substr,matches_folded));id("friendsearchbutton").innerHTML=
"Search";id("friendsearchbutton").disabled=false;};function drawFriendSearchResults(a_arr){id("friendsearchresults").style.display="block";if(a_arr.length==0)id("friendsearchcontent").innerHTML=
"no matches";else{var l_results=new Array();for(var hs=0;hs<a_arr.length&&hs<10;hs++){var l_displayName=SEARCHABLE_FRIENDS[a_arr[hs]].getName();var qp=SEARCHABLE_FRIENDS[a_arr[hs]].B();
var l_thumbnail=SEARCHABLE_FRIENDS[a_arr[hs]].cv();l_displayName=unescape(l_displayName);if(IE){l_results.push("<div onclick='OYF_showUserDetails(\""+qp+"\", 1)'><div class='im'><img src=\""+
l_thumbnail+"\" onclick='OYF_showUserDetails("+qp+", 2)'></div><span onclick='OYF_showUserDetails("+qp+", 3)'>"+l_displayName+"</span></div>");}else{l_results.push(
"<div onclick='OYF_showUserDetails(\""+qp+"\", 5)'><div class='im'><img src=\""+l_thumbnail+"\"></div><span>"+l_displayName+"</span></div>");}}id("friendsearchcontent").innerHTML=l_results.join("");}}
;function hideFriendSearchResults(){id("friendsearchresults").style.display="none";};function PetFinderUser(V){this.m=V;this.m_viewed=false;this.m_viewedNext=false;this.m_givenThumbsup=false;};
PetFinderUser.prototype.getUser=function(){return this.m;};PetFinderUser.prototype.isViewed=function(){return this.m_viewed;};PetFinderUser.prototype.setViewed=function(a_viewed){this.m_viewed=
a_viewed;};PetFinderUser.prototype.isViewedNext=function(){return this.m_viewedNext;};PetFinderUser.prototype.setViewedNext=function(a_viewedNext){this.m_viewedNext=a_viewedNext;};
PetFinderUser.prototype.isGivenThumbsup=function(){return this.m_givenThumbsup;};PetFinderUser.prototype.setGivenThumbsup=function(a_thumbsup){this.m_givenThumbsup=a_thumbsup;};
function PetFinderOperationManager(a_petFinderDiv){this.m_petFinder=a_petFinderDiv;this.m_refreshRate=750;this.m_getUsersOp=undefined;this.m_operations=[];this.m_currentOp=undefined;
this.m_updateTrackingRecurrence=3;this.m_updateTrackingCounter=this.m_updateTrackingRecurrence;clearInterval(PetFinderOperationManager.invokeOperationInterval);var l_self=this;
PetFinderOperationManager.invokeOperationInterval=setInterval(function(){l_self.processNextOperation();},this.m_refreshRate);};PetFinderOperationManager.prototype.addOperation=function(a_operation,sG)
{switch(a_operation){case PetFinderOperation.TYPE.SWITCHGENDER:{this.m_getUsersOp=new PetFinderOperation(a_operation,this.m_petFinder.switchGender.bind(this.m_petFinder,sG));break;}
case PetFinderOperation.TYPE.PREVIOUS:{this.m_operations.push(new PetFinderOperation(a_operation,this.m_petFinder.previousProfile.bind(this.m_petFinder,sG)));break;}case PetFinderOperation.TYPE.NEXT:{
this.m_operations.push(new PetFinderOperation(a_operation,this.m_petFinder.nextProfile.bind(this.m_petFinder,sG)));break;}default:{}}};PetFinderOperationManager.prototype.processNextOperation=
function(){this.m_updateTrackingCounter--;if(!this.m_currentOp||this.m_currentOp.isExpired()){this.m_currentOp=undefined;if(this.m_getUsersOp){this.m_operations.splice(0,this.m_operations.length);
this.m_currentOp=this.m_getUsersOp;this.m_getUsersOp=undefined;}else if(this.m_operations.length>0){this.m_currentOp=this.m_operations.shift();}if(this.m_currentOp)this.m_currentOp.execute();}if(
this.m_updateTrackingCounter==0){this.m_updateTrackingCounter=this.m_updateTrackingRecurrence;this.m_petFinder.updateTrackingData();}};PetFinderOperationManager.prototype.doneCurrentOp=function(
a_operation,sG){this.m_currentOp=undefined;};function PetFinderOperation(bS,a_func){this.cQ=bS;this.m_func=a_func;};PetFinderOperation.prototype.execute=function(){this.m_func();this.m_startTime=
new Date().getTime();};PetFinderOperation.prototype.isExpired=function(){if(this.m_startTime)return(new Date().getTime()-this.m_startTime)>10000;return false;};PetFinderOperation.TYPE={};
PetFinderOperation.TYPE.PREVIOUS=1;PetFinderOperation.TYPE.NEXT=2;PetFinderOperation.TYPE.SWITCHGENDER=3;function PetFinderDiv(rA){this.pL=rA;this.l=undefined;this.m_currentUser=0;this.m_users=[];
this.dF="Both";this.isDebug=false;this.m_userIdChangedAttribsMap=new Object();var l_self=this;this.m_petFinderOperationManager=new PetFinderOperationManager(this);this.qh();};PetFinderDiv.IMAGE_WIDTH=
"400";PetFinderDiv.IMAGE_HEIGHT="400";PetFinderDiv.prototype.qh=function(){var l_self=this;var l_tipDiv=$divcl(this.pL,"explanationBox");l_tipDiv.innerHTML=
"<h1> Find a Pet </h1> Look for a pet to own, and find new ways to make OYF money. You can earn up to $30,000 every 24 hours using the pet finder.";var l_switch_gender=function(){
var l_currentSelected=$(".gender_options .selected").get(0);$(".gender_options .selected").removeClass('selected');$(l_currentSelected).html("");var l_link=$el("a",l_currentSelected);l_link.href=
"javascript:void();";$(l_link).html(l_currentSelected.pf_gender);$(l_link).click(l_switch_gender);var l_gender=$(this).parent().get(0).pf_gender;$(this).parent().addClass('selected');$(this).parent()
.html("<span>"+l_gender+"</span>");l_self.m_petFinderOperationManager.addOperation(PetFinderOperation.TYPE.SWITCHGENDER,l_gender);};this.m_selectionDiv=$divcl(this.pL,"select_gender");
var l_gender_options=$divcl(this.m_selectionDiv,"gender_options");var l_option_choice=$divcl(l_gender_options,"gender_option_choice");l_option_choice.pf_gender="Both";$(l_option_choice).addClass(
"first");$(l_option_choice).addClass("selected");l_option_choice.innerHTML="<span>Both</span>";l_option_choice=$divcl(l_gender_options,"gender_option_choice");l_option_choice.pf_gender="Male";
var l_male_choice=$el("a",l_option_choice);l_male_choice.href="javascript:void();";$(l_male_choice).html("Male");$(l_male_choice).click(l_switch_gender);l_option_choice=$divcl(l_gender_options,
"gender_option_choice");l_option_choice.pf_gender="Female";var l_female_choice=$el("a",l_option_choice);l_female_choice.href="javascript:void();";$(l_female_choice).html("Female");$(l_female_choice)
.click(l_switch_gender);var l_label=$div(this.m_selectionDiv);$(l_label).css({color:"#666666",fontWeight:"bold",padding:"10px"});$(l_label).html("Select Gender:");this.l=$divcl(this.pL,"petfinder");
this.loadUsers(this.drawPetFinder);};PetFinderDiv.prototype.loadUsers=function(al){var k={};k.user_id=MAIN_DATA.A().getId();if(this.dF&&this.dF!="Both"){k.gender=this.dF;}var l_callback=al.bind(this);
var l_self=this;var l_loadUsers=function(rH){if(l_self.cF(rH))l_callback();};U(REQUEST_DESTINATION_URL+"/ffs/getrandomusers?isDebug="+this.isDebug,l_loadUsers,k);};PetFinderDiv.prototype.cF=function(
J){var l_responseText=oH(J);var l_self=this;f(l_responseText);if(l_responseText&&l_responseText.indexOf("<xml>")== -1){new ModalDialog(
"An error occured retrieving the data for Own Your Friend. OYF might be temporarily down for maintenance...","Error",null,ModalDialog.ERROR).showDialog();return false;}var F=bc(J);if(!g(F)){
new ModalDialog("An error occured retrieving the data for Own Your Friend. OYF might be temporarily down for maintenance...","Error",null,ModalDialog.ERROR).showDialog();return false;}var l_info=K(F,
"info");if(g(l_info)){new ModalDialog(decodeURIComponent(l_info),"Error",null,ModalDialog.ERROR).showDialog();return false;}l_info=K(F,"error");if(g(l_info)){new ModalDialog(decodeURIComponent(l_info)
,"Error",null,ModalDialog.ERROR).showDialog();return false;}var fJ=0;$(F).find("user").each(function(i,a_userState){fJ++;var ab=new be();ab.bT(a_userState);var l_petFinderUser=new PetFinderUser(ab);
if(i==0)l_petFinderUser.setViewed(true);l_self.m_users.push(l_petFinderUser);});if(fJ==0){var l_noUsersDiv=$divcl(this.pL,"explanationBox");l_noUsersDiv.innerHTML=
"<h1> No more users </h1> No users were found that matches the criteria of your search.";return false;}return true;};PetFinderDiv.prototype.switchGender=function(a_gender){this.m_users.length=0;
this.m_currentUser=0;this.dF=a_gender;this.loadUsers(this.drawPetFinder);};PetFinderDiv.prototype.drawPetFinder=function(){var l_self=this;$(this.l).html("");this.m_imageDiv=$divcl(this.l,"image");$(
this.m_imageDiv).css({float:"left",width:PetFinderDiv.IMAGE_WIDTH+"px",height:PetFinderDiv.IMAGE_HEIGHT+"px"});var l_curUser=this.m_users[this.m_currentUser].getUser();if(l_curUser.cv()!=null){
var l_largeUrl=l_curUser.cv();if(l_largeUrl.indexOf("/s_")>0||l_largeUrl.indexOf("_s.jpg")>0||l_largeUrl.indexOf("_s.gif")>0){l_largeUrl=l_largeUrl.replace("/s_","/l_").replace("_s.jpg","_l.jpg")
.replace("_s.gif","_l.gif");}this.displayImageLoader();var myImage=new Image();myImage.name="petimg.jpg";myImage.onload=getWidthAndHeight;myImage.onerror=loadFailure;myImage.src=l_largeUrl;}
var l_userDetailsDiv=$divcl(this.l,"userDetailsDiv");$(l_userDetailsDiv).css({float:"left",width:"280px"});var l_profileDiv=$divcl(l_userDetailsDiv,"userProfileDiv");var M=document.createElement(
"div");l_profileDiv.appendChild(M);$(l_profileDiv).css({paddingLeft:"50px"});M.style.margin="0px 0px 5px 0px";M.style.fontSize="14px";M.style.fontWeight="bold";M.style.color="#0e1f5b";M.style.cursor=
"pointer";aE(M,"click",OYF_showUserDetails,l_curUser.B());var kW=l_curUser.gb();M.innerHTML=l_curUser.D();var ej=document.createElement("div");l_profileDiv.appendChild(ej);ej.style.fontSize="12px";
ej.style.color="#CC2222";ej.id="ProfileMessage_"+l_curUser.B();var gc=l_curUser.ea();if(g(gc)){gc=jd(gc,20,/\S{20}/);ej.appendChild(document.createTextNode(gc));ej.style.marginBottom="5px";var tx=
l_curUser.getStatusMessageChanger();var tw=l_curUser.getStatusMessageChangeDate();if(g(l_curUser.getStatusMessageChanger())){ej.title="Created by "+tx+" on "+tw;}}var fm=document.createElement("div");
l_profileDiv.appendChild(fm);fm.innerHTML="<span style='color:#888888; font-size:12px;'> Worth: </span> <span id='ProfileWorth_"+l_curUser.B()+
"' style='color:#09460F; font-size:12px; font-weight:bold;'> $"+addCommas(l_curUser.bw())+"</span>";var lM=document.createElement("div");l_profileDiv.appendChild(lM);lM.innerHTML=
"<span style='color:#888888; font-size:12px;'> Cash: </span> <span style='color:#09460F; font-size:12px; font-weight:bold;'> $"+addCommas(l_curUser.eg())+"</span>";var l_thumbsUpDiv=$div(l_profileDiv)
;l_thumbsUpDiv.innerHTML="<img title='Like this profile? Give them a thumbs up' src='"+IMAGES_PROD_URL+"/favicons/thumbsup"+(useGIF()?".gif":".png")+
"'></img> <span id='thumbsUpCount' style='color:#888888; font-size:12px;'>("+l_curUser.getNumThumbsup()+")</span>";$(l_thumbsUpDiv).css({paddingLeft:"3px",paddingTop:"2px",cursor:"pointer"});$(
l_thumbsUpDiv).click(l_self.incrementThumbs.bind(l_self,this.m_users[this.m_currentUser]));var l_userActionsDiv=$divcl(l_userDetailsDiv,"userActionsDiv");$(l_userActionsDiv).css({paddingTop:"5px",
paddingLeft:"50px"});this.m_userActionController=new UserActionController(l_userActionsDiv,l_curUser);$divcl(this.l,"clearall");var l_navigationBar=$divcl(this.l,"navigationBar");$(l_navigationBar)
.css({marginTop:"10px"});var l_nextSkip=$div(l_navigationBar);var l_nextSkipClass="petfinder_next_skip"+(useGIF()?"_ie6":"");var l_nextSkipClassDisabled="petfinder_next_skip_disabled"+(useGIF()?
"_ie6":"");l_nextSkip.innerHTML="<div id='pfNextButton' class='"+l_nextSkipClass+
" petfinder_navigation_button'> <div style='margin-top:18; padding-left:15'>Next Pet</div><div style='padding-left:15'>(+$300)</div></div>";var l_nextProfile=function(){$('#pfNextButton').removeClass(
l_nextSkipClass);$('#pfNextButton').addClass(l_nextSkipClassDisabled);$(l_nextSkip).unbind('click',l_nextProfile);l_self.m_petFinderOperationManager.addOperation(PetFinderOperation.TYPE.NEXT);};$(
l_nextSkip).click(l_nextProfile);var l_previousSkip=$div(l_navigationBar);var l_previousSkipClass="petfinder_previous_skip"+(useGIF()?"_ie6":"");var l_previousSkipClassDisabled=
"petfinder_previous_skip_disabled"+(useGIF()?"_ie6":"");var l_previousProfile=function(){$('#pfPrevButton').removeClass(l_previousSkipClass);$('#pfPrevButton').addClass(l_previousSkipClassDisabled);$(
l_previousSkip).unbind('click',l_previousProfile);l_self.m_petFinderOperationManager.addOperation(PetFinderOperation.TYPE.PREVIOUS);};l_previousSkip.innerHTML="<div id='pfPrevButton' class='"+
l_previousSkipClass+" petfinder_navigation_button'> <div style='margin-top:18;text-align:right; padding-right:15'>Previous</div><div style='text-align:right; padding-right:30'>Pet</div></div>";if(
this.m_currentUser==0){$(l_previousSkip).unbind('click',l_previousProfile);$('#pfPrevButton').removeClass(l_previousSkipClass);$('#pfPrevButton').addClass(l_previousSkipClassDisabled);}else{$(
l_previousSkip).click(l_previousProfile);}this.m_petFinderOperationManager.doneCurrentOp();};PetFinderDiv.prototype.previousProfile=function(){if(this.m_currentUser>0){this.m_currentUser--;
this.drawPetFinder();}};PetFinderDiv.prototype.nextProfile=function(){var l_curUserIndex=this.m_currentUser;this.m_currentUser++;if(!this.m_users[l_curUserIndex].isViewedNext()){
this.m_users[l_curUserIndex].setViewedNext(true);this.setUserIdAttrib(this.m_users[l_curUserIndex].getUser().B(),"viewedNext",true);}if(l_curUserIndex==this.m_users.length-1){this.displayImageLoader()
;this.loadUsers(this.drawPetFinder);if(this.m_users.length>=50){this.m_users.splice(0,10);this.m_currentUser-=10;}}else{if(!this.m_users[l_curUserIndex+1].isViewed()){this.m_users[l_curUserIndex+
1].setViewed(true);this.setUserIdAttrib(this.m_users[l_curUserIndex+1].getUser().B(),"viewed",true);}this.drawPetFinder();}};PetFinderDiv.prototype.setUserIdAttrib=function(oi,a_attrib,kc){
var l_attribs=this.m_userIdChangedAttribsMap[oi];if(!l_attribs){l_attribs=new Object();}l_attribs[a_attrib]=kc;this.m_userIdChangedAttribsMap[oi]=l_attribs;};PetFinderDiv.prototype.displayImageLoader=
function(){$(".image").html("<img src='http://cdn0.supercomment.com/kissme/images/ajax-loader.gif'></img>");};PetFinderDiv.prototype.updateTrackingData=function(){var l_hasProperty=false;for(
var i in this.m_userIdChangedAttribsMap){l_hasProperty=true;break;}if(l_hasProperty){var l_userIdChangedAttribsMap=this.m_userIdChangedAttribsMap;this.m_userIdChangedAttribsMap=new Object();var l_ids=
new Array();var l_viewedArray=new Array();var l_viewedNextArray=new Array();for(var i in l_userIdChangedAttribsMap){l_ids.push(i);if(l_userIdChangedAttribsMap[i]["viewed"]){l_viewedArray.push(1);
l_userIdChangedAttribsMap[i]["viewed"]=undefined;}else l_viewedArray.push(0);if(l_userIdChangedAttribsMap[i]["viewedNext"]){l_viewedNextArray.push(1);l_userIdChangedAttribsMap[i]["viewedNext"]=
undefined;}else l_viewedNextArray.push(0);}if(l_ids.length>0){var k={};k.user_id=MAIN_DATA.A().getId();k.unique_ids=l_ids.join();k.viewed=l_viewedArray.join();k.viewed_next=l_viewedNextArray.join();U(
REQUEST_DESTINATION_URL+"/ffs/petfindertrackupdate",function(aA){var F=bc(aA);if(g(F)){var l_cash=K(F,"viewer_cash");if(g(l_cash)){try{MAIN_DATA.A().fZ(parseInt(l_cash));}catch(err){f(err);};try{
MAIN_STATUS_DIV.fK(l_cash);}catch(err){f(err);};}}},k,0);}}};PetFinderDiv.prototype.incrementThumbs=function(a_petFinderUser){if(!a_petFinderUser.isGivenThumbsup()){a_petFinderUser.setGivenThumbsup(
true);var k=MAIN_DATA.A().dh();k.target_user_id=a_petFinderUser.getUser().B();U(REQUEST_DESTINATION_URL+"/ffs/incthumbsup",function(aA){var F=bc(aA);var T;if(!g(F)){T=new ModalDialog(
"Unfortunately there was an error, the technical team has been notified. Thank you for your patience!","Error occured",null,ModalDialog.ERROR);T.showDialog();a_petFinderUser.setGivenThumbsup(false);
return false;}var l_info=jo(F,"info");if(g(l_info)){T=new ModalDialog(l_info,"Error occured",null,ModalDialog.ERROR);T.showDialog();a_petFinderUser.setGivenThumbsup(false);return false;}var sZ=jo(F,
"error");if(g(sZ)){T=new ModalDialog(sZ,"Error occured",null,ModalDialog.ERROR);T.showDialog();a_petFinderUser.setGivenThumbsup(false);return false;}var l_thumbsUpCountText=$("#thumbsUpCount").text();
var l_thumbsUpCount=parseInt(l_thumbsUpCountText.substring(1,l_thumbsUpCountText.length-1))+1;$("#thumbsUpCount").html("("+l_thumbsUpCount+")");a_petFinderUser.getUser().setNumThumbsup(
l_thumbsUpCount);},k,0);}else{var T=new ModalDialog("You have already given thumbs up to this profile.","Already Given Thumbs up",null,ModalDialog.WARN);T.showDialog();}};function getWidthAndHeight(){
this.onload=function(){};if(this.width==0&&this.height==0){$(".image").html("<img src='http://x.myspacecdn.com/images/no_pic.gif' style='display:block;margin-left:auto;margin-right:auto'></img>");
return false;}var l_imgHtml="<img src='"+this.src+"'";if(this.height/this.width>PetFinderDiv.IMAGE_HEIGHT/PetFinderDiv.IMAGE_WIDTH){var l_height=Math.min(PetFinderDiv.IMAGE_HEIGHT,this.height);
var l_width=parseInt(l_height*this.width/this.height);l_imgHtml+=" style='width:"+l_width+";height:"+l_height+";display: block;margin-left:auto;margin-right:auto'";}else{var l_width=Math.min(
PetFinderDiv.IMAGE_WIDTH,this.width);var l_height=parseInt(l_width*this.height/this.width);l_imgHtml+=" style='width:"+l_width+";height:"+l_height+
";display: block;margin-left:auto;margin-right:auto'";}l_imgHtml+="></img>";$(".image").html(l_imgHtml);return true;};function loadFailure(){$(".image").html(
"<img src='http://x.myspacecdn.com/images/no_pic.gif' style='display:block;margin-left:auto;margin-right:auto'></img>");return true;};function UserActionController(rA,V){this.m=V;this.pL=rA;this.draw(
);};UserActionController.prototype.draw=function(){var l_showBuyFriends=true;if(g(MAIN_DATA.ar(v.MY_PETS))){if(MAIN_DATA.ar(v.MY_PETS).bM(this.m.getId()))l_showBuyFriends=false;}var l_div;if(
l_showBuyFriends){l_div=$divcl(this.pL,"petfinder_poke_action");$(l_div).addClass("petfinder_poke_action_button"+(useGIF()?"_ie6":""));var l_buyDiv=$div(l_div);$(l_buyDiv).html("Buy "+this.m.D()+
" for $"+addCommas(this.m.dT())+"</span>");$(l_div).click(this.oN.bind(this));$(l_buyDiv).css({paddingTop:"18px",textAlign:"center",margin:"auto"});}l_div=$divcl(this.pL,"petfinder_poke_action");$(
l_div).addClass("petfinder_poke_action_button"+(useGIF()?"_ie6":""));var l_pokeDiv=$div(l_div);$(l_pokeDiv).html("Poke (+$1000)");$(l_div).click(this.ja.bind(this));$(l_pokeDiv).css({paddingTop:
"18px",textAlign:"center",margin:"auto"});l_div=$divcl(this.pL,"petfinder_poke_action");$(l_div).addClass("petfinder_poke_action_button"+(useGIF()?"_ie6":""));var l_commentDiv=$div(l_div);$(
l_commentDiv).html("Write a comment (-$2000)");$(l_div).click(this.sJ.bind(this));$(l_commentDiv).css({paddingTop:"18px",textAlign:"center",margin:"auto"});l_div=$divcl(this.pL,
"petfinder_poke_action");$(l_div).addClass("petfinder_poke_action_button"+(useGIF()?"_ie6":""));var l_giveGiftDiv=$div(l_div);$(l_giveGiftDiv).html("Give a gift");$(l_div).click(this.sendGift.bind(
this));$(l_giveGiftDiv).css({paddingTop:"18px",textAlign:"center",margin:"auto"});};UserActionController.prototype.oN=function(){if(MAIN_DATA.A().eg()<this.m.dT()){var T=new ModalDialog(
"<span style='color:#FF2222;'> Unfortunately you need a little more $$$ to buy "+this.m.D()+
"</span>. <a href='#' onclick='OYF.mainTabs.switchToTab(OYF.TAB_MORE_MONEY);return false;'>Click here</a> to earn more money...","Not enough cache",null,ModalDialog.ERROR);T.showDialog();return false;
}var l_buyButtons={};l_buyButtons["Buy"]=this.ki.bind(this);l_buyButtons["Cancel"]=function(){return false;};var l_confirmBuy=new ModalDialog("<span style='font-size:14px;'> Purchasing "+this.m.D()+
" will cost <span style='color:red; font-weight:bold;'> $"+addCommas(this.m.dT())+"</span>. You currently have <span style='color:#09460F; font-weight:bold;'> $"+addCommas(MAIN_DATA.A().eg())+
"</span></span>","Confirm Purchase",l_buyButtons,ModalDialog.INFO);l_confirmBuy.showDialog();return false;};UserActionController.prototype.ki=function(){var k=this.m.dh();k.from_user_id=MAIN_DATA.A()
.B();k.to_user_id=this.m.B();k.pf_num_times_bought=1;var l_self=this;U(REQUEST_DESTINATION_URL+"/ffs/purchaseuser",function(aA){l_self.gY(aA);},k,0);return false;};UserActionController.prototype.gY=
function(aA){var F=bc(aA);var T;if(!g(F)){T=new ModalDialog("Unfortunately there was an error, the technical team has been notified. Thank you for your patience!","Error occured",null,
ModalDialog.ERROR);T.showDialog();return false;}var rQ=jo(F,"info");if(g(rQ)){T=new ModalDialog(rQ,"Error occured",null,ModalDialog.ERROR);T.showDialog();return false;}var l_self=this;var l_buttons={}
;l_buttons["Close"]=function(){if(!OYF.ACTIVITY_SENT){sendBuyPetActivity(l_self.m,l_self.m.dT(),function(J){if(J.getData()==1){var k=MAIN_DATA.A().dh();U(REQUEST_DESTINATION_URL+
"/ffs/setactivitysent?user_id="+MAIN_DATA.A().B(),function(){},k,0);OYF.ACTIVITY_SENT=true;}});}};new ModalDialog("You've just bought "+this.m.D()+" for "+this.m.dT()+
". Go to the My Pets section of the homepage to see your new pet.","Bought Pet",l_buttons,ModalDialog.INFO).showDialog();var dk=K(F,"buyer_cash");if(g(dk)){try{MAIN_DATA.A().fZ(parseInt(dk));}catch(
err){f(err);};try{MAIN_STATUS_DIV.fK(dk);}catch(err){f(err);};}var l_petWorth=K(F,"pet_worth");if(g(l_petWorth)){this.m.setWorth(parseInt(l_petWorth));}var l_petCash=K(F,"pet_cash");if(g(l_petCash)){
this.m.fZ(parseInt(l_petCash));}NEWSFEED_CACHE.av();if(!MAIN_DATA.ar(v.MY_PETS).bM(this.m.getId())){MAIN_DATA.ar(v.MY_PETS).ka(this.m);MAIN_DATA.ar(v.MY_PETS).aB(function(a_count){MAIN_DATA.ar(
v.MY_PETS).jg(a_count+1);});}return false;};UserActionController.prototype.nF=function(){var l_self=this;if(g(MAIN_DATA.ar(v.MY_PETS))){MAIN_DATA.ar(v.MY_PETS).aB(function(kn){l_self.jN=kn;f(
"user has: "+l_self.jN+" pets.");});}if(!g(MAIN_DATA.ar(v.MY_PETS))||this.jN==0){var T=new ModalDialog("To poke a user with a pet, you must own at least one pet!","No pets found",null,
ModalDialog.INFO);T.showDialog();return false;}else{var aa=$el("table");var af=$el("tbody",aa);$(aa).css({fontSize:10});var o=$el("tr",af);var cJ=$el("td",o);cJ.innerHTML="Make";cJ=$el("td",o);
this.mF=new ks(cJ);cJ=$el("td",o);this.mE=new fp(cJ);cJ=$el("td",o);cJ.innerHTML="<span style='color:#3b5998;'>"+this.m.D()+"</span>";var l_pokeWithPetButtons={};l_pokeWithPetButtons["Poke with Pet"]=
this.oA.bind(this);l_pokeWithPetButtons["Cancel"]=function(){return false;};var T=new ModalDialog("","Poke "+this.m.D()+" with a Pet",l_pokeWithPetButtons,ModalDialog.INFO);T.showDialog();$(T.ad())
.html("");T.ad().appendChild(aa);}return false;};UserActionController.prototype.oA=function(){var fB=this.mF.dP();this.cG=MAIN_DATA.ar(v.MY_PETS).bM(fB);this.cE=this.mE.ff();var k={};k.owner_id=
MAIN_DATA.A().B();k.from_user_id=this.cG.B();k.to_user_id=this.m.B();k.to_display_name=bo(this.m.getName());k.poke_type=this.cE;k.pf_num_pokes_with_pet=1;var l_self=this;U(REQUEST_DESTINATION_URL+
"/ffs/pokeuser",function(aA){l_self.nT(aA)},k,0);return false;};UserActionController.prototype.nT=function(aA){var F=bc(aA);var T;if(!g(F)){T=new ModalDialog(
"Unfortunately there was an error, the technical team has been notified. Thank you for your patience!","Error occured",null,ModalDialog.ERROR);T.showDialog();return false;}var l_info=jo(F,"info");if(
g(l_info)){T=new ModalDialog(l_info,"Error occured",null,ModalDialog.ERROR);T.showDialog();return false;}var sZ=jo(F,"error");if(g(sZ)){T=new ModalDialog(sZ,"Error occured",null,ModalDialog.ERROR);
T.showDialog();return false;}new ModalDialog("You've just made "+this.cG.D()+" "+this.cE+" "+this.m.D(),"Poking Successful",null,ModalDialog.INFO).showDialog();var l_cash=K(F,"viewer_cash");if(g(
l_cash)){try{MAIN_DATA.A().fZ(parseInt(l_cash));}catch(err){f(err);};try{MAIN_STATUS_DIV.fK(l_cash);}catch(err){f(err);};}NEWSFEED_CACHE.av();this.cG=undefined;this.cE=undefined;return false;};
UserActionController.prototype.ja=function(){var aa=document.createElement("table");var af=document.createElement("tbody");aa.appendChild(af);var o=document.createElement("tr");af.appendChild(o);
var cJ=document.createElement("td");o.appendChild(cJ);this.jy=new fp(cJ);cJ=document.createElement("td");o.appendChild(cJ);cJ.innerHTML="<span style='color:#3b5998; font-weight:bold;'>"+this.m.D()+
"</span>";var l_pokeButtons={};l_pokeButtons["Poke"]=this.doPokeFriend.bind(this);l_pokeButtons["Cancel"]=function(){return false;};var T=new ModalDialog("","Poke "+this.m.D(),l_pokeButtons,
ModalDialog.INFO);T.showDialog();$(T.ad()).html("");T.ad().appendChild(aa);return false;};UserActionController.prototype.doPokeFriend=function(){if(!g(this.jy))return;this.dv=this.jy.ff();
this.m_pf_selectedPokePastTense=this.jy.getSelectedPokePastTense();var k={};k.from_user_id=MAIN_DATA.A().B();k.to_user_id=this.m.B();k.to_display_name=bo(this.m.getName());k.poke_type=this.dv;
k.pf_num_pokes=1;var l_self=this;U(REQUEST_DESTINATION_URL+"/ffs/pokeuser",function(aA){l_self.nU(aA);},k,0);return false;};UserActionController.prototype.nU=function(aA){var F=bc(aA);var T;if(!g(F)){
T=new ModalDialog("Unfortunately there was an error, the technical team has been notified. Thank you for your patience!","Error occured",null,ModalDialog.ERROR);T.showDialog();return false;}
var l_info=jo(F,"info");if(g(l_info)){T=new ModalDialog(l_info,"Error occured",null,ModalDialog.ERROR);T.showDialog();return false;}var sZ=jo(F,"error");if(g(sZ)){T=new ModalDialog(sZ,"Error occured",
null,ModalDialog.ERROR);T.showDialog();return false;}new ModalDialog("You've just "+this.m_pf_selectedPokePastTense+" "+this.m.D(),"Poking Successful",null,ModalDialog.INFO).showDialog();var l_cash=K(
F,"viewer_cash");if(g(l_cash)){try{MAIN_DATA.A().fZ(parseInt(l_cash));}catch(err){f(err);};try{MAIN_STATUS_DIV.fK(l_cash);}catch(err){f(err);};}NEWSFEED_CACHE.av();this.dv=undefined;
this.m_pf_selectedPokePastTense=undefined;return false;};UserActionController.prototype.sJ=function(){var l_commentDiv=$div();this.m_commentErrorDiv=$div(l_commentDiv);$(this.m_commentErrorDiv).css({
paddingTop:"5px",height:"15px",width:"300px",paddingBottom:"5px",fontSize:"10px",color:"red"});try{this.sK=document.createElement("<input type='text' size='60' maxlength='100'/>");}catch(error){
this.sK=document.createElement("input");this.sK.type="text";this.sK.size=60;this.sK.maxLength=100;}l_commentDiv.appendChild(this.sK);var l_commentButtons={};l_commentButtons["Comment"]=
this.doSendComment.bind(this);l_commentButtons["Cancel"]=function(){return false;};var T=new ModalDialog("","Leave a Comment On "+this.m.D()+"'s Newsfeed",l_commentButtons,ModalDialog.INFO);
T.setDimensions(200,600);T.setAutoHide(false);T.showDialog();$(T.ad()).html("");T.ad().appendChild(l_commentDiv);return false;};UserActionController.prototype.doSendComment=function(){var tj=
undefined;try{tj=this.sK.value;if(tj.length<4){$(this.m_commentErrorDiv).html("Comments should be at least 4 characters long");return true;}}catch(err){f(err);}var k={};k.from_user_id=MAIN_DATA.A().B(
);k.to_user_id=this.m.B();k.comment=bo(tj);k.pf_num_comments_left=1;var l_self=this;U(REQUEST_DESTINATION_URL+"/ffs/sendcomment",function(J){l_self.onSendComment(J);},k,0);return false;};
UserActionController.prototype.onSendComment=function(J){var respText=oH(J);if(respText!=undefined&&respText.indexOf("<SUCCESS>true</SUCCESS>")>=0){var F=bc(J);var dk=K(F,"sender_cash");if(g(dk)){try{
MAIN_DATA.A().fZ(parseInt(dk));}catch(err){f(err);};try{MAIN_STATUS_DIV.fK(dk);}catch(err){f(err);};}NEWSFEED_CACHE.av();}else{var F=bc(J);var sZ;if(!g(F)){sZ="Got no response from the server!";}else{
sZ=K(F,"error");}new ModalDialog("Your comment could not be sent for the following reason:"+sZ,"Error Sending Comment",null,ModalDialog.ERROR).showDialog();}};UserActionController.prototype.sendGift=
function(){var l_giftsDiv=$div();$(l_giftsDiv).css({height:"400px",width:"600px"});this.m_giftSelectionModel=new SingleSelectionModel().bind("select",function(){});OYF.GIFT_RECIPIENT=this.m;
var l_giveGiftsDiv=new GiveGiftsDiv($div());l_giveGiftsDiv.setGiftEveryone(true);this.m_giftChooserDiv=l_giveGiftsDiv.m_giftChooserDiv;l_giftsDiv.appendChild(this.m_giftChooserDiv.l);
var l_sendGiftButtons={};l_sendGiftButtons["Send Gift"]=function(){l_giveGiftsDiv.sendGift();};l_sendGiftButtons["Cancel"]=function(){return false;};var T=new ModalDialog("","Pick a Gift to Send to "+
this.m.D(),l_sendGiftButtons,ModalDialog.INFO);T.setDimensions(600,750);T.showDialog();$(T.ad()).html("");T.ad().appendChild(l_giftsDiv);return false;}