function swap18k() {
	var year = parseInt($('birth_y').value);
	var month = parseInt($('birth_m').value);
	var day = parseInt($('birth_d').value);
	var under18 = $('under18');
	var check18 = $('check18');
	var kiyaku = $('kiyaku');


	if (!year || !month || !day) {
		under18.style.display = 'none';
		return;
	}

	url = '/net/check/over18/y/'
		+ year + '/m/' + month + '/d/' + day;
	
	// $('submit').style.display = 'none';

	var d1 = new Date();
        var d2 = new Date(year + 18, month - 1, day);

        if (d1 >= d2) {
		under18.style.display = 'none';
		check18.checked = 'true';
		if (kiyaku.checked == true || kiyaku.checked == 'checked')
		{
			$('submit').style.display = 'block';
		}
	}
	else {
		under18.style.display = 'block';
		check18.checked = true;
	}
}

function accept18k() {
	var check18 = $('check18');
	var kiyaku = $('kiyaku');
	var sbmt = $('submit');

	if (check18.checked != true || kiyaku.checked != true) {
		sbmt.style.display = "none";
	} else {
		sbmt.style.display = "block";
	}
}

function submit18k() {
	var year = parseInt($('birth_y').value);
	var month = parseInt($('birth_m').value);
	var day = parseInt($('birth_d').value);

	var d1 = new Date();
        var d2 = new Date(year + 18, month - 1, day);

	var check18 = $('check18');
	var kiyaku = $('kiyaku');

	if ( d1 < d2 && check18.checked != true) {
		alert('18歳未満の方は親の同意を得てチェックを入れてください。');
		return;
	}
	if (kiyaku.checked != true) {
		alert('規約に同意し、チェックを入れてください。');
		return;
	}
	$('form').submit();
}



