/*
	*** SVA zHosting ***
	jQuery Enhancement JavaScript for SVA zHosting
	(c) Mareike Hybsier - http://www.die-programmiererin.de
*/

$(function() {
	
	// Add hover functions to all navigation elements (nested ul elements)
	$(".hover").hover(function() { $('#ul_' + this.id).show(); }, function() { $('#ul_' + this.id).hide(); });
	
	// Add hover function to all tooltip elements
	$(".tooltip").hover(function() { $('#tooltip_' + extract(this.id)).show(); }, function() { $('#tooltip_' + extract(this.id)).hide(); });
	
	// Hide the additional columns in registration form
	$("table#more_address_data").hide();
	$("table#questionary").hide();
	
	// Add show/hide functions to the additional columns in registration form
	$("a#show_more_address_data").click(function() {
		$("table#more_address_data").show();
		$("a#hide_more_address_data").show();
		$("a#show_more_address_data").hide();
	});
	$("a#hide_more_address_data").click(function() {
		$("table#more_address_data").hide();
		$("a#show_more_address_data").show();
	});
	$("a#show_questionary").click(function() {
		$("table#questionary").show();
		$("a#hide_questionary").show();
		$("a#show_questionary").hide();
	});
	$("a#hide_questionary").click(function() {
		$("table#questionary").hide();
		$("a#show_questionary").show();
	});
	
	// Utility function			  
	function extract (id) { return id.split('_')[1]; }
});
