//-------------------------------------------------------//
//概要		：ウィンドウを閉じる
//作成者	：田中義
//日付		：2006/06/01
//引数		：
//-------------------------------------------------------//
function CloseWin(){
    window.close();
}

//-------------------------------------------------------//
//概要		：フォームの値を継承して指定URLへリンク
//作成者	：田中義
//日付		：2006/06/01
//引数		：myURL->リンク先URL
//-------------------------------------------------------//

function menuLink(linkLoc) {
	if(linkLoc !="") { window.location.href=linkLoc;} 
}

//-------------------------------------------------------//
//概要		：フォームの値を継承して指定URLへリンク
//作成者	：田中義
//日付		：2006/06/01
//引数		：myURL->リンク先URL
//-------------------------------------------------------//
function MoveUrl(myURL){
	url = myURL.options[myURL.selectedIndex].value;
	var LL = document.EDIT.elements.length;
	for(i = 0; i < LL; i++){
		url += "&";
		url += document.EDIT.elements[i].name;
		url += "=";
		// チェックボックスの場合は有効のみ
		if(document.EDIT.elements[i].type == 'checkbox'){
			if(document.EDIT.elements[i].checked == true){
				url += encodeURI(document.EDIT.elements[i].value);
			}
		}else{
			url += encodeURI(document.EDIT.elements[i].value);
		}
	}
	if(url != ""){
		location.href = url;
	}
}

//-------------------------------------------------------//
//概要		：ロールオーバー
//作成者	：田中義
//日付		：2006/06/01
//引数		：
//-------------------------------------------------------//
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


//-------------------------------------------------------//
//概要		：クリップボードにコピー
//作成者	：田中義
//日付		：2006/06/01
//引数		：
//-------------------------------------------------------//
function ClipCopy(p_str){
	window.clipboardData.setData("text",p_str);
	alert(p_str);
}

//-------------------------------------------------------//
//概要		：チェックボックスを選択
//作成者	：田中義
//日付		：2006/10/24
//引数		：
//-------------------------------------------------------//
function Chenge_check(){
	for(i = 0; i < document.delform.elements.length; i++){
		document.delform.elements[i].checked = document.delform.main_check_del.checked;
	}
}
//-------------------------------------------------------//
//概要		：親ウィンドウに値を返す
//作成者	：田中義
//日付		：2006/11/11
//引数		：
//-------------------------------------------------------//
function setParent(){
	ct = document.getElementById("toParent").value;
	window.opener.document.getElementById("getText").value = ct;
	window.close();
}

//-------------------------------------------------------//
//概要		：テキストエリアの高さを変更する
//作成者	：田中義
//日付		：2006/11/11
//引数		：nRows	->高さ
//　　　　　：p_Id	->フォームID
//-------------------------------------------------------//
function setTA(nRows, p_Id){
	document.getElementById(p_Id).rows = nRows;
}

// プルダウンメニュー
function txt_flip(tagnam1){
	if(document.getElementById(tagnam1).style.display == ''){
		document.getElementById(tagnam1).style.display='none';
	}else{
		document.getElementById(tagnam1).style.display='';
	}
}

//-------------------------------------------------------//
//概要		：元ウィンドウの移動
//作成者	：田中義
//日付		：2007/02/07
//引数		：
//-------------------------------------------------------//
function OpenerMoveUrl(myURL){
	if(opener.closed){
		NewWin = window.open("", "Mwindow");
		NewWin.location.href = myURL;
	}else{
		opener.location.href = myURL;
	}
}

//-------------------------------------------------------//
//概要		：プルダウンメニュー
//作成者	：田中義
//日付		：2007/02/07
//引数		：
//-------------------------------------------------------//
function txt_flip(tagnam1){
	if(document.getElementById(tagnam1).style.display == ''){
		document.getElementById(tagnam1).style.display='none';
	}else{
		document.getElementById(tagnam1).style.display='';
	}
}
