var ErrMsg_Cookie = "The browser you are using refuses to sign in. (<a href='http://www.jtb.co.jp/myjtb/help.html'>cookies rejected</a>)<br><br>";

function Onload(flg)
{
	hiddenformsubmit(flg);
	if (flg != "1") 
	{
		CheckEnviron();
		SetFocus();
	}
}

function SetFocus()
{
	var el = window.document.getElementById('idLoginUserID');
	if ( el != null )
	{
		el.focus();
	}
	else
	{
		window.document.getElementById('idLoginPassword').focus();
	}
}

function loginsubmit(flg)
{
	document.Form1.SubmitParam.value = flg;
	if (flg != "1")
	{ 
		document.Form1.submit();
	}
}

function hiddenformsubmit(flg)
{
	if (flg == 1) 
	{
		document.SubmitForm.submit();
	}
}

function CheckEnviron()
{
	var msg = "";
	var exp = new Date(); 
	var check = "1";
	exp.setTime(exp.getTime()+1000*60*60*24*1);
	document.cookie = "FCookie=True;domain=.japanican.com;path=/;expires="+exp.toGMTString();

	var items = document.cookie.split(';');
	var ret = false;
	for (i = 0; i <items.length; i++) {
		if ("FCookie=True" == items[i].replace(/^\s+|\s+$/g, "")) {
			document.getElementById("environ-disp").style.visibility = "hidden";
			ret = true;
			break;
		}
	}
	if (ret == false)
	{
		msg = ErrMsg_Cookie;
		check += "0";
	}
	else
	{
		check += "1";
	}
	
	document.Form1.____environcheck.value = check;
	document.getElementById("environ-msg").innerHTML = msg;
	document.cookie = "FCookie=True;domain=.japanican.com;path=/;expires=2000-01-01";
}

