<!--
function gendate(){ //Generates date in format "Måndagen den 24 November 20005"
     now=new Date();
     var year = now.getYear()
     if (year < 1000){year+=1900}
    var months=new Array("Januari","Februari","Mars","April","Maj","Juni","Juli","Augusti","September","Oktober","November","December");
    // create array of day names
    var weekDay = new Array("Söndag","Måndag","Tisdag","Onsdag","Torsdag","Fredag","Lördag")
    var date=weekDay[now.getDay()] + "en den " + now.getDate()+" "+months[now.getMonth()]+" "+year;
    document.write(date)
}

function updat(){
update = new Date(document.lastModified);
theMonth = update.getMonth()+1;
if(theMonth<10)theMonth="0"+theMonth;
theDate = update.getDate();
if(theDate<10)theDate="0"+theDate;
theYear = update.getYear();
if(theYear<2000) theYear=1900+theYear;
document.write("Uppdaterad " + theYear + "-" + theMonth + "-" + theDate);
}

// Date controlled code, don't forget </div> at end of block!
function newUntil (styear, stmonth, stday, exyear, exmonth, exday){
notstarted = 'display:none';
running = 'display:block';
ended = 'display:none';

 now = new Date();
 expire = new Date (exyear, exmonth-1, exday, now.getHours(), now.getMinutes(), now.getSeconds()+1 );
 start = new Date (styear, stmonth-1, stday, now.getHours(), now.getMinutes(), now.getSeconds()+1 );
 st = Math.round(start.getTime()/3600000);
 ex = Math.round(expire.getTime()/3600000);
 nu = Math.round(now.getTime()/3600000);
  if ( st  > ex ){
  alert("Start time is greater than the expire time\n\nConsider your settings");
  return(notstarted);
  }
 if ( st > nu ) // the event has not started yet
  return(notstarted);
 if ( st  <=  nu && ex  >= nu ) // the event is running
  return(running);
 if ( ex < nu ) // the event is ended
  return(ended);
}
// End date-controlled code

//Script for showing full-size images
var pictwin = null; //initialize variable for item window
var docwin = null; //initialize variable for document window

function show(url,wdt,hgt){
var lsY = window.screen.availHeight / 2 - hgt / 2;
var lsX = window.screen.availWidth / 2 - wdt / 2;
var tmp = ""; //initialize variable for item window code
tmp += '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">\n'
tmp += '<HTML><HEAD><TITLE>Klicka i bilden för att stänga fönstret</TITLE>\n'
tmp += '<META HTTP-EQUIV="imagetoolbar" CONTENT="no">\n'
tmp += '</HEAD>\n'
tmp += '<BODY BGCOLOR=#000000 leftmargin=0 marginwidth=0 topmargin=0 marginheight=0 oncontextmenu="return false">\n'
tmp += '<TABLE cellpadding="0" cellspacing="0" border="0"  width="100%" height="100%"><TR><TD align="center" valign="middle">\n'
tmp += '<A HREF="javascript:self.close();" title="Klicka i bilden för att stänga fönstret"><IMG SRC="' + url + '" border="0"></A>\n'
tmp += '</TD></TR></TABLE>\n'
tmp += '</BODY></HTML>'
var features = "scrollbars=no,menubar=no,resizable=no,status=no,width="+(wdt+4)+",height="+(hgt+4)+",left="+lsX+",top="+lsY;
  pictwin = window.open("","picWin",features);  //Create window
  pictwin.document.write(tmp);
  pictwin.document.close();
  window.pictwin.focus();
}
function showdoc(url,wdt,hgt) {
  var lsY = window.screen.availHeight / 2 - hgt / 2;
  var lsX = window.screen.availWidth / 2 - wdt / 2; 
  features = "scrollbars=yes,menubar=no,resizable=yes,status=no,width="+wdt+",height="+hgt+",left="+lsX+",top="+lsY;
  docwin = window.open(url,"documentWin",features);  //Create window
  window.docwin.focus();
}

function killwin(){ // closes window "pictwin"
if(pictwin!=null && !pictwin.closed){
pictwin.close();
pictwin = null;
 }
if(docwin!=null && !docwin.closed){ // closes window "docwin"
docwin.close();
docwin = null;
 }
}


window.onfocus = killwin; // closes window "pictwin" and/or "docwin" when main window gets focus
//-->