if(typeof(BBWidget)=="undefined"){BBWidget=[];var BooBoxWidget=new function(){this.server="http://static.boo-box.com/";this.apiserver="http://sledge.boo-box.com/";this.cssV="786875858";this.naveggReg=/(interney)/;this.pixelServerReg=/(interney)/;this.customReg=/(interney|blogblogs|jovemnerd|ikwa)/;this.jqueryApi={google:"http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js",our:"http://static.boo-box.com/javascripts/jquery/api/1.3.2.js"};var j=function j(l){var m="",o=0,q=0,p=0,n=0;while(o<l.length){q=l.charCodeAt(o);if(q<128){m+=String.fromCharCode(q);o+=1}else{if((q>191)&&(q<224)){n=l.charCodeAt(o+1);m+=String.fromCharCode(((q&31)<<6)|(n&63));o+=2}else{n=l.charCodeAt(o+1);c3=l.charCodeAt(o+2);m+=String.fromCharCode(((q&15)<<12)|((n&63)<<6)|(c3&63));o+=3}}}return m};this.thisEl=function f(m){var p=[],o=[],l=document.getElementsByTagName("script");for(var n=0,q=l.length;n<q;n++){if(l[n].src&&l[n].src.match(/javascripts\/embed\.js(\?.*)?/)){p.push(l[n]);o.push(l[n].src.replace(/javascripts\/embed\.js(\?.*)?/,""))}}return{inlineMark:p[m],basePath:o[m]}};this.loadUserInfo=function g(p){var r=parseInt(p.el);this.scriptParent=this.thisEl(r).inlineMark;var o=this.scriptParent.parentNode,n=document.createElement("div"),l=false,q=o.getElementsByTagName("div");for(var m=0;m<q.length;m++){if(q[m].className=="boo-powered"){q[m].style.display="none"}}if(o.className.match(/boo-widget/)){BBWidget[r]["width"]=o.style.width;o.style.width="auto";o.removeAttribute("class")}if(p.fullad){return this.makeBanner(p.fullad,n)||""}else{if(p.item){return this.makeWidget(p,r,n)||""}else{return false}}};this.makeWidget=function a(C,l,n){var z=C.item.sort(function(){return 0.5-Math.random()}),y=(parseInt(C.limit)>=z.length)?z.length:parseInt(C.limit);if(z.length<=0){return false}if(navigator&&navigator.userAgent){var x=(navigator.userAgent.toLowerCase().match(/iphone/))}if(!x&&typeof(BBWidget[l]["width"])=="undefined"){BBWidget[l]["width"]="200px"}else{if(x){BBWidget[l]["width"]="auto"}}if(typeof(BBWidget[l]["format"])=="undefined"){BBWidget[l]["format"]="default"}if(typeof(C.type)=="string"&&C.type=="tracks"){n.className="boo-widget text";n.style.width=BBWidget[l]["width"];out='<ul class="boo-gallery" style="display:none;">';for(var w=0;w<y;w++){out+="<li>";if(C.bid!="undefined"){out+='<a href="http://boo-box.com/link/bid:'+C.bid+"/tags:"+z[w]._value.artist+'" class="bbli" target="_blank">'}else{out+='<a href="http://boo-box.com/link/aff:'+C.shop+"/uid:"+C.aff+"/tags:"+z[w]._value.artist+'" class="bbli" target="_blank">'}out+=z[w]._value.artist+" - "+z[w]._value._name+' <img src="http://boo-box.com/bbli" alt="[bb]" /></a></li>'}include_script=true;return out}else{n.className="boo-widget "+BBWidget[l]["format"];var B=(!BBWidget[l]["format"]||BBWidget[l]["format"]=="default");if(B&&typeof(BBWidget[l]["width"])!="undefined"){var A=BBWidget[l]["width"];A.match(/px/)?n.style.width=A:n.style.width=A+"px"}out='<ul class="boo-gallery" style="display:none;">';for(var w=0;w<y;w++){var E=z[w]._value.title||z[w]._value._name,v=(z[w]._value.content_type=="flash");E=j(E);var o=z[w]._value.url||z[w]._value.uri;if(BBWidget[l]["ads"]){o=BBWidget[l]["ads"]+o}if(z[w]._value.price){E+=" - "+z[w]._value.price}var t="COMPRE",m="BUY",q=(C.lang=="pt-BR"),s=(C.bid||z[w]._value.shop&&z[w]._value.shop.match(/(mercadolivre|gamestown|americanas|submarino|buscape|jacotei|jovemnerd)(id)?/)[0]),r=(C.bid&&C.lang)?(q?t:m):(s?t:m);out+="<li"+((w!=y-1)?"":' class="last"')+">";if(!v){if(typeof(C.type)=="string"&&C.type=="top_artists"){theTags=z[w]._value._name;o="http://boo-box.com/link/"+((C.bid!="undefined")?"bid:"+C.bid:"aff:"+C.shop+"/uid:"+C.aff)+"/tags:"+theTags;include_script=true}out+='<a onmouseover="BooBoxWidget.isHover(this, true);" onmouseout="BooBoxWidget.isHover(this, false);" style="background: url( '+z[w]._value.img+') no-repeat center center" href="'+o+'" title="'+E+'" target="_blank">';out+='<img alt="'+j(z[w]._value._name)+'" src="'+z[w]._value.img+'" class="bbno" /></a>';if(z[w]._value.price!=""){var p=(z[w]._value.price)?z[w]._value.price:r;if(BBWidget[l]["price"]!="no"){out+='<span title="'+E+'" class="boo-price" onmouseover="BooBoxWidget.isHover(this, true);" onmouseout="BooBoxWidget.isHover(this, false);"><a href="'+o+'" title="'+E+'" target="_blank">'+p+"</a></span>"}out+='<span title="'+E+'" class="boo-compra" onmouseover="BooBoxWidget.isHover(this, true);" onmouseout="BooBoxWidget.isHover(this, false);"><a href="'+o+'" title="'+E+'" target="_blank">'+r+"</a></span>"}}else{var D=z[w]._value;out+='<embed wmode="transparent" menu="false" width="'+D.width+'" height="'+D.height+'" flashvars="'+this.makeFlashVars(D.flash_var,D.url)+'" allowscriptaccess="always" allowfullscreen="true" quality="high" name="movie_player" id="bbpddds" src="'+D.img+'" type="application/x-shockwave-flash"/>'}out+="</li>"}out+="</ul>"}var u='<div class="clear"></div>';out+=[u,'<div class="boo-powered"><a target="_blank" class="boo-brand" href="http://boo-box.com">Ganhe mais usando boo-box</a></div>',u].join("");return this.insertWidget(out,n)};this.makeBanner=function b(q,o){var l=q._value,n="",p=function p(){var s='<div class="clear"></div>',t="";if(l.aditional_content&&l.aditional_content!=""){t+=l.aditional_content}t+=s;return t};o.className="boo-widget";o.id="boo-widget-banner";o.style.width=l.width+"px";switch(l.content_type){case"image":n+='<a target="_blank" href="'+l.url+'"><img style="border:0;width:'+l.width+"px;height:"+l.height+'px;" src="'+l.img+'" /></a>'+p();this.insertWidget(n,o);break;case"flash":n+='<embed wmode="transparent" menu="false" width="'+l.width+'" height="'+l.height+'" flashvars="'+this.makeFlashVars(l.flash_var,l.url)+'" allowscriptaccess="always" allowfullscreen="true" quality="high" name="movie_player" id="bbpddds" src="'+l.img+'" type="application/x-shockwave-flash"/>'+p();this.insertWidget(n,o);break;case"js":n+='<script type="text/javascript" src="'+l.img+'"><\/script>'+p();this.insertWidget(n,o);break;default:var m=this;function r(x){var w=x?x:jQuery.noConflict(),u=Math.floor(Math.random()*11)+parseInt(l.width),v=["boo-banner-",u].join(""),t=document.createElement("div"),s=['<iframe onload="BooBoxWidget.onloadIframe()" id="',v,'" width="',l.width,'" height="',l.height,'" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" topmargin="0" leftmargin="0" allowtransparency="true"></iframe>',p()].join("");t.innerHTML=s;document.getElementsByTagName("body")[0].appendChild(t);BooBoxWidget._iframe=document.getElementById(v);BooBoxWidget._banner=l;m.insertWidget(t,o,w)}if(typeof(jQuery)=="undefined"){BooBoxWidget.headInsert(this.jqueryApi.google,"script",function(s){(s==="error")?BooBoxWidget.headInsert(m.jqueryApi.our,"script",r):r()})}else{r(jQuery)}break}};this.onloadIframe=function(){BooBoxWidget._iframe.contentWindow.document.write("<div>"+BooBoxWidget._banner.img+"</div>");BooBoxWidget._iframe.onload=null};this.insertWidget=function c(l,m,n){if(!n){m.innerHTML=l}else{n(m).append(l)}return this.scriptParent.parentNode.insertBefore(m,this.scriptParent)};this.makeFlashVars=function e(m,p){var l=[];for(var q=0,o=m.length;q<o;q++){l.push([m[q],"=",p[q]].join(""));if(q!==o-1){l.push("&")}}return l.join("")};this.isHover=function h(m,l){m.parentNode.className=(l)?m.parentNode.className+" boo-ativo":m.parentNode.className.replace(/boo-ativo/gi,"")};this.headInsert=function d(q,p,r){var n=document.getElementsByTagName("head")[0],o=document.createElement(p);switch(p){case"script":o.type="text/javascript";o.src=q;break;case"link":o.rel="stylesheet";o.href=q;o.type="text/css";break}if(r){var m=false;o.onerror=function l(){r("error")};o.onload=o.onreadystatechange=function(){if(!m&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){m=true;r();o.onload=o.onreadystatechange=null;n.removeChild(o)}}}return n.appendChild(o)};this.getNavegg=function k(n){if(BBWidget[BBWidget.length-1]["name"]!==undefined&&BBWidget[BBWidget.length-1]["name"].match(BooBoxWidget.naveggReg)){var m=[],o=n||"";if(typeof(ltgc)!="undefined"){if(ltgc("navegg_shopping")){m=ltgc("navegg_shopping").split(",")||[]}}if(m.length==0){var l=document.cookie;if(l){l=l.split("navegg_shopping=");if(l.length>1){l=l[1].split(";")[0];if(l){m=l.split(",")||[]}}}}o=o.split(",");o=m.concat(o).join(",");return o}return n}}}BBWidget.push({});var bb_opts="name,type,user,shop,bid,aff,limit,list,keywords,keygroup,uid,width,format,price,lang,ads,sinc,ref,log".split(",");var urlstring=[],userOption=undefined,userValue="";for(var i=0,bb_opt_length=bb_opts.length;i<bb_opt_length;i++){userOption=bb_opts[i],userValue=window[["bb_",userOption].join("")];if(userValue!==undefined&&userValue!==""){if(!bb_opts[i].match(/(name|width|format|ads|ref)/)){if(userOption==="keywords"||userOption==="keygroup"){userValue=BooBoxWidget.getNavegg(userValue)}urlstring.push(["&",userOption,"=",userValue].join(""))}else{if(userOption.match(/format/)){urlstring.push(["&",userOption,"_api=",userValue].join(""))}else{if(userOption.match(/width/)){var width=parseInt(userValue.replace(/px/,"")),total_width=parseInt(BBWidget[BBWidget.length-1].limit*100),lines=total_width/width,height=parseInt((lines==1)?100:lines*100);urlstring.push(["&_width=",width,"&_height=",height].join(""))}else{if(userOption.match(/ref/)){urlstring.push(["&",userOption,"=",escape(userValue)].join(""))}}}}BBWidget[BBWidget.length-1][userOption]=userValue}window[["bb_",bb_opts[i]].join("")]=""}if(typeof BBWidget[BBWidget.length-1].ref!="string"||BBWidget[BBWidget.length-1].ref==""){urlstring.push(["&ref=",escape(window.location.href)].join(""))}urlstring=urlstring.join("");$thisEl=BooBoxWidget.thisEl(BBWidget.length-1);var reg=BBWidget[BBWidget.length-1]["name"].match(BooBoxWidget.customReg);if(reg){BooBoxWidget.headInsert(BooBoxWidget.server+"stylesheets/widgets/"+reg[0]+".css?v="+BooBoxWidget.cssV,"link");BooBoxWidget.url=[BooBoxWidget.apiserver,reg[0],"/list"].join("")}else{BooBoxWidget.headInsert(BooBoxWidget.server+"stylesheets/widgets/widget.css?v="+BooBoxWidget.cssV,"link");BooBoxWidget.url=BooBoxWidget.apiserver+BBWidget[BBWidget.length-1]["name"]+"/list"}if(BBWidget[BBWidget.length-1]["name"].match(BooBoxWidget.pixelServerReg)){var pxlSrvImg=new Image();pxlSrvImg.src="http://pixer.meaningtool.com/boobox/0/hit"}BooBoxWidget.url=[BooBoxWidget.url,"?callback=BooBoxWidget.loadUserInfo&el=",(BBWidget.length-1),urlstring,"&sref=",escape(document.referrer),"&rnd=",Math.floor(Math.random()*(1000))].join("");BooBoxWidget.headInsert(BooBoxWidget.url,"script");