function NytVindue(url,navn) {
 var options="toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=655,height=495,top=100,left=100";
 msgwindow=window.open(url,navn,options);
}

function datecalculator(oform) {
 var now = new Date();

 var lngt = oform["OTKDLmonum"];
 var typ = oform["OTKDLmoval"];
 var out = oform["ffa"];

 var months=new Array(12);
 months[0]="Jan";
 months[1]="Feb";
 months[2]="Mar";
 months[3]="Apr";
 months[4]="May";
 months[5]="Jun";
 months[6]="Jul";
 months[7]="Aug";
 months[8]="Sep";
 months[9]="Oct";
 months[10]="Nov";
 months[11]="Dec"; 

 if(isNaN(lngt.value) || (lngt.value <= 0)) {
  lngt.value = "0";
  typ.value = "dg";
  out.value = now.getDate() + ". " + months[now.getMonth()] + " " + now.getFullYear();
 }
 else {
  if(typ.value == "dg") {
   now.setDate(now.getDate() + (lngt.value*1));
  }
  else if(typ.value == "wk") {
   now.setDate(now.getDate() + (lngt.value*7));
  }
  else if(typ.value == "md") {
   now.setMonth(now.getMonth() + (lngt.value*1));
  }
  else if(typ.value == "yr") {
   now.setFullYear(now.getFullYear() + (lngt.value*1));
  }
  out.value = now.getDate() + ". " + months[now.getMonth()] + " " + now.getFullYear()
 }
}
