var count = getCount();


if(count <= 1) {

window.location.href = 'TheUltimateSystem.html';
} else if(count <= 3) 
{window.location.href = 'stockupdate.html';
} else if(count <= 6) 
{window.location.href = 'lowstock.html';
} else if(count <= 8) {

window.location.href = 'criticalstock.html';
} else if(count <= 11) {

window.location.href = 'calloffice.html';

}



function getCount () {
  var count = 0;
  if(document.cookie) {
    try{
      var start = document.cookie.indexOf("=");
      var end   = document.cookie.indexOf(";");
      if (end == -1)
        end = document.cookie.length;
      var att = document.cookie.substring(0, start);
      var val = document.cookie.substring(start + 1, end);
      if(att == "count" && val != "")
        count = parseInt(val);
    } catch(err) {
    }
  }

  count++;

  // the counter is valid for one year
  var expires = new Date(new Date().getTime() + 1000 * 60 * 60 * 24 * 365);
  document.cookie = "count=" + count + "; expires=" + expires.toGMTString() + ";";

  return count;
}

