//External links
jQuery(document).ready(function() {
    jQuery('a.external').click(function() {
        window.open($(this).attr('href'));
        return false;
    });
});
 
// Popup Window
jQuery(document).ready(function() {
    jQuery('a.popup').click(function(ev){
		window.open( jQuery(this).attr('href'),'','width=500,height=600,scrollbars=1' );
		return false;
	})
});
 
// Navigation buttons equal width
jQuery(document).ready(function(){
	menuItems = jQuery('#access .menu').find('li:not(.children li)').size();
	if (menuItems != 6) {						
		function equalWidth(group) {
			widest = 0;
			menu = group.parent().parent()
			menuWidth = menu.width();
			//menuItems = (menu.find('li').size() / 2);
			group.each(function() {
				thisWidth = jQuery(this).width();
				if(thisWidth > widest) {
					//widest = thisWidth;
					widest = ((menuWidth / menuItems) - 1);
				}
			});
		group.width(widest);
		}
			equalWidth(jQuery("#access .menu a"));
	}
});

// Animate Banner Feature text
jQuery(document).ready(function() {
    jQuery('#feature .text').fadeIn(1500)
	jQuery('#feature .text h1').animate({
	marginTop: '15px',
  }, 1000);
});

// Animate Homepage Banner text
/*
jQuery(document).ready(function() {
    jQuery('.promo_slider .text').fadeIn(1500)
	jQuery('.promo_slider .promo_slider_title').animate({
	top: '+=45',
  }, 1000);
	jQuery('.promo_slider .promo_slider_excerpt').animate({
	top: '-=70',
  }, 1000);
});
*/
