
function Trim(str)
{
   	//trim leding spaces
       while(true)
       {
       	if(str.charAt(0) == ' ')
           	str = str.substr(1);
           else
           	break;
       }
       //trim trailing spaces
       while(true)
       {
       	if(str.charAt(str.length-1) == ' ')
           	str = str.substr(0,str.length-1);
           else
           	break;
       }
       return(str);
}

function OpenWindow(url, wh)
{
	window.open(url, '', wh);
}

function swapImages(imgIcon, ImgId, ImgSwap, flag)
{
	if (flag == 1)
	{
		imgIcon.style.filter = "progid:DXImageTransform.Microsoft.BasicImage(grayscale=10)";
	}
	else
	{
		imgIcon.style.filter = '';
	}
	ImgId.src = ImgSwap.src;
}
