function renderBMANHat(b){function a(h){var e=false;var g=document.getElementsByTagName("head")[0];var f=document.createElement("link");f.setAttribute("href","http://hat.bmanpn.com/static/app/v1/global/css/bmanhat2.css");f.setAttribute("rel","stylesheet");var d=document.createElement("script");d.setAttribute("src","http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js");d.onload=d.onreadystatechange=function(){if(!e&&(!this.readyState||this.readyState=="complete"||this.readyState=="loaded")){e=true;h();d.onload=d.onreadystatechange=null;g.removeChild(d)}};g.appendChild(d);g.appendChild(f)}function c(d){a(function(){d(jQuery.noConflict(true))})}c(function(j){j.fn.extend({everyTime:function(r,s,t,u){return this.each(function(){j.timer.add(this,r,s,t,u)})},oneTime:function(r,s,t){return this.each(function(){j.timer.add(this,r,s,t,1)})},stopTime:function(r,s){return this.each(function(){j.timer.remove(this,r,s)})}});j.extend({timer:{global:[],guid:1,dataKey:"$.timer",regex:/^([0-9]+(?:\.[0-9]*)?)\s*(.*s)?$/,powers:{ms:1,cs:10,ds:100,s:1000,das:10000,hs:100000,ks:1000000},timeParse:function(t){if(t==undefined||t==null){return null}var r=this.regex.exec(j.trim(t.toString()));if(r[2]){var s=parseFloat(r[1]);var u=this.powers[r[2]]||1;return s*u}else{return t}},add:function(u,s,t,w,y){var r=0;if(j.isFunction(t)){if(!y){y=w}w=t;t=s}s=j.timer.timeParse(s);if(typeof s!="number"||isNaN(s)||s<0){return}if(typeof y!="number"||isNaN(y)||y<0){y=0}y=y||0;var x=j.data(u,this.dataKey)||j.data(u,this.dataKey,{});if(!x[t]){x[t]={}}w.timerID=w.timerID||this.guid++;var v=function(){if((++r>y&&y!==0)||w.call(u,r)===false){j.timer.remove(u,t,w)}};v.timerID=w.timerID;if(!x[t][w.timerID]){x[t][w.timerID]=window.setInterval(v,s)}this.global.push(u)},remove:function(t,s,u){var v=j.data(t,this.dataKey),r;if(v){if(!s){for(s in v){this.remove(t,s,u)}}else{if(v[s]){if(u){if(u.timerID){window.clearInterval(v[s][u.timerID]);delete v[s][u.timerID]}}else{for(var u in v[s]){window.clearInterval(v[s][u]);delete v[s][u]}}for(r in v[s]){break}if(!r){r=null;delete v[s]}}}for(r in v){break}if(!r){j.removeData(t,this.dataKey)}}}}});j(window).bind("unload",function(){j.each(j.timer.global,function(r,s){j.timer.remove(s)})});var f=window.location;if(j("#bmanhat-votd").length!=0){j("#bmanhat-votd").css("margin-left","0");j("#bmanhat-votd").css("display","block")}else{j(document).ready(function(){j("#bmanhat-votd").css("margin-left","0");j("#bmanhat-votd").css("display","block")})}o();k(f);l(f);function e(s){j("#bmanhat-dropdown-top").attr("onMouseOver","_gaq.push(['bmanhat._trackEvent', 'hover', 'break_media', '"+s+"']);");var t=j("#bmanhat-sites-breakmedia").attr("href");j("#bmanhat-sites-list li a").each(function(){var u=j(this).text();j(this).attr("onClick","_gaq.push(['bmanhat._trackEvent', 'click', '"+u+"', '"+s+"']);")});var r="_gaq.push(['bmanhat._trackEvent', 'click', 'navigate_featured', '"+s+"']);";j("#bmanhat-leftarrow").attr("onClick",r);j("#bmanhat-rightarrow").attr("onClick",r);j(document).ready(function(){j("#bmanhat-featured-list li a").each(function(){var u=j(this).attr("href");j(this).attr("onClick","_gaq.push(['bmanhat._trackEvent', 'click', '"+u+"', '"+s+"']);")})});j("#bmanhat-sharing-facebook").attr("onClick","_gaq.push(['bmanhat._trackEvent', 'click', 'facebook', '"+s+"']);");j("#bmanhat-sharing-twitter").attr("onClick","_gaq.push(['bmanhat._trackEvent', 'click', 'twitter', '"+s+"']);");j("#bmanhat-sharing-digg").attr("onClick","_gaq.push(['bmanhat._trackEvent', 'click', 'digg', '"+s+"']);");j(document).ready(function(){j("#bman_feature").prepend('<div id="bmanhat-votd-mouseover"></div>');j("#bmanhat-votd-mouseover").attr("onMouseOver","_gaq.push(['bmanhat._trackEvent', 'hover', 'video_of_the_day', '"+s+"']);");j(".bman_feature_tip_desc").attr("onClick","_gaq.push(['bmanhat._trackEvent', 'click', 'video_of_the_day', '"+s+"']);")})}function o(){var r='<div id="bmanhat-sites">';r+='<div id="bmanhat-sites-list">';r+='<span id="bmanhat-sites-title"></span>';r+='<span id="bmanhat-dropdown-top"><span id="bmanhat-sites-breakmedia">Break Media</span></span>';r+="<ul>";r+='<li><img src="http://hat.bmanpn.com/static/live/v1/img/bmanhat/logos/break.jpg" /><a href="http://www.break.com">Break.com</a></li>';r+='<li><img src="http://hat.bmanpn.com/static/live/v1/img/bmanhat/logos/mademan.jpg" /><a href="http://www.mademan.com">Mademan</a></li>';r+='<li><img src="http://hat.bmanpn.com/static/live/v1/img/bmanhat/logos/chickipedia.jpg" /><a href="http://www.chickipedia.com">Chickipedia</a></li>';r+='<li><img src="http://hat.bmanpn.com/static/live/v1/img/bmanhat/logos/holytaco.jpg" /><a href="http://www.holytaco.com">Holy Taco</a></li>';r+='<li><img src="http://hat.bmanpn.com/static/live/v1/img/bmanhat/logos/screenjunkies.jpg" /><a href="http://www.screenjunkies.com">Screen Junkies</a></li>';r+='<li><img src="http://hat.bmanpn.com/static/live/v1/img/bmanhat/logos/cagepotato.jpg" /><a href="http://www.cagepotato.com">Cage Potato</a></li>';r+='<li><img src="http://hat.bmanpn.com/static/live/v1/img/bmanhat/logos/allleftturns.jpg" /><a href="http://www.allleftturns.com">All Left Turns</a></li>';r+='<li><img src="http://hat.bmanpn.com/static/live/v1/img/bmanhat/logos/filefront.jpg" /><a href="http://www.gamefront.com">GameFront</a></li>';r+='<li><img src="http://hat.bmanpn.com/static/live/v1/img/bmanhat/logos/tuvez.jpg" /><a href="http://www.tuvez.com">Tu Vez</a></li>';r+="</ul>";r+='<span id="bmanhat-dropdown-bottom"></span>';r+="</div>";r+="</div>";j("#bmanhat-insidewrap").prepend(r)}function k(){var r='<div id="bmanhat-featured">';r+='<span id="bmanhat-leftarrow"></span>';r+='<span id="bmanhat-rightarrow"></span>';r+='<ul id="bmanhat-featured-list">';r+="</ul>";r+="</div>";j(r).insertAfter("#bmanhat-sites")}function l(){var t="http://www.facebook.com/sharer.php?u="+escape(f)+"&t=";t+=escape(j("title").html());t+="&src=sp";var v="javascript:window.open('"+t+"','fbWindow','menubar=1,resizable=1,width=626,height=436');";var u="http://twitter.com/home?status="+f;var r="javascript:window.open('"+u+"','twitterWindow','menubar=1,resizable=1,scrollbars=1,width=800,height=430');";var s='<div id="bmanhat-sharing">';s+='<span id="bmanhat-sharing-title" >Sharing</span>';s+='<span id="bmanhat-sharing-facebook" ><a href="javascript:void(0);" onclick="'+v+'">Facebook</a></span>';s+='<span id="bmanhat-sharing-twitter" ><a href="javascript:void(0);" onclick="'+r+'">Twitter</a></span>';s+='<span id="bmanhat-sharing-digg" ><a class="DiggThisButton DiggIcon"></a></span>';s+="</div>";j(document).ready(function(){j(s).appendTo("#bmanhat-insidewrap")})}var n="featuredlist";var q=1000;var i=250;var m={slideshowDelay:10000,pageNum:1,activeLI:0,totalLI:0,endOfList:false};h(true,f);function h(t,s){var r={};r.urlData={"http://break.com":"break-logo","http://www.break.com":"break-logo","http://horror.break.com":"break-logo","http://sports.break.com":"break-logo","http://holytaco.com":"holytaco-logo","http://www.holytaco.com":"holytaco-logo","http://screenjunkies.com":"screenjunkies-logo","http://www.screenjunkies.com":"screenjunkies-logo","http://cagepotato.com":"cagepotato-logo","http://www.cagepotato.com":"cagepotato-logo","http://allleftturns.com":"allleftturns-logo","http://www.allleftturns.com":"allleftturns-logo","http://filefront.com":"filefront-logo","http://www.filefront.com":"filefront-logo","http://news.filefront.com":"filefront-logo","http://mademan.com":"mademan-logo","http://www.mademan.com":"mademan-logo"};if(m.endOfList!=true){j.getJSON("http://service.break.com/breakhat/index/"+m.pageNum+"?callback=?",function(u){if(u.length>0){m.slideshowDelay=(u[0].SlideShowDelay*1000);j.each(u,function(C,v){var D="";if(v.IsGamTag==false){var y=/(https?:\/\/)([^\/]+)/;var z=v.Url.match(y);var E=/(mademan.com\/chickipedia\/)/i;var w=r.urlData[z[0].toLowerCase()];if(w!=undefined){if(v.Url.match(E)!=null){w="chickipedia-logo"}D='<span class="bmanhat-featured-logo" id="'+w+'"> on </span>'}j("#bmanhat-featured-list").append('<li><a href="'+v.Url+'">'+v.Title+D+"</a></li>")}if(v.IsGamTag==true){var x=v.GamTag;var B=x+"-container";j("#bmanhat-featured-list").append('<li id="'+B+'"></li>');j("#bmanhat-featured-list #"+B).attr("onClick","_gaq.push(['bmanhat._trackEvent', 'click', 'sponsored', '"+s+"']);");GA_googleAddSlot("ca-pub-8735055091446807",x);GA_googleFetchAds();GA_googleFillSlot(x);var A="#google_ads_div_"+x;j("head").append("<style>"+A+"{display:none;}</style>");j(document).ready(function(){var F=j(A).detach();F.appendTo("#"+B);j(A).css("display","inherit")})}});if(t==true){j("#bmanhat-featured li:eq(0)").css("display","list-item");p(m.slideshowDelay)}m.totalLI=j("#bmanhat-featured-list li").size()}else{m.endOfList=true}})}}function p(r){j(document).everyTime(r,n,function(){g("no")})}j("#bmanhat-leftarrow").click(function(){j(document).stopTime(n);d("yes");p(m.slideshowDelay)});j("#bmanhat-rightarrow").click(function(){j(document).stopTime(n);g("yes");p(m.slideshowDelay)});function d(r){if(r=="yes"){j("#bmanhat-featured li:eq("+m.activeLI+")").fadeOut(i)}else{j("#bmanhat-featured li:eq("+m.activeLI+")").fadeOut(q)}if(m.activeLI==0){m.activeLI=m.totalLI}m.activeLI=m.activeLI-1;j("#bmanhat-featured li:eq("+m.activeLI+")").fadeIn(q)}function g(r){if(r=="yes"){j("#bmanhat-featured li:eq("+m.activeLI+")").fadeOut(i)}else{j("#bmanhat-featured li:eq("+m.activeLI+")").fadeOut(q)}m.activeLI=m.activeLI+1;if(m.activeLI==(m.totalLI-3)&&m.endOfList!=true){m.pageNum=m.pageNum+1;h("false",f)}if(m.activeLI==m.totalLI){m.activeLI=0}j("#bmanhat-featured li:eq("+m.activeLI+")").fadeIn(q)}})}(function(){var b=document.createElement("SCRIPT"),a=document.getElementsByTagName("SCRIPT")[0];b.type="text/javascript";b.async=true;b.src="http://widgets.digg.com/buttons.js";a.parentNode.insertBefore(b,a)})();
