$(document).ready(function () {
  $('#vaihto1').hover(function() {
      $("#image1").fadeIn("fast");
  }, function () {
      $("#image1").fadeOut("fast");
  });
});

$(document).ready(function () {
  $('#vaihto2').hover(function() {
      $("#image2").fadeIn("fast");
  }, function () {
      $("#image2").fadeOut("fast");
  });
});

$(document).ready(function () {
  $('#vaihto3').hover(function() {
      $("#image3").fadeIn("fast");
  }, function () {
      $("#image3").fadeOut("fast");
  });
});

$(document).ready(function () {
  $('#vaihto42').hover(function() {
      $("#image4").fadeIn("fast");
      $("#historialista").fadeIn("fast");
  }, function () {
      $("#image4").fadeOut("fast");
      $("#historialista").fadeOut("fast");
  });
});

$(document).ready(function () {
  $('#vaihto5').hover(function() {
      $("#image5").fadeIn("fast");
  }, function () {
      $("#image5").fadeOut("fast");
  });
});

$(document).ready(function () {
  $('#vaihto6').hover(function() {
      $("#image6").fadeIn("fast");
  }, function () {
      $("#image6").fadeOut("fast");
  });
});

$(document).ready(function () {
  $('#vaihto7').hover(function() {
      $("#image7").fadeIn("fast");
	document.getElementById("image71").style.display="block";
      $("#image71").fadeIn(1);
  }, function () {
      $("#image7").fadeOut("fast");
	document.getElementById("image71").style.display="none";
  });
});

$(document).ready(function () {
  $('#vaihto8').hover(function() {
      $("#image8").fadeIn("fast");
	document.getElementById("image81").style.display="block";
      $("#image81").fadeIn(1);
  }, function () {
      $("#image8").fadeOut("fast");
	document.getElementById("image81").style.display="none";
  });
});

function link(nmbr,language){

if (language != "2"){

if (nmbr == "1"){
window.open ("index.html","_top");
} else if (nmbr == "2"){
window.open ("simulaattori.html","_top");
} else if (nmbr == "3"){
window.open ("ajankohtaista.html","_top");
} else if (nmbr == "4"){
window.open ("historia.html","_top");
} else if (nmbr == "5"){
window.open ("yhteystiedot.html","_top");
} else if (nmbr == "6"){
window.open ("yhteistyokumppanit.html","_top");
} else if (nmbr == "7"){
document.getElementById("sahkoposti1").style.display = "block";
document.getElementById("sahkoposti2").style.display = "block";
document.getElementById("sahkoposti3").style.display = "none";
} else if (nmbr == "8"){
window.open ("http://www.lentosimulaattori.1g.fi/kuvat/","_blank");
} else if (nmbr == "9"){
window.open ("http://www.youtube.com/user/Cessna172sim","_blank");
}

} else {

if (nmbr == "1"){
window.open ("index-eng.html","_top");
} else if (nmbr == "2"){
window.open ("simulaattori-eng.html","_top");
} else if (nmbr == "3"){
window.open ("ajankohtaista-eng.html","_top");
} else if (nmbr == "4"){
window.open ("historia-eng.html","_top");
} else if (nmbr == "5"){
window.open ("yhteystiedot-eng.html","_top");
} else if (nmbr == "6"){
window.open ("yhteistyokumppanit-eng.html","_top");
} else if (nmbr == "7"){
document.getElementById("sahkoposti1").style.display = "block";
document.getElementById("sahkoposti2").style.display = "block";
document.getElementById("sahkoposti3").style.display = "none";
} else if (nmbr == "8"){
window.open ("http://www.lentosimulaattori.1g.fi/kuvat/","_blank");
} else if (nmbr == "9"){
window.open ("http://www.youtube.com/user/Cessna172sim","_blank");
}

}

}

function linkhover(theid, action){
if (action == "1"){
if (theid == "1"){
document.getElementById("image1").src = "pic/linkkihighlighthover.gif";
} else if(theid == "2"){
document.getElementById("image2").src = "pic/linkkihighlighthover.gif";
} else if(theid == "3"){
document.getElementById("image3").src = "pic/linkkihighlighthover.gif";
} else if(theid == "4"){
document.getElementById("image4").src = "pic/linkkihighlighthover.gif";
} else if(theid == "5"){
document.getElementById("image5").src = "pic/linkkihighlighthover.gif";
} else if(theid == "6"){
document.getElementById("image6").src = "pic/linkkihighlighthover.gif";
} else if(theid == "7"){
document.getElementById("image7").src = "pic/linkkihighlighthover.gif";
} else if(theid == "8"){
document.getElementById("image8").src = "pic/linkkihighlighthover.gif";
}
} else {
if (theid == "1"){
document.getElementById("image1").src = "pic/linkkihighlight.gif";
} else if(theid == "2"){
document.getElementById("image2").src = "pic/linkkihighlight.gif";
} else if(theid == "3"){
document.getElementById("image3").src = "pic/linkkihighlight.gif";
} else if(theid == "4"){
document.getElementById("image4").src = "pic/linkkihighlight.gif";
} else if(theid == "5"){
document.getElementById("image5").src = "pic/linkkihighlight.gif";
} else if(theid == "6"){
document.getElementById("image6").src = "pic/linkkihighlight.gif";
} else if(theid == "7"){
document.getElementById("image7").src = "pic/linkkihighlight.gif";
} else if(theid == "8"){
document.getElementById("image8").src = "pic/linkkihighlight.gif";
}
}
}