/*
Funkcje do obsługi ciasteczek
Autor: Bill Dortch, hIdaho Design <bdortch@netw.com>
http://www.hidaho.com/cookies/cookie.txt
Modyfikacje: Martin Webb <martin@irt.org>
http://www.irt.org/articles/js016
http://www.tech.irt.org/articles/js016/
*/

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 null;
  }
  if(start == -1) {
    return null;
  }
  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" : "");
}
