// www.netlabor.hu

function setCookie(name, value)
 { var curCookie = name + "=" + escape(value);
   document.cookie = curCookie;}


function getCookie(name)
 {var prefix = name + "=";
  var cSI = document.cookie.indexOf(prefix);
  if (cSI==-1) return null;
  var cEI=document.cookie.indexOf(";", cSI + prefix.length);
  if (cEI==-1) cEI=document.cookie.length;
  return unescape(document.cookie.substring(cSI+prefix.length,cEI));
 }


function deleteCookie(name)
  { if (getCookie(name))
     {document.cookie = name+"=" +"; expires=Thu, 01-Jan-70 00:00:01 GMT";  
     }
  }



//All checked item will be added to eshop1 cookie

function addc()
 { var scart = getCookie("eshop1");
   if (!scart){scart ="";}

   //scanning elements
   var lel=document.forms[0].elements.length;
   lel=lel-3;    // 3 button object 3 volt

   var noe=0;  
   var ci=0;
   var tstr="";
   while (ci<lel)
    { if (document.forms[0].elements[ci].checked)
       {tstr=document.forms[0].elements[ci].value;
        if (scart.indexOf(tstr)<0){scart=scart+tstr;noe++;}
       }
      ci++;
     }
    
//   alert(noe+" ajánlat lett hozzáadva a listához.");
   
    setCookie("eshop1",scart);
    return
 }



function emptyc()
 { setCookie("eshop1","");
//  alert("A lista üres.");
 }

