var cookieNameRoot = "saved_taxform_version1_slot";

function initialise() {      
   var savedCookies = false;
   
   for (var i = 0; i < 5; i++) {
      var fname = getFilename(cookieNameRoot + i);
      if (fname != null) {
         savedCookies = true;
         break;
      }
   }
   
   if (savedCookies) {
      document.getElementById("visibleifsavedcookies").style.display = "block";
   }
   
}  // initialise()

// Returns the value of the cookie with specified name
function getCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for (var i = 0; i < ca.length; i++) {
		var c = ca[i];
      var index = 0;
		while ( c.charAt(index) == ' ' ) index++;
		if ( c.indexOf(nameEQ, index) == index ) return c.substring(index + nameEQ.length);
	}
	return null;
}  // getCookie()

function getFilename(cookieName) {
   var theCookie = getCookie(cookieName);
   
   if (theCookie != null) {
      return decodeURIComponent( theCookie.substring( 1, theCookie.indexOf("#") ) );
   } else {
      return null;
   }   
}  // getFilename()

