/* 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 haeUutiset(sivu, lahtoid)
  {
    xmlHttp = ajaxInit();
    xmlHttp.onreadystatechange=function()
	  {
	  if(xmlHttp.readyState==4)
	    {
	    kohde = document.getElementById("nosto_uutiset");
	    kohde.innerHTML=xmlHttp.responseText + '<div class="clear_both"></div>';
	    }
    }
    document.getElementById("u1").style.background = "#eee";
    document.getElementById("u2").style.background = "#eee";
    document.getElementById("u1").style.border = "1px solid #d0d0d0";
    document.getElementById("u2").style.border = "1px solid #d0d0d0";

    lahtoid.style.background = "white";
    lahtoid.style.border = "1px solid white";

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


function Blogit(sivu, lahtoid)
  {
    xmlHttp = ajaxInit();
    xmlHttp.onreadystatechange=function()
	  {
	  if(xmlHttp.readyState==4)
	    {
	    kohde = document.getElementById("nosto_blogit");
	    kohde.innerHTML=xmlHttp.responseText + '<div class="clear_both"></div>';
	    }
    }

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

