var ajax = new sack();


//Ana grup listesinden secim yapildiginda , alt grup kutusunu doldurur.
function getAnaGrup(sel)
{

	var anagrup_id = sel.options[sel.selectedIndex].value;

	document.getElementById('altgrup').options.length = 0;	// Empty city select box
	document.getElementById('tip').options.length = 0;	// Empty city select box
	
	if(anagrup_id.length>0)
	{
	ajax.requestFile = 'gruplar.php?islem=anagrup&id='+anagrup_id;	// Specifying which file to get
	ajax.onCompletion = createAnaGrup;	// Specify function that will be executed after file has been found
	ajax.runAJAX();		// Execute AJAX function
	}
}

//alt grup listsinden secim yapildiginda tip kutusunu doldurur
function getAltGrup(sel)
{
	var altgrup_id = document.getElementById('altgrup').options[sel.selectedIndex].value;
	document.getElementById('tip').options.length = 0;	// Empty city select box
	if(altgrup_id.length>0){
		ajax.requestFile = 'gruplar.php?islem=altgrup&id='+altgrup_id;	// Specifying which file to get
		ajax.onCompletion = createAltGrup;	// Specify function that will be executed after file has been found
		ajax.runAJAX();		// Execute AJAX function
	}
}

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

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






////////////////////////

function getAnaGrup1(sel)
{

	var anagrup_id = sel.options[sel.selectedIndex].value;

	document.getElementById('altgrup').options.length = 0;	// Empty city select box
	document.getElementById('tip').options.length = 0;	// Empty city select box
	
	if(anagrup_id.length>0)
	{
	ajax.requestFile = 'gruplar.php?islem=anagrup&id='+anagrup_id;	// Specifying which file to get
	ajax.onCompletion = createAnaGrup1;	// Specify function that will be executed after file has been found
	ajax.runAJAX();		// Execute AJAX function
	}
}

//alt grup listsinden secim yapildiginda tip kutusunu doldurur
function getAltGrup1(sel)
{
	var altgrup_id = document.getElementById('altgrup').options[sel.selectedIndex].value;
	document.getElementById('tip').options.length = 0;	// Empty city select box
	if(altgrup_id.length>0){
		ajax.requestFile = 'gruplar.php?islem=altgrup&id='+altgrup_id;	// Specifying which file to get
		ajax.onCompletion = createAltGrup1;	// Specify function that will be executed after file has been found
		ajax.runAJAX();		// Execute AJAX function
	}
}

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

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