var ajax = new Array();

function getProductGroupList(sel)
{
	var SectorId = sel.options[sel.selectedIndex].value;
	document.getElementById('ProductGroupId').options.length = 0;	// Empty ProductGroup select box
	//if(SectorId.length>0){
		var index = ajax.length;
		ajax[index] = new sack();
		
		ajax[index].requestFile = 'GetProductGroups.asp?SectorId='+SectorId;	// Specifying which file to get
		ajax[index].onCompletion = function(){ createProductGroups(index) };	// Specify function that will be executed after file has been found
		ajax[index].runAJAX();		// Execute AJAX function
	//}
}

function createProductGroups(index)
{
	var obj = document.getElementById('ProductGroupId');
	eval(ajax[index].response);	// Executing the response from Ajax as Javascript code	
}



function getTSTProductGroupList(sel,named,address)
{
	var selId = sel.options[sel.selectedIndex].value;
	document.getElementById(named).options.length = 0;	// Empty city select box
	if(selId.length>0){
		var index = ajax.length;
		ajax[index] = new sack();
		
		ajax[index].requestFile = address+selId;	// Specifying which file to get
		ajax[index].onCompletion = function(){ createTSTProductGroups(index,named) };	// Specify function that will be executed after file has been found
		ajax[index].runAJAX();		// Execute AJAX function
	}
}

function createTSTProductGroups(index,named)
{
	var obj = document.getElementById(named);
	eval(ajax[index].response);	// Executing the response from Ajax as Javascript code	
}