// For the HTML templates. The ASPX pages use ~ on the master page.
if (typeof ROOT_URL == 'undefined'){ ROOT_URL = '../';}


// POPUPS
// target="_blank" in xhtml documents
jQuery(function($) { 
	$("a[rel~='external']").click(function(){
		window.open($(this).attr("href"));
		return false;
	});
});	


// COLLAPSE the FAQs
jQuery(function($) { 
	$(".faqBody").hide();
	$(".faqHead").click(function(e){
		var faq = $(this).parents('.faq');
		faq.toggleClass('expanded')
			.find('.faqBody').slideToggle(200);
		var icon = faq.find('.faqExpandCollapse img').attr('src');
		icon = (icon.indexOf('expand') != -1) ? icon.replace('expand','collapse') : icon.replace('collapse','expand');
		faq.find('.faqExpandCollapse img').attr('src',icon);		
		return false;
	});
});	


// TABS for the pricing page
jQuery(function($) { 
	$("#feeTabs #tabs a").click(function(e){
		var tab = $(this).parents('li');
		tab.siblings().removeClass('selected');
		tab.addClass('selected');
		tab.find('a').blur();
		var index = $("#feeTabs #tabs li").index(tab);
		var contents = $("#feeTabsContent div[id^=tab]");
		contents.removeClass('expanded');
		contents.addClass('collapsed');
		$(contents.get(index)).addClass('expanded');
		return false;										   
	});
});	


// FORCE the content box to always be as tall as the sidebar. 
jQuery(function($) {
	var sidebar = $('#sidebar');
	if (sidebar.length) { 
		$("#box .inner").css('min-height', sidebar.height());
	}
});	

