var ajax = new Array();
	
	function getTypesList(sel)
	{
		var flrCode = sel.options[sel.selectedIndex].value;
		document.getElementById('type_ID').options.length = 0;	// Empty city select box
		if(flrCode.length > 0){
			var index = ajax.length;
			ajax[index] = new sack();
			
			ajax[index].requestFile = 'admin/libs/getTypes.php?mkID=' + flrCode;	// Specifying which file to get
			ajax[index].onCompletion = function(){ createTypes(index) };	// Specify function that will be executed after file has been found
			ajax[index].runAJAX();		// Execute AJAX function
		}
	}
	
	function createTypes(index)
	{
		var obj = document.getElementById('type_ID');
		eval(ajax[index].response);	// Executing the response from Ajax as Javascript code
	}
	
	/*********
	*
	*	get models based on type lists
	*
	**********/
	
	var ajax = new Array();
	
	function getModelsList(sel)
	{
		var flrCode = sel.options[sel.selectedIndex].value;
		document.getElementById('model_ID').options.length = 0;	// Empty city select box
		if(flrCode.length > 0){
			var index = ajax.length;
			ajax[index] = new sack();
			
			ajax[index].requestFile = 'admin/libs/getModels.php?mdID=' + flrCode;	// Specifying which file to get
			ajax[index].onCompletion = function(){ createModels(index) };	// Specify function that will be executed after file has been found				
			ajax[index].runAJAX();		// Execute AJAX function
		}
	}
	
	function createModels(index)
	{
		var obj = document.getElementById('model_ID');
		eval(ajax[index].response);	// Executing the response from Ajax as Javascript code			
	}
	
	/*********
	*
	*	get grades based on models lists
	*
	**********/
	
	var ajax = new Array();
	
	function getGradeList(sel)
	{
		var flrCode = sel.options[sel.selectedIndex].value;
		document.getElementById('grade_ID').options.length = 0;	// Empty city select box
		if(flrCode.length > 0){
			var index = ajax.length;
			ajax[index] = new sack();
			
			ajax[index].requestFile = 'admin/libs/getGrades.php?mdID=' + flrCode;	// Specifying which file to get
			ajax[index].onCompletion = function(){ createGrades(index) };	// Specify function that will be executed after file has been found				
			ajax[index].runAJAX();		// Execute AJAX function
		}
	}
	
	function createGrades(index)
	{
		var obj = document.getElementById('grade_ID');
		eval(ajax[index].response);	// Executing the response from Ajax as Javascript code			
	}