function popitup(url) {
	newwindow=window.open(url,'name','height=200,width=150');
	
	if (window.focus) {newwindow.focus()}
	return false;
}

function popup(url, height, width) {
	newwindow=window.open(url,'name','height='+height+',width='+width+'');
	
	if (window.focus) {newwindow.focus()}
	return false;
}

function refreshParent() {
	window.opener.location.href = window.opener.location.href;

	if (window.opener.progressWindow)		
	{
		window.opener.progressWindow.close()
	}
	window.close();
}

function edit(id) {
	var url = "registrant.php?do=edit&id="+id;
	
	newwindow=window.open(url,'Edit'+id,'height=500,width=600,scrollbars=1');
	
	if (window.focus) {newwindow.focus()}
	return false;
}

function selectOptionByValue(id, val){
	var selObj = document.getElementById(id);
	var A= selObj.options, L= A.length;
	while(L){
		if (A[--L].value== val){
			selObj.selectedIndex= L;
			L= 0;
		}
	}
}
						
function setCheckedValue(radioObj, newValue) {
	if(!radioObj)
		return;
	var radioLength = radioObj.length;
	if(radioLength == undefined) {
		radioObj.checked = (radioObj.value == newValue.toString());
		return;
	}
	for(var i = 0; i < radioLength; i++) {
		radioObj[i].checked = false;
		if(radioObj[i].value == newValue.toString()) {
			radioObj[i].checked = true;
		}
	}
}
