
function setCookie(name, value){
//var dat = new Date();
//var datPlus = dat.getTime() + (24*60*60*1000);
//dat.setTime(datPlus);
var thisCookie = name + "=" + escape(value) + "; path=/"; //+ "; expires=" + dat.toGMTString();
document.cookie = thisCookie;
//alert ('Setovan document.cookie ' + document.cookie);
}

function getCookie (name) {
  var arg = name + "=";
  var alen = arg.length;
  var clen = document.cookie.length;
  var i = 0;
  while (i < clen) {
    var j = i + alen;
    if (document.cookie.substring(i, j) == arg)
      return getCookieVal (j);
    i = document.cookie.indexOf(" ", i) + 1;
    if (i == 0) break; 
  }
  return '';
}
function getCookieVal (offset) {
  var endstr = document.cookie.indexOf (";", offset);
  if (endstr == -1)
    endstr = document.cookie.length;
  return unescape(document.cookie.substring(offset, endstr));
}

function DeleteCookie (name) {
var thisCookie = name + "=; expires=Thu, 01-Jan-70 00:00:01 GMT";
document.cookie = thisCookie;
}

/*
function DeleteCookie (name,path,domain) {
  if (GetCookie(name)) {
    document.cookie = name + "=" +
      ((path) ? "; path=" + path : "") +
      ((domain) ? "; domain=" + domain : "") +
      "; expires=Thu, 01-Jan-70 00:00:01 GMT";
  }
}

if (   (  cookieVal.IndexOf('main.html') == -1 )
	&& ( cookieVal.IndexOf('concept.html') == -1)
	&& ( (cookieVal.IndexOf('programm.html')) == -1) 
	&& ( (cookieVal.IndexOf("work.html")) == -1)
	&& ( (cookieVal.IndexOf("ideas.php")) == -1 )
	&& ( (cookieVal.IndexOf("discussion.html")) == -1)
	&& ( (cookieVal.IndexOf("wiki/index.php")) == -1 )
	&& ( (cookieVal.IndexOf("partner.html")) == -1)
	&& ( (cookieVal.IndexOf("location.html")) == -1) 
	&& ( (cookieVal.IndexOf("contact.html")) == -1 )
	)
{
	setCookie("main.html");
}
*/
