//******************************************************************************
// <summary> テンプレートのサムネイルを表示する画面オープン
// <param  > 
// <returns> 
// <remarks> 
function watchTemplate()
{
	wx = 150;
	wy = 600;
	x = (screen.width - wx) / 2;
	y = (screen.height - wy) / 2;
	window.open("./template.php", "template", "scrollbars=yes, toolbar=no, location=no, directories=no, left="+x+", top="+y+", width="+wx+", height="+wy);
}

//******************************************************************************
// <summary> 項目を削除前の確認ダイアログ
// <param  > val : 遷移先URL
// <returns> 
// <remarks> 
function doDelete(val)
{
	if (confirm('削除してよろしいですか？'))
	{
		location.href = val;
	}
}

//******************************************************************************
// <summary> ファイルを削除前の確認ダイアログ
// <param  > 
// <returns> 
// <remarks> 
function doDeleteFile()
{
	if (confirm('削除してよろしいですか？'))
	{
		return true;
	}
	else
	{
		return false;
	}
}

//******************************************************************************
// <summary> 現在時刻を設定する
// <param  > 
// <returns> 
// <remarks> 
function set_now(val)
{
	now = new Date();
	
	thisYear = now.getYear();
	if (thisYear < 2000)
	{
		thisYear = thisYear + 1900;
	}

	switch (val)
	{
		case 'load':
		confirm_mode = document.getElementById("confirm_mode").value;
		if (confirm_mode == 'insert')
		{
			document.getElementById("year").value   = thisYear;
			document.getElementById("month").value  = now.getMonth() +1;
			document.getElementById("day").value    = now.getDate();
			document.getElementById("hour").value   = now.getHours();
			document.getElementById("minute").value = now.getMinutes();
			document.getElementById("second").value = now.getSeconds();
		}
			break;
		
		case 'click':
			document.getElementById("year").value   = thisYear;
			document.getElementById("month").value  = now.getMonth() +1;
			document.getElementById("day").value    = now.getDate();
			document.getElementById("hour").value   = now.getHours();
			document.getElementById("minute").value = now.getMinutes();
			document.getElementById("second").value = now.getSeconds();
			break;
		
		default:
			break;
	}
}
