# FitPack::slide.pl i-maruyama@fit.ac.jp
# Ref. http://hppg.moe.hm/okwave/qa/q7414453/
$::inline_plugin{'slide.pl_version'}= sub{'FitPack::slide.pl 1.2'};
my $hide_start='';
if(exists($::form{hide})){ 
  if($::form{hide}==2){
  $hide_start=<<HTML;
\$('div.subsection>div').hide();
HTML
  }elsif($::form{hide}==1){
  $hide_start=<<HTML;
\$('div.section>div').hide();\$('div.subsection>div').hide();
HTML
}
}

push(@::html_header,<<HTML);
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript">
	\$().ready ( function() {
		$hide_start
		\$('div.day > h2').click(function() {
			\$('div.section > div').slideToggle('slow');
			\$('div.subsection > div').slideToggle('slow');
		});
		\$('div.section > h3').click(function() {
			\$(this).next().slideToggle('fast');
		}).next().find('div.close').click ( function() {
			\$(this).parent().slideToggle('fast');
		});
		\$('div.subsection > h4').click(function() {
			\$(this).next().slideToggle('fast');
		}).next().find('div.close').click ( function() {
			\$(this).parent().slideToggle('fast');
		});
	});
</script>
<style type="text/css">
h2 { cursor: pointer; }h3 { cursor: pointer; }h4 { cursor: pointer; }
</style>
HTML
