/*
 * End-user JS class for rendering a yfrog widget.
 *
 * @author Tyler
 */
var YfrogWidget=function(a){this.baseURL="http://yfrog.com/widget/iframe?";this.widgetURL=null;if(a.theme.tweets.color===undefined){a.theme.tweets.color="#444444"}if(a.theme.tweets.links===undefined){a.theme.tweets.links="#4C5667"}if(a.theme.tweets.backgroundColor===undefined){a.theme.tweets.backgroundColor="#fff"}if(a.theme.shell.color===undefined){a.theme.shell.color="#eee"}if(a.theme.shell.backgroundColor===undefined){a.theme.shell.backgroundColor="#eee"}if(a.theme.shell.backgroundImage===undefined){a.theme.shell.backgroundImage=""}if(a.theme.header.avatar===undefined){a.theme.header.avatar=true}if(a.theme.header.name===undefined){a.theme.header.name=true}if(a.theme.header.color===undefined){a.theme.header.color=a.theme.tweets.color}if(a.count===undefined){a.count=10}if(a.type===undefined){a.type="vertical"}if(a.width===undefined){a.width=300}if(a.height===undefined){a.height=500}if(a.type=="vertical"){if(a.width<275){a.width=275}if(a.height<375){a.height=375}}else{if(a.type=="thumbnail"){if(a.width<275){a.width=275}if(a.height<270){a.height=270}}}this.URLOptions={username:a.username,type:a.type,count:a.count,width:a.width,height:a.height,tweetsColor:encodeURIComponent(a.theme.tweets.color),tweetsLinks:encodeURIComponent(a.theme.tweets.links),tweetsBackgroundColor:encodeURIComponent(a.theme.tweets.backgroundColor),shellColor:encodeURIComponent(a.theme.shell.color),shellBackgroundColor:encodeURIComponent(a.theme.shell.backgroundColor),shellBackgroundImage:encodeURIComponent(a.theme.shell.backgroundImage),headerAvatar:a.theme.header.avatar,headerName:a.theme.header.name,headerColor:encodeURIComponent(a.theme.header.color)};this.iframeOptions={width:a.width,height:a.height};this.render=function(){this.buildWidgetURL();document.write('<iframe src="'+this.widgetURL+'" width="'+this.iframeOptions.width+'" height="'+this.iframeOptions.height+'" allowtransparency="true" frameborder="0" scrolling="no" id="widget_iframe"></iframe>')};this.buildWidgetURL=function(){this.widgetURL=this.baseURL;var c=0;for(var b in this.URLOptions){if(this.URLOptions.hasOwnProperty(b)){if(c===0){this.widgetURL+=b+"="+this.URLOptions[b]}else{this.widgetURL+="&"+b+"="+this.URLOptions[b]}}c++}}};
