Ext.override(Ext.form.RadioGroup,{afterRender:function(){var A=this;
this.items.each(function(B){B.on("check",function(C,D){if(D){A.fireEvent("change",A,C.getRawValue())
}})
});
Ext.form.RadioGroup.superclass.afterRender.call(this)
}});
var embedSizes=function(){var B,C,A;
B=[{w:520,h:420,txt:"blog size 520 x 420"},{w:640,h:450,txt:"medium 640 x 450"},{w:800,h:550,txt:"large 800 x 550"},{w:640,h:480,txt:"custom"}];
C=1;
A=B.length-1;
return{getWidth:function(){return B[C].w
},getHeight:function(){return B[C].h
},setOption:function(D){if(D>=0&&D<=A){C=D
}},setCustomWidth:function(D){B[A].w=D
},setCustomHeight:function(D){B[A].h=D
},getCustomWidth:function(D){return B[A].w
},getCustomHeight:function(D){return B[A].h
},getCustomIndex:function(){return A
},makeRadios:function(){var F=[];
for(var E=0,D=B.length;
E<D;
E++){F.push({boxLabel:B[E].txt,name:"embedsize",checked:E===C,inputValue:E})
}return F
}}
}();
var shareform=function(){var J,K,B,I;
function A(R){var O=R.split("&");
var Q={};
for(var N=0,M=O.length;
N<M;
N++){var P=O[N].split("=");
Q[P[0]]=P[1]
}return Q
}function F(N){var M=[];
for(var O in N){if(N.hasOwnProperty(O)){M.push(O+"="+N[O])
}}return M.join("&")
}function G(){var M=window.location.href,O=M.split("?",2),N=O[0],P=A(O[1]||"");
delete P.login;
P.url="lesson";
P.embed="true";
return N+"?"+F(P)
}function E(){var M=I?(B.indexOf("?")===-1?"?":"&")+"fullscreen=true":"";
return'<a href="'+B+M+'">'+K+"</a>"
}function H(){return'<iframe scrolling="no" src="'+G()+' " width="'+embedSizes.getWidth()+'" height="'+embedSizes.getHeight()+'">iframe for "'+K+'" not supported....</iframe>'
}function D(N){if(N.name==="cwidth"){embedSizes.setCustomWidth(N.value)
}else{embedSizes.setCustomHeight(N.value)
}var M=J.getForm().findField("embedtxt");
if(M){J.getForm().findField("sizeradios").items.get(0).setValue(embedSizes.getCustomIndex());
M.setValue(H())
}}function L(M,N){embedSizes.setOption(N);
J.getForm().findField("embedtxt").setValue(H())
}function C(M,N){I=N;
J.getForm().findField("linktxt").setValue(E())
}return{create:function(N,M){K=N;
B=M;
J=new Ext.FormPanel({labelWidth:100,frame:true,bodyStyle:"padding:5px 5px 0",height:9999,items:[{xtype:"fieldset",title:"Link",layout:"form",autoHeight:true,width:280,items:[{xtype:"checkbox",name:"fullscreen",fieldLabel:"Full Screen",listeners:{change:C}},{xtype:"textfield",name:"linktxt",fieldLabel:"Copy and Paste",readOnly:true,value:E()}]},{xtype:"fieldset",title:"Embed",layout:"form",autoHeight:true,width:280,items:[{xtype:"radiogroup",width:Ext.isIE?280:140,fieldLabel:"Embed Size",columns:1,id:"sizeradios",items:embedSizes.makeRadios(),listeners:{change:L}},{xtype:"numberfield",fieldLabel:"Custom width",width:40,id:"cwidth",name:"cwidth",allowNegative:false,allowDecimals:false,maxValue:9999,value:embedSizes.getCustomWidth(),listeners:{valid:D}},{xtype:"numberfield",fieldLabel:"Custom height",width:40,id:"cheight",name:"cheight",allowNegative:false,allowDecimals:false,maxValue:9999,value:embedSizes.getCustomHeight(),listeners:{valid:D}},{xtype:"textfield",fieldLabel:"Copy and Paste",name:"embedtxt",readOnly:true,value:H()}]}]});
return J
}}
}();