
function change_chapter_list(id, s, a, d)
{
	$('working2').appear();
	var frmObj = $(id);
//	alert(s);
	var show = $(s);
	var region = $('list_region').value;
	
	for(b=0;b<$('form1').list_type.length;b++) {
	if($('form1').list_type[b].checked) id = $('form1').list_type[b].value;
														}
	var dis = $('disabled');
	if(dis.checked) active = 0; else active = 1;
	//var query = '?show='+id+'&region='+region+'&active='+active;
	var file = '/aj/adchapters';
	//ajaxCall(file,query,'chap_list');
	new Ajax.Updater('chap_list',file,{method:'get',
			 parameters:{show:id,region:region,active:active,status:a,del:d}
			});
//	$('working2').puff();
	
}

function edit_chapter(ch)
{
	
	//$('form').style.display ='block';
	var file ='/aj/chapterform';
	//var query = '?id='+ch;
	//ajaxCall(file,query,'form');
	new Ajax.Updater('form',file,{method:'get',
					parameters:{id:ch}
					});
	$('form').appear();
	$('add_link').href = '/admin/chapters?add=1';
	$('add_link').onclick = '';
}


function admin_chapter_validation(id)
{
	//Setup vars
	var frmObj = $(id);
	var chapter = $('chaptername');
	var college = $('college');
	var region = $('region');
	var zip = $('zip');
	var web = $('web');
	var lock = $('lock');
	
	if(chapter.value ==''){
		alert('Please enter a valid Chapter name');
		chapter.focus()
		chapter.select()
		return false
	}
	if(region.value ==''){
		alert('Please select the appropiate region for this chapter listing');
		return false
	}
	if(!reNumber.test(zip.value)){
		alert('Please enter a valid zipcode for this chapter');
		zip.focus()
		zip.select()
		return false
	}

	//Validate
	

}

