/*
http://www2.ocn.ne.jp/~yoochan/decoration/JavaScript/library_dom.htm
クロスブラウザ実現のための基本関数群（DOMブラウザ対応）より
*/

function getWindowHeight(){
  if(window.innerHeight) return window.innerHeight; // Mozilla, Opera, NN4
  if(document.documentElement && document.documentElement.clientHeight){ // 以下 IE
   return document.documentElement.clientHeight;
  }
  else if(document.body && document.body.clientHeight){
   return document.body.clientHeight;
  }
  return 0;
}

function getWindowWidth(){
  if(window.innerWidth) return window.innerWidth; // Mozilla, Opera, NN4
  if(document.documentElement && document.documentElement.clientWidth){ // 以下 IE
   return document.documentElement.clientWidth;
  }
  else if(document.body && document.body.clientWidth){
   return document.body.clientWidth;
  }
  return 0;
}

function Change(i,j) {
	Img = i
	ImgName = j
	document.images[Img].src = ImgName
}

function slidePage(point) {
  step=80;
  start=getWinYOffset();
  difference=point-start;
  tmp=difference;
  k = 0.80;
  i=0;
  move()
}

function move() {
  if (i<step) {
    tmp=tmp*k;
    window.scroll(0,start+(difference-tmp));
    setTimeout("move()",0)
    i++;
  } else {
    window.scroll(0,difference+start)
  }
}

/*
http://www2.ocn.ne.jp/~yoochan/decoration/JavaScript/library_dom.htm
クロスブラウザ実現のための基本関数群（DOMブラウザ対応）より、スクロールY座標を
取得する関数群を拝借
*/
function getWinYOffset(){
  if(window.scrollY) return window.scrollY; // Mozilla
  if(window.pageYOffset) return window.pageYOffset; // Opera, NN4
  if(document.documentElement && document.documentElement.scrollTop){ // 以下 IE
   return document.documentElement.scrollTop;
  }
  else if(document.body && document.body.scrollTop){
   return document.body.scrollTop;
  }
  return 0;
}
