<?xml version="1.0" encoding="UTF-8"?>
<Module>
<ModulePrefs title="Facebook"
 directory_title="Facebook"
 title_url="http://www.facebook.com/"
 description="__MSG_hdesc__"
 author="iBuno" author_affiliation="iBuno" author_email="gadgets@ibuno.net"
 author_link="http://www.ibuno.net/gadgets/" author_location="Milan,Italy"
 author_photo="http://www.ibuno.net/gadgets/author.png"
 author_aboutme="Software solutions for the web and for mobile platforms. IT consulting."
 author_quote="Web + Mobile"
 thumbnail="http://www.ibuno.net/gadgets/facebook/g/thumbnail.png"
 screenshot="http://www.ibuno.net/gadgets/facebook/g/screenshot.png"
 height="350" width="320" scrolling="false">
  <Require feature="analytics"/>
  <Require feature="views" />
  <Require feature="dynamic-height" />
  <Require feature="minimessage"/>
  <Require feature="setprefs"/>
  <Optional feature="maximize"/>
  <Locale messages="http://www.ibuno.net/gadgets/facebook/l/ALL_ALL.xml" />
  <Locale lang="it" messages="http://www.ibuno.net/gadgets/facebook/l/it_ALL.xml" />
  <Locale country="IT" messages="http://www.ibuno.net/gadgets/facebook/l/it_ALL.xml" />
  <Locale lang="tl" messages="http://www.ibuno.net/gadgets/facebook/l/tl_ALL.xml" />
  <Locale country="PH" messages="http://www.ibuno.net/gadgets/facebook/l/tl_ALL.xml" />
