<?php
function add_where_create($http_arg) {
	return ('');
}
function add_my_filter($http_arg) {
?>
	<div style="margin:3px 0;">
<script>
$(function() {
	$("#question_off").click(function() {
		if (this.checked) {
			$(".study_mycheck_question").css("display","none");
			$(".study_mycheck_answer").css("display","");
			$("#answer_off").attr("checked", "");
			$.cookie('study_display_question','off',{ path:'<?= MY_SESSION_PATH ?>', expires:365 });
			$.cookie('study_display_answer','',{ path:'<?= MY_SESSION_PATH ?>', expires:365 });
		} else {
			$(".study_mycheck_question").css("display","");
			$.cookie('study_display_question','',{ path:'<?= MY_SESSION_PATH ?>', expires:365 });
		}
		if (this.checked || $("#answer_off").checked) {
			$(".study_mycheck_question").css("width","<?= MYCHECK_QA_WIDTH_2 ?>");
			$(".study_mycheck_answer").css("width","<?= MYCHECK_QA_WIDTH_2 ?>");
		} else {
			$(".study_mycheck_question").css("width","<?= MYCHECK_QA_WIDTH_1 ?>");
			$(".study_mycheck_answer").css("width","<?= MYCHECK_QA_WIDTH_1 ?>");
		}
	});
	$("#answer_off").click(function() {
		if (this.checked) {
			$(".study_mycheck_answer").css("display","none");
			$(".study_mycheck_question").css("display","");
			$("#question_off").attr("checked", "");
			$.cookie('study_display_answer','off',{ path:'<?= MY_SESSION_PATH ?>', expires:365 });
			$.cookie('study_display_question','',{ path:'<?= MY_SESSION_PATH ?>', expires:365 });
		} else {
			$(".study_mycheck_answer").css("display","");
			$.cookie('study_display_answer','',{ path:'<?= MY_SESSION_PATH ?>', expires:365 });
		}
		if (this.checked || $("#question_off").checked) {
			$(".study_mycheck_question").css("width","<?= MYCHECK_QA_WIDTH_2 ?>");
			$(".study_mycheck_answer").css("width","<?= MYCHECK_QA_WIDTH_2 ?>");
		} else {
			$(".study_mycheck_question").css("width","<?= MYCHECK_QA_WIDTH_1 ?>");
			$(".study_mycheck_answer").css("width","<?= MYCHECK_QA_WIDTH_1 ?>");
		}
	});
});
function CheckboxOnOff(check, onOff) {
	if (onOff == 'on') {
		window.location.href = "<?= $_SERVER['SCRIPT_NAME'] ?>?" + check + "=off&<?= query_from_http_arg_pool($http_arg, 'ck0,ck1,ck2,ck3') ?>";
	} else {
		window.location.href = "<?= $_SERVER['SCRIPT_NAME'] ?>?" + check + "=on&<?= query_from_http_arg_pool($http_arg, 'ck0,ck1,ck2,ck3') ?>";
	}
}
function CheckboxChkAll() {
	window.location.href = "<?= $_SERVER['SCRIPT_NAME'] ?>?ck0=off&ck1=off&ck2=off&ck3=off&<?= query_from_http_arg_pool($http_arg, 'ck0,ck1,ck2,ck3') ?>";
}
</script>
	チェック<label><input type="radio" onClick="CheckboxChkAll()"<? if ($_SESSION['study_list_check_all'] <> 'off') echo ' checked' ?>>すべて</label>
<?php	for ($ix=0; $ix<=3; $ix++) { ?>
		<label><input type="checkbox" onClick="CheckboxOnOff('ck<?= $ix ?>', '<?= $_SESSION['study_list_check'.$ix] ?>')"<? if ($_SESSION['study_list_check'.$ix] == 'on') echo ' checked' ?>>
<? if ($_SESSION['study_list_check'.$ix] == 'on' ) { ?><span style='background-color: #ffe0c0;'>&nbsp;<?= $ix ?>&nbsp;</span><? } else { ?>&nbsp;<?= $ix ?>&nbsp;<? } ?>
<?php	} ?></label>
<label><input id="question_off" type="checkbox"<? if ($_COOKIE['study_display_question'] == 'off') echo ' checked' ?>>質問を隠す</label>
<label><input id="answer_off" type="checkbox"<? if ($_COOKIE['study_display_answer'] == 'off') echo ' checked' ?>>解答を隠す</label>
	</div>
<?php
}
?>
