function trim( strTarget ) {

  var sidx = 0;
  var eidx;
  
  if ( typeof strTarget == "undefined" ) return "";
    
  eidx = strTarget.length - 1;

  while ( (strTarget.charAt( sidx ) == ' ') && (sidx < strTarget.length) ) sidx++;

  while ( (strTarget.charAt( eidx ) == ' ') && (eidx >= 0) ) eidx--;

  // If eidx became negative, it means the whole string is blanks; if this is
  // the case, the substring function will switch sidx and eidx (go figure), so
  // we check for this condition and return an empty string if necessary

  strTarget = (eidx < 0) ? "" : strTarget.substring(sidx, eidx+1);

  return strTarget;
  }

  function fixDate(date) {
    var base = new Date(0);
    var skew = base.getTime();
    if (skew > 0) { date.setTime(date.getTime() - skew); }
  }
  // determine age
  function howOld(day,month,year) {
      var c = new Date(); // a new instance
      fixDate(c);

      var thisDay = c.getDate();
      var thisMonth = c.getMonth() + 1;
      var thisYear = c.getFullYear();

      var yearsold = thisYear - year; 
      var monthsold = 0;
      var daysold = 0;
      var age = '';

      if (thisMonth >= month) {
    	  monthsold = thisMonth - month;
      }
      else {
    	  yearsold--;
    	  monthsold = thisMonth + 12 - month;
      }

      if (thisDay >= day) {
      daysold = thisDay - day;
      }
      else {
          if (monthsold > 0) {
        	  monthsold--;
          }
          else {
        	  yearsold--;
        	  monthsold += 11;
          }
          daysold = thisDay + 31 - day;
      }

      if (yearsold < 0) return '';

      if ((yearsold == 0) && (monthsold == 0) && (daysold == 0)) return '';

      if (yearsold > 0) {
          age = yearsold;
          if (yearsold > 1) age;
          age += ' ';
      }

      return age;
  }
  
  function openInformationWindow( sPage, h, w ) {
    window.open(sPage, "_blank", "height=" + h + ",width=" + w + ",toolbar=no,status=no,menubar=no,location=no,scrollbars=yes");
  }