var ua = jQuery.browser; /******************************* * Equal Height Columns Function ******************************/ function bfa_equal_columns() { jQuery('.ehc').each( function() { var row = jQuery(this); if ( ua.msie && parseInt( ua.version, 10 ) < 8 ) { var height = row.outerHeight(); // outerheight for IE < 8 } else { // var height = row.height(); var height = row.outerHeight(); } row.find('> div').each( function() { jQuery(this).height( height ); }); }); } function bfa_video_resize() { jQuery('.row > div, .row5 > div, .lw').each( function() { var col = jQuery(this), p = col.find('.post').first(), bc = p.find('.post-bodycopy'), maxWidth = col.width() - ( p.outerWidth() - p.width() ) - ( bc.outerWidth() - bc.width() ); col.find('embed, iframe').each( function() { var video = jQuery(this), videoWidth = video.attr('width'); if( videoWidth > maxWidth ) { videoHeight = video.attr('height'), videoMaxHeight = ( maxWidth / videoWidth * videoHeight ); video.attr({ width: maxWidth, height: videoMaxHeight }); } }); }); } function bfa_img_grayscale() { jQuery('.post-thumb img').each(function(){ var el = jQuery(this); el.css({'position':'absolute'}) .wrap("
") .clone().addClass('img_grayscale') .css({'position':'absolute','z-index':'998','opacity':'1.0'}) .insertBefore(el) .queue(function(){ var el = jQuery(this); el.parent().css({'width':this.offsetWidth,'height':this.offsetHeight }); el.dequeue(); }); }); } /******************************* * Grayscale post thumbs ******************************/ jQuery(window).load(function() { if( jQuery(window).width() > 959 ) { bfa_img_grayscale(); } }); /******************************* * Run on resize ******************************/ jQuery(window).resize(function() { bfa_video_resize(); bfa_equal_columns(); }); WebFontConfig = { // google: { families: [ 'Yanone Kaffeesatz:400,300,200,700', 'Gruppo', 'Droid Sans:normal,bold' ] }, google: { families: ["Yanone+Kaffeesatz:400,200"] }, fontactive: function(fontFamily, fontDescription) { // Avoids 'FOUC' - Flash of unstyled content in Firefox, Set 'body { opacity: 0 }' in CSS stylesheet jQuery('body').css('opacity', 1); bfa_equal_columns(); } }; (function() { var wf = document.createElement('script'); wf.src = ('https:' == document.location.protocol ? 'https' : 'http') + '://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js'; wf.type = 'text/javascript'; wf.async = 'true'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(wf, s); })(); jQuery(document).ready(function($) { if( $('body').css('opacity') == 0 ) { $('body').css('opacity', 1); } // A class for zebra-striped table rows $('.hentry table tr:nth-child(even), .comment-text table tr:nth-child(even)').addClass('alternate'); if( jQuery().colorbox ) { $('.gallery figure a span').colorbox({rel: 'gal', slideshow: true, slideshowSpeed: 3500, opacity: 0.7, href: function(){ var src = $(this).prev('img').attr('src').replace( /-\d+x\d+./, '.' ); // full src = remove '-150x150' from thumb src return src; }}); } bfa_video_resize(); // Fade image if( $(window).width() > 959 ) { $('.hentry').hover( function(){ $(this).find('.img_grayscale').stop().animate({opacity:0}, 1000).next().stop().animate({opacity:1}, 700); }, function(){ $(this).find('.img_grayscale').stop().animate({opacity:1}, 1000).next().stop().animate({opacity:0}, 700); } ); } else { $('.hentry .post-thumb img').css('opacity', 1); } /** * jQuery Mobile Menu * Turn unordered list menu into dropdown select menu * version 1.0(31-OCT-2011) * * Built on top of the jQuery library * http://jquery.com * * Documentation * http://github.com/mambows/mobilemenu */ (function($){ $.fn.mobileMenu = function(options) { var defaults = { defaultText: 'Navigate to...', className: 'select-menu', subMenuClass: 'sub-menu', subMenuDash: '–' }, settings = $.extend( defaults, options ), el = $(this); this.each(function(){ // ad class to submenu list el.find('ul').addClass(settings.subMenuClass); // Create base menu $('