
//======================================================================================
// クリックジャック攻撃対策
//======================================================================================
function CheckClickJack(strBlankPageUrl, strErrorPageUrl)
{
	try
	{
		// インラインフレーム？
		if (window.self.location != window.top.location)
		{
			// ドメインが異なればブランクへ
			if (window.top.location.host != window.self.location.host)
			{
				location.href = strBlankPageUrl;
			}
		}
	}
	catch (ex)
	{
		// 実際にはクロスサイトのドメインは参照できないのでここでブランクへ
		location.href = strBlankPageUrl;
	}
}

//======================================================================================
// 二重押しチェック防止
//======================================================================================
var exec_submit_flg = 0;
function exec_submit()
{
	if (exec_submit_flg == 0)
	{
		exec_submit_flg = 1;
		return true;
	}
	else
	{
		return false;
	}
}

//======================================================================================
// 画像差し替えのリセット
//======================================================================================
var strOriginalImageNameMouseMoveChange = null;
function reset_picture(tag_name)
{
	var obj = document.getElementById(tag_name);
	if (obj != null)
	{
		// オリジナルの名前に戻す
		if (strOriginalImageNameMouseMoveChange != null)
		{
			obj.src = strOriginalImageNameMouseMoveChange;
		}
	}
}

//======================================================================================
// 画像差し替え
//======================================================================================
function change_picture(tag_name, file)
{
	var obj = document.getElementById(tag_name);
	if (obj != null)
	{
		// オリジナルの名前を保存
		if (strOriginalImageNameMouseMoveChange == null)
		{
			strOriginalImageNameMouseMoveChange = obj.src;
		}
		obj.src = file;
	}
	return false;
}

//======================================================================================
// ウインドウポップアップ
//======================================================================================
function show_popup_window(strUrl, iWidth, iHeight, blDispScrollbar, blResizable, strWindowName)
{
	var strScrollbars = blDispScrollbar ? "yes" : "no";
	var strResizable = blResizable ? "yes" : "no";
	scWidthCenter = screen.availWidth / 2;
	scHeightCenter = screen.availHeight / 2;
	var strOption = "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=" + strScrollbars + ",resizable=" + strResizable + ",width=" + iWidth + ",height=" + iHeight + ",left=" + (scWidthCenter - (iWidth / 2)) + ",top=" + (scHeightCenter - (iHeight / 2));
	var wObj = window.open(strUrl, strWindowName, strOption);
	if (wObj != null)
	{
		wObj.focus();
	}
}
