/**
* @desc     select the accordion tab given
* @author   Septimiu CERNAT
* @since    2009-09-16
* @param    number - nr - the number of the tab you want to select
* @param    string - id - the id of the accordion - default: 'accordion'
*/
function select_acc_tab(nr,id)
{
    //alert(nr + ' --- ' + id);
	// if the id does not exist
	if (id == undefined)
	{
		// set an id by default
		id = 'accordion';
	}
	// hide the content of the other tabs
	$('#'+id+' > .accordion_content').hide();
	// show the content of the given tab  
	$('#'+id+' > #acc_'+id+'_'+nr).show();
}


/**
* @desc     select from another accordion a tab that is on the same level as the current tab
* @author   Elena Sarmasan
* @since    2009-10-22
* @param    element - the DOM element that points to the title of the tab
* @param    string - id - the id of the other accordion 
*/
function select_eq_acc_tab(element,id)
{
	// set an id to the current title tab
	$(element).attr('id','selected_accordion_tab');
	// get the tab id of the current tab
	var tab_id = $('#selected_accordion_tab + div').attr('id');
	// split the tab id to get the number of the tab
	var array = tab_id.split('_');
	// get the number of the tab
	var nr = array[array.length-1];
	// select the tab from the other accordion
	select_acc_tab(nr,id);
	// remove the id that we added before
	$(element).removeAttr('id');
}
