﻿//<script language="javascript">
	function init()
	{
		if(created.toLowerCase() == "true")
			document.login.submit();
		/*	
		var java = Components.getComponentVersion('{08B0E5C0-4FCB-11CF-AAA5-00401C608500}','componentid');
		
		if(java != "")
			login.action = login.action + "&j=1";
		else
			login.action = login.action + "&j=0";
			*/
	}

	function openReg()
		{
			parent.document.all.popUp_reg.all.f_popUp_reg.src = "user/signup.asp";
			parent.document.all.popUp_reg.style.visibility = 'visible';
			parent.document.all.popUp_news.style.visibility = 'hidden';
		}
	
	function chkLogin()
	{
		if (document.login.username.value.length < 3)
		{
			alert("ユーザーネームは３文字以上でお願いします。");
			document.login.username.focus();
			return false;
		}
		
		if (document.login.password.value.length < 3)
		{
			alert("パスワードは３文字以上でお願いします。");
			document.login.password.focus();
			return false;
		}
	}
	
	function saveLogin(){
		
		if (document.login.savelogin.checked != true)
			return true;
		else
			return confirm("ユーザーネームとパスワードをこのコンピューターに記憶させてよろしいですか？");
	}	
	
	//tjekker emailadressen
	function check_email(address) {
		if ((address == "")
		|| (address.indexOf ('@') == -1)
		|| (address.indexOf ('.') == -1))
			return false;
		return true;
	}
	
	function chkMail()
	{	
		if(!check_email(document.sendmail.emailAdr.value))
			{
				alert("メールアドレスを書いてください。");
				document.sendmail.emailAdr.focus();	
				return false;
			}
		
		return true;		
	}

	function fix_zindex()
	{
	parent.setFocus("sq_Login");
	}

	function openHelp()
	{
		parent.openHelp('omrating');
	}

	function swap_help(obj)
	{
		obj.src = "../images/help_icon_swap.gif";
	}

	function swap_help_back(obj)
	{
		obj.src = "../images/help_icon.gif";
	}
//</script>