// -----------------------------------------------------------------------------------
// Write updateinfo
// -----------------------------------------------------------------------------------

function UpdateInfo(year, month, day, hour, minute) {
  var created = new Date(year, month - 1, day, hour, minute, 0);
  var modified = new Date(Date.parse(document.lastModified));
	var now = new Date();
  document.open();
  document.write("Skapad:     " + BuildDateTimeString(created, false) + " CET<br>\n");
  document.write("Uppdaterad: " + BuildDateTimeString(modified, false) + " CET<br>\n");
  document.write("Copyright &copy; " + created.getFullYear() + " - " + now.getFullYear() + "\n");
  document.close();
}

function BuildDateTimeString(date, showseconds) {
  str = "";
  str = date.getFullYear();
  str += "-";
  if (date.getMonth() < 9) str += "0";
  str += (date.getMonth() + 1);
  str += "-";
  if (date.getDate() < 10) str += "0";
  str += date.getDate();
  str += " ";
  if (date.getHours() < 10) str += "0";
  str += date.getHours();
  str += ":";
  if (date.getMinutes() < 10) str += "0";
  str += date.getMinutes();
  if(showseconds) {
    str += ":";
    if (date.getSeconds() < 10) str += "0";
    str += date.getSeconds();
  }
  return str;
}

// -----------------------------------------------------------------------------------
// Check browser
// -----------------------------------------------------------------------------------
/*
   DynAPI Distribution
   Browser Class

   The DynAPI Distribution is distributed under the terms of the GNU LGPL license.
*/

function Browser() {
  this.name=navigator.appName;
  if (name=="Netscape") this.n="ns";
  else if ((this.name=="Opera") || (navigator.userAgent.indexOf("Opera")>0)) this.n = "opera";
  else if (this.name=="Microsoft Internet Explorer") this.n="ie";
  if (!this.name) alert('Unidentified browser./nThis browser is not supported,');
	
  this.version=navigator.appVersion;
  this.v=parseInt(this.version);
  
  this.isNS=(this.n=="ns" && this.v>=4);
  this.isNS4=(this.n=="ns" && this.v==4);
  this.isNS6=(this.n=="ns" && this.v==5);
  this.isIE=(this.n=="ie" && this.v>=4);
  this.isIE4=(this.version.indexOf('MSIE 4')>0);
  this.isIE5=(this.version.indexOf('MSIE 5')>0);
  this.isIE55=(this.version.indexOf('MSIE 5.5')>0);
  if (this.isIE) {
    start = this.version.indexOf('MSIE') + 5;
    stop = this.version.indexOf(';', start);
    this.v = this.version.slice(start, stop);
  }
  this.isOpera=(this.n=="opera");
  
  this.isDOM=(document.createElement && document.appendChild && document.getElementsByTagName)?true:false;
  this.isDef=(this.ie||this.dom); // most used browsers, for faster if loops
  
  var ua=navigator.userAgent.toLowerCase();
  if (ua.indexOf("win")>-1) this.platform="Windows";
  else if (ua.indexOf("mac")>-1) this.platform="Mac";
  else this.platform="other";
}
browser = new Browser();
