function fix_flash(){var a=document.getElementsByTagName("embed");for(i=0;i<a.length;i++){embed=a[i];var b;if(embed.outerHTML){var c=embed.outerHTML;if(c.match(/wmode\s*=\s*('|")[a-zA-Z]+('|")/i))b=c.replace(/wmode\s*=\s*('|")window('|")/i,"wmode='transparent'");else b=c.replace(/<embed\s/i,"<embed wmode='transparent' ");embed.insertAdjacentHTML("beforeBegin",b);embed.parentNode.removeChild(embed)}else{b=embed.cloneNode(true);if(!b.getAttribute("wmode")||b.getAttribute("wmode").toLowerCase()=="window")b.setAttribute("wmode","transparent");embed.parentNode.replaceChild(b,embed)}}var d=document.getElementsByTagName("object");for(i=0;i<d.length;i++){object=d[i];var e;if(object.outerHTML){var c=object.outerHTML;if(c.match(/<param\s+name\s*=\s*('|")wmode('|")\s+value\s*=\s*('|")[a-zA-Z]+('|")\s*\/?\>/i))e=c.replace(/<param\s+name\s*=\s*('|")wmode('|")\s+value\s*=\s*('|")window('|")\s*\/?\>/i,"<param name='wmode' value='transparent' />");else e=c.replace(/<\/object\>/i,"<param name='wmode' value='transparent' />\n</object>");var f=object.childNodes;for(j=0;j<f.length;j++){try{if(f[j]!=null){var g=f[j].getAttribute("name");if(g!=null&&g.match(/flashvars/i)){e=e.replace(/<param\s+name\s*=\s*('|")flashvars('|")\s+value\s*=\s*('|")[^'"]*('|")\s*\/?\>/i,"<param name='flashvars' value='"+f[j].getAttribute("value")+"' />")}}}catch(h){}}object.insertAdjacentHTML("beforeBegin",e);object.parentNode.removeChild(object)}}}twitterfeed={user:"berryplusclean",numTweets:20,appendTo:"#sidebarcontent",go:function(){$.ajax({url:"http://api.twitter.com/1/statuses/user_timeline.json/",type:"GET",dataType:"jsonp",data:{screen_name:twitterfeed.user,count:twitterfeed.numTweets,include_entities:true,exclude_replies:true},success:function(a,b,c){StyleUsers=function(a,b){var c=b;for(var d=0;d<a.length;d++){var e=a[d].indices[0];var f=a[d].indices[1]-e;var g=b.substr(e,f);var h='<a class="twitteruserlink" href="http://twitter.com/#!/'+g.substr(1)+'">'+g+"</a>";c=c.replace(g,h);var h='<a href="http://twitter.com/#!/'+g.substr(1)+'"><span class="twitteruserlink">'+g+"</span></a>";c=c.replace(g,h)}return c};StyleHashTags=function(a,b){var c=b;for(hashtagindex in a){hashtagstr="#"+a[hashtagindex].text;c=c.replace(hashtagstr,'<a href="http://twitter.com/#!/search?q=%23'+a[hashtagindex].text+'"><span class="hashtag">'+hashtagstr+"</span></a>")}return c};StyleUrls=function(a,b){var c=b;for(urlindex in a){urlstr=a[urlindex].url;c=c.replace(urlstr,'<a href="'+urlstr+'"><span class="archivetweetlink">'+a[urlindex].display_url+"</span></a>")}return c};$(twitterfeed.appendTo).append('<hr><h1 style="font-size:24px;margin-top:0px;margin-bottom:0px;">Twitter</h1><div id="tweetheadblock"><span id="justberrylogo"></span><span class="tweetheadslogan">In Laundry Rooms Everywhere</span><span class="tweetheadusername"><a href="http://twitter.com/#!/berryplusclean">@BerryPlusClean</a></span></div>');for(var d=0;d<3;d++){var e='<hr><div class="sidebarentry" date="xDATEx"><span class="archivepostcontent archivetweet"><p style="text-align:left;font-size:16px;margin-bottom:0px;padding-bottom:0px;">xTWEETx</p></span></div>';e=e.replace("xDATEx",a[d].created_at);var f=a[d].text;if(a[d].entities.user_mentions){f=StyleUsers(a[d].entities.user_mentions,a[d].text)}if(a[d].entities.hashtags){f=StyleHashTags(a[d].entities.hashtags,f)}if(a[d].entities.urls){f=StyleUrls(a[d].entities.urls,f)}linksml='<span class="archivetweetoperations"><a class="atopadding" href="http://twitter.com/intent/tweet?in_reply_to=TWEETID">reply</a><a class="atopadding" href="http://twitter.com/intent/retweet?tweet_id=TWEETID">retweet</a><a href="http://twitter.com/intent/favorite?tweet_id=TWEETID">favorite</a></span>';linksml=linksml.replace(/TWEETID/g,a[d].id_str);e=e.replace("xTWEETx",f);e=e+linksml;$(twitterfeed.appendTo).append(e)}if($("#sidebarwrapper").height()+20>$("#maincontentwrapper").height()){$("#maincontentwrapper").css("height",$("#sidebarwrapper").height()+20+"px");if($("#content").height()>$("#maincontentwrapper").height()){$("#maincontentwrapper").css("height",$("#content").height()+16+"px")}}}})}};var sidebarFix=function(){if($("#maincontentwrapper").height()<$("#sidebarwrapper").height()+140){$("#maincontentwrapper").css("height",$("#sidebarwrapper").height()+140+"px")}if($("#content").height()>$("#maincontentwrapper").height()){$("#maincontentwrapper").css("height",$("#content").height()+16+"px")}};$(document).ready(function(){fix_flash();$("#nav").children("a").children("img").hover(function(){this.src=this.src.replace("\nLink","LinkOver")},function(){this.src=this.src.replace("LinkOver","Link")});$(".subnav ul li").hover(function(){alert($(this).children().children().trigger("mou\nseenter"))},function(){alert($(this).children().children().trigger("mouseout"))});$(".subnav ul li a img").hover(function(){this.src=this.src.replace("Link.","LinkOver.")},function(){this.src=this.src.replace("LinkOver.","Link.")});if($("#content").height()>$("#maincontentwrapper").height()){$("#maincontentwrapper").css("height",$("#content").height()+15+"px")}twitterfeed.go()})

