/***template ...start*******/
var ope, ope1,ope2, ope3;

function MM_openBrWindow(theURL) { //v2.0
  ope = window.open(theURL,'popupwin','width=700,height=500,toolbar=no,menubar=no,location=no,directories=no,scrollbars=yes,status=no,resizable=yes');
  if (document.layers || document.all) ope.focus();
}


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_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_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];}
}
/***template ...end ********/




/**********************************************************************
* 子画面表示
**********************************************************************/
function OpenSubWindow(argURL, argTarget, argHeight, argWidth)
{
	var wHeight;
	var wWidth;
	
	if(OpenSubWindow.arguments.length < 3){
		wWidth = 540;
	} else {
		wWidth = argWidth;
	}
	
	if(!OpenSubWindow.arguments.length < 2){
		wHeight = 570;
	} else {
		wHeight = argHeight;
	}
	
	var hndlWindow=window.open(argURL, argTarget, "location=0,menubar=0,resizable=1,status=0,toolbar=0,titlebar=0,scrollbars=1,Height=" + wHeight + ",Width=" + wWidth + ",top=" + ((screen.height-wHeight)/2) + ",left=" + ((screen.width - wWidth)/2));
	
	hndlWindow.focus()
}


/**********************************************************************
* ページ遷移
**********************************************************************/
function MovePage(frm, ctl_prefix, arg)
{

	eval('frm.' + ctl_prefix + '_movepage').value = "movepage";
	eval('frm.' + ctl_prefix + '_pageno').value =Number(arg);
	frm.submit();
	//Sch_Submit()
}

/**********************************************************************
* 全チェックボックスのステータスを変更する
**********************************************************************/
function SelectCheckBox(frm, argSrc, argDst)
{
	var i;
	var e;
	
	for(i=0;i<frm.length;i++)
	{
		e = frm.elements[i];
		if(e.type == 'checkbox' && e.name==argDst)
		{
			e.checked = argSrc.checked;
		}
	}
	return false;
}

/**********************************************************************
* 全チェックボックスのうちどれかが選択されているか判定する
**********************************************************************/
function IsChecked(frm, argDst)
{
	var i;
	var e;
	
	for(i=0;i<frm.length;i++)
	{
		e = frm.elements[i];
		if(e.type == 'checkbox' && e.name==argDst)
		{
			if(e.checked == true)
			{
				return true;
			}
		}
	}
	return false;
}


/**********************************************************************
* 日付コンボに今日の日付を設定
**********************************************************************/
function SetNow(frm, nmY, nmM, nmD){
	var y, m, d, now
	
	now = new Date();
	
	y = now.getYear();
	m = now.getMonth() + 1;
	d = now.getDate();
	
	if (y < 2000) { y += 1900; }
	
	SetComboValue(eval('frm.' + nmD), d)
	SetComboValue(eval('frm.' + nmM), m)
	SetComboValue(eval('frm.' + nmY), y)
	
}

/**********************************************************************
* プルダウンの値を設定
**********************************************************************/
function SetComboValue(argCtl, argValue){
	
	with(argCtl)
	{
		var i
		for(i=0; i < options.length; ++i)
		{
			if(options[i].value == argValue){
				options[i].selected = true;
				return;
			} else {
			}
		}
	}
}


/**********************************************************************
* 
**********************************************************************/
function CloseSubWindow(argConfirm)
{
	if(!argConfirm){
		window.close();
		return;
	}
	
	//このウィンドウを閉じます。\nよろしいですか？
	if(confirm('\u3053\u306E\u30A6\u30A3\u30F3\u30C9\u30A6\u3092\u9589\u3058\u307E\u3059\u3002\n\u3088\u308D\u3057\u3044\u3067\u3059\u304B\uFF1F')){
		window.close();
	}
}

/**********************************************************************
* 
**********************************************************************/
function LogOut(argURL)
{
	//ログアウトします。\nよろしいですか？
	if(!confirm('\u30ED\u30B0\u30A2\u30A6\u30C8\u3057\u307E\u3059\u3002\n\u3088\u308D\u3057\u3044\u3067\u3059\u304B\uFF1F')){
	} else {
		window.location=argURL;
	}
}
