	function popUp(file,w,h) {
		window.open(file,"_blank",'toolbar=0,location=0,scrollbars=1,width=' + w +',height=' + h + ',resizable=1,left=100,top=100');
	}
	function popUpFull(file) {
		window.open(file,"_blank",'toolbar=no,location=no,scrollbars=yes,status=no,width=720,height=540,resizable=yes,left=100,top=100');
		//window.open(file,"_blank",'toolbar=no,location=no,scrollbars=yes,status=no,width=1016,height=700,resizable=yes,left=0,top=0');
	}
	function popUpFullscreen(file) {
		window.open(file,"_blank",'toolbar=no,location=no,scrollbars=yes,status=no,fullscreen=yes,resizable=yes,left=0,top=0');
	}
	function addpopUp(file,w,h) {
		window.open(file,"_blank",'toolbar=0,location=0,scrollbars=1,width=' + w +',height=' + h + ',resizable=1,left=100,top=100');
	}
	function propopUp(file,w,h) {
		window.open(file,"_blank",'toolbar=0,location=0,scrollbars=1,width=' + w +',height=' + h + ',resizable=1,left=100,top=100');
	}
	function OnePopUp(file) {
		top.window.moveTo(0, 26);
		top.window.resizeTo(505, 714);
		window.open(file,"OnePopUp",'toolbar=0,location=0,scrollbars=1,width=507,height=674,resizable=1,left=505,top=26');
	}
	function popUpT(file) {
		window.open(file,"_blank",'toolbar=0,location=0,scrollbars=1,width=800,height=674,resizable=1,left=26,top=26');
	}
	function conFirm_mtr(){
		flag = confirm("？");
		if (flag) alert("了承しました"); else alert("再確認してください");
	}
	function popUpCenter(file,w,h,tool) {
		if(tool!='1'){
			tool = 0;
		}
		l = (screen.width - w) / 2;
		t = (screen.height - h) / 2 - 13;
//jyo 200807xx start
//		window.open(file,"_blank",'toolbar='+tool+',location='+tool+',scrollbars=1,width='+w+',height='+h+',resizable=0,left='+l+',top='+t);
		window.open(file,"_blank",'toolbar='+tool+',location='+tool+',scrollbars=1,width='+w+',height='+h+',resizable=1,left='+l+',top='+t);
//jyo 200807xx end
	}


//hirooka 2010324 add start tiesvillage用
	function popUpvi() {
		document.ties_vill.method = "post";
		document.ties_vill.action = "http://sns.tiesnet.jp/sns/member/session.php?prc=login";
		document.ties_vill.submit();

	}
//hirooka 2010324 add end tiesvillage用



//20080905 natsume add start wiki用に作成
	function popUpCenter_wiki(file,w,h,tool) {
		if(tool!='1'){
			tool = 0;
		}
		l = (screen.width - w) / 2;
		t = (screen.height - h) / 2 - 13;
		window.open(file,"_blank",'toolbar=1,menubar=0,location=1,scrollbars=1,width='+w+',height='+h+',resizable=1,left='+l+',top='+t);
	}
