// Устанавливаем дату истечения cookies на год.
var largeExpDate = new Date ();
largeExpDate.setTime(largeExpDate.getTime() + (365 * 24 * 3600 * 1000));

function getCookie(name) {
  var prefix = name + '=';
  var start = document.cookie.indexOf(prefix);
  if (start == -1) {
    return '';
  }
  start += prefix.length;
  var end = document.cookie.indexOf(';', start);
  if (end == -1) {
    end = document.cookie.length;
  }
  return unescape(document.cookie.substring(start, end));
}

function showProfile(id) {
  var newWindow = window.open('profile.phtml?id=' + id, 'userInfo', 'scrollbars,resizable,status=0,toolbar=0,menubar=0,location=0,width=533,height=300');
  newWindow.focus();
  return false;
}
function editMessage(id) {
  var newWindow = window.open('EditMessage.phtml?id=' + id, 'editMessage', 'scrollbars,resizable,status=0,toolbar=0,menubar=0,location=0,width=800,height=300');
  newWindow.focus();
}
function blockUser(id) {
  var newWindow = window.open('blockUser.phtml?id=' + id, 'blockUser', 'scrollbars,resizable,status=0,toolbar=0,menubar=0,location=0,width=800,height=300');
  newWindow.focus();
}
function warnUser(id) {
  var newWindow = window.open('warnUser.phtml?id=' + id, 'warnUser', 'scrollbars,resizable,status=0,toolbar=0,menubar=0,location=0,width=800,height=300');
  newWindow.focus();
}
function updateBlock(id) {
  var newWindow = window.open('blockUpdate.phtml?id=' + id, 'blockUpdate', 'scrollbars,resizable,status=0,toolbar=0,menubar=0,location=0,width=800,height=300');
  newWindow.focus();
}
function updateWarn(id) {
  var newWindow = window.open('warnUpdate.phtml?id=' + id, 'warnUpdate', 'scrollbars,resizable,status=0,toolbar=0,menubar=0,location=0,width=800,height=300');
  newWindow.focus();
}
function showProfileJS(id) {
  var newWindow = window.open('profile.phtml?id=' + id, 'userInfo', 'scrollbars,resizable,status=0,toolbar=0,menubar=0,location=0,width=533,height=300');
  newWindow.focus();
}
