/* Uudelleenkäytettävä Ajax-alustus */
function ajaxInit() 
  {
  var xmlHttp;
  try
    {
    // Firefox, Opera 8.0+, Safari
    xmlHttp=new XMLHttpRequest();
    }
  catch (e)
    {
    // Internet Explorer
    try
      {
      xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
      }
    catch (e)
      {
      try
        {
        xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
        }
      catch (e)
        {
        alert("Selaimesi ei tue Ajaxia!");
        return false;
        }
      }
    }
    return xmlHttp;
  }

function haeSisalto(sivu, lahtoid)
  {
    xmlHttp = ajaxInit();
    xmlHttp.onreadystatechange=function()
	  {
	  if(xmlHttp.readyState==4)
	    {
	    kohde = document.getElementById("nosto_ohjelma");
	    kohde.innerHTML=xmlHttp.responseText;
	    }
    }
    document.getElementById("n1").style.background = "transparent";
    document.getElementById("n2").style.background = "transparent";
    document.getElementById("n3").style.background = "transparent";
    document.getElementById("n4").style.background = "transparent";
    document.getElementById("n5").style.background = "transparent";
    document.getElementById("n6").style.background = "transparent";
    document.getElementById("n7").style.background = "transparent";
    document.getElementById("n8").style.background = "transparent";
    document.getElementById("n9").style.background = "transparent";
    lahtoid.style.background = "#ffffff";
    lahtoid.blur();

    xmlHttp.open("GET",sivu,true);
    xmlHttp.send(null);
  return false;
  }

function haeUutiset(sivu, lahtoid)
  {
    xmlHttp = ajaxInit();
    xmlHttp.onreadystatechange=function()
	  {
	  if(xmlHttp.readyState==4)
	    {
	    kohde = document.getElementById("nosto_uutiset");
	    kohde.innerHTML=xmlHttp.responseText;
	    }
    }
    /*document.getElementById("u1").style.background = "#eee";
    document.getElementById("u2").style.background = "#eee";
    document.getElementById("u3").style.background = "#eee";
    document.getElementById("u4").style.background = "#eee";*/
    /*document.getElementById("u1").style.border = "1px solid #d0d0d0";
    document.getElementById("u2").style.border = "1px solid #d0d0d0";
    document.getElementById("u3").style.border = "1px solid #d0d0d0";
    document.getElementById("u4").style.border = "1px solid #d0d0d0";*/
/*
    document.getElementById("u5").style.background = "transparent";
*/
    /*lahtoid.style.background = "white";
    lahtoid.style.border = "1px solid white";
    lahtoid.blur();*/
    document.getElementById("u1").style.background = "transparent";
    document.getElementById("u2").style.background = "transparent";
    document.getElementById("u3").style.background = "transparent";
    document.getElementById("u4").style.background = "transparent";
    lahtoid.style.background = "#ffffff";
        lahtoid.style.paddingTop = "5px";
        lahtoid.style.paddingRight = "10px";
        lahtoid.style.paddingBottom = "8px";
        lahtoid.style.paddingLeft = "10px";
        lahtoid.style.marginTop = "-5px";
        lahtoid.style.marginRight = "0";
        lahtoid.style.marginBottom = "0";
        lahtoid.style.marginLeft = "0";
        lahtoid.style.display = "block";

    

    xmlHttp.open("GET",sivu,true);
    xmlHttp.send(null);
  return false;
  }

function haeUrheilut(sivu, lahtoid)
  {
    xmlHttp = ajaxInit();
    xmlHttp.onreadystatechange=function()
	  {
	  if(xmlHttp.readyState==4)
	    {
	    kohde = document.getElementById("nosto_urheilu");
	    kohde.innerHTML=xmlHttp.responseText + '<div class="clear_both"></div>';
	    }
    }
    /*document.getElementById("ur1").style.background = "#eee";
    document.getElementById("ur2").style.background = "#eee";
    document.getElementById("ur3").style.background = "#eee";
    document.getElementById("ur1").style.border = "1px solid #d0d0d0";
    document.getElementById("ur2").style.border = "1px solid #d0d0d0";
    document.getElementById("ur3").style.border = "1px solid #d0d0d0";*/
/*
    document.getElementById("u4").style.background = "transparent";
    document.getElementById("u5").style.background = "transparent";
*/
    lahtoid.style.background = "white";
    //lahtoid.style.border = "1px solid white";
    lahtoid.blur();
    document.getElementById("ur1").style.background = "transparent";
    document.getElementById("ur2").style.background = "transparent";
    document.getElementById("ur3").style.background = "transparent";
    lahtoid.style.background = "#ffffff";
        lahtoid.style.paddingTop = "5px";
        lahtoid.style.paddingRight = "10px";
        lahtoid.style.paddingBottom = "8px";
        lahtoid.style.paddingLeft = "10px";
        lahtoid.style.marginTop = "-5px";
        lahtoid.style.marginRight = "0";
        lahtoid.style.marginBottom = "0";
        lahtoid.style.marginLeft = "0";
        lahtoid.style.display = "block";

    xmlHttp.open("GET",sivu,true);
    xmlHttp.send(null);
  return false;
  }

function haeViihde(sivu, lahtoid)
  {
    xmlHttp = ajaxInit();
    xmlHttp.onreadystatechange=function()
	  {
	  if(xmlHttp.readyState==4)
	    {
	    kohde = document.getElementById("nosto_viihde_sisalto");
	    kohde.innerHTML=xmlHttp.responseText + '<div class="clear_both"></div>';
	    }
    }
    document.getElementById("vi1").style.background = "transparent";
//    document.getElementById("vi2").style.background = "#eee";
    document.getElementById("vi3").style.background = "transparent";
    //document.getElementById("vi1").style.border = "1px solid #d0d0d0";
//    document.getElementById("vi2").style.border = "1px solid #d0d0d0";
    //document.getElementById("vi3").style.border = "1px solid #d0d0d0";
/*
    document.getElementById("u4").style.background = "transparent";
    document.getElementById("u5").style.background = "transparent";
*/
    lahtoid.style.background = "white";
    //lahtoid.style.border = "1px solid white";
    lahtoid.blur();
    lahtoid.style.background = "#ffffff";
        lahtoid.style.paddingTop = "5px";
        lahtoid.style.paddingRight = "10px";
        lahtoid.style.paddingBottom = "8px";
        lahtoid.style.paddingLeft = "10px";
        lahtoid.style.marginTop = "-5px";
        lahtoid.style.marginRight = "0";
        lahtoid.style.marginBottom = "0";
        lahtoid.style.marginLeft = "0";
        lahtoid.style.display = "block";

    xmlHttp.open("GET",sivu,true);
    xmlHttp.send(null);
  return false;
  }


