

var popupWin = null;
function openWin(target, width, height)
{
	var popupTop = (screen.height - height)/2;
	var popupLeft = (screen.width - width)/2;

	if(popupWin == null || popupWin.closed)
	{
		popupWin = window.open(target,'windowName','scrollbars=yes,resizable=yes,top=' + popupTop + ',left=' + popupLeft + ',status=no,width=' + width + ',height=' + height);
	}
	else
	{
		popupWin.location = target;
		setTimeout("popupWin.focus()",500)
	}
}

function trim(strText)
{
    if ( strText==null )
          return strText;

    if ( strText=="" )
          return strText;

    // this will get rid of leading spaces
    while (strText.substring(0,1) == ' ')
        strText = strText.substring(1, strText.length);

    // this will get rid of trailing spaces
    while (strText.substring(strText.length-1,strText.length) == ' ')
        strText = strText.substring(0, strText.length-1);

   return strText;
}


