

function getMembers(){

	document.frmMDirectory.submit();	

}



/* ---------- Admin bits ---------------------- */


function copyToList(from,to)
{
  fromList = eval('document.forms[0].' + from);
  toList = eval('document.forms[0].' + to);
  if (toList.options.length > 0 && toList.options[0].value == 'temp')
  {
    toList.options.length = 0;
  }
  var sel = false;
  for (i=0;i<fromList.options.length;i++)
  {
    var current = fromList.options[i];
    if (current.selected)
    {
      sel = true;
      if (current.value == 'temp')
      {
        alert ('You cannot move this text!');
        return;
      }
      txt = current.text;
      val = current.value;
      toList.options[toList.length] = new Option(txt,val);
      fromList.options[i] = null;
      i--;
    }
  }
  if (!sel) alert ('You haven\'t selected anything!');
}


function allSelect()
{
  List = document.forms[0].chosen;
  if (List.length && List.options[0].value == 'temp') return;
  for (i=0;i<List.length;i++)
  {
     List.options[i].selected = true;
  }
}




//page navigation ---------------------------------------------------
function goPage(curPage, theForm, theDestination){

	eval('document.' + theForm + '.action = "' + theDestination + '"');
	eval('document.' + theForm + '.curPage.value=' + curPage);
	eval('document.' + theForm + '.submit();');		
}

//set cursor focus --------------------------------------------------
function setCursorFocus(frmForm, frmElement){
	eval('document.' + frmForm + '.' + frmElement + '.focus();');
}


//updateUser --------------------------------------------------------
function updateUser(){
	if(confirm("Continue with update?")){
		document.frmUser.pageaction.value = "update";
		document.frmUser.submit();
		}
}


//newUser -----------------------------------------------------------
function newUser(){
	document.location="edituser.asp?pageaction=new";
}



//deleteUser --------------------------------------------------------
function deleteUser(){
	if(confirm("Continue with delete?")){
		document.frmUser.pageaction.value = "delete";
		document.frmUser.submit();
		}
}

//cancelUser --------------------------------------------------------
function cancelUser(){
	document.location="users.asp";
	
}


//updateCategory --------------------------------------------------------
function updateCategory(){
	if(confirm("Continue with update?")){
		document.frmCategory.pageaction.value = "update";
		document.frmCategory.submit();
		}
}


//newCategory -----------------------------------------------------------
function newCategory(){
	document.location="editcategory.asp?pageaction=new";
}



//deleteCategory --------------------------------------------------------
function deleteCategory(){
	if(confirm("Continue with delete?")){
		document.frmCategory.pageaction.value = "delete";
		document.frmCategory.submit();
		}
}

//cancelCategory --------------------------------------------------------
function cancelCategory(cp){
	document.location="categories.asp?curpage=" + cp;
}



//updateMember --------------------------------------------------------
function updateMember(){
		var selectedItems="";
	if(confirm("Continue with update?")){
	
		for (i=0;i<document.frmMember.selectedCategories.options.length;i++){
		selectedItems += (document.frmMember.selectedCategories.options[i].value + "^");
		}
		document.frmMember.selectedcategoryObj.value = selectedItems;
		
		document.frmMember.pageaction.value = "update";
		document.frmMember.submit();
		}
}

function searchMembers(){

	document.frmMemberList.pageaction.value="search";
	document.frmMemberList.submit();

}


//addMember -----------------------------------------------------------
function addMember(){

	document.frmMemberList.pageaction.value = "new";
	document.frmMemberList.action = "editmember.asp";
	document.frmMemberList.submit();
}



//deleteMember --------------------------------------------------------
function deleteMember(){
	if(confirm("Continue with delete?")){
		document.frmMember.pageaction.value = "delete";
		document.frmMember.submit();
		}
}

//cancelMember --------------------------------------------------------
function cancelMember(cp){
	document.location="members.asp?curpage=" + cp;
}


//updateAnnouncement --------------------------------------------------------
function updateAnnouncement(){
	if(confirm("Continue with update?")){
		document.frmAnnouncement.pageaction.value = "update";
		document.frmAnnouncement.submit();
		}
}


//newAnnouncement -----------------------------------------------------------
function newAnnouncement(){
	document.location="editannouncement.asp?pageaction=new";
}



//deleteAnnouncement --------------------------------------------------------
function deleteAnnouncement(){
	if(confirm("Continue with delete?")){
		document.frmAnnouncement.pageaction.value = "delete";
		document.frmAnnouncement.submit();
		}
}

//cancelAnnouncement --------------------------------------------------------
function cancelAnnouncement(){
	document.location="announcements.asp";
	
}



//updateXCategory --------------------------------------------------------
function updateXCategory(){
	if(confirm("Continue with update?")){
		document.frmXCategory.pageaction.value = "update";
		document.frmXCategory.submit();
		}
}


//newXCategory -----------------------------------------------------------
function newXCategory(){
	document.location="editxlinkcategory.asp?pageaction=new";
}


//cancelXCategory --------------------------------------------------------
function cancelXCategory(cp){
	document.location="xlinkcategories.asp?curpage=" + cp;
}


//deleteXCategory --------------------------------------------------------
function deleteXCategory(){
	if(confirm("Continue with delete?")){
		document.frmXCategory.pageaction.value = "delete";
		document.frmXCategory.submit();
		}
}


//updateXLink --------------------------------------------------------
function updateXLink(){
	if(confirm("Continue with update?")){
		document.frmXLink.pageaction.value = "update";
		document.frmXLink.submit();
		}
}


//newXLink -----------------------------------------------------------
function newXLink(){
	document.location="editxlink.asp?pageaction=new";
}


//cancelXLink --------------------------------------------------------
function cancelXLink(cp){
	document.location="xlinks.asp?curpage=" + cp;
}


//deleteXLink --------------------------------------------------------
function deleteXLink(){
	if(confirm("Continue with delete?")){
		document.frmXLink.pageaction.value = "delete";
		document.frmXLink.submit();
		}
}

//updateCea --------------------------------------------------------
function updateCea(){
	if(confirm("Continue with update?")){
		document.frmCea.pageaction.value = "update";
		document.frmCea.submit();
		}
}


//newCea -----------------------------------------------------------
function newCea(){
	document.location="editcea.asp?pageaction=new";
}



//deleteCea --------------------------------------------------------
function deleteCea(){
	if(confirm("Continue with delete?")){
		document.frmCea.pageaction.value = "delete";
		document.frmCea.submit();
		}
}

//cancelCea --------------------------------------------------------
function cancelCea(){
	document.location="cea.asp";
	
}

