/* Code by Giancarlo "GM" Moschitta (info@myphp.it) and Negatyve (http://www.negatyve.com) Powered by jQuery (http://jquery.com)) */

function load_class_categories()
{
	var class_selected = jQuery( this ).val();
	if( class_selected == '' ) {
		jQuery( "#filter-category" ).attr( 'disabled', true ).html( '' ).append( '<option value=""> - </option>' );
		return;
	}

	var class_id = class_selected.split( '|' )[0];
	jQuery.ajax({
		type: 'POST',
		url: SITE_PATH + 'a/ajax.php',
		data: 'c=dati&m=getClassCategories&class_id=' + class_id,
		success: function( result ) {
			if( result == '' || ajaxError( result ) ) {
				jQuery( "#filter-category" ).attr( 'disabled', true ).html( '' ).append( '<option value=""> - </option>' );
				return false;
			}

			jQuery( "#filter-category" ).attr( 'disabled', false ).html( '' ).append( '<option value=""> - </option>' + result );
		}
	});
}
