function onPageChange(obj){
	with(obj){
		index=selectedIndex;
		val=options[index].value;
		if(val != "") document.location.href=val;
	}
}

function goPage(pageNum){
	with(document.navForm){
			cPage.value=pageNum;
			submit();
	}
}

function refresh(pagesize){
	var f = document.navForm;
	f.perpage.value = pagesize;
	f.submit();
}


function replace(s, t, u) {
   /*
   **  Replace a token in a string
   **    s  string to be processed
   **    t  token to be found and removed
   **    u  token to be inserted
   **  returns new String
   */
   i = s.indexOf(t);
   r = "";
   if (i == -1) return s;
   r += s.substring(0,i) + u;
   if ( i + t.length < s.length)
     r += replace(s.substring(i + t.length, s.length), t, u);
   return r;
}

function checkUncheck(id_name){
	with(document.listform){
		for (var i=0;i<elements.length;i++){
			var e = elements[i];
			if (e.name == id_name)
				e.checked = nsAll.checked;
		}
	}
}

function addID(theObj, tarObj){
	with(document.listform){
		if(tarObj.value != "") tarObj.value += ",";
		tarObj.value = tarObj.value + theObj.value;
	}
}
