   function selectall() {
   	var iIndex;
   	var iMaxItems;
	
	if (!window.document.frmDomains.domain) return (false);
					
   	iMaxItems = window.document.frmDomains.domain.length;

	for (iIndex =0;iIndex<iMaxItems;iIndex++) {
		window.document.frmDomains.domain[iIndex].checked = true;
	}
	return (false);
   }
   function unselectall () {
   	var iIndex;
   	var iMaxItems;
					
   	iMaxItems = window.document.frmDomains.domain.length;
					
   	for (iIndex =0;iIndex<iMaxItems;iIndex++) {
   		window.document.frmDomains.domain[iIndex].checked = false;
   	}
	return (false);
   }
   function invertselection () {
   	var iIndex;
   	var iMaxItems;
					
   	iMaxItems = window.document.frmDomains.domain.length;
					
   	for (iIndex =0;iIndex<iMaxItems;iIndex++) {
   		if (window.document.frmDomains.domain[iIndex].checked == true) {
   			window.document.frmDomains.domain[iIndex].checked = false;
   		}
   		else {
   			window.document.frmDomains.domain[iIndex].checked = true;
   		}
   	}
	return (false);
   }


   // grant access rights pages
   function selectallrights() {
   	var iIndex;
   	var iMaxItems;
	
	if (!window.document.frmGrant.capid) return (false);
					
   	iMaxItems = window.document.frmGrant.capid.length;

	for (iIndex =0;iIndex<iMaxItems;iIndex++) {
		window.document.frmGrant.capid[iIndex].checked = true;
	}
	return (false);
   }
   function unselectallrights () {
   	var iIndex;
   	var iMaxItems;
					
   	iMaxItems = window.document.frmGrant.capid.length;
					
   	for (iIndex =0;iIndex<iMaxItems;iIndex++) {
   		window.document.frmGrant.capid[iIndex].checked = false;
   	}
	return (false);
   }
   function invertrightsselection () {
   	var iIndex;
   	var iMaxItems;
					
   	iMaxItems = window.document.frmGrant.capid.length;
					
   	for (iIndex =0;iIndex<iMaxItems;iIndex++) {
   		if (window.document.frmGrant.capid[iIndex].checked == true) {
   			window.document.frmGrant.capid[iIndex].checked = false;
   		}
   		else {
   			window.document.frmGrant.capid[iIndex].checked = true;
   		}
   	}
	return (false);
   }
   function selectparentrights (chk, parentidvalue) {

	if (chk.checked == true) {
	   	var iIndex;
   		var iMaxItems;
					
	   	iMaxItems = window.document.frmGrant.capid.length;
					
   		for (iIndex =0;iIndex<iMaxItems;iIndex++) {
   			if (window.document.frmGrant.capid[iIndex].value == parentidvalue) {
   				window.document.frmGrant.capid[iIndex].checked = true;
				break;
   			}
	   	}
	}
	return (true);
   }
   function validaterightsselection() {
   	var iIndex;
   	var iMaxItems;
	
	if (!window.document.frmGrant.capid) return (false);
					
   	iMaxItems = window.document.frmGrant.capid.length;

	for (iIndex =0;iIndex<iMaxItems;iIndex++) {
		window.document.frmGrant.capid[iIndex].checked = true;
	}
	return (false);
   }

