jQuery(function($){$('.blink').focus(function(){if(this.title==this.value){this.value='';}}).blur(function(){if(this.value==''){this.value=this.title;}});$(".posts-grid .post .post-meta .links .more .icon").click(function(){if($(this).hasClass('opened')){$('.tip:visible').hide();$('a.opened').removeClass("opened");$(".posts-grid .post").attr('style','');}else{$('.tip:visible').hide();$('a.opened').removeClass("opened");$(".posts-grid .post").attr('style','');$(this).addClass('opened');$(this).parents('.post').css('z-index','10');$(this).parent().find('.tip').show();}
return false;})
var classes=new Array('podcasts','live','goods','meltdown');$('#navigation > ul > li > a').each(function(){$(this).append('<span class="arrow"><span></span></span>');for(var i=classes.length- 1;i>=0;i--){if($(this).text().toLowerCase().indexOf(classes[i])!=-1){$(this).parent().addClass(classes[i]);}};});$('.top-categories > ul > li > a').each(function(){if('/category/'+ $(this).html().toLowerCase()+'/'==window.location.pathname||'/category/'+ $(this).html().toLowerCase()+'howto/'==window.location.pathname){$(this).addClass('selected');}});$('.wp-pagenavi').each(function(){if($('.previouspostslink',this).length&&$('.nextpostslink',this).length){$('.previouspostslink',this).appendTo($(this));$(this).append('<span class="dot">.</span>');$('.nextpostslink',this).appendTo($(this));}else{$('.previouspostslink',this).appendTo($(this));$('.nextpostslink',this).appendTo($(this));}
$('a, span',this).wrap('<div class="btn-wrap"></div>');});$('.widget_categories').addClass('widget-categories').append('<div class="cl"></div>');$('.widget-categories li:last, .top-categories li:last').addClass('last');$('#mode-grid').click(function(){$.cookie('mode','grid',{expires:365,path:'/'});location.reload();});$('#mode-full').click(function(){$.cookie('mode','full',{expires:365,path:'/'});location.reload();});$(".podcast_player").each(function(){mp3URL="/player/nerdistPlayer.swf?u="+ $(this).attr('rel');playerbox=$(this);$(this).flashembed({src:mp3URL,wmode:'transparent',onFail:function(){thefile=playerbox.attr('rel').split('&d=')[0];playerbox.html('<a href="'+ thefile+'"><img src="/wp-content/themes/nerdist/images/play.png" /></a>');playerbox.addClass('iPlayer');playerbox.click(function(){thefile=$(this).attr('rel').split('&d=')[0];location.href=thefile;});thefile='';}});});$(".big_number").each(function(){if($(this).html().length==1){$(this).css('fontSize','35px');}else if($(this).html().length==2){$(this).css('fontSize','');}else if($(this).html().length==3){$(this).css('fontSize','27px');}
topMargin=($(this).parent().height()- $(this).height())/2;$(this).css('marginTop',topMargin);});$('#performances').click(function(){if($(this).hasClass('selected')){$(this).removeClass('selected');$('.performance-sel').fadeOut('slow');}else{$(this).addClass('selected');$('.performance-sel').fadeIn('slow');}});$('#meltdown').click(function(){if($(this).hasClass('selected')){$(this).removeClass('selected');$('.meltdown-sel').fadeOut('slow');}else{$(this).addClass('selected');$('.meltdown-sel').fadeIn('slow');}});$('.single-pt_podcast .btn-wrap a').click(function(event){event.preventDefault();$page=$(this).attr('href').split('/');$.cookie($('#main').attr('class'),$page[6],{expires:365,path:'/'});location.reload();});});
