var BooliInspiration={data:{"image":[{"imageId":2657226,"votes":712,"width":768,"height":512},{"imageId":1786653,"votes":632,"width":768,"height":512},{"imageId":2534504,"votes":489,"width":768,"height":512},{"imageId":2479495,"votes":460,"width":768,"height":512},{"imageId":1806459,"votes":459,"width":768,"height":512}],"tag":"mest-gillade","dim":"181x119"},init:function(){var h=0,d=this,e=document.getElementById("booli_href"),b,c=new Image(),g;e.innerHTML='';b=document.getElementById("booli_img");this.w=parseInt(this.data.dim.replace(/x.*/,""),10),this.h=parseInt(this.data.dim.replace(/.*x/,""),10);this.fade.setOpacity(0);this.setStyle(b,e);function f(){h++;if(h>d.data.image.length-1){h=0}g="http://i.bcdn.se/cache/"+d.data.image[h].imageId+"_"+d.data.dim+".jpg";c.src=g;e.href=document.location.protocol+"//www.booli.se/inspiration/"+d.data.tag+"#"+d.data.image[h].imageId;if(d.data.image.length!==1){setTimeout(function(){d.fade.hide(f)},7000)}}function a(i){if(d.data.image[h].aspectRatio>=d.w/d.h){b.style.marginTop=Math.floor((d.h-(d.w/d.data.image[h].aspectRatio))/2)+"px"}else{b.style.marginTop=0}b.src=g;d.fade.show()}c.onload=a;if(d.data.image.length>0){f()}else{}},setStyle:function(img,aimg){var el=document.getElementById("booli_insp"),logo=document.getElementById("booli_logo"),title=document.getElementById("booli_title"),a2=document.getElementById("booli_link"),text=document.getElementById("booli_text");img.style.border="0 none";text.style.width="110px";text.style.listStyle="none inside none";text.style.margin="0";text.style.padding="0";aimg.style.border="0 none";aimg.style.width=this.w+"px";aimg.style.height=this.h+"px";aimg.style.textAlign="center";aimg.style.backgroundColor="#6B6B6B";a2.style.fontFamily="arial,helvetica";a2.style.fontSize="10pt";a2.style.fontWeight="bold";a2.style.color="#144ECB";a2.style.border="0 none";a2.style.clear="left";a2.style.whiteSpace="nowrap";a2.style.lineHeight="1em";el.style.padding="5px";el.style.width=this.w+"px";el.style.height=(this.h+29)+"px";el.style.border="1px solid #E0E0E0";if( /*@cc_on!@*/ !1){el.style.width=(this.w)+"px"}logo.style.width="58px";logo.style.margin="5px 7px 0 0";title.style.fontFamily="arial,helvetica";title.style.fontSize="10px";title.style.margin="5px 0 1px 0";title.style.color="#868686";title.style.fontWeight="bold";title.style.lineHeight="1em";el.style.display=""},fade:(function(){var e,f=1000,b=20,d=0,a=null,c=function(g){if(!e){e=document.getElementById("booli_img")}d=g;e.style.opacity=d;e.style.MozOpacity=d;e.style.KhtmlOpacity=d;e.style.filter="alpha(opacity="+(d*100)+");"};return{setOpacity:function(g){c(0)},show:function(){if(d>=1){return}setTimeout(arguments.callee,f/b);c(d+(1/(f/b)))},hide:function(g){a=g&&typeof g!=="number"?g:a;if(d<=0){a();return}setTimeout(arguments.callee,f/b);c(d-(1/(f/b)))}}})()};BooliInspiration.init();