function sc(w,z){
	if(z==0){
		for(n=0;n<document.cats.elements.length;n++){
			document.cats.elements[n].checked=((n==w)||(w==0))?true:false;
		}
	}
	var allonq="1";
	var befcore="";
	for(n=1;n<document.cats.elements.length;n++){
		if(document.cats.elements[n].checked){
			befcore+="|1";
		}else{
			befcore+="|0";
			allonq="0";
		}
	}
	core=allonq+befcore;
	setCookie("whatson", core);
	self.location.href = self.location.href;
}
function setCookie(name, value, expires, path, domain, secure) {
  var curCookie = name + "=" + escape(value) +
      ((expires) ? "; expires=" + expires.toGMTString() : "") +
      ((path) ? "; path=" + path : "") +
      ((domain) ? "; domain=" + domain : "") +
      ((secure) ? "; secure" : "");
  document.cookie = curCookie;
}
function getCookie(name) {
  var dc = document.cookie;
  var prefix = name + "=";
  var begin = dc.indexOf("; " + prefix);
  if (begin == -1) {
    begin = dc.indexOf(prefix);
    if (begin != 0) return null;
  } else
    begin += 2;
  var end = document.cookie.indexOf(";", begin);
  if (end == -1)
    end = dc.length;
  return unescape(dc.substring(begin + prefix.length, end));
}
