// michiyko js_libraly 


//openwin1
function openwin1(file,name,h,w) { //位置指定_有り クイズで使用　
newWin1= window.open(file,name,"height="+h+",width="+w+",screenX=10,screenY=10,left=10,top=10,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0");
document.MM_returnValue = false;
newWin1.focus()
}


//openwin2
function openwin2(file,name,h,w) {//位置指定_なし
newWin2= window.open(file,name,"height="+h+",width="+w+",toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0");
document.MM_returnValue = false;
newWin2.focus()
}


//openwin3
function openwin3(file,name,h,w) {//位置指定_センター
	sw=screen.availWidth/2-w/2;
	sh=screen.availHeight/2-h/2;
newWin3= window.open(file,name,"height="+h+",width="+w+",top="+sh+",screenY="+sh+",left="+sw+",screenX="+sw+",toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0");
document.MM_returnValue = false;
newWin3.focus()
}






//---------------------------------------------------------------------------------------------
//openwin4
//
//位置指定_有り スクロール有り時のos,ブラウザ別windowサイズ補正　位置中央
//操作のしかたで使用
//
//---------------------------------------------------------------------------------------------

function openwin4(file,name,h,w) {//位置指定_センター
	
	sw=screen.availWidth/2-w/2;
	sh=screen.availHeight/2-h/2
 	//h=screen.height
		
	mac = (navigator.appVersion.indexOf("Mac") != -1) ?true:false;
	ie = (navigator.appName.charAt(0) == "M") ?true:false;
	nn = (navigator.appName.charAt(0) == "N") ?true:false;
	
	if (mac){
		if (ie){
		// mac IE
		w+=1;
		h-=130;
		}
		
		else{
		// mac NN etc.
		w+=1;
		h-=130;
		}
	}
	else{
		if (ie){
		// win IE
		w+=17;
		h-=130;
		}
		else{
		// win NN etc.
		w+=16;
		h-=130;
		}
	}



newWin4= window.open(file,name,"height="+h+",width="+w+",top="+sh+",screenY="+sh+",left="+sw+",screenX="+sw+",toolbar=1,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=1");
document.MM_returnValue = false;
newWin4.focus()
}

