function OpenWin1(dispFile) { //
 var picWin;
 picWin = window.open(dispFile, 'new1', "resizable=yes,location=no,status=yes,menubar=yes,scrollbars=yes,width=780,height=600");
 picWin.focus();
}

function OpenWin2(dispFile) { //
 var picWin;
 picWin = window.open(dispFile, "new2", "resizable=yes,location=no,status=yes,menubar=yes,scrollbars=yes,width=640,height=700");
 picWin.focus();
}

function OpenWin3(dispFile) { //
 var picWin;
 picWin = window.open(dispFile, "new2", "resizable=yes,location=no,status=yes,menubar=yes,scrollbars=yes,width=740,height=1000");
 picWin.focus();
}

function OpenWin4(dispFile) { //
 var picWin;
 picWin = window.open(dispFile, "new2", "resizable=yes,location=no,status=yes,menubar=yes,scrollbars=yes,width=640,height=450");
 picWin.focus();
}

function mvWin(dispFile) { //
 var picWin;
 picWin = window.open(dispFile, "new1", "resizable=yes,location=no,status=no,menubar=no,scrollbars=no,width=380,height=345");
 picWin.focus();
}


function mvWin2(dispFile) { //
 var picWin;
 picWin = window.open(dispFile, "new2", "resizable=yes,location=no,status=no,menubar=no,scrollbars=no,width=600,height=500");
 picWin.focus();
}





function imgsWin(a, n, w, h) { //
 var win1 = window.open(a, n,"resizable=yes,status=yes,location=no,toolbar=no,menubar=no,scrollbars=yes,favorites=no,width="+w+",height="+h );
 win1.focus();
}



function imgsWin2(n, w, h,src,alt) { //
 var win1 = window.open('', n,"resizable=yes,status=yes,location=no,toolbar=no,menubar=no,scrollbars=yes,favorites=no,width="+w+",height="+h );
 win1.document.write("<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>");
 win1.document.write("<html xml:lang='ja' lang='ja'><head>");
 win1.document.write("<meta http-equiv='content-type' content='text/html; charset=Shift_JIS' /><meta http-equiv='content-style-type' content='text/css' /><meta http-equiv='content-script-type' content='text/javascript' />");
 win1.document.write("<title>");
 win1.document.write(alt);
 win1.document.write("</title></head>");
 win1.document.write("<body style='padding:5px 0px 0px 0px;text-align:center;color:#333333;font-size:12px;' link='#009900' vlink='#009900'><img src='");
 win1.document.write(src);
 win1.document.write("' border='0' alt='");
 win1.document.write(alt);
 win1.document.write("（拡大画像）'><br /><a href='#' onclick='parent.close()'>ウィンドウを閉じる</a></body>");
 win1.document.write("</html>");
 win1.document.close();
 win1.focus();
}

