function bookmarkit()
{
window.external.addFavorite('http://www.syncog.wsl.edu.pl/','Syntax in Cognitive Grammar')
}

function confirm_delete(link, dzial, text)
{
  var is_confirmed = confirm('Usuwasz ' + dzial + ' :\n' + text + '\n\nJesteś pewien tego co robisz ???');
  if (is_confirmed) {
    link.href += '&is_confirmed=1';
  }
  return is_confirmed;
}

function highlight_row(row, new_color)
{
  cells = row.cells;
  cellscnt  = cells.length; 
  for (i = 0; i < cellscnt; i++)  {
    cells[i].style.backgroundColor = new_color;
  } 
}

// Newsy
function popup(url)
{
  aw=screen.availWidth;
  ah=screen.availHeight;
  width = 800;
  height = 600;
  var popup = window.open(url,"popup",'left=' + (aw-width)/2 + ',top=' + (ah-height)/2 + ',width='+width+',height='+height+',resizable=yes,scrollbars=yes,menubar=no' );
}

//Wybór DATY
function popup2(url,width,height,itemname,initdate)
{
  aw=screen.availWidth;
  ah=screen.availHeight;
  var popup = window.open(url+"?itemname="+itemname+"&initdate="+initdate,'popup2','left=' + (aw-width)/2 + ',top=' + (ah-height)/2 + ',width='+width+',height='+height+',resizable=no,scrollbars=no,menubar=no,status=no,toolbar=no,location=no,directories=no'); 
}

function get_cookie(name) {
  var start = document.cookie.indexOf(name+"=");
  var len = start+name.length+1;
  if ((!start) && (name != document.cookie.substring(0,name.length))) return "";
  if (start == -1) return "";
  var end = document.cookie.indexOf(";",len);
  if (end == -1) end = document.cookie.length;
  return unescape(document.cookie.substring(len,end));
}


function set_cookie(name,value,expires,path,domain,secure) {
  document.cookie = name + "=" +escape(value) +
    ( (expires) ? ";expires=" + expires.toGMTString() : "") +
    ( (path) ? ";path=" + path : "") + 
    ( (domain) ? ";domain=" + domain : "") +
    ( (secure) ? ";secure" : "");
}