var gadgets=gadgets||{};var shindig=shindig||{};var osapi=osapi||{}; gadgets.config=function(){var components={};var configuration;return{'register':function(component,opt_validators,opt_callback){var registered=components[component];if(!registered){registered=[];components[component]=registered;} registered.push({validators:opt_validators||{},callback:opt_callback});},'get':function(opt_component){if(opt_component){return configuration[opt_component]||{};} return configuration;},'init':function(config,opt_noValidation){configuration=config;for(var name in components){if(components.hasOwnProperty(name)){var componentList=components[name],conf=config[name];for(var i=0,j=componentList.length;i1){for(var i=0,arg;(arg=arguments[i]);++i){listItems.push(arg);}}else{listItems=list;} return function(data){for(var i=0,test;(test=listItems[i]);++i){if(data===listItems[i]){return true;}} return false;};},'RegExValidator':function(re){return function(data){return re.test(data);};},'ExistsValidator':function(data){return typeof data!=="undefined";},'NonEmptyStringValidator':function(data){return typeof data==="string"&&data.length>0;},'BooleanValidator':function(data){return typeof data==="boolean";},'LikeValidator':function(test){return function(data){for(var member in test){if(test.hasOwnProperty(member)){var t=test[member];if(!t(data[member])){return false;}}} return true;};}};}();gadgets.config.isGadget=true;gadgets.config.isContainer=false; gadgets['util']=function(){function parseUrlParams(url){var query;var queryIdx=url.indexOf("?");var hashIdx=url.indexOf("#");if(hashIdx===-1){query=url.substr(queryIdx+1);}else{query=[url.substr(queryIdx+1,hashIdx-queryIdx-1),"&",url.substr(hashIdx+1)].join("");} return query.split("&");} var parameters=null;var features={};var services={};var onLoadHandlers=[];var escapeCodePoints={0:false,10:true,13:true,34:true,39:true,60:true,62:true,92:true,8232:true,8233:true};function unescapeEntity(match,value){return String.fromCharCode(value);} function init(config){features=config["core.util"]||{};} if(gadgets.config){gadgets.config.register("core.util",null,init);} return{'getUrlParameters':function(opt_url){var no_opt_url=typeof opt_url==="undefined";if(parameters!==null&&no_opt_url){return parameters;} var parsed={};var pairs=parseUrlParams(opt_url||document.location.href);var unesc=window.decodeURIComponent?decodeURIComponent:unescape;for(var i=0,j=pairs.length;i=400){resp.errors=[resp.rc+" Error"];}else if(resp.text){if(resp.rc>=300&&resp.rc<400){params.CONTENT_TYPE="TEXT";} switch(params.CONTENT_TYPE){case"JSON":case"FEED":resp.data=gadgets.json.parse(resp.text);if(!resp.data){resp.errors.push("500 Failed to parse JSON");resp.rc=500;resp.data=null;} break;case"DOM":var dom;if(typeof ActiveXObject!='undefined'){dom=new ActiveXObject("Microsoft.XMLDOM");dom.async=false;dom.validateOnParse=false;dom.resolveExternals=false;if(!dom.loadXML(resp.text)){resp.errors.push("500 Failed to parse XML");resp.rc=500;}else{resp.data=dom;}}else{var parser=new DOMParser();dom=parser.parseFromString(resp.text,"text/xml");if("parsererror"===dom.documentElement.nodeName){resp.errors.push("500 Failed to parse XML");resp.rc=500;}else{resp.data=dom;}} break;default:resp.data=resp.text;break;}} return resp;} function makeXhrRequest(realUrl,proxyUrl,callback,paramData,method,params,processResponseFunction,opt_contentType){var xhr=makeXhr();if(proxyUrl.indexOf('//')==0){proxyUrl=document.location.protocol+proxyUrl;} xhr.open(method,proxyUrl,true);if(callback){xhr.onreadystatechange=gadgets.util.makeClosure(null,processResponseFunction,realUrl,callback,params,xhr);} if(paramData!==null){xhr.setRequestHeader('Content-Type',opt_contentType||'application/x-www-form-urlencoded');xhr.send(paramData);}else{xhr.send(null);}} function respondWithPreload(postData,params,callback){if(gadgets.io.preloaded_&&postData.httpMethod==="GET"){for(var i=0;i0){var extraparams="?refresh="+refreshInterval+'&' +gadgets.io.encodeValues(paramData);makeXhrRequest(url,proxyUrl+extraparams,callback,null,"GET",params,processResponse);}else{makeXhrRequest(url,proxyUrl,callback,gadgets.io.encodeValues(paramData),"POST",params,processResponse);}}},makeNonProxiedRequest:function(relativeUrl,callback,opt_params,opt_contentType){var params=opt_params||{};makeXhrRequest(relativeUrl,relativeUrl,callback,params.POST_DATA,params.METHOD,params,processNonProxiedResponse,opt_contentType);},clearOAuthState:function(){oauthState=undefined;},encodeValues:function(fields,opt_noEscaping){var escape=!opt_noEscaping;var buf=[];var first=false;for(var i in fields){if(fields.hasOwnProperty(i)&&!/___$/.test(i)){if(!first){first=true;}else{buf.push("&");} buf.push(escape?encodeURIComponent(i):i);buf.push("=");buf.push(escape?encodeURIComponent(fields[i]):fields[i]);}} return buf.join("");},getProxyUrl:function(url,opt_params){var params=opt_params||{};var refresh=params.REFRESH_INTERVAL;if(refresh===undefined){refresh="3600";} var urlParams=gadgets.util.getUrlParameters();var rewriteMimeParam=params.rewriteMime?"&rewriteMime="+encodeURIComponent(params.rewriteMime):"";var ret=config.proxyUrl.replace("%url%",encodeURIComponent(url)).replace("%host%",document.location.host).replace("%rawurl%",url).replace("%refresh%",encodeURIComponent(refresh)).replace("%gadget%",encodeURIComponent(urlParams.url)).replace("%container%",encodeURIComponent(urlParams.container||urlParams.synd||"default")).replace("%rewriteMime%",rewriteMimeParam);if(ret.indexOf('//')==0){ret=window.location.protocol+ret;} return ret;}};}();gadgets.io.RequestParameters=gadgets.util.makeEnum(["METHOD","CONTENT_TYPE","POST_DATA","HEADERS","AUTHORIZATION","NUM_ENTRIES","GET_SUMMARIES","GET_FULL_HEADERS","REFRESH_INTERVAL","OAUTH_SERVICE_NAME","OAUTH_USE_TOKEN","OAUTH_TOKEN_NAME","OAUTH_REQUEST_TOKEN","OAUTH_REQUEST_TOKEN_SECRET","OAUTH_RECEIVED_CALLBACK"]);gadgets.io.MethodType=gadgets.util.makeEnum(["GET","POST","PUT","DELETE","HEAD"]);gadgets.io.ContentType=gadgets.util.makeEnum(["TEXT","DOM","JSON","FEED"]);gadgets.io.AuthorizationType=gadgets.util.makeEnum(["NONE","SIGNED","OAUTH"]);var tamings___=tamings___||[];tamings___.push(function(imports){caja___.whitelistFuncs([[gadgets.io,'encodeValues'],[gadgets.io,'getProxyUrl'],[gadgets.io,'makeRequest']]);}); (function(){var instance=null;var prefs={};var esc=gadgets.util.escapeString;var messages={};var defaultPrefs={};var language="en";var country="US";var moduleId=0;function parseUrl(){var params=gadgets.util.getUrlParameters();for(var i in params){if(params.hasOwnProperty(i)){if(i.indexOf("up_")===0&&i.length>3){prefs[i.substr(3)]=String(params[i]);}else if(i==="country"){country=params[i];}else if(i==="lang"){language=params[i];}else if(i==="mid"){moduleId=params[i];}}}} function mergeDefaults(){for(var name in defaultPrefs){if(typeof prefs[name]==='undefined'){prefs[name]=defaultPrefs[name];}}} gadgets.Prefs=function(){if(!instance){parseUrl();mergeDefaults();instance=this;} return instance;};gadgets.Prefs.setInternal_=function(key,value){var wasModified=false;if(typeof key==="string"){if(!prefs.hasOwnProperty(key)||prefs[key]!==value){wasModified=true;} prefs[key]=value;}else{for(var k in key){if(key.hasOwnProperty(k)){var v=key[k];if(!prefs.hasOwnProperty(k)||prefs[k]!==v){wasModified=true;} prefs[k]=v;}}} return wasModified;};gadgets.Prefs.setMessages_=function(msgs){messages=msgs;};gadgets.Prefs.setDefaultPrefs_=function(defprefs){defaultPrefs=defprefs;};gadgets.Prefs.prototype.getString=function(key){if(key===".lang"){key="lang";} return prefs[key]?esc(prefs[key]):"";};gadgets.Prefs.prototype.setDontEscape_=function(){esc=function(k){return k;};};gadgets.Prefs.prototype.getInt=function(key){var val=parseInt(prefs[key],10);return isNaN(val)?0:val;};gadgets.Prefs.prototype.getFloat=function(key){var val=parseFloat(prefs[key]);return isNaN(val)?0:val;};gadgets.Prefs.prototype.getBool=function(key){var val=prefs[key];if(val){return val==="true"||val===true||!!parseInt(val,10);} return false;};gadgets.Prefs.prototype.set=function(key,value){throw new Error("setprefs feature required to make this call.");};gadgets.Prefs.prototype.getArray=function(key){var val=prefs[key];if(val){var arr=val.split("|");for(var i=0,j=arr.length;i0){resp.data.ErrorMsg=resp.errors[0];} if(resp.data.link){resp.data.URL=url;} if(resp.data.title){resp.data.Title=resp.data.title;} if(resp.data.description){resp.data.Description=resp.data.description;} if(resp.data.link){resp.data.Link=resp.data.link;} if(resp.data.items&&resp.data.items.length>0){resp.data.Entry=resp.data.items;for(var index=0;index]+>/g,"");} function _trim(str){return str.replace(/^\s+|\s+$/g,"");} function _toggle(el){el=(typeof el==="string")?_gel(el):el;if(el!==null){if(el.style.display.length===0||el.style.display==="block"){el.style.display="none";}else if(el.style.display==="none"){el.style.display="block";}}} var _uid=(function(){var _legacy_uidCounter=0;return function(){return _legacy_uidCounter++;};})();function _min(a,b){return(ab?a:b);} function _exportSymbols(name,sym){var attach=window;var parts=name.split(".");for(var i=0,j=parts.length;i','amp':'&','nbsp':'\xa0','quot':'\"','apos':'\''},decimalEscapeRe=/^#(\d+)$/,hexEscapeRe=/^#x([0-9A-Fa-f]+)$/;function lookupEntity(name){var m;return name=lcase(name),ENTITIES.hasOwnProperty(name)?ENTITIES[name]:(m=name.match(decimalEscapeRe),m?String.fromCharCode(parseInt(m[1],10)):(m=name.match(hexEscapeRe))?String.fromCharCode(parseInt(m[1],16)):'')}function decodeOneEntity(_,name){return lookupEntity(name)}nulRe=/\0/g;function stripNULs(s){return s.replace(nulRe,'')}entityRe=/&(#\d+|#x[0-9A-Fa-f]+|\w+);/g;function unescapeEntities(s){return s.replace(entityRe,decodeOneEntity)}ampRe=/&/g,looseAmpRe=/&([^a-z#]|#(?:[^0-9x]|x(?:[^0-9a-f]|$)|$)|$)/gi,ltRe=//g,quotRe=/\"/g,eqRe=/\=/g;function escapeAttrib(s){return s.replace(ampRe,'&').replace(ltRe,'<').replace(gtRe,'>').replace(quotRe,'"').replace(eqRe,'=')}function normalizeRCData(rcdata){return rcdata.replace(looseAmpRe,'&$1').replace(ltRe,'<').replace(gtRe,'>')}INSIDE_TAG_TOKEN=new RegExp('^\\s*(?:(?:([a-z][a-z-]*)(\\s*=\\s*(\"[^\"]*\"|\'[^\']*\'|(?=[a-z][a-z-]*\\s*=)|[^>\"\'\\s]*))?)|(/?>)|.[^a-z\\s>]*)','i'),OUTSIDE_TAG_TOKEN=new RegExp('^(?:&(\\#[0-9]+|\\#[x][0-9a-f]+|\\w+);||]*>|<\\?[^>*]*>|<(/)?([a-z][a-z0-9]*)|([^<&>]+)|([<&>]))','i');function makeSaxParser(handler){return function parse(htmlText,param){var attribName,attribs,dataEnd,decodedValue,eflags,encodedValue,htmlLower,inTag,m,openTag,tagName;htmlText=String(htmlText),htmlLower=null,inTag=false,attribs=[],tagName=void 0,eflags=void 0,openTag=void 0,handler.startDoc&&handler.startDoc(param);while(htmlText){m=htmlText.match(inTag?INSIDE_TAG_TOKEN:OUTSIDE_TAG_TOKEN),htmlText=htmlText.substring(m[0].length);if(inTag){if(m[1]){attribName=lcase(m[1]);if(m[2]){encodedValue=m[3];switch(encodedValue.charCodeAt(0)){case 34:case 39:encodedValue=encodedValue.substring(1,encodedValue.length-1)}decodedValue=unescapeEntities(stripNULs(encodedValue))}else decodedValue=attribName;attribs.push(attribName,decodedValue)}else if(m[4])eflags!==void 0&&(openTag?handler.startTag&&handler.startTag(tagName,attribs,param):handler.endTag&&handler.endTag(tagName,param)),openTag&&eflags&(html4.eflags.CDATA|html4.eflags.RCDATA)&&(htmlLower===null?(htmlLower=lcase(htmlText)):(htmlLower=htmlLower.substring(htmlLower.length-htmlText.length)),dataEnd=htmlLower.indexOf('':handler.pcdata('>',param);break;default:handler.pcdata('&',param)}}}handler.endDoc&&handler.endDoc(param)}}return{'normalizeRCData':normalizeRCData,'escapeAttrib':escapeAttrib,'unescapeEntities':unescapeEntities,'makeSaxParser':makeSaxParser}})(),html.makeHtmlSanitizer=function(sanitizeAttributes){var ignoring,stack;return html.makeSaxParser({'startDoc':function(_){stack=[],ignoring=false},'startTag':function(tagName,attribs,out){var attribName,eflags,i,n,value;if(ignoring)return;if(!html4.ELEMENTS.hasOwnProperty(tagName))return;eflags=html4.ELEMENTS[tagName];if(eflags&html4.eflags.FOLDABLE)return;else if(eflags&html4.eflags.UNSAFE)return ignoring=!(eflags&html4.eflags.EMPTY),void 0;attribs=sanitizeAttributes(tagName,attribs);if(attribs){eflags&html4.eflags.EMPTY||stack.push(tagName),out.push('<',tagName);for(i=0,n=attribs.length;i')}},'endTag':function(tagName,out){var eflags,i,index,stackEl;if(ignoring)return ignoring=false,void 0;if(!html4.ELEMENTS.hasOwnProperty(tagName))return;eflags=html4.ELEMENTS[tagName];if(!(eflags&(html4.eflags.UNSAFE|html4.eflags.EMPTY|html4.eflags.FOLDABLE))){if(eflags&html4.eflags.OPTIONAL_ENDTAG)for(index=stack.length;--index>=0;){stackEl=stack[index];if(stackEl===tagName)break;if(!(html4.ELEMENTS[stackEl]&html4.eflags.OPTIONAL_ENDTAG))return}else for(index=stack.length;--index>=0;)if(stack[index]===tagName)break;if(index<0)return;for(i=stack.length;--i>index;)stackEl=stack[i],html4.ELEMENTS[stackEl]&html4.eflags.OPTIONAL_ENDTAG||out.push('');stack.length=index,out.push('')}},'pcdata':function(text,out){ignoring||out.push(text)},'rcdata':function(text,out){ignoring||out.push(text)},'cdata':function(text,out){ignoring||out.push(text)},'endDoc':function(out){var i;for(i=stack.length;--i>=0;)out.push('');stack.length=0}})};function html_sanitize(htmlText,opt_uriPolicy,opt_nmTokenPolicy){var out=[];return html.makeHtmlSanitizer(function sanitizeAttribs(tagName,attribs){var attribKey,attribName,atype,i,value;for(i=0;iMAX_NIX_SEARCHES){gadgets.warn('Nix transport setup failed, falling back...');ready('..',false);return;} if(!handler&&window.opener&&"GetAuthToken"in window.opener){handler=window.opener;if(handler.GetAuthToken()==gadgets.rpc.getAuthToken('..')){var token=gadgets.rpc.getAuthToken('..');handler.CreateChannel(window[NIX_GET_WRAPPER]('..',token),token);nix_channels['..']=handler;window.opener=null;ready('..',true);return;}} window.setTimeout(function(){conductHandlerSearch();},NIX_SEARCH_PERIOD);} function getLocationNoHash(){var loc=window.location.href;var idx=loc.indexOf('#');if(idx==-1){return loc;} return loc.substring(0,idx);} function setupSecureRelayToParent(rpctoken){var childToken=(0x7FFFFFFF*Math.random())|0;var data=[getLocationNoHash(),childToken];gadgets.rpc._createRelayIframe(rpctoken,data);var hash=window.location.href.split('#')[1]||'';function relayTimer(){var newHash=window.location.href.split('#')[1]||'';if(newHash!==hash){clearInterval(relayTimerId);var params=gadgets.util.getUrlParameters(window.location.href);if(params.childtoken==childToken){conductHandlerSearch();return;} ready('..',false);}} var relayTimerId=setInterval(relayTimer,100);} return{getCode:function(){return'nix';},isParentVerifiable:function(opt_receiverId){if(opt_receiverId){return isForceSecure[opt_receiverId];} return false;},init:function(processFn,readyFn){ready=readyFn;if(typeof window[NIX_GET_WRAPPER]!=='unknown'){window[NIX_HANDLE_MESSAGE]=function(data){window.setTimeout(function(){processFn(gadgets.json.parse(data));},0);};window[NIX_CREATE_CHANNEL]=function(name,channel,token){if(gadgets.rpc.getAuthToken(name)===token){nix_channels[name]=channel;ready(name,true);}};var vbscript='Class '+NIX_WRAPPER+'\n ' +'Private m_Intended\n' +'Private m_Auth\n' +'Public Sub SetIntendedName(name)\n ' +'If isEmpty(m_Intended) Then\n' +'m_Intended = name\n' +'End If\n' +'End Sub\n' +'Public Sub SetAuth(auth)\n ' +'If isEmpty(m_Auth) Then\n' +'m_Auth = auth\n' +'End If\n' +'End Sub\n' +'Public Sub SendMessage(data)\n ' +NIX_HANDLE_MESSAGE+'(data)\n' +'End Sub\n' +'Public Function GetAuthToken()\n ' +'GetAuthToken = m_Auth\n' +'End Function\n' +'Public Sub CreateChannel(channel, auth)\n ' +'Call '+NIX_CREATE_CHANNEL+'(m_Intended, channel, auth)\n' +'End Sub\n' +'End Class\n' +'Function '+NIX_GET_WRAPPER+'(name, auth)\n' +'Dim wrap\n' +'Set wrap = New '+NIX_WRAPPER+'\n' +'wrap.SetIntendedName name\n' +'wrap.SetAuth auth\n' +'Set '+NIX_GET_WRAPPER+' = wrap\n' +'End Function';try{window.execScript(vbscript,'vbscript');}catch(e){return false;}} return true;},setup:function(receiverId,token,forcesecure){isForceSecure[receiverId]=!!forcesecure;if(receiverId==='..'){if(forcesecure){setupSecureRelayToParent(token);}else{conductHandlerSearch();} return true;} try{var frame=document.getElementById(receiverId);var wrapper=window[NIX_GET_WRAPPER](receiverId,token);frame.contentWindow.opener=wrapper;}catch(e){return false;} return true;},call:function(targetId,from,rpc){try{if(nix_channels[targetId]){nix_channels[targetId].SendMessage(gadgets.json.stringify(rpc));}}catch(e){return false;} return true;},relayOnload:function(receiverId,data){var src=data[0]+'#childtoken='+data[1];var childIframe=document.getElementById(receiverId);childIframe.src=src;}};}();} gadgets.rpctx=gadgets.rpctx||{};if(!gadgets.rpctx.rmr){gadgets.rpctx.rmr=function(){var RMR_SEARCH_TIMEOUT=500;var RMR_MAX_POLLS=10;var rmr_channels={};var process;var ready;function appendRmrFrame(channelFrame,relayUri,data,opt_frameId){var appendFn=function(){document.body.appendChild(channelFrame);channelFrame.src='about:blank';if(opt_frameId){channelFrame.onload=function(){processRmrData(opt_frameId);};} channelFrame.src=relayUri+'#'+data;};if(document.body){appendFn();}else{gadgets.util.registerOnLoadHandler(function(){appendFn();});}} function setupRmr(frameId){if(typeof rmr_channels[frameId]==="object"){return;} var channelFrame=document.createElement('iframe');var frameStyle=channelFrame.style;frameStyle.position='absolute';frameStyle.top='0px';frameStyle.border='0';frameStyle.opacity='0';frameStyle.width='10px';frameStyle.height='1px';channelFrame.id='rmrtransport-'+frameId;channelFrame.name=channelFrame.id;var relayUri=gadgets.rpc.getRelayUrl(frameId);if(!relayUri){relayUri=gadgets.rpc.getOrigin(gadgets.util.getUrlParameters()["parent"])+'/robots.txt';} rmr_channels[frameId]={frame:channelFrame,receiveWindow:null,relayUri:relayUri,searchCounter:0,width:10,waiting:true,queue:[],sendId:0,recvId:0};if(frameId!=='..'){appendRmrFrame(channelFrame,relayUri,getRmrData(frameId));} conductRmrSearch(frameId);} function conductRmrSearch(frameId){var channelWindow=null;rmr_channels[frameId].searchCounter++;try{var targetWin=gadgets.rpc._getTargetWin(frameId);if(frameId==='..'){channelWindow=targetWin.frames['rmrtransport-'+gadgets.rpc.RPC_ID];}else{channelWindow=targetWin.frames['rmrtransport-..'];}}catch(e){} var status=false;if(channelWindow){status=registerRmrChannel(frameId,channelWindow);} if(!status){if(rmr_channels[frameId].searchCounter>RMR_MAX_POLLS){return;} window.setTimeout(function(){conductRmrSearch(frameId);},RMR_SEARCH_TIMEOUT);}} function callRmr(targetId,serviceName,from,rpc){var handler=null;if(from!=='..'){handler=rmr_channels['..'];}else{handler=rmr_channels[targetId];} if(handler){if(serviceName!==gadgets.rpc.ACK){handler.queue.push(rpc);} if(handler.waiting||(handler.queue.length===0&&!(serviceName===gadgets.rpc.ACK&&rpc&&rpc.ackAlone===true))){return true;} if(handler.queue.length>0){handler.waiting=true;} var url=handler.relayUri+"#"+getRmrData(targetId);try{handler.frame.contentWindow.location=url;var newWidth=handler.width==10?20:10;handler.frame.style.width=newWidth+'px';handler.width=newWidth;}catch(e){return false;}} return true;} function getRmrData(toFrameId){var channel=rmr_channels[toFrameId];var rmrData={id:channel.sendId};if(channel){rmrData.d=Array.prototype.slice.call(channel.queue,0);rmrData.d.push({s:gadgets.rpc.ACK,id:channel.recvId});} return gadgets.json.stringify(rmrData);} function processRmrData(fromFrameId){var channel=rmr_channels[fromFrameId];var data=channel.receiveWindow.location.hash.substring(1);var rpcObj=gadgets.json.parse(decodeURIComponent(data))||{};var rpcArray=rpcObj.d||[];var nonAckReceived=false;var noLongerWaiting=false;var numBypassed=0;var numToBypass=(channel.recvId-rpcObj.id);for(var i=0;i0)){var from=(fromFrameId==='..')?gadgets.rpc.RPC_ID:'..';callRmr(fromFrameId,gadgets.rpc.ACK,from,{ackAlone:nonAckReceived});}} function registerRmrChannel(frameId,channelWindow){var channel=rmr_channels[frameId];try{var canAccess=false;canAccess='document'in channelWindow;if(!canAccess){return false;} canAccess=typeof channelWindow['document']=='object';if(!canAccess){return false;} var loc=channelWindow.location.href;if(loc==='about:blank'){return false;}}catch(ex){return false;} channel.receiveWindow=channelWindow;function onresize(){processRmrData(frameId);};if(typeof channelWindow.attachEvent==="undefined"){channelWindow.onresize=onresize;}else{channelWindow.attachEvent("onresize",onresize);} if(frameId==='..'){appendRmrFrame(channel.frame,channel.relayUri,getRmrData(frameId),frameId);}else{processRmrData(frameId);} return true;} return{getCode:function(){return'rmr';},isParentVerifiable:function(){return true;},init:function(processFn,readyFn){process=processFn;ready=readyFn;return true;},setup:function(receiverId,token){try{setupRmr(receiverId);}catch(e){gadgets.warn('Caught exception setting up RMR: '+e);return false;} return true;},call:function(targetId,from,rpc){return callRmr(targetId,rpc.s,from,rpc);}};}();} gadgets.rpctx=gadgets.rpctx||{};if(!gadgets.rpctx.ifpc){gadgets.rpctx.ifpc=function(){var iframePool=[];var callId=0;var ready;function encodeLegacyData(args){var argsEscaped=[];for(var i=0,j=args.length;i=0;--i){var ifr=iframePool[i];try{if(ifr&&(ifr.recyclable||ifr.readyState==='complete')){ifr.parentNode.removeChild(ifr);if(window.ActiveXObject){iframePool[i]=ifr=null;iframePool.splice(i,1);}else{ifr.recyclable=false;iframe=ifr;break;}}}catch(e){}} if(!iframe){iframe=document.createElement('iframe');iframe.style.border=iframe.style.width=iframe.style.height='0px';iframe.style.visibility='hidden';iframe.style.position='absolute';iframe.onload=function(){this.recyclable=true;};iframePool.push(iframe);} iframe.src=src;window.setTimeout(function(){document.body.appendChild(iframe);},0);} return{getCode:function(){return'ifpc';},isParentVerifiable:function(){return true;},init:function(processFn,readyFn){ready=readyFn;ready('..',true);return true;},setup:function(receiverId,token){ready(receiverId,true);return true;},call:function(targetId,from,rpc){var relay=gadgets.rpc.getRelayUrl(targetId);++callId;if(!relay){gadgets.warn('No relay file assigned for IFPC');return false;} var src=null;if(rpc.l){var callArgs=rpc.a;src=[relay,'#',encodeLegacyData([from,callId,1,0,encodeLegacyData([from,rpc.s,'','',from].concat(callArgs))])].join('');}else{src=[relay,'#',targetId,'&',from,'@',callId,'&1&0&',encodeURIComponent(gadgets.json.stringify(rpc))].join('');} emitInvisibleIframe(src);return true;}};}();} if(!gadgets.rpc){gadgets.rpc=function(){var CALLBACK_NAME='__cb';var DEFAULT_NAME='';var ACK='__ack';var SETUP_FRAME_TIMEOUT=500;var SETUP_FRAME_MAX_TRIES=10;var services={};var relayUrl={};var useLegacyProtocol={};var authToken={};var callId=0;var callbacks={};var setup={};var sameDomain={};var params={};var receiverTx={};var earlyRpcQueue={};var isChild=(window.top!==window.self);var rpcId=window.name;var securityCallback=function(){};var LOAD_TIMEOUT=0;var FRAME_PHISH=1;var FORGED_MSG=2;var fallbackTransport=(function(){function logFn(name){return function(){gadgets.log("gadgets.rpc."+name+"("+ gadgets.json.stringify(Array.prototype.slice.call(arguments))+"): call ignored. [caller: "+document.location+", isChild: "+isChild+"]");};} return{getCode:function(){return"noop";},isParentVerifiable:function(){return true;},init:logFn("init"),setup:logFn("setup"),call:logFn("call")};})();if(gadgets.util){params=gadgets.util.getUrlParameters();} function getTransport(){return typeof window.postMessage==='function'?gadgets.rpctx.wpm:typeof window.postMessage==='object'?gadgets.rpctx.wpm:window.ActiveXObject?gadgets.rpctx.nix:navigator.userAgent.indexOf('WebKit')>0?gadgets.rpctx.rmr:navigator.product==='Gecko'?gadgets.rpctx.frameElement:gadgets.rpctx.ifpc;} function transportReady(receiverId,readySuccess){var tx=transport;if(!readySuccess){tx=fallbackTransport;} receiverTx[receiverId]=tx;var earlyQueue=earlyRpcQueue[receiverId]||[];for(var i=0;i4){process(gadgets.json.parse(decodeURIComponent(fragment[fragment.length-1])));}else{relayOnload.apply(null,fragment.concat(otherWindow));}},receiveSameDomain:function(rpc){rpc.a=Array.prototype.slice.call(rpc.a);window.setTimeout(function(){process(rpc);},0);},getOrigin:getOrigin,getReceiverOrigin:function(receiverId){var channel=receiverTx[receiverId];if(!channel){return null;} if(!channel.isParentVerifiable(receiverId)){return null;} var origRelay=gadgets.rpc.getRelayUrl(receiverId)||gadgets.util.getUrlParameters().parent;return gadgets.rpc.getOrigin(origRelay);},init:function(){if(transport.init(process,transportReady)===false){transport=fallbackTransport;} if(isChild){setupReceiver('..');}},_getTargetWin:getTargetWin,_createRelayIframe:function(token,data){var relay=gadgets.rpc.getRelayUrl('..');if(!relay){return null;} var src=relay+'#..&'+rpcId+'&'+token+'&'+ encodeURIComponent(gadgets.json.stringify(data));var iframe=document.createElement('iframe');iframe.style.border=iframe.style.width=iframe.style.height='0px';iframe.style.visibility='hidden';iframe.style.position='absolute';function appendFn(){document.body.appendChild(iframe);iframe.src='javascript:""';iframe.src=src;} if(document.body){appendFn();}else{gadgets.util.registerOnLoadHandler(function(){appendFn();});} return iframe;},ACK:ACK,RPC_ID:rpcId,SEC_ERROR_LOAD_TIMEOUT:LOAD_TIMEOUT,SEC_ERROR_FRAME_PHISH:FRAME_PHISH,SEC_ERROR_FORGED_MSG:FORGED_MSG};}();gadgets.rpc.init();} var opensocial=opensocial||{};opensocial.requestSendMessage=function(recipients,message,opt_callback,opt_params){return opensocial.Container.get().requestSendMessage(recipients,message,opt_callback,opt_params);};opensocial.requestShareApp=function(recipients,reason,opt_callback,opt_params){opensocial.Container.get().requestShareApp(recipients,reason,opt_callback,opt_params);};opensocial.requestCreateActivity=function(activity,priority,opt_callback){if(!activity||(!activity.getField(opensocial.Activity.Field.TITLE)&&!activity.getField(opensocial.Activity.Field.TITLE_ID))){if(opt_callback){window.setTimeout(function(){opt_callback(new opensocial.ResponseItem(null,null,opensocial.ResponseItem.Error.BAD_REQUEST,"You must pass in an activity with a title or title id."));},0);} return;} opensocial.Container.get().requestCreateActivity(activity,priority,opt_callback);};opensocial.CreateActivityPriority={HIGH:'HIGH',LOW:'LOW'};opensocial.hasPermission=function(permission){return opensocial.Container.get().hasPermission(permission);};opensocial.requestPermission=function(permissions,reason,opt_callback){opensocial.Container.get().requestPermission(permissions,reason,opt_callback);};opensocial.Permission={VIEWER:'viewer'};opensocial.getEnvironment=function(){return opensocial.Container.get().getEnvironment();};opensocial.newDataRequest=function(){return opensocial.Container.get().newDataRequest();};opensocial.newActivity=function(params){return opensocial.Container.get().newActivity(params);};opensocial.newAlbum=function(opt_params){return opensocial.Container.get().newAlbum(opt_params);};opensocial.newMediaItem=function(mimeType,url,opt_params){return opensocial.Container.get().newMediaItem(mimeType,url,opt_params);};opensocial.newMessage=function(body,opt_params){return opensocial.Container.get().newMessage(body,opt_params);};opensocial.EscapeType={HTML_ESCAPE:'htmlEscape',NONE:'none'};opensocial.newIdSpec=function(params){return opensocial.Container.get().newIdSpec(params);};opensocial.newNavigationParameters=function(params){return opensocial.Container.get().newNavigationParameters(params);};opensocial.invalidateCache=function(){opensocial.Container.get().invalidateCache();};Function.prototype.inherits=function(parentCtor){function tempCtor(){} tempCtor.prototype=parentCtor.prototype;this.superClass_=parentCtor.prototype;this.prototype=new tempCtor();this.prototype.constructor=this;};opensocial.openModal=function(url){opensocial.Container.get().openModal(url);};opensocial.Activity=function(params){this.fields_=params;};opensocial.Activity.Field={TITLE_ID:'titleId',TITLE:'title',TEMPLATE_PARAMS:'templateParams',URL:'url',MEDIA_ITEMS:'mediaItems',BODY_ID:'bodyId',BODY:'body',EXTERNAL_ID:'externalId',STREAM_TITLE:'streamTitle',STREAM_URL:'streamUrl',STREAM_SOURCE_URL:'streamSourceUrl',STREAM_FAVICON_URL:'streamFaviconUrl',PRIORITY:'priority',ID:'id',USER_ID:'userId',APP_ID:'appId',POSTED_TIME:'postedTime'};opensocial.Activity.prototype.getId=function(){return this.getField(opensocial.Activity.Field.ID);};opensocial.Activity.prototype.getField=function(key,opt_params){return opensocial.Container.getField(this.fields_,key,opt_params);};opensocial.Activity.prototype.setField=function(key,data){return(this.fields_[key]=data);};opensocial.Address=function(opt_params){this.fields_=opt_params||{};};opensocial.Address.Field={TYPE:'type',UNSTRUCTURED_ADDRESS:'unstructuredAddress',PO_BOX:'poBox',STREET_ADDRESS:'streetAddress',EXTENDED_ADDRESS:'extendedAddress',REGION:'region',LOCALITY:'locality',POSTAL_CODE:'postalCode',COUNTRY:'country',LATITUDE:'latitude',LONGITUDE:'longitude'};opensocial.Address.prototype.getField=function(key,opt_params){return opensocial.Container.getField(this.fields_,key,opt_params);};opensocial.Album=function(opt_params){this.fields_=opt_params||{};};opensocial.Album.Field={DESCRIPTION:'description',ID:'id',LOCATION:'location',MEDIA_ITEM_COUNT:'mediaITemCount',MEDIA_MIME_TYPE:'MEDIA_MIME_TYPE',MEDIA_TYPE:'MEDIA_TYPE',OWNER_ID:'ownerId',THUMBNAIL_URL:'thumbnailUrl',TITLE:'title'};opensocial.Album.prototype.getField=function(key,opt_params){return opensocial.Container.getField(this.fields_,key,opt_params);};opensocial.Album.prototype.setField=function(key,data){return this.fields_[key]=data;};opensocial.BodyType=function(opt_params){this.fields_=opt_params||{};};opensocial.BodyType.Field={BUILD:'build',HEIGHT:'height',WEIGHT:'weight',EYE_COLOR:'eyeColor',HAIR_COLOR:'hairColor'};opensocial.BodyType.prototype.getField=function(key,opt_params){return opensocial.Container.getField(this.fields_,key,opt_params);};opensocial.Collection=function(array,opt_offset,opt_totalSize){this.array_=array||[];this.offset_=opt_offset||0;this.totalSize_=opt_totalSize||this.array_.length;};opensocial.Collection.prototype.getById=function(id){for(var i=0;i-1)?"&":"?";url+="invite_member="+data["recipientIds"].join(",");return gadgets.rpc.call(null,"nutaku.requestRedirect",null,url);}}},params.callbackfunc!=undefined);},};}();nutaku.callbackStore=function(){return{register:function(name,callback){this[name]=callback;}};}();nutaku.requestRedirect=function(){return{call:function(url){gadgets.rpc.call(null,'nutaku.requestRedirect',null,url);}};}();nutaku.api=function(){return{setCookie:function(params){gadgets.rpc.call(null,'nutaku.apiSetCookie',null,params);},setCookie_revised:function(params){params.revised=true;gadgets.rpc.call(null,'nutaku.apiSetCookie',null,params);},setScroll:function(params){gadgets.rpc.call(null,'nutaku.apiSetScroll',null,params);},redirect:function(params){gadgets.rpc.call(null,'nutaku.apiRedirect',null,params);}};}();nutaku.gadget.init();})(); (function(){opensocial.Container.setContainer(new opensocial.Container);var parentHost=document.referrer.replace(/(^\w+:|^)\/\//,'').replace(/\/+$/,'');nutaku.gadget.setParentHost(parentHost);gadgets.rpc.setupReceiver('..',parentHost);})();gadgets.config.init({"core.io":{"proxyUrl":"\/\/%host%\/gadgets\/proxy?container=default&refresh=%refresh%&url=%url%%rewriteMime%","jsonProxyUrl":"\/\/%host%\/gadgets\/makeRequest"},"rpc":{"parentRelayUrl":"\/container\/rpc_relay.html","useLegacyProtocol":false},"core.util":{"globals":{},"core.config":{},"core.util":{},"shindig.auth":{},"core.json":{},"core.io":{},"core.prefs":{},"core.legacy":{},"core.log":{},"core":{},"core.none":{},"rpc":{},"opensocial-reference":{},"opensocial-base":{},"locked-domain":{},"auth-refresh":{},"security-token":{},"opensocial-jsonrpc-nutaku":{},"sp":{},"sp-net":{}},"osapi.services":{"gadgets.rpc":["container.listMethods"],"http:\/\/%host%\/rpc":["messages.update","albums.update","activities.delete","activities.update","activities.supportedFields","albums.get","activities.get","mediaitems.update","messages.get","appdata.get","system.listMethods","people.supportedFields","messages.create","mediaitems.delete","mediaitems.create","people.get","people.create","albums.delete","messages.delete","appdata.update","activities.create","mediaitems.get","albums.create","appdata.delete","people.update","appdata.create"],"http:\/\/%host%\/gadgets\/api\/rpc":["cache.invalidate","http.head","http.get","http.put","http.post","http.delete"]}});