FLIR.init({path:epic.cdn_url+'facelift/'});(function($){function rotateSlide(span,list){var d=list.data('d');if(d.moving)return;if(span!=null&&span.className=='left')var dir='l';else var dir='r';d.moving=true;var items=list.children('li');margin='-'+d.width+'px';var item=items.get(0);if(dir=='l'){item=items.get(items.length-1);var p=item.parentNode;p.removeChild(item);$(item).css('marginLeft',margin);p.insertBefore(item,items.get(0));margin='0px';}
$(item).animate({marginLeft:margin},d.speed,'easeOutExpo',function(){d.moving=false;if(dir=='r'){var n=items.get(0);var p=n.parentNode;p.removeChild(n);$(n).css('marginLeft','');p.appendChild(n);}
if(d.autoRotate){d.timer=setTimeout(function(){rotateSlide(null,list);},d.autoRotate);}});if(span!=null){if(d.timer)clearTimeout(d.timer);d.autoRotate=false;}}
function makeSlide(list,options){var s=$(list);var h=0;var w=0;var tw=0;s.find('img').each(function(idx,item){var t=item.height;if(t>h)h=t;t=item.width;if(t>w)w=t;tw+=w;});s.wrap('<div class="slide" style="height: '+h+'px; width: '+w+'px;"></div>');s.before('<span class="left"></span>').after('<span class="right"></span>');s.css('width',tw+'px');var i=s.children();i.each(function(idx,o){$(o).css('float','left');});var d=$.extend({width:w,height:h,list:s,current:0,autoRotate:2000,speed:1000},options);var s=$(s).data('d',d);s.parent().find('span').click(function(){rotateSlide(this,s);});if(d&&d.autoRotate){s.data('d').timer=setTimeout(function(){rotateSlide(null,s);},d.autoRotate);}}
$.fn.quickSlide=function(options){this.each(function(idx,obj){makeSlide(obj,options);});}
$.fn.niceQuotes=function(){var fs=new FLIRStyle({cFont:'futura-book-oblique',realFontHeight:true,cSize:20,mode:'wrap'});this.each(function(idx,obj){var h=$(obj).html();$(obj).html($.trim(h).replace('`','<img src="/img/open-quote.png">').replace('´','<img src="/img/close-quote.png">'));FLIR.replace(this,fs);});};$('blockquote').niceQuotes();$('ul.slide').quickSlide();})(jQuery);;(function($){var _currentNews=0;var _news=$('#news div').each(function(i,d){d.style.zIndex=1000-i;});function showPrevious(){}
function showNext(e){e.stopImmediatePropagation();_currentNews=(_currentNews+1)%_news.length;for(var i=0;i<_news.length;i++){if(i==_currentNews)_news.get(i).style.zIndex=1000;else _news.get(i).style.zIndex=999;}}
function showPrevious(e){e.stopImmediatePropagation();_currentNews=(_currentNews-1)%_news.length;for(var i=0;i<_news.length;i++){if(i==_currentNews)_news.get(i).style.zIndex=1000;else _news.get(i).style.zIndex=999;}}
$('#news .prev').click(showPrevious);$('#news .next').click(showNext);})(jQuery);