jQuery(function($) { /** * Fix for absolute 100% height/width in IE6 * @see http://www.alistapart.com/articles/conflictingabsolutepositions/ */ $('.a-block').each(function(){ var $this = $(this); var height = $this.height(); $this.height(height); $this.find('a').height(height); }); /** * Collapsibles */ $('.box-collapsible > .title a').click(function(){ $this = $(this); $this.parent().next().slideToggle('fast'); $this.parents('.box-collapsible').toggleClass('box-collapsible-is-collapsed'); return false; }); $.placeholders({ 'classname': 'placeholder' }); $('#nav-sub li').hoverFix(); MQ.menu(); MQ.ajax.postContent(); MQ.boxF(); }); // MapQuest functions ;(function($) { // MQ global object defined in script block above MQ = MQ || {}; MQ.ajax = {}; MQ.ajax.loading = function() { return '
'; }; MQ.ajax.postContent = function() { $('.lst-a .pst-compact > a').unbind().click(function() { var $this = $(this); var $target = $this.parents('li'); var $postWrap = $this.parents('.pst-compact'); var postId = $postWrap.attr('id').replace('pst-', ''); $postWrap.append(MQ.ajax.loading()); $target.load(MQ.url + 'index.php?mq_action=post_content&template=pst_content&id=' + postId, function() { $target.hide().slideDown('fast'); }); return false; }); }; MQ.menu = function() { $hasMenu = $('#nav-site .has-menu-a'); $menu = $hasMenu.find('> li > .menu'); $menu.hide(); $hasMenu.find('> li.more > .label').click(function(){ $hasMenu.toggleClass('has-menu-a-is-open'); $menu.toggle(); return false }); $('body').click(function(){ $hasMenu.removeClass('has-menu-a-is-open'); $menu.hide(); }); }; /** * IE6 fix for .box-f footer widths */ MQ.boxF = function() { var $footer = $('.has-box-f-footer-b > .footer'); if ($footer.length == 0) { return false; }; $footer.each(function(){ var $this = $(this); var diff = $this.outerWidth() - $this.width(); var parentWidth = $this.parent().width(); $this.width(parentWidth - diff); }); }; })(jQuery); /* * hoverFix 1.0 * Crowd Favorite */ ;(function($) { $.fn.hoverFix = function(classname) { var c = classname || 'hover'; this.hover(function(){ $(this).addClass(c); }, function(){ $(this).removeClass(c); }); }; })(jQuery);