(function($){$.fn.footer=function(options)
{var opts=$.extend({},$.fn.footer.defaults,options);return this.each(function()
{var $footer=$(this);var _footer=this;_footer.isheropage=($('div.homepage-content,div.category-content').length>0);_footer.hasrightrail=($('div.right-rail').length>0)
if(!_footer.isheropage)
{$footer=$footer.remove().clone();$footer.appendTo('.container');}
else
{$footer.addClass('hero-footer');}
$footer.find('> ul > li > a').not(':last').after('&nbsp;|&nbsp;');$footer.find('> ul > li > ul').parent('li').find('> a').addClass('up').parent('li').hover(function()
{$(this).children('ul').show();},function()
{$(this).children('ul').hide();});$footer.find('> ul > li > ul').prepend('<span class="top"></span>');$footer.find('> ul > li > span').click(function()
{$(this).parent('li').children('ul').show();});$footer.find('> ul > li > span').parent('li').hover(function()
{return true;},function()
{$(this).children('ul').hide();});$footer.find('ul.global > li').addClass('region').hover(function()
{$(this).addClass('hover').children('ul').show();},function()
{$(this).removeClass('hover').children('ul').hide();});$footer.find('ul.global > li > ul').prepend('<span class="top"></span>');$footer.css({visibility:'visible'});$footer.bind("footer:resize",function()
{if(_footer.isheropage)
{var _left=236;var _window=$(window).width();var _margin=_window-opts.footerWidth-opts.leftMargin;(_footer.hasrightrail)?_margin-=opts.rightMargin:null;((_margin/2)>0)?_left+=(_margin/2):null;$footer.css({left:_left});}}).trigger("footer:resize");});};$.fn.footer.defaults={footerWidth:713,leftMargin:236,rightMargin:120};})(jQuery);