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';
  }
}

function changeme(id)
{
document.getElementById(id).style.bgColor="#9ACBF6";
}

function openinformation(who)
{
window.open('per_info.php?id='+who,'info','height=400,width=400,left=200,top=200');
}

function cal_go(y, m) {
  $('#ajax-takvim').load('ajax-takvim.php', {year: y, month: m});
}
function pop(url, width, height) {
  var options = "width=" + width + ",height=" + height + ",";
  options    += "resizable=no,scrollbars=yes,status=no,";
  options    += "menubar=no,toolbar=no,location=no,directories=no";
  var newWin  = window.open(url, 'newWin', options);
  newWin.focus();
}

function ackapa(id) {
    $('#s'+id).toggle('slow');
    var iconVal = $("#open_icon_"+id).attr("value");
    //alert(iconVal);
    if(iconVal==1) {
    	$("#open_icon_"+id).attr("value",2);
        var src = "images/minus_src.gif";
        $(".open_icon_"+id).attr("src", src);
    } else if(iconVal==2){
    	$("#open_icon_"+id).attr("value",1);
        var src = "images/plus_src.gif";
        $(".open_icon_"+id).attr("src", src);
    }
}