//20080905 natsume add end


	// add Y.Tanni 2007.01.24 ビデオ再生画面を開く為のFunction
	function popUpVideo(file) {
		if (file.substr(0, 1) == "e" || file.substr(0, 1) == "g") {
			window.open('http://'+TIES_DOMAIN+'/material/video/video.php?mtr_id='+file, 'playlist','width=1012,height=705,left=0px,top=0px,resizable=1,toolbar=0,status=0,scrollbars=0,location=0,directories=0,menubar=0,titlebar=0');
	
		} else {
			window.open(file, 'playlist','width=1012,height=705,left=0px,top=0px,resizable=1,toolbar=0,status=0,scrollbars=0,location=0,directories=0,menubar=0,titlebar=0');
		}
		

	}


	//ユーザー検索
	function Teacher_Select_Proc(n){
		window.open('../public/search_user_list.php?user_kbn_t=1&id_obj=author_id&uid_obj=author_univ&name_obj=author&obj_num=' + n + '&s_type=2', '', 'width=640, height=640, directories=no, location=no, titlebar=no, status=no');
	}

	//呼出し元Reload(コース)
	function ParentReload(mtr_id, mtr_type, mode_flag){
		parent.opener.location.href="mtr_page_upd_list.php?mtr_type="+mtr_type+"&mtr_id="+mtr_id+"&mode_flag="+mode_flag;
		top.window.close();
	}
	//呼出し元Reload(問題)
	function ParentReload_Q(mtr_id, p_mtr_id, p_mtr_type){
		parent.opener.location.href="mtr_quest_detail.php?mtr_id="+mtr_id+"&p_mtr_id="+p_mtr_id;"&p_mtr_type="+p_mtr_type;
		top.window.close();
	}
	//呼出し元Reload(アンケート)
	function ParentReload_A(mtr_id, p_mtr_id, p_mtr_type){
		//parent.opener.location.href="mtr_survey_detail.php?mtr_id="+mtr_id+"&p_mtr_id="+p_mtr_id;"&p_mtr_type="+p_mtr_type;
		window.top.opener.location.reload();
		top.window.close();
	}


	//マテリアル追加
	var win_MakeTxt = 0;
	var win_AddMaterial = 0;
	var win_OpenSort = 0;
	var win_popUp2 = 0;

	function AddMaterial(mtr_id, mtr_type, mode_flag){
		var open_url = "unit_search.php?hid_mtr_type=" + mtr_type + "&hid_mtr_id=" + mtr_id + "&mode_flag=" + mode_flag;

		{
			if ( win_AddMaterial==0 ){
				win_AddMaterial = window.open(open_url, 'AddMaterial', 'width=800, height=600, directories=no, location=no, titlebar=no, status=no resizable=yes, dependent=yes');
			}else{
				if ( win_AddMaterial.closed ){
					win_AddMaterial = window.open(open_url, 'AddMaterial', 'width=800, height=600, directories=no, location=no, titlebar=no, status=no resizable=yes, dependent=yes');
				}
			}
		}
		win_AddMaterial.focus();
	}

	//教材の並べ替え
	function OpenSortWindow(mtr_id, mtr_type, mode_flag, lec_id)
	{
		if(lec_id){
			var open_url = "mtr_page_upd_sort_list.php?&lec_id=" + lec_id + "&mtr_id=" + mtr_id + "&mtr_type=0";
		}else{
			var open_url = "mtr_page_upd_sort_list.php?mtr_type=" + mtr_type + "&mtr_id=" + mtr_id + "&mode_flag=" + mode_flag;
		}
		if (win_OpenSort==0){
			win_OpenSort = window.open(open_url, 'OpenSort', 'width=300, height=720, directories=no, location=no, titlebar=no, status=no resizable=yes, dependent=yes');
		}else{
			if ( win_OpenSort.closed ){
				win_OpenSort = window.open(open_url, 'OpenSort', 'width=300, height=720, directories=no, location=no, titlebar=no, status=no resizable=yes, dependent=yes');
			}
		}
		win_OpenSort.focus();
	}


	function popAlert(str){
		alert(str);
//		var pop_obj;
//		pop_obj=window.createPopup();
//		pop_obj.show((screen.width-190)/2,(screen.height-100)/2,190,100);
//		pop_obj.document.bgColor="white";
//		pop_obj.document.body.innerHTML="<div style=\"padding:5px;border:solid #0000ff 2px;font-size:13px;height:100px;\"><br><br>"+str+"<br><br><div align=\"right\"><img src=\"/common/img/tieskun_alert.gif\"></div></div>\n";
		return;
	}

	// add kan.chst 2008.01.17 FTPエクスプローラを開くのFunction
	function doFtp(sUrl){
		var wdw;
		var strVersion,strIE;
		strIE =navigator.appVersion;
		strVersion =strIE.split(";");

		if(strVersion[1] ==" MSIE 7.0"){
			// modified by Liuyang 2008/2/8 Start　ActiveXがブロックされる場合エラー出さないため
			//document.TIES_FTP.runExplorer(sUrl);
			try{
				if(document.TIES_FTP){
					document.TIES_FTP.runExplorer(sUrl);
				}
			}catch(e){
			}
			// modified by Liuyang 2008/2/8 Start　ActiveXがブロックされる場合エラー出さないため
		}else{
			wdw = window.open(sUrl,'ftp', 'width=640, height=480, location=no , directories=no, titlebar=no, status=no');
		}
	}

	/**
	* 
	* タグの一覧／設定ウィンドウ表示
	* 
	* @param mtr_id  教材ID
	* @param title タイトル
	* @param url  遷移先URL
	* @param p_mtr_id  親教材ID(省略可)
	* 
	* 教材をクリックしたときの制御を行う。
	* サイトナビに値を渡す作業と、ページ遷移作業を主に行う。
	* 
	**/
	function show_tag( mtr_id, from_type, from_id, view_flag, func_name )
	{
		paramenters = "?mtr_id="      + mtr_id
					+ "&from_type="   + from_type
					+ "&from_id="     + from_id
					+ "&view_flag="   + view_flag
					+ "&func_name="   + func_name;
		
		optional_arg = "directories = no,"
					+ "location = no,"
					+ "menubar = no,"
					+ "resizable = yes,"
					+ "toolbar = no,"
					+ "scrollbars = yes,"
					+ "width = 500,"
					+ "height = 600";
		
		// タグ設定ウィンドウを表示する
		window.open( "http://" + TIES_DOMAIN + "/public/tag.php" + paramenters, "_blank", optional_arg );
		
		return;
	}
	
	//周.CHST add 2010/07/15 自分登録講義 start
	function popUpLecEdit(file,w,h) 
	{
		window.open(file,"_blank",'toolbar=0,location=0,scrollbars=0,width=' + w +',height=' + h + ',resizable=1,left=100,top=100');
	}
	//周.CHST add 2010/07/15 自分登録講義 end
