/* Copyright (C) YOOtheme GmbH, YOOtheme Proprietary Use License (http://www.yootheme.com/license) */

jQuery(function($){var relativeTime=function(time_value){var parsed_date=new Date(Date.parse(time_value.replace(/(\d+)-(\d+)-(\d+)T(.+)([-\+]\d+):(\d+)/g,"$1/$2/$3 $4 UTC$5$6")));var relative_to=arguments.length>1?arguments[1]:new Date;var delta=parseInt((relative_to.getTime()-parsed_date)/1e3);if(delta<60){return $widgetkit.trans.get("LESS_THAN_A_MINUTE_AGO")}else if(delta<120){return $widgetkit.trans.get("ABOUT_A_MINUTE_AGO")}else if(delta<45*60){return $widgetkit.trans.get("X_MINUTES_AGO",parseInt(delta/60).toString())}else if(delta<90*60){return $widgetkit.trans.get("ABOUT_AN_HOUR_AGO")}else if(delta<24*60*60){return $widgetkit.trans.get("X_HOURS_AGO",parseInt(delta/3600).toString())}else if(delta<48*60*60){return $widgetkit.trans.get("ONE_DAY_AGO")}else{return $widgetkit.trans.get("X_DAYS_AGO",parseInt(delta/86400).toString())}};$(".wk-twitter time").each(function(){$(this).html(relativeTime($(this).attr("datetime")))});var bubbles=$(".wk-twitter-bubbles");if(bubbles.length){var matchBubblesHeight=function(){bubbles.each(function(){var maxheight=0;$(this).find("p.content").each(function(){var h=$(this).height();if(h>maxheight)maxheight=h}).css("min-height",maxheight)})};matchBubblesHeight();$(window).bind("load",matchBubblesHeight)}});