

// Expanding Navigation
jQuery(document).ready(function($) {
	$("ul#tabs:first > li").hover(function() {
		$(this).addClass('active');
		$('ul', this).show();
	}, function() {
		$(this).removeClass('active');
		$('ul', this).hide();
	});
});


// Generate index-links for selected pages [FAQ, Equipment]
jQuery(document).ready(function($) {
	if ($('body.faq, body.equipment').size() < 1) { return; }
	if ($('.format_text h2').size() < 1) { return; }
	
	var jList = '<div id="jumpList"><ul></ul></div>';
	$(jList).prependTo('div.format_text');
	$('.format_text h2').each(function (i, el) {
		var aText = $(el).html().replace(/ /g, "_");
		var aLink = '<a href="#" name="'+aText+'"></a>';
		$(el).before(aLink);
		var jLink = '<li><a href="#'+aText+'">'+$(el).html()+'</a></li>';
		$(jLink).appendTo('#jumpList ul');
	});
});


// Smooth scroll "back to top"
jQuery(document).ready(function($) {
	$('a.link2top').click(function () {
		$('html').animate({scrollTop:0}, 'slow');
		return false;
	});
});

// Portfolio Management Button
jQuery(document).ready(function($) {
	$('#ManagePortfolioPopup').click(function(e) {
		window.open("https://www.praemium.biz/pr_redirector/redirect.aspx?gid=cosgrove", 'pop', "fullsceen=yes, toolbar=no, menubar=no, scrollbars=yes, status=yes, resizable=yes");
	});
});