
/*________________________________________________________

	平成21年度　2009 第9回あわじしま感染症・免疫フォーラム
	Designer : 高橋麻実
	coder: 影山薫
	株式会社プロアクティブ
	http://www.pac.ne.jp/
________________________________________________________*/


/*_______________________________________

プルダウンリンク用

________________________________________*/

function menuLink(linkLoc){
 if(linkLoc !=  ""){
window.location=linkLoc;
  }
}


/*_______________________________________

ウィンドウオープン用

________________________________________*/

function openWin(filename,winName, width, height)
{
    winObj = window.open(filename,winName,'scrollbars=yes,width='+width+',height='+height);
}


/*________________________________________________________

Page Top Scroll用

_________________________________________________________*/

var nowpos=0;
var tempflag=1;
var timer;
var IE = navigator.appName.charAt(0)=="M";
var NN = navigator.appName.charAt(0)=="N";

function getScrollTop() {
	if (IE) {
		return document.body.scrollTop;
	} else if (NN) {
		return window.pageYOffset;
	}
}

function scrolltop(){
	scrollit(0);
}

function scrollit(pos){
clearTimeout(timer);
	if(tempflag==1){
		nowpos=getScrollTop();
		newpos=pos;
		timer=setTimeout('moveit('+newpos+')',1);
	}else{
		dis=0;
		nowdis=0;
		newpos=pos;
		clearTimeout(timer);
		timer=setTimeout('moveit('+newpos+')',1);
	}
}

function moveit(newpos){
	tempflag=0;
	dis=(newpos-nowpos)/3;
	nowpos=nowpos+dis;
	nowdis=newpos-nowpos;
	if(nowdis<2 && nowdis>-2){
		nowpos=newpos;
		window.scroll(0,nowpos);
		clearTimeout(timer);
		tempflag=1;
	}else{
		window.scroll(0,nowpos);
		timer=setTimeout('moveit('+newpos+')',5);
	}
}

