	var editWin;
	var seaWin;
	var tId;

	function initFS() {
		if (ua.InternetExplorer) {
			if (ua.mac) {
				if (frame_menu.document.body && frame_cmd.document.body && frame_list.document.body) {
					dfs=Array(
					   fs[0]-parseInt(frame_menu.document.body.clientWidth),
					   fs[1]-parseInt(frame_cmd.document.body.clientHeight),
					   fs[2]-parseInt(frame_list.document.body.clientHeight));
				}
			} else {
                                cols=frame_main.cols.split(',');
				rows=frame_bbs.rows.split(',');
				dfs=Array(
				   fs[0]-parseInt(cols[0]),
				   fs[1]-parseInt(rows[0]),
				   fs[2]-parseInt(rows[1]));
			}
		} else {  // e mozilla
			dfs=Array(
				   fs[0]-parseInt(frame_menu.innerWidth),
				   fs[1]-parseInt(frame_cmd.innerHeight),
				   fs[2]-parseInt(frame_list.innerHeight));
		}
		checkFS();
	}

	function checkFS() {
		if (ua.InternetExplorer) {
			if (ua.mac) {
				if (frame_menu.document.body && frame_cmd.document.body && frame_list.document.body) {
					nfs=Array(
					   dfs[0]+parseInt(frame_menu.document.body.clientWidth),
					   dfs[1]+parseInt(frame_cmd.document.body.clientHeight),
					   dfs[2]+parseInt(frame_list.document.body.clientHeight));
					result=putFS(nfs);
					if (result) {
						//frame_cmd.document.body.clientHeight=fs[1];
						//frame_list.document.body.clientHeight=fs[2];
					}
				}
			} else {
                                cols=frame_main.cols.split(',');
				rows=frame_bbs.rows.split(',');
				nfs=Array(
					   dfs[0]+parseInt(cols[0]),
					   dfs[1]+parseInt(rows[0]),
					   dfs[2]+parseInt(rows[1]));
				result=putFS(nfs);
				if (result) {
					//frame_bbs.rows=fs[1]+','+fs[2]+',*';
				}
			}
		} else {  // mozilla
			nfs=Array(
				   dfs[0]+parseInt(frame_menu.innerWidth),
				   dfs[1]+parseInt(frame_cmd.innerHeight),
				   dfs[2]+parseInt(frame_list.innerHeight));
			result=putFS(nfs);
			if (result) {
				//frame_cmd.moveTo=(frame_cmd.innerWidth,200);
				//frame_list.innerHeight=fs[2];
			}
		}
		tId=setTimeout('checkFS()',100);
	}

	function putFS(nfs) {
		if (fs[0]!=nfs[0] || fs[1]!=nfs[1] || fs[2]!=nfs[2]) {
			fs[0]=nfs[0];
			fs[2]=nfs[2];
			setCookie('fs',fs[0]+','+fs[1]+','+fs[2]);
			//alert(getCookie('fs'));
			return true;
		}
		return false;
	}

	function selectPmode(pmode) {
		Xpmode=pmode;
		if (frame_view.selectArticle) {
			frame_view.selectArticle(0,0);
		}
		if (frame_menu.selectBbs) {
			frame_menu.selectBbs(pmode,0);
		}
		return false;
	}
	function selectBbs(bno) {
		if (frame_view.selectArticle) {
			frame_view.selectArticle(bno,0);
		} else {
			return true;
		} 
		return false;
	}
	function selectOrder(order) {
		if (frame_list.selectOrder) {
			frame_list.selectOrder(order);
		}
		return false;
	}

	function promptArticle(bno) {
		vno=prompt('半角で発言番号を 258 のように入れてください。','');
		if (vno) {
			if (frame_list.selectArticle) {
				frame_list.setHash();   // 位置づけ強制
			}
			if (frame_view.selectArticle) {
				frame_view.selectArticle(bno,vno);
			}
		}
	}

	/* call back from article */
	function loadedArticle(pmode,bno,vno) {
		if (bno && vno) {
			Xpmode=pmode;
		}
		Xbno=bno;
		Xvno=vno;
		for(i = 0 ; i< 10 ; i++) {
			if (frame_list.selectArticle) {
				frame_list.selectArticle(bno,vno);
				break;
			} else {
				frame_list.location.href='?act_list=true&Xpmode='+Xpmode+'&Xbno='+bno+'&Xvno='+vno+'#'+vno;
			}
		}
		for(i = 0 ; i< 10 ; i++) {
			if (frame_menu.selectBbs) {
				frame_menu.selectBbs(Xpmode,bno);
				break;
			}
		}
	}

	/* call back from list */
	function loadedList(bno,vno,order,prev,next,wflag) {
		Xbno=bno;
		Xvno=vno;
		for(i = 0 ; i< 10 ; i++) {
			if (frame_cmd.selectCommander) {
				if (wflag==0) {
					frame_cmd.selectCommander(99,bno,vno,order,prev,next);
				} else {
					frame_cmd.selectCommander(Xpmode,bno,vno,order,prev,next);
				}
				break;
			}
		}
	}

	function prevList() {
		return frame_list.prevList();
	}

	function nextList() {
		return frame_list.nextList();
	}

	function insertArticle(bno,pvno) {
		url='?act_insert=true&Xbno='+bno+'&Xpvno='+pvno;
		editWin=window.open(url,'editWin','width=800,height=600,scrollbars=yes,resizable=yes');
		editWin.focus();
		return false;
	}
	function updateArticle(bno,vno) {
		url='?act_update=true&Xbno='+bno+'&Xvno='+vno;
		editWin=window.open(url,'editWin','width=800,height=600,scrollbars=yes,resizable=yes');
		editWin.focus();
		return false;
	}
	function insertDoArticle(bno,vno) {
		url='?Xpmode='+Xpmode+'&Xbno='+bno+'&Xvno='+vno;
		location.href=url;
		return false;
	}
	function updateDoArticle(bno,vno) {
		url='?Xpmode='+Xpmode+'&Xbno='+bno+'&Xvno='+vno;
		location.href=url;
		return false;
	}
	function searchWin() {
		url='../app/s_bbs.php';
		seaWin=window.open(url,'seaWin','width=800,height=600,scrollbars=yes,resizable=yes');
		seaWin.focus();
		return false;
	}
	function resetFrame() {
		clearCookie('fs');
		url='?Xpmode='+Xpmode+'&Xbno='+Xbno+'&Xvno='+Xvno;
		location.href=url;
		return false;
	}