//画像拡大機能：コピーライトなし
function zoomImgNocptxt(n, w, h,src,alt,info) { //
 h = Number(h) + 100;
 var win1 = window.open('', n,"resizable=yes,status=yes,location=no,toolbar=no,menubar=no,scrollbars=yes,favorites=no,width="+w+",height="+h );
 win1.document.write("<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN' 'http://www.w3.org/TR/html4/loose.dtd'>");
 win1.document.write("<html lang='ja'>");
 win1.document.write("<head>");
 win1.document.write("<meta http-equiv='Content-Type' content='text/html; charset=shift_jis' />");
 win1.document.write("<title>"+alt+"</title>");
 win1.document.write("</head>");
 win1.document.write("<body style='padding:10px 20px; margin:0px;color:#333333;font-size:12px;' link='#009900' vlink='#009900'>");
 win1.document.write("<div style='width:"+(w-50)+"px;margin:0px auto;'>");
 win1.document.write("<div style='padding-bottom:10px;'><a href='/index.html' target='_blank'><img src='/com_imgs/banner_w208.jpg' alt='がん情報サービス' border='0'></a></div>");
 win1.document.write("<div style='padding-bottom:10px;background-image:url(/com_imgs/dot.gif); background-repeat:repeat-x; height:1px; overflow:hidden;'></div>");
 win1.document.write("<div style='padding-bottom:10px;'><img src='"+src+"' border='0' alt='"+alt+"（拡大画像）'></div>");
 win1.document.write("<div style='padding-bottom:10px;background-image:url(/com_imgs/dot.gif); background-repeat:repeat-x; height:1px; overflow:hidden;'></div>");
 if (info != null) {win1.document.write("<div style='padding-bottom:10px;font-size:small; text-align:left; line-height:120%;'>"+info+"</div>");}
 win1.document.write("<div style='padding-bottom:10px;text-align:center;'><a href='#' onclick='parent.close()'>ウィンドウを閉じる</a></div>");
 win1.document.write("<div style='padding-bottom:10px;text-align:center;'><img src='/com_imgs/copyright.gif' alt='(c) 独立行政法人国立がん研究センターがん対策情報センター'></div>");
 win1.document.write("</div>");
 win1.document.write("</body>");
 win1.document.write("</html>");

 /*
 win1.document.write("<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>");
 win1.document.write("<html xml:lang='ja' lang='ja'><head>");
 win1.document.write("<meta http-equiv='content-type' content='text/html; charset=Shift_JIS' /><meta http-equiv='content-style-type' content='text/css' /><meta http-equiv='content-script-type' content='text/javascript' />");
 win1.document.write("<title>");
 win1.document.write(alt);
 win1.document.write("</title></head>");
 win1.document.write("<body style='padding:5px 0px 0px 0px;color:#333333;font-size:12px;' link='#009900' vlink='#009900'><table border='0' cellspacing='0' cellpadding='0'><tr><td><img src='");
 win1.document.write(src);
 win1.document.write("' border='0' style='margin-left:20px;' alt='" + alt + "（拡大画像）'><br />");
 if (info != "") { win1.document.write("<div style='font-size:small; text-align:left; padding:0px 20px; line-height:120%;'>" + info + "</div>"); }
 win1.document.write("<div style='text-align:center;'><a href='#' onclick='parent.close()'>ウィンドウを閉じる</a></div></td></tr></table></body>");
 win1.document.write("</html>");
 */
 win1.document.close();
 win1.focus();
}

