function home_view(display){createCookie('home_view',display,30);$("select#briefs_pref").val(display);if(display=='always')
{$('.brief_home').css('display','block');$('.brief_home').css('min-height','80px');$('.shortheadline').accordion('disable');}
else
{$('.brief_home').css('display','none');$('.shortheadline').accordion('enable');$('.shortheadline').accordion('activate',false);$('.shortheadline').accordion('destroy');$('.shortheadline').accordion({active:false,header:'.headline_home',collapsible:true,autoHeight:false,event:display,animated:'slowslide',changestart:function(event,ui){$('.brief_home').css('min-height','0')},change:function(event,ui){$('.brief_home:visible').css('min-height','80px');$('.headline_home').blur();}});}}
$(document).ready(function(){$.tmo_home={};$.tmo_home.home_view=readCookie('home_view');if($.tmo_home.home_view==null||$.tmo_home.home_view==''||$.tmo_home.home_view===null||$.tmo_home.home_view=='top3')
{$.tmo_home.home_view="divclick";}
$("select#briefs_pref").val($.tmo_home.home_view);jQuery.event.special.divclick={setup:function(data,namespaces){var elem=this,$elem=jQuery(elem);$elem.bind('click',jQuery.event.special.divclick.handler);},teardown:function(namespaces){var elem=this,$elem=jQuery(elem);$elem.unbind('click',jQuery.event.special.divclick.handler);},handler:function(event){var elem=this,$elem=jQuery(elem),clicks=$elem.data('clicks')||0;clicks+=1;var originalElement=event.srcElement;if(event.target)originalElement=event.target;if(!originalElement){originalElement=event.originalTarget;}
if(originalElement.nodeName.toLowerCase()!='a'){clicks=0;event.type="divclick";jQuery.event.handle.apply(this,arguments)}
$elem.data('clicks',clicks);}};var cfg=($.hoverintent={sensitivity:10,interval:600});$.event.special.hoverintent={setup:function(){$(this).bind("mouseover",jQuery.event.special.hoverintent.handler);},teardown:function(){$(this).unbind("mouseover",jQuery.event.special.hoverintent.handler);},handler:function(event){event.type="hoverintent";var self=this,args=arguments,target=$(event.target),cX,cY,pX,pY;function track(event){cX=event.pageX;cY=event.pageY;};pX=event.pageX;pY=event.pageY;function clear(){target.unbind("mousemove",track).unbind("mouseout",arguments.callee);clearTimeout(timeout);}
function handler(){var originalElement=event.srcElement;if(event.target)originalElement=event.target;if(!originalElement){originalElement=event.originalTarget;}
if(((Math.abs(pX-cX)+Math.abs(pY-cY))<cfg.sensitivity)&&originalElement.nodeName.toLowerCase()!='a'){clear();jQuery.event.handle.apply(self,args);}else{pX=cX;pY=cY;timeout=setTimeout(handler,cfg.interval);}}
var timeout=setTimeout(handler,cfg.interval);target.mousemove(track).mouseout(clear);return true;}};if($.tmo_home.home_view!="always")
{$('.shortheadline').accordion({active:false,header:'.headline_home',collapsible:true,autoHeight:false,event:$.tmo_home.home_view,animated:'slowslide',changestart:function(event,ui){$('.brief_home').css('min-height','0')},change:function(event,ui){$('.brief_home:visible').css('min-height','80px');$('.headline_home').blur();}});}
else
{$(".brief_home").css('display','block');$(".brief_home").css('min-height','80px');}
$('.headline_home').hover(function(){if(($("#briefs_pref option:selected").val()=="divclick")&&$(this).next().css('display')!="block"){$(".timestamp_home",this).css('background','url(/imgs/site_images/tmo/more.png) no-repeat left top');$(".title_home",this).css('background','url(/imgs/site_images/tmo/more2.png) no-repeat right top');}},function(){$(".timestamp_home",this).css('background','');$(".title_home",this).css('background','');});$(".brief_home").hover(function(){$(this).prev().css('background','#eed');},function(){$(this).prev().css('background','');});$.extend($.ui.accordion.animations,{slowslide:function(options){$.ui.accordion.animations.slide(options,{duration:600});}});$(window).bind("resize",hideShowBadges);function hideShowBadges(e){var newWindowWidth=$(window).width();if(newWindowWidth>1320)
{$(".jcarousel-container-horizontal").css("width","930px");}
else
{$(".jcarousel-container-horizontal").css("width","620px");}}
$('#mycarousel').jCarouselLite({btnNext:".next",btnPrev:".prev",auto:6500,speed:1000,visible:2,pauseOnHover:true});$('.badgecont').hover(function(){$(this).find('.cattxt').fadeOut("fast");$(this).find('.headline').fadeOut("fast");$(this).find('.badge-teas').fadeIn("fast");},function(){$(this).find('.cattxt').fadeIn("fast");$(this).find('.headline').fadeIn("fast");$(this).find('.badge-teas').fadeOut("fast");});$('.headline').each(function(){var targetHeight=50;if(isNaN(parseInt($(this).css("font-size"))))
$(this).css("font-size",'24px');while($(this).height()>targetHeight&&parseInt($(this).css("font-size"))>12)
{$(this).css("font-size",(parseInt($(this).css("font-size"))-1)+'px');}});$(".cattxt").each(function(){var targetWidth=200;if(isNaN(parseInt($(this).css("font-size"))))
$(this).css("font-size",'16px');while($(this).width()>targetWidth&&parseInt($(this).css("font-size"))>14)
{$(this).css("font-size",(parseInt($(this).css("font-size"))-1)+'px');}});});
