function trim(s) {
  while ((s.substring(0, 1) == ' ') || (s.substring(0, 1) == '\n') || (s.substring(0, 1) == '\r') || (s.substring(0, 1) == '\t')) {
    s = s.substring(1, s.length);
  }

  while ((s.substring(s.length-1, s.length) == ' ') || (s.substring(s.length-1, s.length) == '\n') || (s.substring(s.length-1, s.length) == '\r') || (s.substring(s.length-1, s.length) == '\t')) {
    s = s.substring(0, s.length-1);
  }

  return s;
}

function openwin(url, w, h, n) {
  var options = "width=" + w + ",height=" + h + ",";
  options += "resizable=no,scrollbars=yes,status=yes,";
  options += "menubar=no,toolbar=no,location=no,directories=no";
  var newWin = window.open(url, 'win_' + n, options);
  newWin.focus();
}

function access_guard(url) {
  if (window.opener)
    window.close();
  else
    document.location = url;
}

function over(n) {
  document.all[n].src = 'images/arrow1.jpg';
}

function out(n) {
  document.all[n].src = 'images/arrow2.jpg';
}

function cal_browse(day, month, year) {
  document.location = 'meetings.php?day='+day+'&month='+month+'&year='+year;
}

function cal_over(id, color) {
  id.style.backgroundColor = color;
  id.style.cursor = 'hand';
  id.style.color = '#FFFFFF';
}

function cal_out(id, color, act) {
  if(act == 1){
  id.style.backgroundColor = '#006699';
  id.style.cursor = 'default';
  id.style.color = '#fff';  
  }
  else {
  id.style.backgroundColor = color;
  id.style.cursor = 'default';
  id.style.color = '#000000';
  }
}

