function isEmail( param )
{
    if(param.match("^[0-9A-Za-z._]+@[0-9A-Za-z.]+$"))
	{
        return true;
    }
	else
	{
        return false;
    }
}

function isEmpty( str )
{
	work = str.replace( /[\s　\t\n\r]/g, '' );

	return ( work == '' );
}

function sendMail()
{
	if( isEmpty( window.document.form2.name.value ) )
	{
		alert( 'お名前を入力してください。' );
	}
	else
	{
		if( isEmpty( window.document.form2.email.value ) )
		{
			alert( 'メールアドレスを入力してください。' );
		}
		else
		{
			if( isEmail( window.document.form2.email.value ) )
			{
				if( isEmpty( window.document.form2.tel.value ) )
				{
					alert( '電話番号を入力してください。' );
				}
				else
				{
					if( isEmpty( window.document.form2.comment.value ) )
					{
						alert( 'ご相談内容を入力してください。' );
					}
					else
					{
						if( window.confirm( 'メールを送信します。' ) )
						{
							window.document.form2.action = "sendMail.php";
            				window.document.form2.submit();
						}
					}
				}
			}
			else
			{
				alert( 'メールアドレスが不正です。' );
			}
		}
	}
}

function downloadHandbill( pdf )
{
	window.document.form1.action = "downloadHandbill.php";
	window.document.form1.pdf_name.value = pdf;
	window.document.form1.submit();
}

function shohin_list( type )
{
	if( type == '2' )
	{
		window.document.form.action = 'shohin_select_list.html';
	}
	else
	{
		window.document.form.action = 'shohin_list.html';
	}

    window.document.form.shohin_type.value = type;
	window.document.form.submit();
}

function shohin_page( type, num )
{
	window.document.form.action = 'goods.html';
    window.document.form.shohin_type.value = type;
	window.document.form.shohin_num.value = num;
	window.document.form.submit();
}

