(function(){var b=/listbadge.js$/,a=(typeof(inPipe)=="undefined")?false:true;var e=function(){YUI.namespace("Env.Pipes.InfoPage");YUI().use("node","event","anim","panel","dd-plugin","json-parse",function(j){var f=(typeof(host)=="undefined")?"pipes.yahoo.com":host,k="";for(var g=0;g<16;g++){k+=String.fromCharCode(Math.floor(Math.random()*26)+97)}window[k]={};if(!j.Lang.isUndefined(YUI.Env.Pipes.InfoPage)){YUI.Env.Pipes.InfoPage.pipeListBadge=window[k]}var h=window[k];h.f=function(){return{runFunction:[],timeoutCount:10,inpipe:a,init:function(){var n=document.getElementsByTagName("SCRIPT");for(var m=0;m<n.length;m++){var l=(this.inpipe)?n[m].id:n[m].src;if(l.match(b)){h.a={};if(n[m].innerHTML){try{h.a=j.JSON.parse(n[m].innerHTML)}catch(o){h.a={err:"trouble parsing JSON object"}}}h.w=document.createElement("DIV");n[m].parentNode.insertBefore(h.w,n[m]);n[m].parentNode.removeChild(n[m]);h.f.buildStructure();break}}},buildStructure:function(){h.d={title:"&nbsp;",height:"300px",width:"100%",border:"none",margin:"0",padding:"0",containerPadding:"0",evenBackgroundColor:"#FFF",oddBackgroundColor:"#F6F6F6",pipesTitleFontSize:"inherit",pipesDescriptionFontSize:"0.92em",count:25};var t="";if(this.inpipe){h.d.width="100%";h.d.height="100%";h.a.count=25;h.a.hideHeader="true"}else{t="overflow:auto;overflow-x:hidden;"}for(var o in h.d){if(j.Lang.isUndefined(h.a[o])){h.a[o]=h.d[o]}}h.w.className=k;if(!j.Lang.isUndefined(h.a.addClassName)){h.w.className+=" "+h.a.addClassName}if(!j.Lang.isUndefined(h.a.id)){h.w.id=h.a.id}if(!j.Lang.isUndefined(h.a.width)){if(h.a.width.indexOf("px")==-1&&h.a.width.indexOf("%")==-1&&h.a.width.indexOf("em")==-1){h.a.width=h.a.width+"px"}h.w.style.width=h.a.width}if(j.Lang.isUndefined(h.a.height)){if(h.a.height.indexOf("px")==-1&&h.a.height.indexOf("%")==-1&&h.a.height.indexOf("em")==-1){h.a.height=h.a.height+"px"}}var v=document.createElement("style");document.getElementsByTagName("head")[0].appendChild(v);if(!window.createPopup){v.appendChild(document.createTextNode(""))}var x=document.styleSheets[document.styleSheets.length-1];var w={"":"{zoom:1;position:"+h.a.position+";top:"+h.a.top+";left:"+h.a.left+";width:"+h.a.width+";height:"+h.a.height+";background-color:"+h.a.backgroundColor+";border:"+h.a.border+";font:"+h.a.font+";margin:"+h.a.margin+";padding:"+h.a.padding+";}",a:"{cursor:pointer;text-decoration:none;color:"+h.a.color+";}","a.yba":"{background:transparent url(http://l.yimg.com/a/i/us/pps/pipes-16.png) 0 0 no-repeat;_background-image:url(http://l.yimg.com/a/i/us/pps/pipes-16.gif);float:left;height:16px;margin:3px 0 0 3px;width:16px;}","div.ybad":"{display:inline;height:16px;font-size:9px;font-weight:bold;line-height:22px;color:inherit;}","a.gt":"{position:absolute;height:16px;display:inline;color:inherit;font-size:9px;font-weight:bold;line-height:22px;right:12px;cursor:pointer;text-decoration:underline;}","div.gts":"{position:absolute;height:16px;display:inline;color:inherit;font-size:12px;font-weight:bold;line-height:20px;right:2px;cursor:none;text-decoration:none;}","a.ybaa":"{color:inherit;text-decoration:underline}","sup.ybas":"{font-size:100%;color:inherit}","a.ybt":"{font-weight:bold;color:"+h.a.headlineColor+";}","div.ybx":"{visibility:hidden;background-color:transparent;margin:"+h.a.containerPadding+";padding:0;position:relative;}","div.ybr":"{zoom:1;position:relative;display:block;font-size:1em;margin:3px 0 0 0;padding:0pt;width:100%;"+t+"}","div.ybf":"{display:none;width:104%;background-color:transparent;height:20px;margin:0;padding:0;position:relative}","div.ybr li.ybi":"{background-color:"+h.a.evenBackgroundColor+";margin:0;padding:5px 5px 5px 0;list-style:none;list-style-position:outside;overflow:hidden;text-indent:0}","div.ybr li.ybi.odd":"{background-color:"+h.a.oddBackgroundColor+";}","h3.ybh":"{margin:0;padding:0;font-weight:bold;background-color:"+h.a.headerBackgroundColor+";}","h3.ybt":"{margin:0;padding:0;position:relative;}","div.PBajaxwait":"{position:relative;display:block;width:100%;height:100%;margin-top:-"+h.a.containerPadding+";background: #eee url('http://l.yimg.com/a/i/us/pps/logo_ani_1.gif') 50% 50% no-repeat;opacity:0.75;filter:alpha(opacity=75);}",".pipesImgdescription":"{display:block;width:100%;height:auto;color:"+h.a.descriptionColor+";}",".pipesImgdescription .pipesThumbnail":"{position:relative;float:left;margin-bottom:3px;_zoom:1;}",".pipesImgdescription .pipesThumbnail img":"{position:static;width:50px;height:50px;border:1px solid #eee}",".pipesImgdescription .pipesTitle":"{font-size:"+h.a.pipesTitleFontSize+";font-weight:bold;padding-bottom:3px;width:100%;}",".pipesImgdescription .pipesDescription":"{font-size:"+h.a.pipesDescriptionFontSize+";}",".pipesHolder":"{padding: 5px 5px 5px 0;}",".pipesText":"{zoom:1;margin-left:55px;*float:left;*margin-left:20px;}",ul:"{display:block;overflow:hidden;position:relative;width:300000px;z-index:2;padding:0;margin:auto;}","ul.pipesSmallthumb li":"{border:1px solid #eee;display:block;float:left;height:32px;list-style-image:none;list-style-position:outside;list-style-type:none;overflow:hidden;padding:2px;width:32px;}","ul.pipesSmallthumb li:hover":"{border:1px solid red;}","ul.pipesSmallthumb":"{margin: 10px 0 0;padding:0;width:auto;}","ul.pipesSmallthumb li a img":"{height:32px;width:32px;cursor:pointer;border: 0px;position:static;left:inherit;right:inherit;}"};var q={"gin div.hd":"{background-color:#eee;border:none}"};var u="";for(var i in w){var n="."+k+" "+i;if(window.createPopup){u+=n+w[i]}else{var m=document.createTextNode(n+w[i]);v.appendChild(m)}}for(var i in q){var n="#"+k+i;if(window.createPopup){u+=n+q[i]}else{var m=document.createTextNode(n+q[i]);v.appendChild(m)}}if(window.createPopup){x.cssText=u}h.w.ajaxwait=document.createElement("DIV");h.w.ajaxwait.className="PBajaxwait";h.w.c=document.createElement("DIV");h.w.c.className="ybx";h.w.h=document.createElement("h3");h.w.h.className="ybh";if(!j.Lang.isUndefined(h.a.hideHeader)){h.w.h.style.display="none"}h.w.t=document.createElement("A");h.w.t.className="ybt";h.w.t.innerHTML=h.a.title;h.w.t.target="_blank";h.w.h.appendChild(h.w.t);h.w.c.appendChild(h.w.h);h.w.r=document.createElement("DIV");h.w.r.className="ybr";h.w.c.appendChild(h.w.r);h.w.dtf=document.createElement("div");h.w.dtf.className="ybf";h.w.dtf.innerHTML='<a href="http://'+f+'" class="yba"></a> &nbsp;<div class="ybad">Powered by <a class="ybaa" href="'+f+'">Y! Pipes</a><sup class="ybas">&trade;</sup></div><a class="gt">Get This</a><div class="gts">&#187;</div>';var p=h.w.dtf.getElementsByTagName("a"),l=h.w.dtf.getElementsByTagName("div");this.getThisDiv=p[2];this.getThisDivArrow=l[1];h.w.ajaxwait.appendChild(h.w.c);h.w.ajaxwait.appendChild(h.w.dtf);h.w.appendChild(h.w.ajaxwait);if(!this.inpipe){if(j.Lang.isUndefined(h.a.localJson)){h.f.runSearch()}else{h.f.renderResult(h.a.localJson)}}},runCalledFromPipe:function(){h.f.renderResult(YUI.Env.Pipes.InfoPage.jsondata)},runSearch:function(){h.f.callback="pipesCallback";pipesCallback=function(n){if(pipesCallBackArr[n.value.requesturl]){for(var o=0;o<pipesCallBackArr[n.value.requesturl].length;o++){if(pipesCallBackArr[n.value.requesturl][o]){pipesCallBackArr[n.value.requesturl][o].f.renderResult(n);pipesCallBackArr[n.value.requesturl][o]=null}}}};var i="http://"+f+"/pipes/pipe.info?_id="+h.a.pipe_id,l="http://run.pipes.yahoo.com/pipes/pipe.run?_id="+h.a.pipe_id+"&_render=badge&_callback="+h.f.callback;this.queryparams="";for(var m in h.a.pipe_params){if(j.Lang.isNull(h.a.pipe_params[m])){continue}l+="&"+encodeURIComponent(m)+"="+encodeURIComponent(h.a.pipe_params[m]);this.queryparams+="&"+decodeURIComponent(m)+"="+decodeURIComponent(h.a.pipe_params[m])}h.w.t.href=i;if(typeof(pipesCallBackArr)=="undefined"){pipesCallBackArr=[]}if(j.Lang.isUndefined(pipesCallBackArr[l])){pipesCallBackArr[l]=[]}pipesCallBackArr[l].push(h);h.f.runScript(l,k)},renderResult:function(l){if(l.value.published==""){var i=h.w.h.cloneNode(true);i.innerHTML=l.value.title;h.w.h.parentNode.replaceChild(i,h.w.h);h.w.h=i;this.getThisDiv.style.display="none";this.getThisDivArrow.style.display="none"}else{var i=h.w.t.cloneNode(true);i.innerHTML=l.value.title;h.w.t.parentNode.replaceChild(i,h.w.t);h.w.t=i}this.listbadge.init(l)},runScript:function(i,m){var l=document.createElement("script");l.id=m;l.type="text/javascript";l.src=i;document.getElementsByTagName("head")[0].appendChild(l)},createSSLink:function(m,n){var i=document.createElement("link");i.id=n;i.rel="stylesheet";i.type="text/css";i.href=m;document.getElementsByTagName("head")[0].appendChild(i)},removeScript:function(l){var i=document.getElementById(l);if(i){i.parentNode.removeChild(i)}},getthisfuncInside:function(){var i=(this.inpipe)?YUI.Env.Pipes.InfoPage.pid:h.a.pipe_id,l=(this.inpipe)?"":h.f.queryparams;if(j.Lang.isUndefined(this.getitnow)){this.getitnow=new j.Panel({srcNode:"#"+k+"gin",width:420,centered:true,constrain:true,modal:true,zIndex:11111,headerContent:'<div style="border:none;font:bold 16px arial;color:#626262;text-align:left;padding-left:5px">Get this Yahoo! Pipes<sup>&trade;</sup> Badge <div style="position:absolute;right:35px;letter-spacing:4px;top:3px;"><a style="font-size:11px;color:#626262;" href="http://'+f+'/pipes/badgedocs" target="_blank">HELP</a></div></div>',bodyContent:'<iframe width="415" height="350" allowtransparency="true" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0" scrolling="no" src="http://'+f+"/pipes/badge.config?page=1&_btype=list&_id="+i+l+'"></iframe>',plugins:[j.Plugin.Drag]});this.getitnow.render();j.one("#"+k+"ginClose").on("click",this.getitnow.hide,this.getitnow,this.getitnow)}this.getitnow.show()},getthisfuncOutside:function(){var l=(this.inpipe)?YUI.Env.Pipes.InfoPage.pid:h.a.pipe_id,m=(this.inpipe)?"":h.f.queryparams,i="http://"+f+"/pipes/badge.config?page=1&_btype=list&_id="+l+m;window.open(i)},listbadge:{init:function(n){j.one(h.w.ajaxwait).removeClass("PBajaxwait");if(!h.f.inpipe){h.w.dtf.style.display="block";if(n.value.published!=""){this.checkViewport()}}j.on("windowresize",this.resized,this,this);var i=h.w.r.offsetWidth;if(!h.f.inpipe){var o=(parseInt(h.a.containerPadding,10)*2);var m=h.w.offsetHeight-h.w.h.offsetHeight-h.w.dtf.offsetHeight-o-5;if(m>0){h.w.r.style.height=m+"px"}}this.w=i;this.remove();if(n&&n.value&&n.value.items&&n.value.items.length){this.startnum=0;this.orglen=n.value.items.length;this.countby=h.a.count;this.results=n;var p=(this.orglen<this.countby)?this.orglen:this.countby;this.create(this.startnum,p);this.startnum=this.countby}else{var l=h.w.r.cloneNode(true);l.innerHTML="<h4>No results</h4>";h.w.r.parentNode.replaceChild(l,h.w.r);h.w.r=l}j.one(h.w.c).setStyle("visibility","visible")},checkViewport:function(){var i=j.one(h.f.getThisDiv);i.detach("click");var l=j.one("body");if(l.get("winWidth")>=422&&l.get("winHeight")>=415){i.on("click",h.f.getthisfuncInside,this,this)}else{i.on("click",h.f.getthisfuncOutside,this,this)}},resized:function(){if(this.currheight!=document.documentElement.clientHeight&&this.currheight!=""){this.checkViewport()}this.currheight=document.documentElement.clientHeight},createDescription:function(n,l){var m=(j.Lang.isUndefined(n.smallimg))?"":"<img src='"+n.smallimg+"' />",o=(l=="imgBadge")?"":"<div class='pipesThumbnail'>"+m+"</div>",i=(m==""||l=="imgBadge")?"style='margin-left:0px;'":"style='margin-left:55px;*margin-left:20px;'";imgdescription="<div class='pipesImgdescription'><div class='pipesHolder'>"+o+"<div class='pipesText' "+i+"><div class='pipesTitle'><a href='"+n.link+"' target='_blank'>"+n.title+"</a></div><div class='pipesDescription'>"+n.description+"</div><ul class='pipesSmallthumb'></ul></div></div></div>";return imgdescription},createDescThumbs:function(l,q,u){var i=l.getElementsByTagName("ul"),m=q-55,n="";this.smallthumbholder=i[0];this.smallitemimgcount=Math.round(m/50);var o=(this.smallitemimgcount>u.usethisimgarr.length)?u.usethisimgarr.length:this.smallitemimgcount;for(var p=1;p<o;p++){n+="<li><a href="+u.usethisimgarr[p].url+" target='_blank'><img src='"+u.usethisimgarr[p].url+"'</a></li>"}if(n==""){this.smallthumbholder.style.marginTop="0px"}else{var s=this.smallthumbholder.cloneNode(true);s.innerHTML=n;this.smallthumbholder.parentNode.replaceChild(s,this.smallthumbholder);this.smallthumbholder=s;var r=this.smallthumbholder.getElementsByTagName("img");this.thumbnails=r;for(g=0;g<r.length;g++){new this.makeGrow(r[g])}}},makeGrow:function(m){var o=null,r=m,s,q,n;var p=function(u){var t=j.one(r);s=t.getXY();q=parseInt(t.getStyle("width"));n=parseInt(t.getStyle("height"));o=u.cloneNode(false);o.style.position="absolute";o.style.width="32px";o.style.height="32px";o.style.top=s[1]+"px";o.style.left=s[0]+"px";o.style.zIndex="999";o.style.display="none";o.style.padding="2px";o.style.border="1px solid #eee";o.className="clonedSmallImg";document.body.appendChild(o);l()};var l=function(t){if(j.Lang.isNull(o)){p(r);return}o.style.display="inline";var v=new j.Anim({node:o,to:{width:200,height:200},easing:"backOut",duration:0.6});var u=v.get("node");v.on("tween",function(){var w=s[0]-((u.offsetWidth-q)>>1),x=s[1]-((u.offsetHeight-n)>>1);if(w<0){w=0}if(x<0){x=0}j.one(u).setXY([w,x])});v.run();h.f.listbadge.growAnim=v;j.one(o).on("mouseout",i)};var i=function(){if(h.f.listbadge.growAnim.get("running")){window.setTimeout(function(){i()},50);return}j.one(o).detach("mouseout");var u=new j.Anim({node:o,to:{width:32,height:32},duration:0.2});var t=u.get("node");u.on("tween",function(){var v=s[0]-((t.offsetWidth-q)>>1),w=s[1]-((t.offsetHeight-n)>>1);if(v<0){v=0}if(w<0){w=0}j.one(t).setXY([v,w])});u.on("end",function(){var v=u.get("node");v.setStyle("display","none")});u.run()};j.one(r).on("mouseover",l)},remove:function(){h.w.r.innerHTML=""},create:function(n,v){for(var p=n;p<v;p++){var u=this.results.value.items[p];var r=u.media.regular.length;var w=u.media.thumbnails.length;var o=(r>w)?u.media.regular:u.media.thumbnails;u.usethisimgarr=o;if(o.length!=0){if(u.media.thumbnails.length!=0){u.smallimg=u.media.thumbnails[0].url}else{u.smallimg=o[0].url}}var s=document.createElement("LI");this.li=s;s.className="ybi";if(p%2){s.className+=" odd"}s.innerHTML=this.createDescription(u);this.createDescThumbs(this.li,this.w,u);var l=s.getElementsByTagName("div")[2],q=s.getElementsByTagName("div")[3],y=s.getElementsByTagName("div")[4],x=s.getElementsByTagName("div")[5];if(l.innerHTML!=""){j.one(l).setStyle("margin-right","8px")}j.one(q).setStyle("margin-left","0px");h.w.r.appendChild(s)}if(h.f.inpipe){if(this.orglen>v||n!=0){this.pagDiv=document.createElement("div");this.pagDiv.className="paginate"}if(this.orglen>v){var m=document.createElement("a");m.innerHTML="Next >";this.pagDiv.appendChild(m);j.one(m).on("click",this.next_pag,this,this)}if(n!=0){var t=document.createElement("a");t.innerHTML="< Prev";if(this.orglen>v){t.style.right="40px";t.style.position="absolute"}else{t.style.right="";t.style.position=""}this.pagDiv.appendChild(t);j.one(t).on("click",this.prev_pag,this,this)}if(this.orglen>v||n!=0){h.w.r.appendChild(this.pagDiv);this.pagDiv=null}}},prev_pag:function(){this.remove();var l=this.startorg-this.countby;var i=l+this.countby;if(i>=this.orglen){i=this.orglen}this.create(l,i);location.href="#";this.startnum=i;this.startorg=l},next_pag:function(){this.remove();var l=this.startnum;var i=this.countby+l;if(i>=this.orglen){i=this.orglen}this.create(l,i);location.href="#";this.startnum=i;this.startorg=l}}}}();h.f.init()})};if(typeof(YUI)=="undefined"||!YUI){var d=document.getElementById("yui");if(d==null){var c=document.createElement("script");c.id="yui";c.type="text/javascript";c.src="http://yui.yahooapis.com/3.4.0/build/yui/yui-min.js";document.getElementsByTagName("head")[0].appendChild(c)}}if(a){e()}else{if(typeof window.addEventListener!=="undefined"){if(window.opera){e()}else{window.addEventListener("load",e,false)}}else{if(typeof window.attachEvent!=="undefined"){window.attachEvent("onload",e)}}}})();
