function kokotarkistus()
{
  var Btop = document.getElementById('bottomline').offsetTop;
  var Ktop = document.getElementById('kehys').offsetTop
  var plusTKtop = 0;
  var UNtop = 230;
  var Kheight = Btop - Ktop - 100;
  // if (browser == "Safari") Kheight = Kheight - 10;
  if (Kheight > 620) 
    {
      LiikaaTop = Kheight - 620;
      Kheight = 620;
      if (LiikaaTop > 64)
       {
        plusTKtop = LiikaaTop - 64;
        document.getElementById('taustakuva').style.top = plusTKtop + "px";
       }
    }
  if (Kheight < 620)
    {
      UNtop = 230 - (620-Kheight);
      if (UNtop < 0) UNtop = 0;
      document.getElementById('uutisnosto').style.marginTop = UNtop + "px";
    }  
  document.getElementById('kehys').style.height = Kheight + "px";
  Slideheight = Kheight;
  return(Slideheight);
}

function uudista_sivu()
{
  location.reload();
}


  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
  // window.alert( 'Width = ' + myWidth );
  // window.alert( 'Height = ' + myHeight );

var taustakorkeus = myHeight - 110;
var resizeTimer = null;

      
  $(document).ready(function() {
      $("#bottomline").addClass("screenbottom");	
      $("body").addClass("oflhidden");
      $("#taustakuva").addClass("oflhidden");
      taustakorkeus = kokotarkistus();
      $(window).bind('resize', function() { 
        if (resizeTimer) clearTimeout(resizeTimer);
        resizeTimer = setTimeout("uudista_sivu()", 100);
      });
   }); 


