window.widgetproviderRender = window.widgetproviderRender ||
function(){
var gadgets=gadgets||{};
gadgets.log=function(A){gadgets.log.logAtLevel(gadgets.log.INFO,A)
};
gadgets.warn=function(A){gadgets.log.logAtLevel(gadgets.log.WARNING,A)
};
gadgets.error=function(A){gadgets.log.logAtLevel(gadgets.log.ERROR,A)
};
gadgets.setLogLevel=function(A){gadgets.log.logLevelThreshold_=A
};
gadgets.log.logAtLevel=function(C,B){if(C<gadgets.log.logLevelThreshold_||!window.console){return 
}var A=window.console.log;
if(C==gadgets.log.WARNING&&window.console.warn){A=window.console.warn
}else{if(C==gadgets.log.ERROR&&window.console.error){A=window.console.error
}}A(B)
};
gadgets.log.INFO=1;
gadgets.log.WARNING=2;
gadgets.log.ERROR=3;
gadgets.log.NONE=4;
gadgets.log.logLevelThreshold_=gadgets.log.INFO;;
var gadgets=gadgets||{};
gadgets.util=function(){function G(){var L;
var K=document.location.href;
var I=K.indexOf("?");
var J=K.indexOf("#");
if(J===-1){L=K.substr(I+1)
}else{L=[K.substr(I+1,J-I-1),"&",K.substr(J+1)].join("")
}return L.split("&")
}var E=null;
var D={};
var C={};
var F=[];
var A={0:false,10:true,13:true,34:true,39:true,60:true,62:true,92:true,8232:true,8233:true};
function B(I,J){return String.fromCharCode(J)
}function H(I){D=I["core.util"]||{}
}if(gadgets.config){gadgets.config.register("core.util",null,H)
}return{getUrlParameters:function(){if(E!==null){return E
}E={};
var L=G();
var O=window.decodeURIComponent?decodeURIComponent:unescape;
for(var J=0,I=L.length;
J<I;
++J){var N=L[J].indexOf("=");
if(N===-1){continue
}var M=L[J].substring(0,N);
var K=L[J].substring(N+1);
K=K.replace(/\+/g," ");
E[M]=O(K)
}return E
},makeClosure:function(L,N,M){var K=[];
for(var J=2,I=arguments.length;
J<I;
++J){K.push(arguments[J])
}return function(){var O=K.slice();
for(var Q=0,P=arguments.length;
Q<P;
++Q){O.push(arguments[Q])
}return N.apply(L,O)
}
},makeEnum:function(J){var L={};
for(var K=0,I;
(I=J[K]);
++K){L[I]=I
}return L
},getFeatureParameters:function(I){return typeof D[I]==="undefined"?null:D[I]
},hasFeature:function(I){return typeof D[I]!=="undefined"
},getServices:function(){return C
},registerOnLoadHandler:function(I){F.push(I)
},runOnLoadHandlers:function(){for(var J=0,I=F.length;
J<I;
++J){F[J]()
}},escape:function(I,M){if(!I){return I
}else{if(typeof I==="string"){return gadgets.util.escapeString(I)
}else{if(typeof I==="array"){for(var L=0,J=I.length;
L<J;
++L){I[L]=gadgets.util.escape(I[L])
}}else{if(typeof I==="object"&&M){var K={};
for(var N in I){if(I.hasOwnProperty(N)){K[gadgets.util.escapeString(N)]=gadgets.util.escape(I[N],true)
}}return K
}}}}return I
},escapeString:function(M){var J=[],L,N;
for(var K=0,I=M.length;
K<I;
++K){L=M.charCodeAt(K);
N=A[L];
if(N===true){J.push("&#",L,";")
}else{if(N!==false){J.push(M.charAt(K))
}}}return J.join("")
},unescapeString:function(I){return I.replace(/&#([0-9]+);/g,B)
}}
}();
gadgets.util.getUrlParameters();;
var gadgets=gadgets||{};
if(window.JSON){gadgets.json={parse:function(B){try{return window.JSON.parse(B)
}catch(A){return false
}},stringify:function(B){try{return window.JSON.stringify(B)
}catch(A){return null
}}}
}else{gadgets.json=function(){function f(n){return n<10?"0"+n:n
}Date.prototype.toJSON=function(){return[this.getUTCFullYear(),"-",f(this.getUTCMonth()+1),"-",f(this.getUTCDate()),"T",f(this.getUTCHours()),":",f(this.getUTCMinutes()),":",f(this.getUTCSeconds()),"Z"].join("")
};
var m={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};
function stringify(value){var a,i,k,l,r=/["\\\x00-\x1f\x7f-\x9f]/g,v;
switch(typeof value){case"string":return r.test(value)?'"'+value.replace(r,function(a){var c=m[a];
if(c){return c
}c=a.charCodeAt();
return"\\u00"+Math.floor(c/16).toString(16)+(c%16).toString(16)
})+'"':'"'+value+'"';
case"number":return isFinite(value)?String(value):"null";
case"boolean":case"null":return String(value);
case"object":if(!value){return"null"
}a=[];
if(typeof value.length==="number"&&!value.propertyIsEnumerable("length")){l=value.length;
for(i=0;
i<l;
i+=1){a.push(stringify(value[i])||"null")
}return"["+a.join(",")+"]"
}for(k in value){if(value.hasOwnProperty(k)){if(typeof k==="string"){v=stringify(value[k]);
if(v){a.push(stringify(k)+":"+v)
}}}}return"{"+a.join(",")+"}"
}}return{stringify:stringify,parse:function(text){if(/^[\],:{}\s]*$/.test(text.replace(/\\["\\\/b-u]/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){return eval("("+text+")")
}return false
}}
}()
};;
var gadgets=gadgets||{};
gadgets.rpctx=gadgets.rpctx||{};
gadgets.rpctx.Wpm=function(){var A;
return{getCode:function(){return"wpm"
},isParentVerifiable:function(){return true
},init:function(B,C){A=C;
try{if(window.addEventListener){window.addEventListener("message",function(E){B(gadgets.json.parse(E.data))
},false)
}else{if(window.attachEvent){window.attachEvent("onmessage",function(E){B(gadgets.json.parse(E.data))
})
}}A("..",true);
return true
}catch(D){return false
}},setup:function(C,B){if(C===".."){gadgets.rpc.call(C,gadgets.rpc.ACK)
}return true
},call:function(B,F,D){var C=B===".."?parent:frames[B];
var E=gadgets.rpc.getRelayUrl(B);
if(E){C.postMessage(gadgets.json.stringify(D),E)
}return true
}}
}();;
var gadgets=gadgets||{};
gadgets.rpctx=gadgets.rpctx||{};
gadgets.rpctx.Dpm=function(){var A;
return{getCode:function(){return"dpm"
},isParentVerifiable:function(){return false
},init:function(B,C){A=C;
window.addEventListener("message",function(D){B(gadgets.json.parse(D.data))
},false);
A("..",true);
return true
},setup:function(C,B){if(C===".."){gadgets.rpc.call(C,gadgets.rpc.ACK)
}return true
},call:function(B,E,D){var C=B===".."?parent.document:frames[B].document;
C.postMessage(gadgets.json.stringify(D));
return true
}}
}();;
var gadgets=gadgets||{};
gadgets.rpctx=gadgets.rpctx||{};
gadgets.rpctx.FrameElement=function(){var E="__g2c_rpc";
var B="__c2g_rpc";
var D;
var C;
function A(G,K,J){try{if(K!==".."){var F=window.frameElement;
if(typeof F[E]==="function"){if(typeof F[E][B]!=="function"){F[E][B]=function(L){D(gadgets.json.parse(L))
}
}F[E](gadgets.json.stringify(J));
return 
}}else{var I=document.getElementById(G);
if(typeof I[E]==="function"&&typeof I[E][B]==="function"){I[E][B](gadgets.json.stringify(J));
return 
}}}catch(H){}return true
}return{getCode:function(){return"fe"
},isParentVerifiable:function(){return false
},init:function(F,G){D=F;
C=G;
return true
},setup:function(J,F){if(J!==".."){try{var I=document.getElementById(J);
I[E]=function(K){D(gadgets.json.parse(K))
}
}catch(H){return false
}}if(J===".."){C("..",true);
var G=function(){window.setTimeout(function(){gadgets.rpc.call(J,gadgets.rpc.ACK)
},500)
};
gadgets.util.registerOnLoadHandler(G)
}return true
},call:function(F,H,G){A(F,H,G)
}}
}();;
var gadgets=gadgets||{};
gadgets.rpctx=gadgets.rpctx||{};
gadgets.rpctx.Nix=function(){var C="GRPC____NIXVBS_wrapper";
var D="GRPC____NIXVBS_get_wrapper";
var F="GRPC____NIXVBS_handle_message";
var B="GRPC____NIXVBS_create_channel";
var A=10;
var J=500;
var I={};
var H;
var G=0;
function E(){var L=I[".."];
if(L){return 
}if(++G>A){gadgets.warn("Nix transport setup failed, falling back...");
H("..",false);
return 
}if(!L&&window.opener&&"GetAuthToken" in window.opener){L=window.opener;
if(L.GetAuthToken()==gadgets.rpc.getAuthToken("..")){var K=gadgets.rpc.getAuthToken("..");
L.CreateChannel(window[D]("..",K),K);
I[".."]=L;
window.opener=null;
H("..",true);
return 
}}window.setTimeout(function(){E()
},J)
}return{getCode:function(){return"nix"
},isParentVerifiable:function(){return false
},init:function(L,M){H=M;
if(typeof window[D]!=="unknown"){window[F]=function(O){window.setTimeout(function(){L(gadgets.json.parse(O))
},0)
};
window[B]=function(O,Q,P){if(gadgets.rpc.getAuthToken(O)===P){I[O]=Q;
H(O,true)
}};
var K="Class "+C+"\n Private m_Intended\nPrivate m_Auth\nPublic Sub SetIntendedName(name)\n If isEmpty(m_Intended) Then\nm_Intended = name\nEnd If\nEnd Sub\nPublic Sub SetAuth(auth)\n If isEmpty(m_Auth) Then\nm_Auth = auth\nEnd If\nEnd Sub\nPublic Sub SendMessage(data)\n "+F+"(data)\nEnd Sub\nPublic Function GetAuthToken()\n GetAuthToken = m_Auth\nEnd Function\nPublic Sub CreateChannel(channel, auth)\n Call "+B+"(m_Intended, channel, auth)\nEnd Sub\nEnd Class\nFunction "+D+"(name, auth)\nDim wrap\nSet wrap = New "+C+"\nwrap.SetIntendedName name\nwrap.SetAuth auth\nSet "+D+" = wrap\nEnd Function";
try{window.execScript(K,"vbscript")
}catch(N){return false
}}return true
},setup:function(O,K){if(O===".."){E();
return true
}try{var M=document.getElementById(O);
var N=window[D](O,K);
M.contentWindow.opener=N
}catch(L){return false
}return true
},call:function(K,N,M){try{if(I[K]){I[K].SendMessage(gadgets.json.stringify(M))
}}catch(L){return false
}return true
}}
}();;
var gadgets=gadgets||{};
gadgets.rpctx=gadgets.rpctx||{};
gadgets.rpctx.Rmr=function(){var G=500;
var E=10;
var H={};
var B;
var I;
function K(O,M,N){var P=function(){document.body.appendChild(O);
O.src="about:blank";
O.src=M+"#"+N
};
if(document.body){P()
}else{gadgets.util.registerOnLoadHandler(function(){P()
})
}}function C(O){if(typeof H[O]==="object"){return 
}var P=document.createElement("iframe");
var M=P.style;
M.position="absolute";
M.top="0px";
M.border="0";
M.opacity="0";
M.width="10px";
M.height="1px";
P.id="rmrtransport-"+O;
P.name=P.id;
var N=gadgets.rpc.getDomainRoot(gadgets.rpc.getRelayUrl(O))+"/robots.txt";
H[O]={frame:P,receiveWindow:null,relayUri:N,searchCounter:0,width:10,waiting:true,queue:[],sendId:0,recvId:0};
if(O!==".."){K(P,N,A(O))
}D(O)
}function D(N){var P=null;
H[N].searchCounter++;
try{if(N===".."){P=window.parent.frames["rmrtransport-"+window.name]
}else{P=window.frames[N].frames["rmrtransport-.."]
}}catch(O){}var M=false;
if(P&&typeof P!=="undefined"){M=F(N,P)
}if(!M){if(H[N].searchCounter>E){return 
}setTimeout(function(){D(N)
},G)
}}function J(N,P,T,S){var O=null;
if(T!==".."){O=H[".."]
}else{O=H[N]
}if(O){if(P!==gadgets.rpc.ACK){O.queue.push(S)
}if(O.waiting||(O.queue.length===0&&!(P===gadgets.rpc.ACK&&S&&S.ackAlone===true))){return true
}if(O.queue.length>0){O.waiting=true
}var M=O.relayUri+"#"+A(N);
try{O.frame.contentWindow.location=M;
var Q=O.width==10?20:10;
O.frame.style.width=Q+"px";
O.width=Q
}catch(R){return false
}}return true
}function A(N){var O=H[N];
var M={id:O.sendId};
if(O){M.d=Array.prototype.slice.call(O.queue,0);
M.d.push({s:gadgets.rpc.ACK,id:O.recvId})
}return gadgets.json.stringify(M)
}function L(X){var U=H[X];
var Q=U.receiveWindow.location.hash.substring(1);
var Y=gadgets.json.parse(decodeURIComponent(Q))||{};
var N=Y.d||[];
var O=false;
var T=false;
var V=0;
var M=(U.recvId-Y.id);
for(var P=0;
P<N.length;
++P){var S=N[P];
if(S.s===gadgets.rpc.ACK){I(X,true);
if(U.waiting){T=true
}U.waiting=false;
var R=Math.max(0,S.id-U.sendId);
U.queue.splice(0,R);
U.sendId=Math.max(U.sendId,S.id||0);
continue
}O=true;
if(++V<=M){continue
}++U.recvId;
B(S)
}if(O||(T&&U.queue.length>0)){var W=(X==="..")?window.name:"..";
J(X,gadgets.rpc.ACK,W,{ackAlone:O})
}}function F(P,R){var O=H[P];
try{var N=false;
N="document" in R;
if(!N){return false
}N=typeof R.document=="object";
if(!N){return false
}var Q=R.location.href;
if(Q==="about:blank"){return false
}}catch(M){return false
}O.receiveWindow=R;
R.onresize=function(){L(P)
};
if(P===".."){K(O.frame,O.relayUri,A(P))
}L(P);
return true
}return{getCode:function(){return"rmr"
},isParentVerifiable:function(){return true
},init:function(M,N){B=M;
I=N;
return true
},setup:function(O,M){try{C(O)
}catch(N){gadgets.log("Caught exception setting up RMR: "+N);
return false
}return true
},call:function(M,O,N){return J(M,N.s,O,N)
}}
}();;
var gadgets=gadgets||{};
gadgets.rpctx=gadgets.rpctx||{};
gadgets.rpctx.Ifpc=function(){var E=[];
var D=0;
var C;
function B(H){var F=[];
for(var I=0,G=H.length;
I<G;
++I){F.push(encodeURIComponent(gadgets.json.stringify(H[I])))
}return F.join("&")
}function A(I){var G;
for(var F=E.length-1;
F>=0;
--F){var J=E[F];
try{if(J&&(J.recyclable||J.readyState==="complete")){J.parentNode.removeChild(J);
if(window.ActiveXObject){E[F]=J=null;
E.splice(F,1)
}else{J.recyclable=false;
G=J;
break
}}}catch(H){}}if(!G){G=document.createElement("iframe");
G.style.border=G.style.width=G.style.height="0px";
G.style.visibility="hidden";
G.style.position="absolute";
G.onload=function(){this.recyclable=true
};
E.push(G)
}G.src=I;
setTimeout(function(){document.body.appendChild(G)
},0)
}return{getCode:function(){return"ifpc"
},isParentVerifiable:function(){return true
},init:function(F,G){C=G;
C("..",true);
return true
},setup:function(G,F){C(G,true);
return true
},call:function(F,K,I){var J=gadgets.rpc.getRelayUrl(F);
++D;
if(!J){gadgets.warn("No relay file assigned for IFPC");
return 
}var H=null;
if(I.l){var G=I.a;
H=[J,"#",B([K,D,1,0,B([K,I.s,"","",K].concat(G))])].join("")
}else{H=[J,"#",F,"&",K,"@",D,"&1&0&",encodeURIComponent(gadgets.json.stringify(I))].join("")
}A(H);
return true
}}
}();;
var gadgets=gadgets||{};
gadgets.rpc=function(){var P="__cb";
var N="";
var F="__ack";
var M=500;
var H=10;
var B={};
var C={};
var T={};
var I={};
var K=0;
var b={};
var S={};
var D={};
var Z={};
var J={};
var R={};
var U=(window.top!==window.self);
var a=gadgets.rpctx.Rmr;
if(gadgets.util){Z=gadgets.util.getUrlParameters()
}I[".."]=Z.rpctoken||Z.ifpctok||0;
var V=(Z.rpc_earlyq==="1");
function A(){return typeof window.postMessage==="function"?gadgets.rpctx.Wpm:typeof window.postMessage==="object"?gadgets.rpctx.Wpm:typeof document.postMessage==="function"?gadgets.rpctx.Dpm:window.ActiveXObject?gadgets.rpctx.Nix:navigator.userAgent.indexOf("WebKit")>0?gadgets.rpctx.Rmr:navigator.product==="Gecko"?gadgets.rpctx.FrameElement:gadgets.rpctx.Rmr
}function X(h,f){var d=Y;
if(!f){d=a
}J[h]=d;
var c=R[h]||[];
for(var e=0;
e<c.length;
++e){var g=c[e];
g.t=gadgets.rpc.getAuthToken(h);
d.call(h,g.f,g)
}R[h]=[]
}function Q(d){if(d&&typeof d.s==="string"&&typeof d.f==="string"&&d.a instanceof Array){if(I[d.f]){if(I[d.f]!==d.t){throw new Error("Invalid auth token. "+I[d.f]+" vs "+d.t)
}}if(d.s===F){window.setTimeout(function(){X(d.f,true)
},0);
return 
}if(d.c){d.callback=function(e){gadgets.rpc.call(d.f,P,null,d.c,e)
}
}var c=(B[d.s]||B[N]).apply(d,d.a);
if(d.c&&typeof c!=="undefined"){gadgets.rpc.call(d.f,P,null,d.c,c)
}}}function G(e){if(!e){return""
}e=e.toLowerCase();
if(e.indexOf("//")==0){e=window.location.protocol+":"+e
}if(e.indexOf("http://")!=0&&e.indexOf("https://")!=0){e=window.location.protocol+"://"+e
}var f=e.substring(e.indexOf("://")+3);
var c=f.indexOf("/");
if(c!=-1){f=f.substring(0,c)
}var h=e.substring(0,e.indexOf("://"));
var g="";
var i=f.indexOf(":");
if(i!=-1){var d=f.substring(i+1);
f=f.substring(0,i);
if((h==="http"&&d!=="80")||(h==="https"&&d!=="443")){g=":"+d
}}return h+"://"+f+g
}var Y=A();
B[N]=function(){gadgets.warn("Unknown RPC service: "+this.s)
};
B[P]=function(d,c){var e=b[d];
if(e){delete b[d];
e(c)
}};
function L(e,c){if(S[e]===true){return 
}if(typeof S[e]==="undefined"){S[e]=0
}var d=document.getElementById(e);
if(e===".."||d!=null){if(Y.setup(e,c)===true){S[e]=true;
return 
}}if(S[e]!==true&&S[e]++<H){window.setTimeout(function(){L(e,c)
},M)
}else{Y=a;
Y.init(Q,X);
Y.setup(e,c);
S[e]=true
}}function E(d,h){if(typeof D[d]==="undefined"){D[d]=false;
var g=gadgets.rpc.getRelayUrl(d);
if(G(g)!==G(window.location.href)){return false
}var f=null;
if(d===".."){f=parent
}else{f=frames[d]
}try{D[d]=f.gadgets.rpc.receiveSameDomain
}catch(c){gadgets.warn("Unexpected: same domain call failed.")
}}if(typeof D[d]==="function"){D[d](h);
return true
}return false
}if(U&&gadgets.config){function W(d){var f=d?d.rpc:{};
var c=f.parentRelayUrl;
if(c.substring(0,7)!=="http://"&&c.substring(0,8)!=="https://"&&c.substring(0,2)!=="//"){if(Z.parent!==""){c=G(Z.parent)+c
}}C[".."]=c;
var e=!!f.useLegacyProtocol;
T[".."]=e;
if(e){Y=gadgets.rpctx.Rmr;
Y.init(Q,X)
}if(Y.setup("..")===false){Y=a;
Y.init(Q,X);
Y.setup("..")
}}var O={parentRelayUrl:gadgets.config.NonEmptyStringValidator};
gadgets.config.register("rpc",O,W)
}return{register:function(d,c){if(d===P||d===F){throw new Error("Cannot overwrite callback/ack service")
}if(d===N){throw new Error("Cannot overwrite default service: use registerDefault")
}B[d]=c
},unregister:function(c){if(c===P||c===F){throw new Error("Cannot delete callback/ack service")
}if(c===N){throw new Error("Cannot delete default service: use unregisterDefault")
}delete B[c]
},registerDefault:function(c){B[N]=c
},unregisterDefault:function(){delete B[N]
},forceParentVerifiable:function(){if(!Y.isParentVerifiable()){Y=gadgets.rpctx.Rmr
}},call:function(c,d,i,g){if(typeof Z.parent=="undefined"){return 
}c=c||"..";
var h="..";
if(c===".."){h=window.name
}++K;
if(i){b[K]=i
}var f={s:d,f:h,c:i?K:0,a:Array.prototype.slice.call(arguments,3),t:I[c],l:T[c]};
if(E(c,f)){return 
}var e=V?J[c]:Y;
if(!e){if(!R[c]){R[c]=[f]
}else{R[c].push(f)
}return 
}if(T[c]){e=gadgets.rpctx.Rmr
}if(e.call(c,h,f)===false){Y=a;
Y.init(Q,X);
Y.setup(c,f.t);
Y.call(c,h,f)
}},getRelayUrl:function(d){var c=C[d];
if(c&&c.indexOf("//")==0){c=document.location.protocol+c
}return c
},setRelayUrl:function(d,c,e){C[d]=c;
T[d]=!!e
},setAuthToken:function(c,d){d=d||"";
I[c]=String(d);
L(c,d)
},getAuthToken:function(c){return I[c]
},getRelayChannel:function(){return Y.getCode()
},receive:function(c){if(c.length>4){Q(gadgets.json.parse(decodeURIComponent(c[c.length-1])))
}},receiveSameDomain:function(c){c.a=Array.prototype.slice.call(c.a);
window.setTimeout(function(){Q(c)
},0)
},getDomainRoot:G,init:function(){if(Y.init(Q,X)===false){Y=a;
Y.init(Q,X)
}},ACK:F}
}();
gadgets.rpc.init();;
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.GadgetService=function(){};
gadgets.GadgetService.prototype.setHeight=function(B,A){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("requestNavigateTo",this.requestNavigateTo);
gadgets.rpc.register("requestSendMessage",this.requestSendMessage)
};
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.setUserPref=function(H,C,E){var G=gadgets.container.gadgetService.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.requestSendMessage=function(A,D,B,C){if(B){window.setTimeout(function(){B(new opensocial.ResponseItem(null,null,opensocial.ResponseItem.Error.NOT_IMPLEMENTED,null))
},0)
}};
gadgets.IfrGadgetService.prototype.requestNavigateTo=function(A,D){var E=gadgets.container.gadgetService.getGadgetIdFromModuleId(this.f);
var B=gadgets.container.gadgetService.getUrlForView(A);
if(D){var C=gadgets.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(B){var A=document.getElementById(this.layoutRootId_);
return A
};
gadgets.Gadget=function(B){this.userPrefs_={};
if(B){for(var A in B){if(B.hasOwnProperty(A)){this[A]=B[A]
}}}};
gadgets.Gadget.prototype.getUserPrefs=function(){return this.userPrefs_
};
gadgets.Gadget.prototype.setUserPrefs=function(A){this.userPrefs_=A
};
gadgets.Gadget.prototype.getUserPref=function(A){return this.userPrefs_[A]
};
gadgets.Gadget.prototype.setUserPref=function(A,B){this.userPrefs_[A]=B
};
gadgets.Gadget.prototype.render=function(A){if(A){var B=this;
this.getContent(function(C){A.innerHTML=C;
window.frames[B.getIframeId()].location=B.getIframeUrl()
})
}};
gadgets.Gadget.prototype.getContent=function(A){gadgets.callAsyncAndJoin([this.getMainContent],function(B){A(B.join(""))
},this)
};
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.cssClassGadgetContent="gadgets-gadget-content";
gadgets.IfrGadget.prototype.rpcToken=(2147483647*Math.random())|0;
gadgets.IfrGadget.prototype.rpcRelay="files/container/rpc_relay.html";
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);
A('<iframe id="'+B+'" name="'+B+'" class="'+this.cssClassGadget+'" src="about:blank" frameborder="no" scrolling="no" allowtransparency="true"'+(this.height?' height="'+this.height+'"':"")+(this.width?' width="'+this.width+'"':"")+"></iframe>")
};
gadgets.IfrGadget.prototype.getIframeId=function(){return this.GADGET_IFRAME_PREFIX_+this.id
};
gadgets.IfrGadget.prototype.getIframeUrl=function(){return this.serverBase_+"ifr?container="+this.CONTAINER+(this.dataKey!=null?"&dataKey="+this.dataKey:"")+(this.widgetId!=null?"&widgetId="+this.widgetId:"")+(this.service!=null?"&service="+this.service:"")+"&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_):"")+(gadgets.container.topUrl_?"&top="+encodeURIComponent(gadgets.container.topUrl_):"")+(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(gadgets.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.refresh=function(){var A=this.getIframeId();
document.getElementById(A).src=this.getIframeUrl()
};
gadgets.Container=function(){this.gadgets_={};
this.parentUrl_="http://"+document.location.host;
try{this.topUrl_=top.location.href
}catch(A){}this.country_="ALL";
this.language_="ALL";
this.view_="default";
this.nocache_=0;
this.maxheight_=2147483647
};
gadgets.Container.inherits(gadgets.Extensible);
gadgets.Container.prototype.gadgetClass=gadgets.Gadget;
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.setTopUrl=function(A){this.topUrl_=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){if(typeof A.id=="undefined"||A.id==0){A.id=this.getNextGadgetInstanceId()
}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.setTopUrl=function(A){try{if(!A.match(/^http[s]?:\/\//)){A=top.location.href.match(/^[^?#]+\//)[0]+A
}this.topUrl_=A
}catch(B){}};
gadgets.IfrContainer.prototype.renderGadget=function(B){var A=this.layoutManager.getGadgetChrome(B);
B.render(A);
gadgets.rpc.setAuthToken(B.getIframeId(),B.rpcToken)
};
gadgets.container=new gadgets.IfrContainer();;

	return {
		init: function(queryStr){
			var modules = {"id":0, "targetDivId":null, "service":null, "dataKey":null, "widgetId":null, "url":null, "title":null, "width":null, "height":null
					, "ownerId":null, "viewerId":null, "appId":null, "domain":null, "container":null};
			var prefs = "";
			var params = queryStr.split("&amp;");
			for (var p = 0; p < params.length; p++) {
				var param = params[p];
				maps = param.split('=');
				if (maps.length != 2 || maps[0] == "") {
					continue;
				}
				
				prefs += maps[0] + "=" + maps[1] + "&";
				if (typeof modules[maps[0]] != "undefined") {
					try {
						modules[maps[0]] = decodeURIComponent(maps[1]);
					} catch (e) {
						modules[maps[0]] = maps[1];
					}
				}
			}
			
			if (modules["targetDivId"] == null || document.getElementById(modules["targetDivId"]) == null) {
				var id = (0x7FFFFFFF * Math.random()) | 0;
				modules["targetDivId"] = 'gadget-parent-' + id;
				document.write("<div id='" + modules["targetDivId"] + "'></div>");
			}
			
			gadgets.container.layoutManager = new gadgets.FloatLeftLayoutManager(modules["targetDivId"]);
			var gadget = gadgets.container.createGadget({
				dataKey: modules["dataKey"],
				widgetId: modules["widgetId"],
				id: modules["id"],
				service: modules["service"],
				specUrl: modules["url"],
				title: modules["title"],
				width: modules["width"],
				height: modules["height"],
				hashData: prefs
			});
			gadget.setServerBase("http://widgetprovider.daum.net/gadgets/");

		    var fields = [modules["ownerId"], modules["viewerId"], modules["appId"], modules["domain"], modules["url"], modules["widgetId"], modules["container"]];
		    for (var i = 0; i < fields.length; i++) {
		      // escape each field individually, for metachars in URL
		      fields[i] = escape(fields[i]);
		    }
		    gadget.secureToken = escape(fields.join(":"));		
		    if (modules["dataKey"] != null || modules["ownerId"] != null || modules["viewerId"] != null){
		    	gadgets.container.setNoCache(1);
		    }

			gadgets.container.addGadget(gadget);
			gadgets.container.renderGadget(gadget);
		}
	}
}();
widgetproviderRender.init("url=http://widgetcfs1.daum.net/xml/26/widget/2008/09/22/11/20/48d700df7e8ab.xml&amp;&amp;width=166&amp;height=89&amp;widgetId=85&amp;scrap=1");
