// function when we switch tabs
// show active content block, id name must have "-tab-content"
// if there are any detail content blocks, the base id name should be the same, with "-tab-detail"
function switch_tab(this_tab) {
		
		// populate these arrays dynamically if possible
		var tab_names = new Array("overview","funddata","distributions","pricing","performance","holdings","management","literature","mtp");
		var tab_detail_names = new Array("distributions1","distributions2","pricing1","performance1");

		// hide all detail content blocks
//		for (j=0; j<tab_detail_names.length; j++) {
//			hide_content(tab_detail_names[j] + "-tab-detail");
//		}
		
		// do the tab switch function
		for (i=0; i<tab_names.length; i++) {
			if (this_tab == tab_names[i]) {
				//show_content(tab_names[i] + "-tab-content");
				show_content("tab-" + tab_names[i] + "-active");
				hide_content("tab-" + tab_names[i] + "-inactive");
			} else {		
				//hide_content(tab_names[i] + "-tab-content");
				hide_content("tab-" + tab_names[i] + "-active");
				show_content("tab-" + tab_names[i] + "-inactive");
			}
		}
		
		
	}
	
// function for switching layers within a tab
function switch_layer(this_tab,layer_num,total) {
	if (layer_num == 0) {
		show_content(this_tab + "-tab-content");
	} else {
		hide_content(this_tab + "-tab-content");
	}
	for (i=1; i<=total; i++) {
		if (layer_num == i) {
			show_content(this_tab + i.toString() + "-tab-detail");
		} else {
			hide_content(this_tab + i.toString() + "-tab-detail");
		}
	}
	
}

// function specifically for top 10 issuers/holdings data point in holdings & detail
function toggle_holdings() {
	if (document.getElementById("issuers-table").style.display == "block") {
		show_content('holdings-table');
		hide_content('issuers-table');
	} else {
		show_content('issuers-table');
		hide_content('holdings-table');
	}
		
}
	
