function getObj(id){
	return document.getElementById(id);
}

function getSelectValue(obj)
{
	var retVal = "";
	if(getObj(obj).options[getObj(obj).selectedIndex].value!="")
		retVal = getObj(obj).options[getObj(obj).selectedIndex].value;
	else
		retVal = getObj(obj).options[0].value;
	
	return retVal;
}

function setValue (obj, val){
	for(var i=0;i<getObj(obj).options.length;i++)
	{		
		if(getObj(obj).options[i].value == val) {
			getObj(obj).selectedIndex = i;		
			break;
		}	
	}	
}

function getSelectHtml(obj)
{
	return getObj(obj).options[getObj(obj).selectedIndex].text;
}

//generic function to set a select with a text parameter
function setText(obj, text){
	var myObj = getObj(obj);
	for(var i=0;i<myObj.options.length;i++)
	{	
		if(myObj.options[i].innerText == text)
		{
			myObj.selectedIndex = i;			
			break;
		}
	}
	//eval("myObj.fireEvent('onchange');");
}


