var ajax = new Array();

function getTextList(sel)
{
	var category = sel.options[sel.selectedIndex].value;
	document.getElementById('text').options.length = 0;
	if(category.length>0){
		var index = ajax.length;
		ajax[index] = new sack();

		ajax[index].requestFile = 'getText.php?category='+category;
		ajax[index].onCompletion = function(){ createText(index) };

		ajax[index].runAJAX();
	}
}

function createText(index)
{
	var obj = document.getElementById('text');
	eval(ajax[index].response);
}


function getTextList1(sel)
{
	var category = sel.options[sel.selectedIndex].value;
	document.getElementById('text1').options.length = 0;
	if(category.length>0){
		var index = ajax.length;
		ajax[index] = new sack();

		ajax[index].requestFile = 'getTextDest.php?category='+category;
		ajax[index].onCompletion = function(){ createText1(index) };

		ajax[index].runAJAX();
	}
}

function createText1(index)
{
	var obj = document.getElementById('text1');
	eval(ajax[index].response);
}





function getTextList2(sel)
{
	var category = sel.options[sel.selectedIndex].value;
	document.getElementById('text2').options.length = 0;
	if(category.length>0){
		var index = ajax.length;
		ajax[index] = new sack();

		ajax[index].requestFile = 'getText2.php?category='+category;
		ajax[index].onCompletion = function(){ createText2(index) };

		ajax[index].runAJAX();
	}
}

function createText2(index)
{
	var obj = document.getElementById('text2');
	eval(ajax[index].response);
}




function getTextList3(sel)
{
	var category = sel.options[sel.selectedIndex].value;
	document.getElementById('text3').options.length = 0;
	if(category.length>0){
		var index = ajax.length;
		ajax[index] = new sack();

		ajax[index].requestFile = 'getTextDest2.php?category='+category;
		ajax[index].onCompletion = function(){ createText3(index) };

		ajax[index].runAJAX();
	}
}

function createText3(index)
{
	var obj = document.getElementById('text3');
	eval(ajax[index].response);
}

