// Collapsible Menus Code
function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function eraseCookie(name) {
	createCookie(name,"",-1);
}

function isOpenClose(theID) {
  var cmcookie = cmcookie + theID;
  var cmcookie = readCookie(theID);
  if (cmcookie == 'true') {
    document.getElementById(theID).style.display = "block";
  }
  else {
    document.getElementById(theID).style.display = "none";
  }
}
function openClose(theID) {
  var cmcookie = cmcookie + theID;
  if (document.getElementById(theID).style.display == "none") {
    document.getElementById(theID).style.display = "block";
    eraseCookie(theID);
    createCookie(theID,'true',30);
  }
  else {
    document.getElementById(theID).style.display = "none";
    eraseCookie(theID);
    createCookie(theID,'false',30);
  }
}
function collapseClose(theID) {
  var cmcookie = cmcookie + theID;
  document.getElementById(theID).style.display = "none";
  eraseCookie(theID);
  createCookie(theID,'false',30);
}
function collapseOpen(theID) {
  var cmcookie = cmcookie + theID;
  document.getElementById(theID).style.display = "block";
  eraseCookie(theID);
  createCookie(theID,'true',30);
}
function clearCookies() {
  eraseCookie('cat1');
  eraseCookie('cat2');
  eraseCookie('cat3');
  eraseCookie('cat4');
  eraseCookie('cat5');
  eraseCookie('cat6');
  eraseCookie('cat7');
  eraseCookie('cat8');
  eraseCookie('cat9');
  eraseCookie('cat10');
  eraseCookie('style');
  eraseCookie('mode');
  eraseCookie('ws');
  if (confirm('The following cookies were cleared: "cat1", "cat2", "cat3", "cat4", "cat5", "cat6", "cat7", "cat8", "cat9", "cat10", "style", "mode", "ws".\n\nIf there are any additional cookies that are stored by Pokezam.com or services located on Pokezam.com which you want to have removed by the tool, please send an email to rehtaew@gmail.com.\n\nReload the page?')) {
    location.reload(true);
  }
}