function addItemListbox(objListBox, text, value)
{
  var newOpt;
  newOpt = document.createElement("OPTION");
  newOpt.text=text;
  newOpt.value = value;
  try
  {
  	objListBox.add(newOpt,null);
  } catch(ex)
  	{
		objListBox.add(newOpt,0);
	}
}

function clearListboxItems(objListBox)
{
	while (objListBox.options.length!=0)
	{
		objListBox.remove(0);	
	}
}

function setListboxSelectedIndexByText(objListBox,text)
{
	for(i=0; i<objListBox.options.length; i++)
	{		
		if(objListBox.options[i].text==text)
			objListBox.selectedIndex=i;
	}
}

function setListboxSelectedIndexByValue(objListBox,value)
{
	for(i=0; i<objListBox.options.length; i++)
	{
		if(objListBox.options[i].value==value)
			objListBox.selectedIndex=i;
	}	
}

function removeListboxSelectedItem(objListBox)
{
	objListBox.remove(objListBox.selectedIndex);
}