//画像拡大機能：コピーライト文字のみ
function zoomImgNocpurl(n, w, h,src,alt,txt,info) { //
 h = Number(h) + 100;
 var win1 = window.open('', n,"resizable=yes,status=yes,location=no,toolbar=no,menubar=no,scrollbars=yes,favorites=no,width="+w+",height="+h );
 win1.document.write("<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN' 'http://www.w3.org/TR/html4/loose.dtd'>");
 win1.document.write("<html lang='ja'>");
 win1.document.write("<head>");
 win1.document.write("<meta http-equiv='Content-Type' content='text/html; charset=shift_jis' />");
 win1.document.write("<title>"+alt+"</title>");
 win1.document.write("</head>");
 win1.document.write("<body style='padding:10px 20px; margin:0px;color:#333333;font-size:12px;' link='#009900' vlink='#009900'>");
 win1.document.write("<div style='width:"+(w-50)+"px;margin:0px auto;'>");
 win1.document.write("<div style='padding-bottom:10px;'><a href='/index.html' target='_blank'><img src='/com_imgs/banner_w208.jpg' alt='がん情報サービス' border='0'></a></div>");
 win1.document.write("<div style='padding-bottom:10px;background-image:url(/com_imgs/dot.gif); background-repeat:repeat-x; height:1px; overflow:hidden;'></div>");
 win1.document.write("<div><img src='"+src+"' border='0' alt='"+alt+"（拡大画像）'></div>");
 win1.document.write("<div style='padding-bottom:10px;font-size:small; text-align:right;'><img src='/com_imgs/icon_copyright.gif' border='0' alt='' style='vertical-align:middle; padding-left:2px; padding-right:2px;' />"+txt+"</div>");
 win1.document.write("<div style='padding-bottom:10px;background-image:url(/com_imgs/dot.gif); background-repeat:repeat-x; height:1px; overflow:hidden;'></div>");
 if (info != null) {win1.document.write("<div style='padding-bottom:10px;font-size:small; text-align:left; line-height:120%;'>"+info+"</div>");}
 win1.document.write("<div style='padding-bottom:10px;text-align:center;'><a href='#' onclick='parent.close()'>ウィンドウを閉じる</a></div>");
 win1.document.write("<div style='padding-bottom:10px;text-align:center;'><img src='/com_imgs/copyright.gif' alt='(c) 独立行政法人国立がん研究センターがん対策情報センター'></div>");
 win1.document.write("</div>");
 win1.document.write("</body>");
 win1.document.write("</html>");

 /*
 win1.document.write("<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>");
 win1.document.write("<html xml:lang='ja' lang='ja'><head>");
 win1.document.write("<meta http-equiv='content-type' content='text/html; charset=Shift_JIS' /><meta http-equiv='content-style-type' content='text/css' /><meta http-equiv='content-script-type' content='text/javascript' />");
 win1.document.write("<title>");
 win1.document.write(alt);
 win1.document.write("</title></head>");
 win1.document.write("<body style='padding:5px 0px 0px 0px;color:#333333;font-size:12px;' link='#009900' vlink='#009900'><table border='0' cellspacing='0' cellpadding='0'><tr><td><img src='");
 win1.document.write(src);
 win1.document.write("' border='0' style='margin-left:20px;' alt='");
 win1.document.write(alt);
 win1.document.write("（拡大画像）'><div style='font-size:small; text-align:right; align:middle; padding-right:20px;'><img src='/com_imgs/icon_copyright.gif' border='0' alt='' style='vertical-align:middle; padding-left:2px; padding-right:2px;' />" + txt + "</div>");
 if (info != "") { win1.document.write("<div style='font-size:small; text-align:left; padding:0px 20px; line-height:120%;'>" + info + "</div>"); }
 win1.document.write("<div style='text-align:center;'><a href='#' onclick='parent.close()'>ウィンドウを閉じる</a></div></td></tr></table></body>");
 win1.document.write("</html>");
 */
 win1.document.close();
 win1.focus();
}

