function nameload()
{
  if (bild.width > 0)
  {
    var h2 = document.getElementsByTagName("h2")[0];
    h2 = h2.firstChild.data;
    document.getElementById("maja").firstChild.data = h2;
    if (bild.width > 395)
    {
      document.getElementById("kuva").setAttribute("width", 395);
    }
    else if (bild.height > 330)
    {
      document.getElementById("kuva").setAttribute("height", 330);
    }
    document.getElementById("kuva").src = bild.src;
  }
  else
  {
    window.setTimeout("nameload()", 10);
  }
}
function checkovl()
{
  var h2 = document.getElementsByTagName("h2")[0];
  if (h2.getAttribute("id") == "maja") {reslogo()}
}
function reslogo()
{
  document.getElementById("maja").firstChild.data = document.getElementById("L01").firstChild.data;
  document.getElementById("kuva").removeAttribute("height");
  document.getElementById("kuva").removeAttribute("width");
  document.getElementById("kuva").src = "srmlogo.jpg";
}
function loadpic(url)
{
  reslogo();
  bild = new Image();
  bild.src = url;
  window.setTimeout("nameload()", 10);
}

function wheelZoom(e)
{
  if(window.event) { event.returnValue = false; } // IE
  if(e.cancelable) { e.preventDefault(); }        // DOM-Standard

  if (!e) { e = window.event; }                   // Event-Objekt für IE
  if (e.detail)
  {                                               // Firefox
    if (e.detail < 0) {map.zoomIn();}
    else {map.zoomOut();}
  }
  else if (e.wheelDelta)
  {                                               // IE
    if (e.wheelDelta > 0) { map.zoomIn(null, null, true); }
    else { map.zoomOut( null, true); }
  }
}

function resize()
{
//  var ce = new GLatLng(map.getCenter());
  var iw, ih;
  if (self.innerHeight) // all except Explorer
  {
    iw = self.innerWidth;
    ih = self.innerHeight;
  }
  else if (document.documentElement && document.documentElement.clientHeight) // Explorer 6 Strict Mode
  {
    iw = document.documentElement.clientWidth - 3;
    ih = document.documentElement.clientHeight - 7;
  }
  else if (document.body) // other Explorers
  {
    iw = document.body.clientWidth;
    ih = document.body.clientHeight;
  }

  if (ih < 690) {ih = 690}
  var mm = document.getElementById("map");
  document.getElementById("map").style.height = (ih - 93) + "px";
  document.getElementById("pictab").setAttribute("height", ih - 283);

  if (iw < 1035) {iw = 1035}
  document.getElementById("map").style.width = (iw - 535) + "px";
  document.getElementById("maptab").setAttribute("width", iw - 529);
  document.getElementById("maintab").setAttribute("width", iw - 18);
  map.checkResize();
//  window.setTimeout("map.panTo(ce)", 200);
}

function show()
{
  var i;
  var c;
  for (i = 1; i < 100; i++)
  {
    if (marker[i])
    {
      c = marker[i].getIcon().image;
      c = c.substr(41, c.length - 45);
      if (document.getElementById(c).checked == true) {marker[i].show()} else {marker[i].hide()}
    }
  }
}

function sprache(code)
{
  switch(code)
  {
  case "en":
    var L01 = "Youth Hostels in Finland";
    var L02 = "All information without guarantee";
    var L03 = "Kind of building";
    var L04 = "all year round";
    var L05 = "only summer";
    var L06 = "Farmhouses on the country";
    var L07 = "Other buildings on the country";
    var L08 = "Buildings with camping place";
    var L09 = "Old buildings in the city";
    var L10 = "Modern buildings in the city";
    break;
  case "fi":
    var L01 = "Retkeilymajat Suomessa";
    var L02 = "Kaikki tiedotuksia ilman takuua";
    var L03 = "Rakennuksien tyyppi";
    var L04 = "koko vuosi";
    var L05 = "vain kesällä";
    var L06 = "Maatilat";
    var L07 = "Muut rakennukset maaseudussa";
    var L08 = "Rakennukset leirintäalueella";
    var L09 = "Vanhat rakennukset kaupungissa";
    var L10 = "Modernit rakennukset kaupungissa";
    break;
  case "de":
    var L01 = "Jugendherbergen in Finnland";
    var L02 = "Alle Informationen ohne Gewähr";
    var L03 = "Art der Gebäude";
    var L04 = "ganzjährig";
    var L05 = "nur Sommer";
    var L06 = "Bauernhäuser auf dem Land";
    var L07 = "Andere Gebäude auf dem Land";
    var L08 = "Gebäude mit Campingplatz";
    var L09 = "Alte Gebäude in der Stadt";
    var L10 = "Moderne Gebäude in der Stadt";
    break;
  }
  document.getElementById("L01").firstChild.data = L01;
  document.getElementById("maja").firstChild.data = L01;
  document.getElementById("title").text = L01;
  document.getElementById("L02").firstChild.data = L02;
  document.getElementById("L03").firstChild.data = L03;
  document.getElementById("L04").firstChild.data = L04;
  document.getElementById("L05").firstChild.data = L05;
  document.getElementById("L06").firstChild.data = L06;
  document.getElementById("L07").firstChild.data = L07;
  document.getElementById("L08").firstChild.data = L08;
  document.getElementById("L09").firstChild.data = L09;
  document.getElementById("L10").firstChild.data = L10;
}
