function findPos178(obj) {
	var curtop = 0;
	if (obj.offsetParent) {
	do {
			curtop += obj.offsetTop;
		} while (obj = obj.offsetParent);
	return curtop;
}
}


function scrollPos178() {
var ScrollTop = document.body.scrollTop;
if (ScrollTop == 0)
{
    if (window.pageYOffset)
        ScrollTop = window.pageYOffset;
    else
        ScrollTop = (document.body.parentElement) ? document.body.parentElement.scrollTop : 0;
}
return ScrollTop;
}


function winH178() {
  var myHeight = 0;
  if( typeof( window.innerHeight ) == 'number' ) {
    //Non-IE
    myHeight = window.innerHeight;
  } else if( document.documentElement && document.documentElement.clientHeight ) {
    //IE 6+ in 'standards compliant mode'
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && document.body.clientHeight ) {
    //IE 4 compatible
    myHeight = document.body.clientHeight;
  }
return myHeight;
}
setInterval("script178()",500);
function script178() {
var scroll, sarj;
scroll = scrollPos178() + winH178()/2;
sarj = findPos178(document.getElementById('sarjis178')) + 400;
	if ( Math.abs(scroll - sarj) < winH178()/2 + 400 ) { //näkyy
		document.getElementById('sarjis178').src = "http://www.pikkutunneilla.com/wp-content/uploads/2009/11/178valmis.jpg";
		}
	else
		{
		document.getElementById('sarjis178').src = "http://www.pikkutunneilla.com/wp-content/uploads/2009/11/178valmisa.jpg";

}
	}
