function popupWindow(url,width,height) {
	var popUpWin = 0;
	if(popUpWin)
	{
		if(!popUpWin.closed) popUpWin.close();
	}

	var left = (screen.width/2) - width/2;
  	var top = (screen.height/2) - height/2;

	popUpWin = open(url, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
	popUpWin.focus();
}

function RTrim(str) {

   var whitespace = new String(" \t\n\r");
   var s = new String(str);

   if (whitespace.indexOf(s.charAt(s.length-1)) != -1) {

      var i = s.length - 1;

      while (i >= 0 && whitespace.indexOf(s.charAt(i)) != -1)
         i--;
         s = s.substring(0, i+1);
   }

   return s;
} // end function RTrim

function LTrim(str) {

   var whitespace = new String(" \t\n\r");
   var s = new String(str);

   if (whitespace.indexOf(s.charAt(0)) != -1) {

      var j = 0, i = s.length;

      while (j < i && whitespace.indexOf(s.charAt(j)) != -1)
         j++;

         s = s.substring(j, i);
      }

   return s;
} // end function LTrim

function trim(str) {

   return (LTrim(RTrim(str)));

} // end function trim(String)
