var ajax = new sack();
function getDefaultGroups(sel)
{
	var frm_OrgID = sel.options[sel.selectedIndex].value;
	document.getElementById('frm_DefaultGroupID').options.length = 0;	// Empty select box
	document.Registration.frm_SubGroupID.disabled = true;
	document.getElementById('frm_SubGroupID').options.length = 1;	// Empty select box
	if(frm_OrgID.length>0){
		ajax.requestFile = 'http://www.ediocese.net/register/getDefaultGroups.php?frm_OrgID='+frm_OrgID;	// Specifying which file to get
		ajax.onCompletion = createDefaultGroupList;	// Specify function that will be executed after file has been found
		ajax.runAJAX();		// Execute AJAX function
	}
}
function createDefaultGroupList()
{
	var obj = document.getElementById('frm_DefaultGroupID');
	eval(ajax.response);	// Executing the response from Ajax as Javascript code
	document.Registration.frm_DefaultGroupID.disabled = false;
}

function getSubGroups(sel)
{
	var frm_DefaultGroupID = sel.options[sel.selectedIndex].value;
	document.getElementById('frm_SubGroupID').options.length = 0;	// Empty select box
	if(frm_DefaultGroupID.length>0){
		ajax.requestFile = 'http://www.ediocese.net/register/getSubGroups.php?frm_DefaultGroupID='+frm_DefaultGroupID;	// Specifying which file to get
		ajax.onCompletion = createSubGroupList;	// Specify function that will be executed after file has been found
		ajax.runAJAX();		// Execute AJAX function
	}
}
function createSubGroupList()
{
	var obj = document.getElementById('frm_SubGroupID');
	eval(ajax.response);	// Executing the response from Ajax as Javascript code
	document.Registration.frm_SubGroupID.disabled = false;
}
