function toggle_tab(tab, task, focus_tab, hide_errors, extras)
	{ 
	extras=typeof(extras)!='undefined'?extras:'';

	if (tab==focus_tab)
		{
		return window.location='index.php?task='+task+'&tab='+focus_tab+extras;
		}

	// clear all errors
	if (hide_errors)
		{
		changed=false;
		$$("#spbas .success, #spbas .error").each(function(element)
			{
			element.remove();
			changed=true;
			});

		if (changed)
			{
			$$("#spbas div.inner_tab_content").each(function(element)
				{
				element.setStyle({'marginTop': '-12px'});
				});
			}
		}

	// set all to off
	$$("#inner_tab_container a.on").each(function(element)
		{
		element.toggleClassName('on');
		});

	// set all to off
	$$("#spbas div.inner_tab_content").each(function(element)
		{
		element.hide();
		});

	// set the target tab to focus
	tab_focus='tab_'+tab;
	$(tab_focus).toggleClassName('on');
	$(tab).show();
	}

function toggle_login_resend(focus_group)
	{
	if (focus_group=='resend_group')
		{
		$('resend_group').show();
		$('login_group').hide();
		$('resend_email').value=$('login_email').value;
		}
	else
		{
		$('resend_group').hide();
		$('login_group').show();
		$('login_email').value=$('resend_email').value;
		}
	}

function ignore() {}

/**
* A generic wrapper to prompting for a decision. 
* Loads the page if the user clicks the OK button.
*
* @param string page The page requested.
* @param string confirm_message The message to display to the end user.
*/
function prompt_decision(task, params, confirm_message)
	{
	if (confirm(confirm_message))
		{
		// lpp(module, page, params)
		window.location='index.php?task='+task+params;
		}

	return false;
	}


function toggle_state_province()
	{
	var has_states='states'+$F($('country_id'));

	$$('.states').each(function(item) { item.hide(); });
	if ($(has_states))
		{
		$(has_states).show();
		$('countries').hide();
		$('sop').value='state';
		}
	else
		{
		// $('states').hide();
		$('countries').show();
		$('sop').value='province';
		}
	}


function set_state_choice(country_id)
	{
	var state_id='states_'+country_id;

	$('state_id').value=$F($(state_id));
	}


function toggle_rows_to_show(link_out)
	{
	var max_rows=$F($('max_rows'));

	return window.location=link_out+'&max_rows='+max_rows;
	}