function aPrivate() {
  var isPrivate = true;
  tempVar01 = document.URL;
  if (tempVar01.indexOf("pa") > 1 ) {
    isPrivate = false;
  }
  return isPrivate;
}


function timeStamp() {
  var currentTime = new Date();
  var hours = currentTime.getHours();
  var minutes = currentTime.getMinutes();
  if (minutes < 10){
    minutes = "0" + minutes;
  }
  var seconds = currentTime.getSeconds();
  if (seconds < 10){
    seconds = "0" + seconds;
  }
  return hours+minutes+seconds;
}

function GISapp(){
  var screenWidth = Math.floor(screen.width/100);

  switch (screenWidth) {
    case 8:
    case 9:
      zwidth = 850;
      zheight = 500;
      break;
    case 10:
      zwidth = 950;
      zheight = 600;
      break;
    case 11:
      zwidth = 1050;
      zheight = 700;
      break;
    case 12:
    case 13:
    case 14:
    case 15:
    case 16:
    case 17:
    case 18:
    case 19:
    case 20:
    case 21:
    case 22:
    case 24:
    case 25:
      zwidth = 1150;
      zheight = 800;
      break;
    default:
      zwidth = 950;
      zheight = 600;
      break;
  }

  var theURL = "";
  var tempVar01 = document.URL;
   var theLocation = 0;

  if (tempVar01.indexOf("index.html") < 0) {
    theURL = tempVar01 + "default.htm";
  } else {
    theURL = tempVar01.replace(/index.html/g,"default.htm");
  }
  if (isOnLine()) {
    var windowTitle = "rclis" + timeStamp()
    var w = window.open(theURL, windowTitle, "STATUS=YES,TOOLBAR=NO,RESIZABLE=YES,LOCATION=NO,DIRECTORIES=NO,COPYHISTORY=NO,MENU=NO,SCROLLBARS=NO,top=0,left=0,width="+zwidth+",height="+zheight+"");
    w.focus();
  } else {
    alert("The Riverside County Land Information System is not available.\nPlease check back later.");
  }
}

function isOnLine() {
  //           ,---------- THE 4 DIGIT YEAR
  //           | ,-------- THE MONTH. JAN=00, FEB=01, MAR=02, APRIL=03, MAY=04, JUNE=05, JULY=06, AUG=07, SEP=08, OCT=09, NOV=10, DEC=11
  //           | | ,------ THE DAY NEED LEADING 00
  //           | | | ,---- THE HOUR NEED LEADING 00  24 hour time
  //           | | | | ,-- THE MINUTE NEED LEADING 00
  var off = 200808200700;  // turn off rclis
  var on =  200808201900;  // turn on rclis back on
  var now = 0;     // for rclis not to be available. now needs to be between on and off

  var d = new Date();
  var year = d.getFullYear();

  var month = 00;
  if (d.getMonth() < 10) {
    month = "0" + d.getMonth(); }
  else {
    month = d.getMonth();
  }

  var date = 00;
  if (d.getDate() < 10) {
    date = "0" + d.getDate();
  } else {
    date = d.getDate();
  }

  var hours = 00;
  if (d.getHours() < 10) {
    hours = "0" + d.getHours();
  } else {
    hours = d.getHours();
  }

  var minutes = 00;
  if (d.getMinutes() < 10) {
    minutes = "0" + d.getMinutes();
  } else {
    minutes = d.getMinutes();
  }

  now = year + "" + month + "" + date + "" + hours + "" + minutes;
  if ((now > off) && (now < on)) {
    return false;    // alert("OFF");
  } else {
    return true;     // alert("ON");
  }
}