</ModulePrefs>
<UserPref name="exp" datatype="hidden" default_value="-1"/>
<UserPref name="ads_sx2" display_name="Message1" datatype="bool" default_value="true"/>
<Content type="html" view="home,profile,nav,canvas,default"><![CDATA[
<style type="text/css">
body{background-color:#FFF;}
.t{float:right;margin-right:3px;cursor:pointer;}
.h{color:black;font-size:12px;}
.h h1{color:#3B5998;font-size:14px;}
.mmlib_table__MODULE_ID__ {background-color:#6080C0; color:#D8D8FF;}
.hid{display:none;}
.ptr{cursor:pointer;}
.und{text-decoration:underline;}
.clear{clear:both;display:block;height:0px;line-height:0px;font-size:1px;}
</style>
<!-- Social Network Platform - Facebook and Friends - __MSG_hdesc__ -->
<div style="height:16px;background-color:#3B5998;color:#809ACE;font-size:11px;">
 <div style="float:right;padding:1px;width:200px;">
  <div id="maxDiv2" class="t hid" style="font-size:9px;text-decoration:underline;" onclick="doMax();">__MSG_tipMax__ </div>
  <div id="maxDiv" class="t hid" style="width:13px;height:14px;background-position:-17px;"
   title="__MSG_tipMax__" onclick="doMax();"></div>
  <div id="minDiv" class="t hid" style="width:14px;height:14px;background-position:-32px;"
   title="__MSG_tipMin__" onclick="doMin();"></div>
  <div id="helpDiv" class="t" style="width:14px;height:14px;background-position:0px;"
   title="__MSG_tipHelp__" onclick="doHelp();"></div>
  <div id="gooDiv" class="t hid" style="width:46px;height:14px;background-position:-48px;"
   title="__MSG_tipGoo__" onclick="doGoo();"></div>
 </div>
</div>

<div id="helpoff">
  <div id="adsSide" style="width:124px;height:610px;display:none;float:right;">
    <iframe id="adsFrame" src="" width="100%" height="100%" frameborder="0" scrolling="no"></iframe>
  </div>
  <div id="adsHead" style="display:none;font:11px Arial,SansSerif;background-color:#5B79B8;color:#A0BAEE">
    &nbsp;
    <a href="http://payokee.com/it/lista/?utm_source=igoogle&utm_medium=banner&utm_campaign=fb_small_1" target="_blank" style="color:#eef;">
    Sconti e offerte</a>, su misura per te!
    <a href="#" onclick="_hide('adsHead');prefs.set('ads_sx2',false);return false;" style="float:right;">[x]&nbsp;</a>
</div>

  <div id="fb-root"></div>
<div id="fb-content">

<div id="sidebar_wrap">
  <div id="sidebar">
    <div id="profile-pic"></div>
    <ul id="items">
      <li id="stream-btn" class="selected tab"><div id="stream-icon" class="button fbgraph" title="News Feed"><div class="refresh-btn fbgraph"></div></div></li>
      <li id="wall-btn" class="tab"><div id="wall-icon" class="button fbgraph" title="Wall"><div class="refresh-btn fbgraph"></div></div></li>
    </ul>
    <div id="logout-btn">Logout</div>
  </div>
</div>
<div id="scroller">
  <div id="content">
    <div id="composer" style="display:none">
      <textarea rows="1" cols="10" id="composer-area">What's on your mind?</textarea>
      <span id="composer-btn" class="blue-btn"><button id="composer-submit">Share</button></span>
      <div style="display: none" id="composer-attch">
      </div>
    </div>
    <div id="loading" style="display:none">
      <img id="loading-icon" />
    </div>
    <ul id="login" style="display:none">
      <div id="error" style="display:none">
        Sorry, your login did not work, please try again.
      </div>
      <p id="intro"></p>
      <div id="login-btn-div"><span class="login-btn" id="login-btn"><span id="login-text">Login to Facebook</span></span></div>
    </ul>
    <ul id="stream">
    </ul>
    <ul id="wall" class="empty">
    </ul>
    <ul id="notifications" class="empty">
    </ul>
    <ul id="inbox" class="empty">
    </ul>
  </div>
</div>

</div>
</div>

<div class="clear"></div>
<div id="copyr"></div>
<div id="help" class="h" style="display:none;margin-left:4px;">
 <div style="float:right;cursor:pointer;"><a href="javascript:void(0);" onclick="sw('help','helpoff')">__MSG_Close__</a></div>
 <div id="helpMenu">
  <h1>__MSG_Help__</h1>
  <p><a href="javascript:void(0);" onclick="sw('helpMenu','helpAbout');">__MSG_About__</a></p>
  <p><a href="javascript:void(0);" onclick="sw('helpMenu','helpShare');">__MSG_SendFriend__</a></p>
 </div>
 <div id="helpAbout" style="display:none;">
  <h1>__MSG_About__</h1>
  <p>__MSG_AboutTxt1__</p><p>__MSG_AboutTxt2__</p><p>__MSG_AboutTxt3__</p>
  <p><a href="javascript:void(0);" onclick="sw('helpAbout','helpMenu')">__MSG_Back__</a></p>
 </div>
 <div id="helpShare" style="display:none;">
  <h1>__MSG_SendFriend__</h1>
  <p>__MSG_SendFriendTxt__</p>
  <a href="http://www.ibuno.net/go/face-__MSG_lang__" target="_blank">http://www.ibuno.net/go/face-__MSG_lang__</a>
  <p><a href="javascript:void(0);" onclick="sw('helpShare','helpMenu')">__MSG_Back__</a></p>
 </div>
</div>
<script type="text/javascript">
// return arguments, bypasses minification. Used e.g. as: ret("__MSG_lang__")
function ret(r){return r};
</script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">
(function(d){d.fn.hoverIntent=function(f,l){var j={sensitivity:7,interval:100,timeout:0};j=d.extend(j,l?{over:f,out:l}:f);var c,i,m,o,p=function(r){c=r.pageX;i=r.pageY},s=function(r,a){a.hoverIntent_t=clearTimeout(a.hoverIntent_t);if(Math.abs(m-c)+Math.abs(o-i)<j.sensitivity){d(a).unbind("mousemove",p);a.hoverIntent_s=1;return j.over.apply(a,[r])}else{m=c;o=i;a.hoverIntent_t=setTimeout(function(){s(r,a)},j.interval)}},u=function(r){for(var a=(r.type=="mouseover"?r.fromElement:r.toElement)||r.relatedTarget;a&&
a!=this;)try{a=a.parentNode}catch(e){a=this}if(a==this)return false;var h=jQuery.extend({},r),k=this;if(k.hoverIntent_t)k.hoverIntent_t=clearTimeout(k.hoverIntent_t);if(r.type=="mouseover"){m=h.pageX;o=h.pageY;d(k).bind("mousemove",p);if(k.hoverIntent_s!=1)k.hoverIntent_t=setTimeout(function(){s(h,k)},j.interval)}else{d(k).unbind("mousemove",p);if(k.hoverIntent_s==1)k.hoverIntent_t=setTimeout(function(){k.hoverIntent_t=clearTimeout(k.hoverIntent_t);k.hoverIntent_s=0;j.out.apply(k,[h])},j.timeout)}};
return this.mouseover(u).mouseout(u)}})(jQuery);
(function(d){d.fn.TextAreaExpander=function(f,l){function j(i){i=i.target||i;var m=i.value.length,o=i.offsetWidth;if(m!=i.valLength||o!=i.boxWidth){if(c&&(m<i.valLength||o!=i.boxWidth))i.style.height="0px";var p=Math.max(i.expandMin,Math.min(i.scrollHeight,i.expandMax));i.style.overflow=i.scrollHeight>p?"auto":"hidden";i.style.height=p-7+"px";i.valLength=m;i.boxWidth=o}return true}var c=!(d.browser.msie||d.browser.opera);this.each(function(){if(this.nodeName.toLowerCase()=="textarea"){var i=this.className.match(/expand(\d+)\-*(\d+)*/i);
this.expandMin=f||(i?parseInt("0"+i[1],10):0);this.expandMax=l||(i?parseInt("0"+i[2],10):99999);j(this);if(!this.Initialized){this.Initialized=true;d(this).bind("keyup",j).bind("focus",j)}}});return this}})(jQuery);jQuery(document).ready(function(){jQuery("textarea[class*=expand]").TextAreaExpander()});
(function(d){function f(){var i;i=this;i=d(i);if(!i.data("timeago")){i.data("timeago",{datetime:c.datetime(i)});var m=d.trim(i.text());m.length>0&&i.attr("title",m)}i=i.data("timeago");isNaN(i.datetime)||d(this).text(l(i.datetime));return this}function l(i){return c.inWords((new Date).getTime()-i.getTime())}function j(i,m){return(d.isFunction(i)?i(m):i).replace(/%d/i,m)}d.timeago=function(i){return i instanceof Date?l(i):typeof i=="string"?l(d.timeago.parse(i)):l(d.timeago.datetime(i))};var c=d.timeago;
d.extend(d.timeago,{settings:{refreshMillis:6E4,allowFuture:false,strings:{prefixAgo:null,prefixFromNow:null,suffixAgo:"ago",suffixFromNow:"from now",ago:null,fromNow:null,seconds:"less than a minute",minute:"about a minute",minutes:"%d minutes",hour:"about an hour",hours:"about %d hours",day:"a day",days:"%d days",month:"about a month",months:"%d months",year:"about a year",years:"%d years"}},inWords:function(i){var m=this.settings.strings,o=m.prefixAgo,p=m.suffixAgo||m.ago;if(this.settings.allowFuture){if(i<
0){o=m.prefixFromNow;p=m.suffixFromNow||m.fromNow}i=Math.abs(i)}i/=1E3;var s=i/60,u=s/60,r=u/24,a=r/365;m=i<45&&j(m.seconds,Math.round(i))||i<90&&j(m.minute,1)||s<45&&j(m.minutes,Math.round(s))||s<90&&j(m.hour,1)||u<24&&j(m.hours,Math.round(u))||u<48&&j(m.day,1)||r<30&&j(m.days,Math.floor(r))||r<60&&j(m.month,1)||r<365&&j(m.months,Math.floor(r/30))||a<2&&j(m.year,1)||j(m.years,Math.floor(a));return d.trim([o,m,p].join(" "))},parse:function(i){i=d.trim(i);i=i.replace(/-/,"/").replace(/-/,"/");i=i.replace(/T/,
" ").replace(/Z/," UTC");i=i.replace(/([\+-]\d\d)\:?(\d\d)/," $1$2");return new Date(i)},datetime:function(i){i=d(i).get(0).tagName.toLowerCase()=="time"?d(i).attr("datetime"):d(i).attr("title");return c.parse(i)}});d.fn.timeago=function(){var i=this;i.each(f);var m=c.settings;m.refreshMillis>0&&setInterval(function(){i.each(f)},m.refreshMillis);return i};document.createElement("abbr");document.createElement("time")})(jQuery);
(function(){var d=this,f=d._,l=function(a){this._wrapped=a},j=typeof StopIteration!=="undefined"?StopIteration:"__break__",c=d._=function(a){return new l(a)};if(typeof exports!=="undefined")exports._=c;var i=Array.prototype.slice,m=Array.prototype.unshift,o=Object.prototype.toString,p=Object.prototype.hasOwnProperty,s=Object.prototype.propertyIsEnumerable;c.VERSION="0.5.8";c.each=function(a,e,h){try{if(a.forEach)a.forEach(e,h);else if(c.isNumber(a.length))for(var k=0,n=a.length;k<n;k++)e.call(h,a[k],
k,a);else{var q=c.keys(a);n=q.length;for(k=0;k<n;k++)e.call(h,a[q[k]],q[k],a)}}catch(t){if(t!=j)throw t;}return a};c.map=function(a,e,h){if(a&&c.isFunction(a.map))return a.map(e,h);var k=[];c.each(a,function(n,q,t){k.push(e.call(h,n,q,t))});return k};c.reduce=function(a,e,h,k){if(a&&c.isFunction(a.reduce))return a.reduce(c.bind(h,k),e);c.each(a,function(n,q,t){e=h.call(k,e,n,q,t)});return e};c.reduceRight=function(a,e,h,k){if(a&&c.isFunction(a.reduceRight))return a.reduceRight(c.bind(h,k),e);var n=
c.clone(c.toArray(a)).reverse();c.each(n,function(q,t){e=h.call(k,e,q,t,a)});return e};c.detect=function(a,e,h){var k;c.each(a,function(n,q,t){if(e.call(h,n,q,t)){k=n;c.breakLoop()}});return k};c.select=function(a,e,h){if(a&&c.isFunction(a.filter))return a.filter(e,h);var k=[];c.each(a,function(n,q,t){e.call(h,n,q,t)&&k.push(n)});return k};c.reject=function(a,e,h){var k=[];c.each(a,function(n,q,t){!e.call(h,n,q,t)&&k.push(n)});return k};c.all=function(a,e,h){e=e||c.identity;if(a&&c.isFunction(a.every))return a.every(e,
h);var k=true;c.each(a,function(n,q,t){(k=k&&e.call(h,n,q,t))||c.breakLoop()});return k};c.any=function(a,e,h){e=e||c.identity;if(a&&c.isFunction(a.some))return a.some(e,h);var k=false;c.each(a,function(n,q,t){if(k=e.call(h,n,q,t))c.breakLoop()});return k};c.include=function(a,e){if(a&&c.isFunction(a.indexOf))return c.indexOf(a,e)!=-1;var h=false;c.each(a,function(k){if(h=k===e)c.breakLoop()});return h};c.invoke=function(a,e){var h=c.rest(arguments,2);return c.map(a,function(k){return(e?k[e]:k).apply(k,
h)})};c.pluck=function(a,e){return c.map(a,function(h){return h[e]})};c.max=function(a,e,h){if(!e&&c.isArray(a))return Math.max.apply(Math,a);var k={computed:-Infinity};c.each(a,function(n,q,t){q=e?e.call(h,n,q,t):n;q>=k.computed&&(k={value:n,computed:q})});return k.value};c.min=function(a,e,h){if(!e&&c.isArray(a))return Math.min.apply(Math,a);var k={computed:Infinity};c.each(a,function(n,q,t){q=e?e.call(h,n,q,t):n;q<k.computed&&(k={value:n,computed:q})});return k.value};c.sortBy=function(a,e,h){return c.pluck(c.map(a,
function(k,n,q){return{value:k,criteria:e.call(h,k,n,q)}}).sort(function(k,n){k=k.criteria;n=n.criteria;return k<n?-1:k>n?1:0}),"value")};c.sortedIndex=function(a,e,h){h=h||c.identity;for(var k=0,n=a.length;k<n;){var q=k+n>>1;h(a[q])<h(e)?k=q+1:n=q}return k};c.toArray=function(a){if(!a)return[];if(a.toArray)return a.toArray();if(c.isArray(a))return a;if(c.isArguments(a))return i.call(a);return c.values(a)};c.size=function(a){return c.toArray(a).length};c.first=function(a,e,h){return e&&!h?i.call(a,
0,e):a[0]};c.rest=function(a,e,h){return i.call(a,c.isUndefined(e)||h?1:e)};c.last=function(a){return a[a.length-1]};c.compact=function(a){return c.select(a,function(e){return!!e})};c.flatten=function(a){return c.reduce(a,[],function(e,h){if(c.isArray(h))return e.concat(c.flatten(h));e.push(h);return e})};c.without=function(a){var e=c.rest(arguments);return c.select(a,function(h){return!c.include(e,h)})};c.uniq=function(a,e){return c.reduce(a,[],function(h,k,n){if(0==n||(e===true?c.last(h)!=k:!c.include(h,
k)))h.push(k);return h})};c.intersect=function(a){var e=c.rest(arguments);return c.select(c.uniq(a),function(h){return c.all(e,function(k){return c.indexOf(k,h)>=0})})};c.zip=function(){for(var a=c.toArray(arguments),e=c.max(c.pluck(a,"length")),h=Array(e),k=0;k<e;k++)h[k]=c.pluck(a,String(k));return h};c.indexOf=function(a,e){if(a.indexOf)return a.indexOf(e);for(var h=0,k=a.length;h<k;h++)if(a[h]===e)return h;return-1};c.lastIndexOf=function(a,e){if(a.lastIndexOf)return a.lastIndexOf(e);for(var h=
a.length;h--;)if(a[h]===e)return h;return-1};c.range=function(a,e,h){var k=c.toArray(arguments),n=k.length<=1;a=n?0:k[0];e=n?k[0]:k[1];h=k[2]||1;k=Math.ceil((e-a)/h);if(k<=0)return[];k=Array(k);n=a;for(var q=0;;n+=h){if((h>0?n-e:e-n)>=0)return k;k[q++]=n}};c.bind=function(a,e){var h=c.rest(arguments,2);return function(){return a.apply(e||d,h.concat(c.toArray(arguments)))}};c.bindAll=function(a){var e=c.rest(arguments);if(e.length==0)e=c.functions(a);c.each(e,function(h){a[h]=c.bind(a[h],a)});return a};
c.delay=function(a,e){var h=c.rest(arguments,2);return setTimeout(function(){return a.apply(a,h)},e)};c.defer=function(a){return c.delay.apply(c,[a,1].concat(c.rest(arguments)))};c.wrap=function(a,e){return function(){var h=[a].concat(c.toArray(arguments));return e.apply(e,h)}};c.compose=function(){var a=c.toArray(arguments);return function(){for(var e=c.toArray(arguments),h=a.length-1;h>=0;h--)e=[a[h].apply(this,e)];return e[0]}};c.keys=function(a){if(c.isArray(a))return c.range(0,a.length);var e=
[];for(var h in a)p.call(a,h)&&e.push(h);return e};c.values=function(a){return c.map(a,c.identity)};c.functions=function(a){return c.select(c.keys(a),function(e){return c.isFunction(a[e])}).sort()};c.extend=function(a,e){for(var h in e)a[h]=e[h];return a};c.clone=function(a){if(c.isArray(a))return a.slice(0);return c.extend({},a)};c.tap=function(a,e){e(a);return a};c.isEqual=function(a,e){if(a===e)return true;var h=typeof a;if(h!=typeof e)return false;if(a==e)return true;if(!a&&e||a&&!e)return false;
if(a.isEqual)return a.isEqual(e);if(c.isDate(a)&&c.isDate(e))return a.getTime()===e.getTime();if(c.isNaN(a)&&c.isNaN(e))return true;if(c.isRegExp(a)&&c.isRegExp(e))return a.source===e.source&&a.global===e.global&&a.ignoreCase===e.ignoreCase&&a.multiline===e.multiline;if(h!=="object")return false;if(a.length&&a.length!==e.length)return false;h=c.keys(a);var k=c.keys(e);if(h.length!=k.length)return false;for(var n in a)if(!c.isEqual(a[n],e[n]))return false;return true};c.isEmpty=function(a){return c.keys(a).length==
0};c.isElement=function(a){return!!(a&&a.nodeType==1)};c.isArray=function(a){return!!(a&&a.concat&&a.unshift)};c.isArguments=function(a){return a&&c.isNumber(a.length)&&!a.concat&&!a.substr&&!a.apply&&!s.call(a,"length")};c.isFunction=function(a){return!!(a&&a.constructor&&a.call&&a.apply)};c.isString=function(a){return!!(a===""||a&&a.charCodeAt&&a.substr)};c.isNumber=function(a){return a===+a||o.call(a)==="[object Number]"};c.isDate=function(a){return!!(a&&a.getTimezoneOffset&&a.setUTCFullYear)};
c.isRegExp=function(a){return!!(a&&a.test&&a.exec&&(a.ignoreCase||a.ignoreCase===false))};c.isNaN=function(a){return c.isNumber(a)&&isNaN(a)};c.isNull=function(a){return a===null};c.isUndefined=function(a){return typeof a=="undefined"};c.noConflict=function(){d._=f;return this};c.identity=function(a){return a};c.breakLoop=function(){throw j;};var u=0;c.uniqueId=function(a){var e=u++;return a?a+e:e};c.templateSettings={start:"<%",end:"%>",interpolate:/<%=(.+?)%>/g};c.template=function(a,e){var h=c.templateSettings;
a=new Function("obj","var p=[],print=function(){p.push.apply(p,arguments);};with(obj){p.push('"+a.replace(/[\r\t\n]/g," ").replace(RegExp("'(?=[^"+h.end[0]+"]*"+h.end+")","g"),"\t").split("'").join("\\'").split("\t").join("'").replace(h.interpolate,"',$1,'").split(h.start).join("');").split(h.end).join("p.push('")+"');}return p.join('');");return e?a(e):a};c.forEach=c.each;c.foldl=c.inject=c.reduce;c.foldr=c.reduceRight;c.filter=c.select;c.every=c.all;c.some=c.any;c.head=c.first;c.tail=c.rest;c.methods=
c.functions;var r=function(a,e){return e?c(a).chain():a};c.each(c.functions(c),function(a){var e=c[a];l.prototype[a]=function(){var h=c.toArray(arguments);m.call(h,this._wrapped);return r(e.apply(c,h),this._chain)}});c.each(["pop","push","reverse","shift","sort","splice","unshift"],function(a){var e=Array.prototype[a];l.prototype[a]=function(){e.apply(this._wrapped,arguments);return r(this._wrapped,this._chain)}});c.each(["concat","join","slice"],function(a){var e=Array.prototype[a];l.prototype[a]=
function(){return r(e.apply(this._wrapped,arguments),this._chain)}});l.prototype.chain=function(){this._chain=true;return this};l.prototype.value=function(){return this._wrapped}})();function _gel(d){return document.getElementById(d)}var b="http://www.ibuno.net/gadgets/facebook/",ga="UA-1810728-5",fbId=window.location.hostname.indexOf("gmodules.com")>=0?"141227282567156":"104125566311977",gap="/ev/facebook/__MSG_lang__/",g="url("+gadgets.io.getProxyUrl(b+"g/graph.png")+")",g2="url("+gadgets.io.getProxyUrl(b+"g/fbgraph.png")+")",canvas=gadgets.views&&gadgets.views.getCurrentView().getName().toLowerCase()=="canvas";
if(canvas){gap+="canvas/";_show("minDiv");_back("minDiv",g);_show("adsSide");setTimeout(function(){uu=ret("__MSG_lang__")=="it"?"adside.html":"adside_en.html";_gel("adsFrame").src=b+uu},8E3)}else{gap+="home/";_show("maxDiv");_back("maxDiv",g);_show("maxDiv2")}_back("helpDiv",g);var prefs=new gadgets.Prefs;synd=_args().synd;if(typeof synd=="undefined")synd="undef";if(synd!="ig"){_back("gooDiv",g);_show("gooDiv")}md=_gel("fb-root");
function doMax(){if(gadgets.views.requestNavigateTo)if(canv=gadgets.views.getSupportedViews().canvas){_IG_Analytics(ga,gap+"doMax");gadgets.views.requestNavigateTo(canv)}}function doMin(){if(gadgets.views.requestNavigateTo)if(canv=gadgets.views.getSupportedViews().home){_IG_Analytics(ga,gap+"doMin");gadgets.views.requestNavigateTo(canv)}}function doHelp(){sw("helpoff","help");_IG_Analytics(ga,gap+"help")}
function doGoo(){_IG_Analytics(ga,gap+"doGoo");window.open("http://www.google.com/ig/adde?hl=__MSG_lang__&moduleurl=hosting.gmodules.com/ig/gadgets/file/104971404861070329537/facebook.xml")}function sw(d,f){_gel(d).style.display="none";_gel(f).style.display="block"}function _show(d){_gel(d).style.display="block"}function _hide(d){_gel(d).style.display="none"}function _back(d,f){_gel(d).style.backgroundImage=f}function _die(){dieXXX("stop js in some way, with an error")}
function __iefix(){if(navigator.userAgent&&navigator.userAgent.indexOf("MSIE")>=0){_gel("adsHead").innerHTML="<p>This gadget is currently not working on Internet Explorer. Use a different browser, wait for a fix or go to the <a href='http://www.facebook.com/' target='_blank'>Facebook</a> site.</p>";_hide("fb-content");_die()}}gmail=_args().container;
if((gmail=typeof gmail!="undefined"&&gmail=="gm")&&!canvas){_gel("adsHead").innerHTML="<span onclick='doMax();' style='cursor:pointer;'>expand</span>";md.style.display="none";_hide("copyr");_hide("fb-content");gadgets.window.adjustHeight();_die()}__iefix();var exper=prefs.getInt("exp");if(exper<0){exper=Math.floor(Math.random()*100);prefs.set("exp",exper)}var expTrack="";if(exper>=5&&synd=="ig"&&prefs.getBool("ads_sx2")==true&&!canvas&&ret("__MSG_lang__")=="it"){_show("adsHead");expTrack="?ads_sx2=1"}var st;
st=canvas?gadgets.io.getProxyUrl(b+"style.css"):gadgets.io.getProxyUrl(b+"style_s.css");var cssl=document.createElement("link");cssl.setAttribute("rel","stylesheet");cssl.setAttribute("type","text/css");cssl.setAttribute("href",st);cssl.setAttribute("media","all");document.getElementById("fb-root").appendChild(cssl);function cgetMessage(d){return locale[d].msg}if(typeof console==="undefined"){var console={};console.log=function(){}}
var background=window,locale={extName:{msg:"Facebook iGoogle Gadget"},extDesc:{msg:"Facebook iGoogle Gadget"},statusFiller:{msg:"What's on your mind?"},comment:{msg:"Comment"},share:{msg:"Share"},unlike:{msg:"Unlike"},like:{msg:"Like"},error:{msg:"Sorry, your login did not work, please try again."},logout:{msg:"Logout"},likesThis:{msg:" likes this."},likeThis:{msg:" like this."},someone:{msg:"Someone"},commentFiller:{msg:"Write a comment..."},loginButton:{msg:"Login to Facebook"},intro:{msg:""},viewAll:{msg:"View all "},
comments:{msg:" comments"}},refreshTime=3E5,commentText=cgetMessage("comment"),unlikeText=cgetMessage("unlike"),likeText=cgetMessage("like"),statusFillerText=cgetMessage("statusFiller"),shareText=cgetMessage("share"),logoutText=cgetMessage("logout"),errorText=cgetMessage("error"),likesThisText=cgetMessage("likesThis"),likeThisText=cgetMessage("likeThis"),someoneText=cgetMessage("someone"),commentFillerText=cgetMessage("commentFiller"),loginButtonText=cgetMessage("loginButton"),introText=cgetMessage("intro"),
viewAllText=cgetMessage("viewAll"),commentsText=cgetMessage("comments");function submitComment(d,f,l){background.addComment(d,f,function(j){console.log(j);l()})}function submitStatus(d,f){background.publish(d,function(l){console.log(l);f()})}function submitLike(d){background.addLike(d,function(f){console.log(f)})}function removeLike(d){background.removeLike(d,function(f){console.log(f)})}
function refreshStream(d,f){background.setStart(d);background.setEnd(f);background.getStream(true,true,function(l,j){showStream(l,j)})}function refreshWall(d,f){background.setStart(d);background.setEnd(f);background.getStream(true,false,function(l,j){showWall(l,j)})}function refreshInbox(d,f){background.setStart(d);background.setEnd(f);background.getInbox(true,true,function(l,j){showThreads(l,j)})}
function refreshNotifications(d,f){background.setStart(d);background.setEnd(f);background.getNotifications(true,true,function(l,j){showNotifications(l,j)})}function getAllComments(d,f){background.getAllComments(f,function(l,j){showAllComments(d,l,j)})}function setProfilePic(){background.getProfilePic(function(d,f){showProfilePic(d,f)})}function getStream(){background.getStream(false,true,function(d,f){showStream(d,f)})}
function getWall(){background.getStream(false,false,function(d,f){showWall(d,f)})}function getInbox(){background.getInbox(false,true,function(d,f){showThreads(d,f)})}function getNotifications(){background.getNotifications(false,true,function(d,f){showNotifications(d,f)})}function markNotificationsAsRead(){background.getNotifications(false,false,function(d){for(var f=[],l=0;l<d.length;l++)d[l].is_unread&&f.push(d[l].notification_id);background.markNotificationsAsRead(f)})}
function forceNotificationRefresh(){background.forceNotificationRefresh()}function showLogin(d){$("#logout-btn").hide();$("#login").show();d&&$("#error").show()}function hideLogin(){$("#login").hide();$("#logout-btn").show()}function showProfilePic(d,f){$("#profile-pic").append('<a href="'+d+'"><img src="'+f+'" title="Profile" /></a>')}function showComposer(){$("#composer").show()}function hideComposer(){$("#composer").hide()}function removeProfilePic(){$("#profile-pic").empty()}
function removeStream(){$("#stream").empty()}function showThreads(d,f){console.log(d,f);$("#inbox").empty();_.each(d,function(l){processThreads(l,f[l.snippet_author])})}
function processThreads(d,f){var l=$('<li class="story"></li>');d.unread>0&&l.addClass("unread");var j=$('<div class="pic"></div>');j.append('<a href="'+f.url+'"><img src="'+f.pic_square+'"> </img></a>');l.append(j);j=$('<div class="post"></div>');var c=$('<div class="message"></div>');c.append('<div class="subject"><a href="http://facebook.com/?sk=messages&tid='+d.thread_id+'">'+(d.subject==""?"(No subject)":d.subject)+"</a></div>");c.find(".subject a").click(function(){setTimeout("forceNotificationRefresh()",
1E3)});c.append('<a class="name" href="'+f.url+'">'+f.name+"</a>");c.append('<div class="snippet">'+d.snippet+"</div>");j.append(c);l.append(j);j=$('<div class="dummy"></div>');l.append(j);$("#inbox").append(l)}function showNotifications(d,f){console.log(d,f);$("#notifications").empty();_.each(d,function(l){processNotification(l,f[l.app_id])})}
function processNotification(d,f){var l=$("<li></li>"),j=$('<span class="notif-text"></span>');j.append('<a href="'+d.href+'">'+d.title_text+"</a>");f&&f.icon_url&&l.append(j).css("background-image","url("+f.icon_url+")");d.is_unread&&l.addClass("unread");$("#notifications").append(l)}function showStream(d,f){var l=_.reduce(f,{},function(j,c){j[c.id]=c;return j});console.log(d,l);$("#stream").empty();_.each(d,function(j){processPost(j,l,$("#stream"))})}
function showWall(d,f){var l=_.reduce(f,{},function(j,c){j[c.id]=c;return j});console.log(d,l);$("#wall").empty();_.each(d,function(j){processPost(j,l,$("#wall"))})}
function processPost(d,f,l){var j=f[d.actor_id],c;if(d.target_id!=null)c=f[d.target_id];var i=$('<li class="story"></li>');i.data("post_id",d.post_id);var m=$('<div class="pic"></div>');m.append('<a href="'+j.url+'"><img src="'+j.pic_square+'"> </img></a>');i.append(m);m=$('<div class="post"></div>');var o=$('<div class="info"></div>');o.append('<a class="name" href="'+j.url+'">'+j.name+"</a>");d.target_id!=null&&o.append(" &#155; ").append('<a class="name" href="'+c.url+'">'+c.name+"</a>");m.append(o);
j=$('<div class="message"></div>');c=d.message;o=c.match(/(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/gi);if(o!==null)for(var p=0;p<o.length;p++)c=c.replace(o[p],'<a href="'+o[p]+'">'+o[p]+"</a>");j.append(c);o=d.attachment;c=$('<div class="actions"></div>');if(o.name||isArray(o.media)){p=$('<div class="attch"></div>');c.css("clear","both");var s=$('<div class="attch-media"></div>');_.each(o.media,function(r){switch(r.type){case "link":s.append('<a href="'+r.href+
'"><img src="'+r.src+'"> </img></a>');break;case "photo":s.append('<a href="'+r.href+'"><img src="'+r.src+'"> </img></a>');break;case "video":s.append('<a href="'+r.href+'"><img src="'+r.src+'"> </img></a>');break;case "swf":s.append('<a href="'+r.swf.source_url+'"><img src="'+r.swf.preview_img+'"> </img></a>');break}});p.append(s);var u=$('<div class="attch-info"></div>');o.name&&u.append('<div class="attch-name"><a href="'+o.href+'">'+o.name+"</div>");o.caption&&u.append('<div class="attch-caption">'+
o.caption+"</div>");o.description&&u.append('<div class="attch-desc">'+o.description+"</div>");p.append(u);j.append(p)}m.append(j);j=$('<span class="time"></span>');j.append(jQuery.timeago(new Date(d.created_time*1E3)));c.append(j);if(d.comments.can_post){j=$('<span class="a comment-btn">'+commentText+"</span>");c.append(" &#183; ").append(j)}if(d.likes.can_like){j=$('<span class="a like-btn"></span>');d.likes.user_likes?j.append(unlikeText):j.append(likeText);c.append(" &#183; ").append(j)}m.append(c);
j=$('<div class="feedback"></div>');if(d.likes.count>0){c=$('<div class="likes"></div>');c.append('<div class="likes-icon"></div>');$(".likes-icon").css("background-image",g2);if(isArray(d.likes.sample)){for(o=0;o<d.likes.sample.length;o++)(p=f[d.likes.sample[o]])&&p.name!==""?c.append('<a href="'+p.url+'">'+p.name+"</a>"):c.append('<span class="a">'+someoneText+"</a>");d.likes.count==1?c.append(likesThisText):c.append(likeThisText)}else c.append(someoneText+likesThisText);j.append(c)}d=renderComments(d.comments,
f);j.append(d);m.append(j);i.append(m);d=$('<div class="dummy"></div>');i.append(d);l.append(i)}function selectTab(d){var f=$($(d).data("content"));localStorage.tab=$(d).data("content");$($("#items li.selected").data("content")).slideUp().hide();$("#items li.button").each(function(){$($(this).data("content")).hide()});f.slideDown();$("#items li.selected").removeClass("selected");$(d).addClass("selected");if(f.hasClass("empty")){$(d).data("init")();f.removeClass("empty")}}
function initLoginEvents(){$("#login-btn").click(function(){localStorage.tab="#stream";fb_login()});$("#logout-btn").click(function(){localStorage.tab="#stream";fb_logout()})}
function initEvents(){$("#composer-area").focus(function(){$(this).val()==statusFillerText&&$(this).css("color","#000").val("")}).focusout(function(){$(this).val()==""&&$(this).css("color","#9C9C9C").val(statusFillerText)});$("#items li.selected").live("hover",function(){showRefresh()}).live("mouseleave",function(){hideRefresh()}).live("click",function(){animateRefresh()});$("#items li:not(.selected)").live("click",function(){selectTab(this)});$("#stream-btn").data("refresh",function(){refreshStream(animateRefresh,
stopAnimatingRefresh)}).data("init",function(){getStream()}).data("content","#stream");$("#wall-btn").data("refresh",function(){refreshWall(animateRefresh,stopAnimatingRefresh)}).data("init",function(){getWall()}).data("content","#wall");$("#inbox-btn").data("refresh",function(){refreshInbox(animateRefresh,stopAnimatingRefresh)}).data("init",function(){getInbox()}).data("content","#inbox");$("#notifications-btn").data("refresh",function(){refreshNotifications(animateRefresh,stopAnimatingRefresh);
markNotificationsAsRead()}).data("init",function(){getNotifications();markNotificationsAsRead()}).data("content","#notifications");$("#items li.selected.tab").live("click",function(){$(this).data("refresh")()});$(".post-comment textarea").live("focus",function(){$(this).val()==commentFillerText&&$(this).css("color","#000").val("")}).live("focusout",function(){$(this).val()==""&&$(this).css("color","#9C9C9C").val(commentFillerText)});canvas!=undefined&&!canvas?$("#composer-area").css("width","160px"):
$("#composer-area").css("width","247px");$(".comment-submit").live("click",function(){var f=$(this).parents("li.story"),l=f.data("post_id");submitComment(l,f.find(".post-comment textarea").val(),function(){getAllComments(f,l)});removeCommentBox(f)});$("#composer-submit").click(function(){if($("#composer textarea").val()!="What's on your mind?"){submitStatus($("#composer textarea").val(),function(){refreshStream(animateRefresh,stopAnimatingRefresh)});$("#composer textarea").val("").focusout()}});$("#composer textarea").val(statusFillerText);
$("#composer-submit").text(shareText);$("#fb-content").find("a").live("click",function(){$(this).attr("target","_blank")});$("span.comment-btn").live("click",function(){showAndSelectCommentBox($(this).parents("li.story"))});$("span.like-btn").live("click",function(){likeStory($(this).parents("li.story"))});$(".show-more-comments").live("click",function(){var f=$(this).parents("li.story");getAllComments(f,f.data("post_id"))});if(localStorage.tab===undefined)localStorage.tab="#stream";var d=$(localStorage.tab);
$($("#items li.selected").data("content")).slideUp().hide();$("#items li.button").each(function(){$($(this).data("content")).hide()});d.slideDown();$("#items li.selected").removeClass("selected");$(localStorage.tab+"-btn").addClass("selected");if(d.hasClass("empty")){$(localStorage.tab+"-btn").data("init")();d.removeClass("empty")}$("#composer textarea").TextAreaExpander(26)}function showLoading(){$("#loading").show()}function hideLoading(){$("#loading").hide()}
function showAndSelectCommentBox(d){var f;if(d.find(".post-comment").length==0){f=$('<li class="post-comment"></li>');f.append('<textarea rows="2"></textarea>').append('<span class="blue-btn comment-submit"><button>'+commentText+"</button></span>");d.find(".comments").append(f)}else f=d.find(".post-comment");f.find("textarea").focus()}function removeCommentBox(d){d.find(".post-comment").remove()}
function likeStory(d){if(d.find(".like-btn").text()==likeText){submitLike(d.data("post_id"));d.find(".like-btn").text(unlikeText)}else{removeLike(d.data("post_id"));d.find(".like-btn").text(likeText)}}function showRefresh(){var d=$("#items li.selected").children("div.button");d.children("div.refresh-btn").fadeIn(200);d.stop(true,true).animate({opacity:0.7},200)}
function hideRefresh(){var d=$("#items li.selected").children("div.button");d.children("div.refresh-btn").fadeOut(300);d.stop(true,true).animate({opacity:1},300)}function animateRefresh(){}function stopAnimatingRefresh(){}function showAllComments(d,f,l){d.find(".comments").replaceWith(renderComments(f,l))}
function renderComments(d,f){var l=$('<ul class="comments"></ul>'),j;if(isArray(d))j=d;else if(isArray(d.comment_list)){j=d.comment_list;if(d.count!=j.length){l.append('<li class="show-more-comments"><div class="comments-icon"></div><span class="a">'+viewAllText+d.count+commentsText+"</span></li>");$(".comments-icon").css("background-image",g2)}}else{if(d.count>0){l.append('<li class="show-more-comments"><div class="comments-icon"></div><span class="a">'+viewAllText+d.count+commentsText+"</span></li>");
$(".comments-icon").css("background-image",g2)}if(d.count!=undefined)return l;j=[];j[0]=d[0]}for(var c=0;c<j.length;c++){var i=j[c],m=f[i.fromid],o=$('<li class="comment"></li>'),p=$('<div class="comment-pic"></div>');p.append('<img src="'+m.pic_square+'" />');var s=$('<div class="comment-info"></div>');s.append('<a href="'+m.url+'" class="comment-name">'+m.name+"</a>");s.append('<span class="comment-time">'+jQuery.timeago(new Date(i.time*1E3))+"</a>");i=$('<div class="comment-msg">'+i.text+"</div>");
o.append(p).append(s).append(i);l.append(o)}return l}function isArray(d){return d&&length in d&&typeof d.length==="number"&&!d.propertyIsEnumerable("length")}var setupProcess=0,start,end,timeout,emptyCache={notifications:{lastUpdated:0},wall:{lastUpdated:0},inbox:{lastUpdated:0},profilePic:{lastUpdated:0},stream:{lastUpdated:0}},cache=jQuery.extend(true,{},emptyCache);function uid(){return FB.getSession().uid}background={};background.isLoggedIn=function(){return FB.getSession()};
background.publish=function(d,f){FB.api({method:"stream.publish",message:d},function(l){console.log(l);f(l)})};background.addComment=function(d,f,l){FB.api({method:"stream.addComment",post_id:d,comment:f},function(j){console.log(j);l(j)})};background.addLike=function(d,f){FB.api({method:"stream.addLike",post_id:d},function(l){console.log(l);f(l)})};background.removeLike=function(d,f){FB.api({method:"stream.removeLike",post_id:d},function(l){console.log(l);f(l)})};
background.getAllComments=function(d,f){FB.api({method:"fql.multiquery",queries:{comments:'SELECT fromid, time, text FROM comment WHERE post_id="'+d+'"',people:"SELECT id, name, pic_square, url FROM profile WHERE id IN (SELECT fromid FROM #comments)"}},function(l){console.log(l);var j=l[0].fql_result_set;l=_.reduce(l[1].fql_result_set,{},function(c,i){c[i.id]=i;return c});f(j,l)})};
background.getInbox=function(d,f,l){f&&start&&start();if(d||!d&&(new Date).valueOf()-cache.inbox.lastUpdated>refreshTime)FB.api({method:"fql.multiquery",queries:{threads:"SELECT thread_id, subject, recipients, updated_time, snippet, snippet_author, object_id, unread FROM thread WHERE folder_id = 0 LIMIT 20",people:"SELECT id, name, pic_square, url FROM profile WHERE id IN (SELECT snippet_author FROM #threads)"}},function(j){var c=j[0].fql_result_set;j=_.reduce(j[1].fql_result_set,{},function(i,m){i[m.id]=
m;return i});cache.inbox.lastUpdated=(new Date).valueOf();cache.inbox.threads=c;cache.inbox.people=j;f&&end&&end();l(c,j)});else{f&&end&&end();l(cache.inbox.threads,cache.inbox.people)}};
background.getNotifications=function(d,f,l){f&&start&&start();if(d||!d&&(new Date).valueOf()-cache.notifications.lastUpdated>refreshTime)FB.api({method:"fql.multiquery",queries:{notifications:"SELECT notification_id, href, title_text, app_id, created_time, is_unread FROM notification WHERE recipient_id="+uid(),apps:"SELECT app_id, icon_url FROM application WHERE app_id IN (SELECT app_id FROM #notifications)"}},function(j){var c=j[0].fql_result_set;j=_.reduce(j[1].fql_result_set,{},function(i,m){i[m.app_id]=
m;return i});cache.notifications.lastUpdated=(new Date).valueOf();cache.notifications.notifications=c;cache.notifications.apps=j;f&&end&&end();l(c,j)});else{f&&end&&end();l(cache.notifications.notifications,cache.notifications.apps)}};
background.getStream=function(d,f,l){start&&start();var j=f?'filter_key="nf" AND is_hidden = 0':"source_id="+uid();if(d||!d&&f&&(new Date).valueOf()-cache.stream.lastUpdated>refreshTime||!f&&(new Date).valueOf()-cache.wall.lastUpdated>refreshTime)FB.api({method:"fql.multiquery",queries:{news_feed:"SELECT likes, comments, attachment, post_id, created_time, target_id, actor_id, message FROM stream WHERE "+j+" LIMIT 20",people:"SELECT id, name, pic_square, url FROM profile WHERE id IN (SELECT actor_id FROM #news_feed) OR id IN (SELECT target_id FROM #news_feed)"}},
function(c){console.log(c);var i=c[0].fql_result_set,m=_.reduce(i,[],function(p,s){p=p.concat(_.map(s.comments.comment_list,function(u){return u.fromid}));if(s.likes.can_like&&s.likes.sample.length>0)p=p.concat(s.likes.sample);return _.uniq(p)}),o=_.reduce(c[1].fql_result_set,{},function(p,s){p[s.id]=s;return p});FB.api({method:"fql.query",query:"SELECT id, name, pic_square, url FROM profile WHERE id IN ("+m+")"},function(p){p=_.reduce(p,{},function(u,r){u[r.id]=r;return u});for(var s in p)o[s]=p[s];
if(f){cache.stream.lastUpdated=(new Date).valueOf();cache.stream.posts=i;cache.stream.people=o}else{cache.wall.lastUpdated=(new Date).valueOf();cache.wall.posts=i;cache.wall.people=o}end&&end();l(i,o)})});else{end&&end();f?l(cache.stream.posts,cache.stream.people):l(cache.wall.posts,cache.wall.people)}};
background.getProfilePic=function(d){cache.profilePic.lastUpdated==0?FB.api({method:"fql.query",query:"SELECT url, pic_square FROM profile WHERE id="+FB.getSession().uid},function(f){console.log(f);cache.profilePic.url=f[0].pic_square;cache.profilePic.profile=f[0].url;cache.profilePic.lastUpdated=(new Date).valueOf();d(f[0].url,f[0].pic_square)}):d(cache.profilePic.profile,cache.profilePic.url)};background.setStart=function(d){start=d};background.setEnd=function(d){end=d};
background.markNotificationsAsRead=function(d){FB.api({method:"notifications.markRead",notification_ids:d},function(f){console.log(f);forceNotificationRefresh()})};background.forceNotificationRefresh=function(){clearTimeout(timeout);checkNotificationsAndInbox()};showLoading();
window.fbAsyncInit=function(){initLoginEvents();cu=document.location.toString();FB.init({appId:fbId,status:true,cookie:true,xfbml:false,channelUrl:cu});FB.getLoginStatus(function(d){initEvents();hideLoading();d.session?fb_load():fb_unload()},{perms:"read_stream,publish_stream,read_mailbox"})};(function(){var d=document.createElement("script");d.async=true;d.src=document.location.protocol+"//connect.facebook.net/en_US/all.js";document.getElementById("fb-root").appendChild(d)})();
window.fbAsyncInit=fbAsyncInit;function fb_login(){FB.login(function(d){d.session?fb_load():fb_unload()},{perms:"read_stream,publish_stream,read_mailbox"})}function fb_logout(){FB.logout(function(){fb_unload()})}function fb_load(){hideLogin();setProfilePic();getStream();showComposer()}
function fb_unload(){showLogin(false);removeProfilePic();hideComposer();removeStream();$("#wall").empty();$("#notifications").empty();$("#inbox").empty();cache=jQuery.extend(true,{},emptyCache);selectTab($("#stream-btn"))}$(".fbgraph").css("background-image",g2);$("span.login-btn").css("background-image",g2);_gel("loading-icon").src=gadgets.io.getProxyUrl(b+"g/loading.gif");setTimeout(function(){_IG_Analytics(ga,gap+"load"+expTrack)},4E3);gadgets.window.adjustHeight(canvas?"":350);
</script>
]]></Content>
</Module>
