﻿
function Select_SelectByValue(oSelect, Value)
{
	var i;
	var iOut = -1;
	
	for (i = 0; i < oSelect.options.length; i++)
	{
		if (oSelect.options[i].value == Value)
		{
			iOut = i;
			break;
		}
	}
	
	oSelect.selectedIndex = iOut;
}

function Select_GetSelectedValue(oSelect)
{
	return oSelect.options[oSelect.selectedIndex].value;
}

function LTrim(sStr)
{
	var s = String(sStr);

	while (s.charAt(0) == ' ')
	{
		s = s.substr(1, s.length);
	} // while
	
	return s;
	
}

function RTrim(sStr)
{
	var s = String(sStr);

	while (s.charAt(s.length - 1) == ' ')
	{
		s = s.substr(0, s.length-1);
	} // while
	
	return s;
	
}

function Trim(sStr)
{
	return LTrim(RTrim(sStr));
}

