

var g_span = null;
var g_span_link = null;
var g_span_tab = null;
var g_span_pics = null;

var g_faq = null;
var g_faq_link = null;

function init_spans(default_text) {
	
	var text;
	var query = document.location.search;
	
	if (query) {
		text = query.substring(1, query.length); 
	} else {
		text = default_text;
	}
	
	g_span = document.getElementById (text)
	g_span.style.display = "block";
	
	g_span_link = document.getElementById (text+ "_link");
	g_span_link.className = "current_link";
	
	g_span_tab = document.getElementById (text +"_tab");
	g_span_tab.className = "current_tab";
	
	g_span_pics = document.getElementById (text+"_pics");
	if (g_span_pics) {
		g_span_pics.style.display = "block";
	}

}

function show_tree (link, text) {
		
	var branch = document.getElementById(text + "_content");
	
	if (branch.style.display == "block") {
		branch.style.display = "none";
	} else {
		branch.style.display = "block";
	}
		
}


function show_span(link) {

	if (g_tooltip_showing) {
		hide_tooltip();
	}

	// if tab is current, do nothing
	if (g_span_link == link) {
		return;
	} else { // change the tab class; hide the current span and show the one clicked

		var text = link.search.substring(1, link.search.length);
		
		// hide current class and change tab to noncurrent
		g_span_link.className = "noncurrent_link";
		g_span_tab.className = "noncurrent_tab";
		g_span.style.display = "none";
		if (g_span_pics) {
			g_span_pics.style.display = "none";
		}
			
		g_span = document.getElementById(text);
		g_span_link = link;
		g_span_tab = document.getElementById (text+"_tab");
		
		g_span_tab.className = "current_tab";
		g_span_link.className = "current_link";
		g_span.style.display = "block";
		
		g_span_pics = document.getElementById (text+"_pics");
		if (g_span_pics) {
			g_span_pics.style.display = "block";
		}
		
	}

}

function spamSpoiler (user, subject, span_id, span_content, domain, dtype) {
	
	document.write('<a href=\"mailto:' + escape(user) + '@' + escape(domain) + '.' + escape(dtype) + '?subject=' + escape(subject) + '\">' + span_content + '</a>');
	var span = document.getElementById(span_id);
	span.style.display="none";

}