
function genDate( year, month, date )
{	
    dateString = "&Date=" + year + "-" + month + "-" + date;
          
    top.location.href =
    '/pls/portal30/url/page/ilkka/j1?depa=4' + dateString;
}

function fetch20dates()
{
  aDay = 24*60*60*1000;
  now = new Date();
  then = new Date( now.getTime() - ( 20 * aDay ) );
  text = '<select name="Date" ONCHANGE="document.sel20.submit()">\n<option value="nochoise">Valitse p&auml;iv&auml;m&auml;&auml;r&auml;</option>\n';
  for( i = now.getTime()-aDay; i >= then.getTime(); i -= aDay )  
  {
    date = new Date( i );
    year = date.getYear();
    if( year < 1900 ) year += 1900;
    dateString = date.getDate() + '.' + ( date.getMonth() + 1 ) + '.' + year;
    dateString2 = year + '-' + ( date.getMonth() + 1 ) + '-' + date.getDate();
    text += '\n<option value="' + dateString2 + '">' + dateString + '</option>';
  }
  text += '</select>';
  document.write( text );
}

function date(yearin,monthin,dayin,dayOfWeek )
{
month = new Array(12);
month[0] = "tammikuuta";
month[1] = "helmikuuta";
month[2] = "maaliskuuta";
month[3] = "huhtikuuta";
month[4] = "toukokuuta";
month[5] = "kes&auml;kuuta";
month[6] = "hein&auml;kuuta";
month[7] = "elokuuta";
month[8] = "syyskuuta";
month[9] = "lokakuuta";
month[10] = "marraskuuta";
month[11] = "joulukuuta";

weekday = new Array(7);
weekday[0] = "Sunnuntai";
weekday[1] = "Maanantai";
weekday[2] = "Tiistai";
weekday[3] = "Keskiviikko";
weekday[4] = "Torstai";
weekday[5] = "Perjantai";
weekday[6] = "Lauantai";
weekday[7] = "Sunnuntai";

today = new Date();
thismonth = today.getMonth();
thisyear = today.getYear();
thisdate = today.getDate();
thisday = today.getDay();

if( yearin != '' )
    thisyear = yearin;
if( monthin != '' )
    thismonth = monthin-1;
if( dayOfWeek != '' )
    thisday = dayOfWeek-1;
if( dayin != '' )
    thisdate = dayin;

if (thisyear < 1000)
{
thisyear = thisyear + 1900
}

document.write(weekday[thisday] + " " + thisdate + ". " + month[thismonth] + " " + thisyear)
}

function popupsaa2(saa)  {
var props = "Scrollbars=1,resizable=1,width=550,height=630";
var url = "/suomi.html";
    w = open(url,"saa",props);
    if ( w.opener == null )
        w.opener = self;
        w.focus();
}