
var last_highlighed_id = null;
var last_radio_id = null;
//Sets the a row as selected, and unselects the previously
//selected row
function setHightlighted(id){
	if(last_highlighed_id != null){			
		var obj = document.getElementById(last_highlighed_id);
		obj.className=obj.className.replace(" selected","");	
	}
	var obj = document.getElementById(id);
	obj.className= obj.className + " selected";
	last_highlighed_id = id;
}

function setHighlightAndCol1Radio(id){
	setHightlighted(id);
	
	var row = document.getElementById(id);
	var obj = null;
	if(document.all){
		
		td1 = row.firstChild.nextSibling;
		obj = td1.firstChild;
	}else{
		
		td1 = row.firstChild.nextSibling.nextSibling.nextSibling;
		obj = td1.firstChild;
	}
	obj.checked = true;
	
	return row;
}

function setRowAndRadio(id){
	setHightlighted("searchTable" + id);
	setRadio("radio" + id);
}

function setRadio(id){
		var obj = document.getElementById(id);
		var lastObj = document.getElementById(last_radio_id);		
		if(!obj.checked) {
			obj.checked = true;
			if(lastObj != null && lastObj.checked) {
				lastObj.checked = false;
			}
		}
		last_radio_id = obj;
}
