
/*________________________________________________________

	日本血液学会
	Designer:Mami Takahashi
	Proactive. Inc
	http://www.pac.ne.jp/
________________________________________________________*/

//------------------------------
// open window
//------------------------------
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function OpenWin( sTRURL ){
	var screen_width = screen.availWidth - 10;
	var screen_height = screen.availHeight - 30;
	sTRFeatures = "screenX=0,screenY=0,width=" + screen_width + ",height=" + screen_height +",";
	sTRFeatures += "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes";
	windowname=window.open( sTRURL, "", sTRFeatures );
	windowname.focus();
}


/*_______________________________________

アコーディオンメニュー

________________________________________*/


// wrapScroll
var mov = new wrapScroll('**');
mov.marginTop = 0;	//上からの位置を指定(px)
//-->

/*_______________________________________

プルダウンリンク用

________________________________________*/

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);
	}
}


