function alustaSivu() {
	var sivu=haeSivunKorkeus();
	var ikkuna=haeIkkunanKorkeus();
	var footer=document.getElementById("footer").offsetHeight;
	
	var summa=sivu;
	
	if(summa<ikkuna) {
		document.getElementById("footer").style.position='absolute';
		document.body.focus();
	}
}

function palkkiMouseOver(mika, sivu) {
	document.getElementById(mika).style.backgroundImage="url(kuvat/palkki_bg.png)";
	document.getElementById(mika).style.textDecoration="underline";
}
function palkkiMouseOut(mika, sivu) {
	document.getElementById(mika).style.backgroundImage="url(kuvat/linkit_bg.png)";
	document.getElementById(mika).style.textDecoration="none";
}

//HAE SIVUN MITAT
function haeSivunLeveys()
{
	var sivunLeveys;
		
	if(window.innerHeight && window.scrollMaxY) 
	{	
		sivunLeveys = document.body.scrollWidth;
	} 
	else if(document.body.scrollWidth > document.body.offsetWidth)
	{
		sivunLeveys = document.body.scrollWidth;
	} 
	else
	{
		sivunLeveys = document.body.offsetWidth;
	}
	
	this.sivunLeveys = sivunLeveys;
	return this.sivunLeveys;
}

function haeSivunKorkeus()
{
	//alert("haeSivunKorkeus");
	var sivunKorkeus;
	
	if(window.innerHeight && window.scrollMaxY) 
	{	
		sivunKorkeus = window.innerHeight + window.scrollMaxY;
	} 
	else if(document.body.scrollHeight > document.body.offsetHeight)
	{
		sivunKorkeus = document.body.scrollHeight;
	} 
	else
	{
		sivunKorkeus = document.body.offsetHeight;
	}
	
	this.sivunKorkeus = sivunKorkeus;
	return this.sivunKorkeus;
}

function haeIkkunanLeveys()
{
	var ikkunanLeveys;
		
	if(window.innerWidth) 
	{
    	ikkunanLeveys = window.innerWidth;
    } 
	else if(document.documentElement && document.documentElement.clientWidth) 
	{
    	ikkunanLeveys = document.documentElement.clientWidth;
	} 
	else if(document.body && document.body.clientWidth) 
	{
    	ikkunanLeveys = document.body.clientWidth;
  	}
	
	return ikkunanLeveys;
}

function haeIkkunanKorkeus()
{
	var ikkunanKorkeus;
	
	if(window.innerHeight) 
	{
    	ikkunanKorkeus = window.innerHeight;
	} 
	else if(document.documentElement && document.documentElement.clientHeight) 
	{
    	ikkunanKorkeus = document.documentElement.clientHeight;
	} 
	else if(document.body && document.body.clientHeight) 
	{
    	ikkunanKorkeus = document.body.clientHeight;
  	}
	
	return ikkunanKorkeus;
}
