

/*
 * function qmpilotChangeVisibility()
 */
function qmpilotChangeVisibility(categoryid,fileId,buttonid) {
	category = $(categoryid);
	files = $(fileId);
	button = $(buttonid);
	
	if(category.className == 'subcategory ie7class') {
		//category.hide();
		category.className = 'subcategory hidden';
		//files.hide();
		files.className = 'file hidden';
		button.className = 'button openButton';
	} else {
		//category.show();
		category.className = 'subcategory ie7class';
		// files.show();
		files.className = 'file';
		button.className = 'button closeButton';
	}
}

/*
 * function qmpilotChangeSorting()
 */
function qmpilotChangeSorting(imageObject,categoryID,columnToSort) {
	// Div which contains the table to sort
	categoryDiv = $(categoryID);
	
	// check which direction
	if(imageObject.hasClassName('ascSorting')) {
		// sort by desc
		
		// change image
		imageObject.writeAttribute('src','fileadmin/template/images/arrow_blue_top.png');
		
		// change sorting
		
		
		
		// change class
		imageObject.removeClassName('ascSorting');
		imageObject.addClassName('descSorting');
		
	} else if (imageObject.hasClassName('descSorting')) {
		// sort by asc
		
		// change image
		imageObject.writeAttribute('src','fileadmin/template/images/arrow_blue_bottom.png');
		
		// change sorting
		
		
		
		// change class
		imageObject.removeClassName('descSorting');
		imageObject.addClassName('ascSorting');
	}
}