//画像拡大機能：コピーライトリンク先あり
function zoomImg(n, w, h,src,alt,txt,url,info) { //
 h = Number(h) + 100;
 var win1 = window.open('', n,"resizable=yes,status=yes,location=no,toolbar=no,menubar=no,scrollbars=yes,favorites=no,width="+w+",height="+h );
 win1.document.write("<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN' 'http://www.w3.org/TR/html4/loose.dtd'>");
 win1.document.write("<html lang='ja'>");
 win1.document.write("<head>");
 win1.document.write("<meta http-equiv='Content-Type' content='text/html; charset=shift_jis' />");
 win1.document.write("<title>"+alt+"</title>");
 win1.document.write("</head>");
 win1.document.write("<body style='padding:10px 20px; margin:0px;color:#333333;font-size:12px;' link='#009900' vlink='#009900'>");
 win1.document.write("<div style='width:"+(w-50)+"px;margin:0px auto;'>");
 win1.document.write("<div style='padding-bottom:10px;'><a href='/index.html' target='_blank'><img src='/com_imgs/banner_w208.jpg' alt='がん情報サービス' border='0'></a></div>");
 win1.document.write("<div style='padding-bottom:10px;background-image:url(/com_imgs/dot.gif); background-repeat:repeat-x; height:1px; overflow:hidden;'></div>");
 win1.document.write("<div><img src='"+src+"' border='0' alt='"+alt+"（拡大画像）'></div>");
 win1.document.write("<div style='padding-bottom:10px;font-size:small; text-align:right;'><img src='/com_imgs/icon_copyright.gif' border='0' alt='' style='vertical-align:middle; padding-left:2px; padding-right:2px;' /><a href='"+url+"' target='_blank'>"+txt+"</a></div>");
 win1.document.write("<div style='padding-bottom:10px;background-image:url(/com_imgs/dot.gif); background-repeat:repeat-x; height:1px; overflow:hidden;'></div>");
 if (info != null) {win1.document.write("<div style='padding-bottom:10px;font-size:small; text-align:left; line-height:120%;'>"+info+"</div>");}
 win1.document.write("<div style='padding-bottom:10px;text-align:center;'><a href='#' onclick='parent.close()'>ウィンドウを閉じる</a></div>");
 win1.document.write("<div style='padding-bottom:10px;text-align:center;'><img src='/com_imgs/copyright.gif' alt='(c) 独立行政法人国立がん研究センターがん対策情報センター'></div>");
 win1.document.write("</div>");
 win1.document.write("</body>");
 win1.document.write("</html>");

 /*
 win1.document.write("<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>");
 win1.document.write("<html xml:lang='ja' lang='ja'><head>");
 win1.document.write("<meta http-equiv='content-type' content='text/html; charset=Shift_JIS' /><meta http-equiv='content-style-type' content='text/css' /><meta http-equiv='content-script-type' content='text/javascript' />");
 win1.document.write("<title>");
 win1.document.write(alt);
 win1.document.write("</title></head>");
 win1.document.write("<body style='padding:5px 0px 0px 0px;color:#333333;font-size:12px;' link='#009900' vlink='#009900'><table border='0' cellspacing='0' cellpadding='0'><tr><td><img src='");
 win1.document.write(src);
 win1.document.write("' border='0' style='margin-left:20px;' alt='");
 win1.document.write(alt);
 win1.document.write("（拡大画像）'><div style='font-size:small; text-align:right; align:middle;'><img src='/com_imgs/icon_copyright.gif' border='0' alt='' style='vertical-align:middle; padding-left:2px; padding-right:2px;' /><a href='");
 win1.document.write(url);
 win1.document.write("' target='_blank'>" + txt + "</a></div>");
 if (info != "") { win1.document.write("<div style='font-size:small; text-align:left; padding:0px 20px; line-height:120%;'>" + info + "</div>"); }
 win1.document.write("<div style='text-align:center;'><a href='#' onclick='parent.close()'>ウィンドウを閉じる</a></div></td></tr></table></body>");
 win1.document.write("</html>");
 */
 win1.document.close();
 win1.focus();
}

//開閉機能

function fromSearch() {
	var a = document.getElementsByTagName("a");
	var obj = [];
	var r = document.referrer;
	//ボタンを追加する
	for (o in a){
		if (a[o].className == "openBoxLinkTxt") {
			a[o].innerHTML += "<img src='/com_imgs/icon_open.gif' border='0' hspace='5' />";
		}
	}
	//検索から来た場合すべて展開する処理
	if (r.split('/')[2] == "search-ganjoho.ncc.go.jp"){
		for (o in a){
			if (a[o].className == "openBoxLinkTxt") {
				var id = a[o].id;
				var p = id.slice(0,(id.length - 4));
				openBox(p,id);
			}
		}
	}
}

function openBox(id,id2){
	var obj = document.getElementById(id);
	var a = document.getElementById(id2);
	if (obj.style.display != "block") {
		obj.style.display = "block";
		//a.style.backgroundImage = 'url(/com_imgs/icon_close.gif)';
		a.getElementsByTagName("img")[0].src = "/com_imgs/icon_close.gif";
	}else{
		obj.style.display = "none";
		//a.style.backgroundImage = 'url(/com_imgs/icon_open.gif)'; 
		a.getElementsByTagName("img")[0].src = "/com_imgs/icon_open.gif";
	}
}

function closeBox(id,id2){
	scrollTo(0,document.getElementById(id).offsetTop-150); 
	document.getElementById(id).style.display = "none";
	//document.getElementById(id2).style.backgroundImage = 'url(/com_imgs/icon_open.gif)'; 
	document.getElementById(id2).getElementsByTagName("img")[0].src = "/com_imgs/icon_open.gif";
}

