var ajax = new sack();

function getcategoriesList(sel)
{
	var categoryCode = sel.options[sel.selectedIndex].value;
	document.getElementById('subcategories').options.length = 0;	// Empty city select box
	if(categoryCode.length>0){
		ajax.requestFile = 'webforms/getcategories.php?categoryCode='+categoryCode;	// Specifying which file to get
		ajax.onCompletion = createsubcategories;	// Specify function that will be executed after file has been found
		ajax.runAJAX();		// Execute AJAX function
	}
}

function createsubcategories()
{
	var obj = document.getElementById('subcategories');
	eval(ajax.response);	// Executing the response from Ajax as Javascript code	
}
