if(!this.JSON){JSON=function(){function f(n){return n<10?"0"+n:n}Date.prototype.toJSON=function(key){return this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z"};var cx=new RegExp("/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g"),escapeable=new RegExp('/[\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g'),gap,indent,breaker,meta={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;function quote(string){escapeable.lastIndex=0;return escapeable.test(string)?'"'+string.replace(escapeable,function(a){var c=meta[a];if(typeof c==="string"){return c}return"\\u"+("0000"+(+(a.charCodeAt(0))).toString(16)).slice(-4)})+'"':'"'+string+'"'}function str(key,holder){var i,k,v,length,mind=gap,partial,value=holder[key];if(value&&typeof value==="object"&&typeof value.toJSON==="function"){value=value.toJSON(key)}if(typeof rep==="function"){value=rep.call(holder,key,value)}switch(typeof value){case"string":return quote(value);case"number":return isFinite(value)?String(value):"null";case"boolean":case"null":return String(value);case"object":if(!value){return"null"}gap+=indent;partial=[];if(typeof value.length==="number"&&!(value.propertyIsEnumerable("length"))){length=value.length;for(i=0;i<length;i+=1){partial[i]=str(i,value)||"null"}v=partial.length===0?"[]":gap?"["+breaker+gap+partial.join(","+breaker+gap)+breaker+mind+"]":"["+partial.join(",")+"]";gap=mind;return v}if(rep&&typeof rep==="object"){length=rep.length;for(i=0;i<length;i+=1){k=rep[i];if(typeof k==="string"){v=str(k,value,rep);if(v){partial.push(quote(k)+(gap?": ":":")+v)}}}}else{for(k in value){if(Object.hasOwnProperty.call(value,k)){v=str(k,value,rep);if(v){partial.push(quote(k)+(gap?": ":":")+v)}}}}v=partial.length===0?"{}":gap?"{"+breaker+gap+partial.join(","+breaker+gap)+breaker+mind+"}":"{"+partial.join(",")+"}";gap=mind;return v}}return{stringify:function(value,replacer,space,linebreak){var i;gap="";indent="";if(space){if(typeof space==="number"){for(i=0;i<space;i+=1){indent+=" "}}else{if(typeof space==="string"){indent=space}}breaker=typeof linebreak!=="string"?"\n":linebreak}rep=replacer;if(replacer&&typeof replacer!=="function"&&(typeof replacer!=="object"||typeof replacer.length!=="number")){throw new Error("JSON.stringify")}return str("",{"":value})},parse:function(text,reviver){var j;function walk(holder,key){var k,v,value=holder[key];if(value&&typeof value==="object"){for(k in value){if(Object.hasOwnProperty.call(value,k)){v=walk(value,k);if(v!==undefined){value[k]=v}else{delete value[k]}}}}return reviver.call(holder,key,value)}cx.lastIndex=0;if(cx.test(text)){text=text.replace(cx,function(a){return"\\u"+("0000"+(+(a.charCodeAt(0))).toString(16)).slice(-4)})}if(/^[\],:{}\s]*$/.test(text.replace(/\\["\\\/bfnrtu]/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){j=eval("("+text+")");return typeof reviver==="function"?walk({"":j},""):j}throw new SyntaxError("JSON.parse")}}}()}var goog=goog||{};goog.net=goog.net||{};goog.net.cookies=goog.net.cookies||{};goog.JsType_={UNDEFINED:"undefined"};goog.isDef=function(a){return typeof a!=goog.JsType_.UNDEFINED};goog.net.cookies.set=function(c,i,h,b,d){if(/;=/g.test(c)){throw new Error('Invalid cookie name "'+c+'"')}if(/;/g.test(i)){throw new Error('Invalid cookie value "'+i+'"')}if(!goog.isDef(h)){h=-1}var f=d?";domain="+d:"";var j=b?";path="+b:"";var e;if(h<0){e=""}else{if(h==0){var g=new Date(1970,1,1);e=";expires="+g.toUTCString()}else{var a=new Date((new Date).getTime()+h*1000);e=";expires="+a.toUTCString()}}document.cookie=c+"="+i+f+j+e};goog.net.cookies.get=function(b,g){var f=b+"=";var d=String(document.cookie);for(var h=-1;(h=d.indexOf(f,h+1))>=0;){var c=h;while(--c>=0){var e=d.charAt(c);if(e==";"){c=-1;break}}if(c==-1){var a=d.indexOf(";",h);if(a<0){a=d.length}return d.substring(h+f.length,a)}}return g};goog.net.cookies.remove=function(b,a,c){var d=goog.net.cookies.containsKey(b);goog.net.cookies.set(b,"",0,a,c);return d};goog.net.cookies.getKeyValues_=function(){var e=String(document.cookie);var g=e.split(/\s*;\s*/);var f=[],a=[],c,b;for(var d=0;b=g[d];d++){c=b.indexOf("=");if(c==-1){f.push("");a.push(b)}else{f.push(b.substring(0,c));a.push(b.substring(c+1))}}return{keys:f,values:a}};goog.net.cookies.getKeys=function(){return goog.net.cookies.getKeyValues_().keys};goog.net.cookies.getValues=function(){return goog.net.cookies.getKeyValues_().values};goog.net.cookies.isEmpty=function(){return document.cookie==""};goog.net.cookies.getCount=function(){var a=String(document.cookie);if(a==""){return 0}var b=a.split(/\s*;\s*/);return b.length};goog.net.cookies.containsKey=function(b){var a={};return goog.net.cookies.get(b,a)!==a};goog.net.cookies.containsValue=function(c){var a=goog.net.cookies.getKeyValues_().values;for(var b=0;b<a.length;b++){if(a[b]==c){return true}}return false};goog.net.cookies.clear=function(){var b=goog.net.cookies.getKeyValues_().keys;for(var a=b.length-1;a>=0;a--){goog.net.cookies.remove(b[a])}};goog.net.cookies.MAX_COOKIE_LENGTH=3950;Function.prototype.inherits=function(a){function b(){}b.prototype=a.prototype;this.superClass_=a.prototype;this.prototype=new b();this.prototype.constructor=this};var gadgets=gadgets||{};gadgets.error={};gadgets.error.SUBCLASS_RESPONSIBILITY="subclass responsibility";gadgets.error.TO_BE_DONE="to be done";gadgets.log=function(a){if(window.console&&console.log){console.log(a)}else{var b=document.createElement("div");b.className="gadgets-log-entry";b.innerHTML=a;document.body.appendChild(b)}};gadgets.callAsyncAndJoin=function(e,a,d){var f=e.length;var c=[];for(var b=0;b<e.length;b++){var g=function(h){e[h].call(d,function(i){c[h]=i;if(--f===0){a(c)}})};g(b)}};gadgets.Extensible=function(){};gadgets.Extensible.prototype.setDependencies=function(a){for(var b in a){this[b]=a[b]}};gadgets.Extensible.prototype.getDependencies=function(a){return this[a]};gadgets.UserPrefStore=function(){};gadgets.UserPrefStore.prototype.getPrefs=function(a){throw Error(gadgets.error.SUBCLASS_RESPONSIBILITY)};gadgets.UserPrefStore.prototype.savePrefs=function(a){throw Error(gadgets.error.SUBCLASS_RESPONSIBILITY)};gadgets.DefaultUserPrefStore=function(){gadgets.UserPrefStore.call(this)};gadgets.DefaultUserPrefStore.inherits(gadgets.UserPrefStore);gadgets.DefaultUserPrefStore.prototype.getPrefs=function(a){};gadgets.DefaultUserPrefStore.prototype.savePrefs=function(a){};gadgets.GadgetService=function(){};gadgets.GadgetService.prototype.setHeight=function(b,a){throw Error(gadgets.error.SUBCLASS_RESPONSIBILITY)};gadgets.GadgetService.prototype.setTitle=function(a,b){throw Error(gadgets.error.SUBCLASS_RESPONSIBILITY)};gadgets.GadgetService.prototype.setUserPref=function(a){throw Error(gadgets.error.SUBCLASS_RESPONSIBILITY)};gadgets.IfrGadgetService=function(){gadgets.GadgetService.call(this);gadgets.rpc.register("resize_iframe",this.setHeight);gadgets.rpc.register("set_pref",this.setUserPref);gadgets.rpc.register("set_title",this.setTitle);gadgets.rpc.register("requestNavigateTo",this.requestNavigateTo)};gadgets.IfrGadgetService.inherits(gadgets.GadgetService);gadgets.IfrGadgetService.prototype.setHeight=function(a){if(a>gadgets.container.maxheight_){a=gadgets.container.maxheight_}var b=document.getElementById(this.f);if(b){b.style.height=a+"px"}};gadgets.IfrGadgetService.prototype.setTitle=function(b){var a=document.getElementById(this.f+"_title");if(a){a.innerHTML=b.replace(/&/g,"&amp;").replace(/</g,"&lt;")}};gadgets.IfrGadgetService.prototype.setUserPref=function(h,c,e){var g=this.getGadgetIdFromModuleId(this.f);var f=gadgets.container.getGadget(g);var b=f.getUserPrefs();for(var d=1,a=arguments.length;d<a;d+=2){b[arguments[d]]=arguments[d+1]}f.setUserPrefs(b)};gadgets.IfrGadgetService.prototype.requestNavigateTo=function(a,d){var e=this.getGadgetIdFromModuleId(this.f);var b=this.getUrlForView(a);if(d){var c=JSON.stringify(d);if(c.length>0){b+="&appParams="+encodeURIComponent(c)}}if(b&&document.location.href.indexOf(b)==-1){document.location.href=b}};gadgets.IfrGadgetService.prototype.getUrlForView=function(a){if(a==="canvas"){return"/canvas"}else{if(a==="profile"){return"/profile"}else{return null}}};gadgets.IfrGadgetService.prototype.getGadgetIdFromModuleId=function(a){return parseInt(a.match(/_([0-9]+)$/)[1],10)};gadgets.LayoutManager=function(){};gadgets.LayoutManager.prototype.getGadgetChrome=function(a){throw Error(gadgets.error.SUBCLASS_RESPONSIBILITY)};gadgets.StaticLayoutManager=function(){gadgets.LayoutManager.call(this)};gadgets.StaticLayoutManager.inherits(gadgets.LayoutManager);gadgets.StaticLayoutManager.prototype.setGadgetChromeIds=function(a){this.gadgetChromeIds_=a};gadgets.StaticLayoutManager.prototype.getGadgetChrome=function(b){var a=this.gadgetChromeIds_[b.id];return a?document.getElementById(a):null};gadgets.FloatLeftLayoutManager=function(a){gadgets.LayoutManager.call(this);this.layoutRootId_=a};gadgets.FloatLeftLayoutManager.inherits(gadgets.LayoutManager);gadgets.FloatLeftLayoutManager.prototype.getGadgetChrome=function(c){var b=document.getElementById(this.layoutRootId_);if(b){var a=document.createElement("div");a.className="skinItem";a.style.cssFloat="left";b.appendChild(a);return a}else{return null}};gadgets.Gadget=function(b){this.userPrefs_={};if(b){for(var a in b){if(b.hasOwnProperty(a)){this[a]=b[a]}}}if(!this.secureToken){this.secureToken="john.doe:john.doe:appid:cont:url:0"}};gadgets.Gadget.prototype.getUserPrefs=function(){return this.userPrefs_};gadgets.Gadget.prototype.setUserPrefs=function(a){this.userPrefs_=a;gadgets.container.userPrefStore.savePrefs(this)};gadgets.Gadget.prototype.getUserPref=function(a){return this.userPrefs_[a]};gadgets.Gadget.prototype.setUserPref=function(a,b){this.userPrefs_[a]=b;gadgets.container.userPrefStore.savePrefs(this)};gadgets.Gadget.prototype.render=function(a){if(a){this.appid=a.id.substr(a.id.lastIndexOf("_")+1);gadgets.container.setView(this.view);this.getContent(function(b){a.innerHTML=b})}};gadgets.Gadget.prototype.getContent=function(a){gadgets.callAsyncAndJoin([this.getTitleBarContent,this.getUserPrefsDialogContent,this.getMainContent],function(b){a(b.join(""))},this)};gadgets.Gadget.prototype.getTitleBarContent=function(a){throw Error(gadgets.error.SUBCLASS_RESPONSIBILITY)};gadgets.Gadget.prototype.getUserPrefsDialogContent=function(a){throw Error(gadgets.error.SUBCLASS_RESPONSIBILITY)};gadgets.Gadget.prototype.getMainContent=function(a){throw Error(gadgets.error.SUBCLASS_RESPONSIBILITY)};gadgets.Gadget.prototype.getAdditionalParams=function(){return""};gadgets.IfrGadget=function(a){gadgets.Gadget.call(this,a);this.serverBase_="../../"};gadgets.IfrGadget.inherits(gadgets.Gadget);gadgets.IfrGadget.prototype.GADGET_IFRAME_PREFIX_="remote_iframe_";gadgets.IfrGadget.prototype.CONTAINER="default";gadgets.IfrGadget.prototype.cssClassGadget="gadgets-gadget";gadgets.IfrGadget.prototype.cssClassTitleBar="gadgets-gadget-title-bar";gadgets.IfrGadget.prototype.cssClassTitle="gadgets-gadget-title";gadgets.IfrGadget.prototype.cssClassTitleButtonBar="gadgets-gadget-title-button-bar";gadgets.IfrGadget.prototype.cssClassGadgetUserPrefsDialog="gadgets-gadget-user-prefs-dialog";gadgets.IfrGadget.prototype.cssClassGadgetUserPrefsDialogActionBar="gadgets-gadget-user-prefs-dialog-action-bar";gadgets.IfrGadget.prototype.cssClassTitleButton="gadgets-gadget-title-button";gadgets.IfrGadget.prototype.cssClassGadgetContent="gadgets-gadget-content";gadgets.IfrGadget.prototype.rpcToken=(2147483647*Math.random())|0;gadgets.IfrGadget.prototype.rpcRelay="files/container/rpc_relay.html";gadgets.IfrGadget.prototype.getTitleBarContent=function(a){a('<div id="'+this.cssClassTitleBar+"-"+this.id+'" class="'+this.cssClassTitleBar+'"><span id="'+this.getIframeId()+'_title" class="'+this.cssClassTitle+'">'+(this.title?this.title:"Title")+'</span> | <span class="'+this.cssClassTitleButtonBar+'"><a href="#" onclick="gadgets.container.getGadget('+this.id+').handleOpenUserPrefsDialog();return false;" class="'+this.cssClassTitleButton+'">settings</a> <a href="#" onclick="gadgets.container.getGadget('+this.id+').handleToggle();return false;" class="'+this.cssClassTitleButton+'">toggle</a></span></div>')};gadgets.IfrGadget.prototype.getUserPrefsDialogContent=function(a){a('<div id="'+this.getUserPrefsDialogId()+'" class="'+this.cssClassGadgetUserPrefsDialog+'"></div>')};gadgets.IfrGadget.prototype.setServerBase=function(a){this.serverBase_=a};gadgets.IfrGadget.prototype.getServerBase=function(){return this.serverBase_};gadgets.IfrGadget.prototype.getMainContent=function(a){var b=this.getIframeId();gadgets.rpc.setRelayUrl(b,this.serverBase_+this.rpcRelay);gadgets.rpc.setAuthToken(b,this.rpcToken);a('<div class="'+this.cssClassGadgetContent+'"><iframe id="'+b+'" name="'+b+'" class="'+this.cssClassGadget+'" src="'+this.getIframeUrl()+'" frameborder="no" scrolling="no"'+(this.height?' height="'+this.height+'"':"")+(this.width?' width="'+this.width+'"':"")+"></iframe></div>")};gadgets.IfrGadget.prototype.getIframeId=function(){return this.GADGET_IFRAME_PREFIX_+this.id};gadgets.IfrGadget.prototype.getUserPrefsDialogId=function(){return this.getIframeId()+"_userPrefsDialog"};gadgets.IfrGadget.prototype.getIframeUrl=function(){return this.serverBase_+"ifr?container="+this.CONTAINER+"&mid="+this.id+"&nocache="+gadgets.container.nocache_+"&country="+gadgets.container.country_+"&lang="+gadgets.container.language_+"&view="+gadgets.container.view_+(this.specVersion?"&v="+this.specVersion:"")+(gadgets.container.parentUrl_?"&parent="+encodeURIComponent(gadgets.container.parentUrl_):"")+(this.debug?"&debug=1":"")+this.getAdditionalParams()+this.getUserPrefsParams()+(this.secureToken?"&st="+this.secureToken:"")+"&url="+encodeURIComponent(this.specUrl)+"#rpctoken="+this.rpcToken+(this.viewParams?"&view-params="+encodeURIComponent(JSON.stringify(this.viewParams)):"")+(this.hashData?"&"+this.hashData:"")};gadgets.IfrGadget.prototype.getUserPrefsParams=function(){var c="";if(this.getUserPrefs()){for(var a in this.getUserPrefs()){var b=this.getUserPref(a);c+="&up_"+encodeURIComponent(a)+"="+encodeURIComponent(b)}}return c};gadgets.IfrGadget.prototype.handleToggle=function(){var b=document.getElementById(this.getIframeId());if(b){var a=b.parentNode;var c=a.style.display;a.style.display=c?"":"none"}};gadgets.IfrGadget.prototype.handleOpenUserPrefsDialog=function(){if(this.userPrefsDialogContentLoaded){this.showUserPrefsDialog()}else{var c=this;var b="ig_callback_"+this.id;window[b]=function(d){c.userPrefsDialogContentLoaded=true;c.buildUserPrefsDialog(d);c.showUserPrefsDialog()};var a=document.createElement("script");a.src="http://gmodules.com/ig/gadgetsettings?mid="+this.id+"&output=js"+this.getUserPrefsParams()+"&url="+this.specUrl;document.body.appendChild(a)}};gadgets.IfrGadget.prototype.buildUserPrefsDialog=function(a){var b=document.getElementById(this.getUserPrefsDialogId());b.innerHTML=a+'<div class="'+this.cssClassGadgetUserPrefsDialogActionBar+'"><input type="button" value="Save" onclick="gadgets.container.getGadget('+this.id+').handleSaveUserPrefs()"> <input type="button" value="Cancel" onclick="gadgets.container.getGadget('+this.id+').handleCancelUserPrefs()"></div>';b.childNodes[0].style.display=""};gadgets.IfrGadget.prototype.showUserPrefsDialog=function(a){var b=document.getElementById(this.getUserPrefsDialogId());b.style.display=(a||a==undefined)?"":"none"};gadgets.IfrGadget.prototype.hideUserPrefsDialog=function(){this.showUserPrefsDialog(false)};gadgets.IfrGadget.prototype.handleSaveUserPrefs=function(){this.hideUserPrefsDialog();var d={};var a=document.getElementById("m_"+this.id+"_numfields").value;for(var e=0;e<a;e++){var b=document.getElementById("m_"+this.id+"_"+e);if(b.type!="hidden"){var g="m_"+this.id+"_up_";var c=b.name.substring(g.length);var f=b.value;d[c]=f}}this.setUserPrefs(d);this.refresh()};gadgets.IfrGadget.prototype.handleCancelUserPrefs=function(){this.hideUserPrefsDialog()};gadgets.IfrGadget.prototype.refresh=function(){var a=this.getIframeId();document.getElementById(a).src=this.getIframeUrl()};gadgets.Container=function(){this.gadgets_={};this.parentUrl_="http://"+document.location.host;this.country_="BE";this.language_="nl";this.view_="default";this.nocache_=0;this.maxheight_=2147483647};gadgets.Container.inherits(gadgets.Extensible);gadgets.Container.prototype.gadgetClass=gadgets.Gadget;gadgets.Container.prototype.userPrefStore=new gadgets.DefaultUserPrefStore();gadgets.Container.prototype.gadgetService=new gadgets.GadgetService();gadgets.Container.prototype.layoutManager=new gadgets.StaticLayoutManager();gadgets.Container.prototype.setParentUrl=function(a){this.parentUrl_=a};gadgets.Container.prototype.setCountry=function(a){this.country_=a};gadgets.Container.prototype.setNoCache=function(a){this.nocache_=a};gadgets.Container.prototype.setLanguage=function(a){this.language_=a};gadgets.Container.prototype.setView=function(a){this.view_=a};gadgets.Container.prototype.setMaxHeight=function(a){this.maxheight_=a};gadgets.Container.prototype.getGadgetKey_=function(a){return"gadget_"+a};gadgets.Container.prototype.getGadget=function(a){return this.gadgets_[this.getGadgetKey_(a)]};gadgets.Container.prototype.createGadget=function(a){return new this.gadgetClass(a)};gadgets.Container.prototype.addGadget=function(a){a.id=this.getNextGadgetInstanceId();a.setUserPrefs(this.userPrefStore.getPrefs(a));this.gadgets_[this.getGadgetKey_(a.id)]=a};gadgets.Container.prototype.addGadgets=function(a){for(var b=0;b<a.length;b++){this.addGadget(a[b])}};gadgets.Container.prototype.renderGadgets=function(){for(var a in this.gadgets_){this.renderGadget(this.gadgets_[a])}};gadgets.Container.prototype.renderGadget=function(a){throw Error(gadgets.error.SUBCLASS_RESPONSIBILITY)};gadgets.Container.prototype.nextGadgetInstanceId_=0;gadgets.Container.prototype.getNextGadgetInstanceId=function(){return this.nextGadgetInstanceId_++};gadgets.Container.prototype.refreshGadgets=function(){for(var a in this.gadgets_){this.gadgets_[a].refresh()}};gadgets.IfrContainer=function(){gadgets.Container.call(this)};gadgets.IfrContainer.inherits(gadgets.Container);gadgets.IfrContainer.prototype.gadgetClass=gadgets.IfrGadget;gadgets.IfrContainer.prototype.gadgetService=new gadgets.IfrGadgetService();gadgets.IfrContainer.prototype.setParentUrl=function(a){if(!a.match(/^http[s]?:\/\//)){a=document.location.href.match(/^[^?#]+\//)[0]+a}this.parentUrl_=a};gadgets.IfrContainer.prototype.renderGadget=function(b){var a=this.layoutManager.getGadgetChrome(b);b.render(a)};gadgets.ASLpageGadgetService=function(){gadgets.IfrGadgetService.call(this);gadgets.rpc.register("resize_iframe",this.setHeight);gadgets.rpc.register("set_pref",this.setUserPref);gadgets.rpc.register("set_title",this.setTitle);gadgets.rpc.register("requestNavigateTo",this.requestNavigateTo);gadgets.rpc.register("debug",this.debug);gadgets.rpc.register("requestCredits",this.requestCredits);gadgets.rpc.register("share_app",this.shareApp)};gadgets.ASLpageGadgetService.inherits(gadgets.IfrGadgetService);gadgets.ASLpageGadgetService.prototype.setHeight=function(a){if(a>gadgets.container.maxheight_){a=gadgets.container.maxheight_}var b=document.getElementById(this.f);if(b){b.style.height=a+"px";b.height=a}};gadgets.ASLpageGadgetService.prototype.debug=function(a){if(typeof(openSocial)!="undefined"){openSocial.debug(a)}else{if(openSocialDebug){openSocialDebug.push(a)}}};gadgets.ASLpageGadgetService.prototype.setUserPref=function(h,c,e){var g=gadgets.ASLpageGadgetService.getGadgetIdFromModuleId(this.f);var f=gadgets.container.getGadget(g);var b=f.getUserPrefs();for(var d=1,a=arguments.length;d<a;d+=2){b[arguments[d]]=arguments[d+1]}f.setUserPrefs(b)};gadgets.ASLpageGadgetService.prototype.requestNavigateTo=function(a,d){var g=gadgets.ASLpageGadgetService.getGadgetIdFromModuleId(this.f);var f=gadgets.container.getGadget(g);var c="/ajax.php?module=apps&function=checkApplicationAdded";var b=this;var e=$.ajax({type:"POST",url:c,cache:false,data:"appid="+f.appid,dataType:"json",success:function(h){gadgets.ASLpageGadgetService.processNavigatePermitted(h,f.appid,b,a,d)}})};gadgets.ASLpageGadgetService.processNavigatePermitted=function(c,g,f,a,e){if(a=="profile"&&(!c.success||!c.added)){}else{var h=gadgets.ASLpageGadgetService.getGadgetIdFromModuleId(f.f);var b=ASL.config.rootURL+gadgets.ASLpageGadgetService.getUrlForView(a,h);if(e){var d=JSON.stringify(e);if(d.length>0){b+="&appParams="+encodeURIComponent(d)}}if(b&&document.location.href.indexOf(b)==-1){document.location.href=b}}};gadgets.ASLpageGadgetService.getUrlForView=function(a,c){var b=gadgets.container.getGadget(c);if(b.sandbox===true){if(a==="canvas"){return"/developer/opensocial/sandbox?view=canvas&url="+encodeURIComponent(b.specUrl)}else{if(a==="profile"){return"/developer/opensocial/sandbox?view=profile&url="+encodeURIComponent(b.specUrl)}else{return null}}}if(a==="canvas"){return"/apps/"+b.appname+"/"}else{if(a==="profile"){return"/profile/"}else{return null}}};gadgets.ASLpageGadgetService.getGadgetIdFromModuleId=function(a){return parseInt(a.match(/_([0-9]+)$/)[1],10)};gadgets.ASLpageGadget=function(a){gadgets.IfrGadget.call(this,a);this.serverBase_=ASL.config.apiURL+"opensocial/gadgets/"};gadgets.ASLpageGadget.inherits(gadgets.IfrGadget);gadgets.ASLpageGadget.prototype.CONTAINER="aslpage";gadgets.ASLpageGadget.prototype.rpcToken=(2147483647)|0;gadgets.ASLpageGadget.prototype.rpcRelay="files/container/rpc_relay.html";gadgets.ASLpageGadget.prototype.setTitle=function(a){this.title=a};gadgets.ASLpageGadget.prototype.getTitleBarContent=function(a){var b=(this.showtitle?'<div class=""><div id="'+this.cssClassTitleBar+"-"+this.id+'" class="clearfix '+this.cssClassTitleBar+'">'+(this.title?'<h2 id="'+this.getIframeId()+'_title" class="left"><a href="/apps/'+this.appname+'">'+this.title+"</a></h2>":"")+'<span class="'+this.cssClassTitleButtonBar+'" /></div>':"");a(b)};gadgets.ASLpageGadget.prototype.getMainContent=function(a){var b=this.getIframeId();gadgets.rpc.setRelayUrl(b,this.serverBase_+this.rpcRelay);gadgets.rpc.setAuthToken(b,this.rpcToken);a('<div class="'+this.cssClassGadgetContent+'"><iframe id="'+b+'" name="'+b+'" class="'+this.cssClassGadget+'" src="'+this.getIframeUrl()+'" frameborder="no" scrolling="no"'+(this.height?' height="'+this.height+'"':"")+(this.width?' width="'+this.width+'"':"")+' style="margin:0 auto;display:block;background-color:transparent;"></iframe></div></div>')};gadgets.ASLpageGadget.prototype.getIframeUrl=function(){this.secureToken=document.getElementById("ticket_"+this.appid).value;return this.serverBase_+"ifr?url="+encodeURIComponent(this.specUrl)+"&container="+this.CONTAINER+"&mid="+this.id+"&nocache="+this.cache+"&flushcache="+this.flushcache+"&country="+gadgets.container.country_+"&lang="+gadgets.container.language_+"&view="+gadgets.container.view_+(this.specVersion?"&v="+this.specVersion:"")+(gadgets.container.parentUrl_?"&parent="+encodeURIComponent(gadgets.container.parentUrl_):"")+(this.debug?"&debug=1":"")+this.getAdditionalParams()+this.getUserPrefsParams()+"#rpctoken="+this.rpcToken+(this.secureToken?"&st="+this.secureToken:"")+(this.viewParams?"&view-params="+encodeURIComponent(this.viewParams):"")+(this.hashData?"&"+this.hashData:"")};gadgets.ASLpageContainer=function(){gadgets.IfrContainer.call(this)};gadgets.ASLpageContainer.inherits(gadgets.IfrContainer);gadgets.ASLpageContainer.prototype.gadgetClass=gadgets.ASLpageGadget;gadgets.ASLpageContainer.prototype.gadgetService=new gadgets.ASLpageGadgetService();gadgets.container=new gadgets.ASLpageContainer();gadgets.CookieBasedUserPrefStore=function(){gadgets.UserPrefStore.call(this)};gadgets.CookieBasedUserPrefStore.inherits(gadgets.UserPrefStore);gadgets.CookieBasedUserPrefStore.prototype.USER_PREFS_PREFIX="gadgetUserPrefs-";gadgets.CookieBasedUserPrefStore.prototype.getPrefs=function(d){var f={};var g=this.USER_PREFS_PREFIX+d.id;var c=goog.net.cookies.get(g);if(c){var b=c.split("&");for(var e=0;e<b.length;e++){var j=b[e].split("=");var a=decodeURIComponent(j[0]);var h=decodeURIComponent(j[1]);f[a]=h}}return f};gadgets.CookieBasedUserPrefStore.prototype.savePrefs=function(d){var c=[];for(var a in d.getUserPrefs()){var b=d.getUserPref(a);var f=encodeURIComponent(a)+"="+encodeURIComponent(b);c.push(f)}var g=this.USER_PREFS_PREFIX+d.id;var e=c.join("&");goog.net.cookies.set(g,e)};gadgets.Container.prototype.userPrefStore=new gadgets.CookieBasedUserPrefStore();
