function restore_all()
{
	$("#tab_files_act").hide();
	$("#tab_folders_act").hide();
	$("#tab_drivers_act").hide();
	
	$("#tab_files").show();
	$("#tab_folders").show();
	$("#tab_drivers").show();
}
function change_tab(type, page)
{
	//restore_all();
/*
	switch(type)
	{
		case "files":
			
			$("#tab_files").hide();
			$("#tab_files_act").show();			
		break;
		case "folders":
			
			$("#tab_folders").hide();
			$("#tab_folders_act").show();			
			
		break;
		case "drivers":
			
			$("#tab_drivers").hide();
			$("#tab_drivers_act").show();			
		break;
	}
	*/
	get_content(type, page)
}
$(document).ready(function(){
   $('#sortFilesTab').resetForm().submit(function(){return false;});
});
function sortFilesTab(form)
{
	$(form).ajaxSubmit({
		beforeSubmit:	function( formData, jqForm, options ){
			$("#public_pager").hide();
			$("#public_progress").show();
		},
		success:		function(response, status) {
			$("#public_content").html(response);	
			$("#public_pager").show();
			$("#public_progress").hide();
				
		}});
}
function get_content(type, page)
{
	//$("#public_content").hide();
	$("#public_pager").hide();
	$("#public_progress").show();
	
	var selectedSort = $("#sortFilesTab :selected").map(function(){return $(this).val();})
	
	  $.post('/publicdrive/' +type+'/0/'+page,
			{page:page, sort: selectedSort[0], order: selectedSort[1]},
			write_response);
}
function write_response(data) 
{
	$("#public_content").html(data);	
	$("#public_pager").show();
	$("#public_progress").hide();		
}
