function ShowHide (what)
{
  if (document.getElementById(what).style.display == "none")
    document.getElementById(what).style.display = "";
  else if (document.getElementById(what).style.display == "")
    document.getElementById(what).style.display = "none";
}

function OpenPicture (width, height, url)
{
  myWindow = window.open ("", "", "width=" + width + ", height=" + height + ", left=" + ((screen.width-width)/2) + ", top=" + ((screen.height-height)/2-50));
	myWindow.document.write("<body style=\"font-family:arial,cursive;font-size:11px;background:#eeeeee;margin:0px;padding:0px;\">\n");
	myWindow.document.write("<a href=\"javascript:window.close()\"><img style=\"border:0px;\" src=\"" + url + "\"/></a>");
	myWindow.document.close();
}

function OpenUserData (width, height, url)
{
  myWindow = window.open (url, "", "width=" + width + ", height=" + height + ", scrollbars=1, left=" + ((screen.width-width)/2) + ", top=" + ((screen.height-height)/2-50));
}

function SetMap ()
{
  document.getElementById('map').innerHTML = "<a target=\"blank\" href=\"http://maps.google.com/maps?f=d&hl=hu&geocode=&saddr="+document.travelsheetform.map1.value+"&daddr="+document.travelsheetform.map2.value+"\">Útvonal megtekintése a Google Maps-on</a>";
}

function WriteDates (to)
{
  document.getElementById(to).innerHTML = "";
  date = new Date (document.travelsheetform.year.value,document.travelsheetform.month.value-1,document.travelsheetform.day.value);
  c1 = document.travelsheetform.c1.value;
  c2 = document.travelsheetform.c2.value;
  i = parseInt(c1);
  while (i <= parseInt(c2)) {
    date.setDate (date.getDate () + parseInt(c1));
    month = date.getMonth () + 1;
    if (month < 10)
      month = "0" + month;
    day = date.getDate ();
    if (day < 10)
      day = "0" + day;
    dateString = date.getFullYear () + "-" + month + "-" + day;
    document.getElementById(to).innerHTML += dateString + "<br>";
    i = i + parseInt(c1);
  }
}
