// JavaScript Document
var wh = 0;
function getHeight() {
	if( typeof( window.innerWidth ) == 'number' ) {
		//Non-IE
    wh = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    wh = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    wh = document.body.clientHeight;
  }
	return wh;
	
}
var scrOfY = 0;
function getScrollY() {
  if( typeof( window.pageYOffset ) == 'number' ) {
  	//Netscape compliant
   	scrOfY = window.pageYOffset;
  } else if( document.body && document.body.scrollTop) {
    //DOM compliant
    scrOfY = document.body.scrollTop;
  } else if( document.documentElement && document.documentElement.scrollTop ) {
    //IE6 standards compliant mode
    scrOfY = document.documentElement.scrollTop;
		
  }
	//alert(document.documentElement.scrollTop);
	return scrOfY;
}
//426px
//150 pixel is the middle point of two pictures
var y = 0;
var ty = 0;
var trg = false;
var top = 0;
var hook = false;
function slide() {
	if (!trg && !hook) {
		trg = document.getElementById("slideImg");
		top = 426;
		hook = true;
		if (!trg) {
			trg = document.getElementById("slideImg2");
			if (!trg)	return;
			top = 302;
			hook = true;
		}
	}
	ty = getScrollY() + Math.round(getHeight() / 2) - top - 150;
	if (ty <= 0) ty = 0;
	if (y != ty) { y = Math.round(y + (ty - y) / 10); }
	trg.style.marginTop = y + 'px';
	setTimeout("slide()", 20);
}
setTimeout("slide()", 20);