################################################################
# Theme Anti-Windoze for hns-2.10
# 1999/12/19  Kenji Suzuki <kenji@inseki.gr.jp>
# Backgroud/AWWU logo by
#  Anti Windows World Union http://www.mrcharlie.com/awwu/

################################################################
# User variable
#  parameter %value is expanded to value of the user variable.
#  you can use other value of user variable by noting as "%user{BASHO}".
package HNS::Hnf::UserVar;
$Templates{'TENKI'} = "[天気:%value]";
$Templates{'BASHO'} = "(%value)";
$Templates{'TAION'} = " 体温:%value度";
$Templates{'TAIJU'} = " 体重:%value" . "Kg";
$Templates{'SUIMIN'} = " 睡眠:%value時間";
$Templates{'BGM'} = " BGM:%value";

################################################################
# Mark
package HNS::Hnf::Command::MARK;
# image size is automatically set
$List{"(^^)"} =  "icons/nomal_13.png";
$List{"(^^;"} = "icons/ase_13.png";
$List{"(;_;)"} = "icons/naku_13.png";
$List{"v(^^)"} = "icons/v_13.png";
$List{"!!"} = "icons/neko_13.png";
$List{"??"} = "icons/hatena_13.png";
$List{"(笑)"} = "icons/warau_13.png";
$List{"ばか"} = "$HNS::System::Theme/ruribaka.png";
$List{"後ろ"} = "$HNS::System::Theme/ruriusiro.png";

################################################################
# CategoryList
package HNS::CategoryList;
$CatDir = "cat";

$TitleLabel = "<font>タイトル一覧</font>";
$SubmitLabel = "表示!";
$Template = qq(<font><img src="%src" width="%width" height="%height" alt="">%value</font><br>\n);
$Categorize = "<font>カテゴリ分類</font>";

################################################################
# Extend HTML
package HNS::ExtHTML;
$DOCTYPE = qq(<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
	"http://www.w3.org/TR/REC-html40/loose.dtd">\n);
#$Head = undef;
$Head = qq(<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"><!--
 body { background-image: url($HNS::System::MyDiaryURI/anti-windoze/screen1.jpg); background-attachment: fixed }
 a { background: #AAAAAA }
 strong { background: #EEEEEE }
 font { background: #EEEEEE }
 h2 { background: #999999 }
 ul { background: #EEEEEE }
 ol { background: #EEEEEE }
 div { background: #EEEEEE }
 blockquote { background: #EEEEEE }
 table { background: #999999 }
 h3.new { margin-left: 1em; background: #AAAAAA }
 div.section { margin-left: 2em; margin-top: 0; background: #EEEEEE }
 div.sub { margin-left: 1em; margin-top: 0 }
 div.list { margin-left: 1em }
 div.fn { margin-left: 1em; margin-top: 0 }
 div.url { margin-bottom: 0 }
 pre { 
  white-space:  pre;
  padding:      0.5em;
  background: #EEEEEE;
  border-color: #ffeeb0;
  border-style: outset;
  border-width: 4px
 }
--></style>
);

#$BodyVal = undef;
##$BodyVal = "bgcolor=#ffffcc";
#$DynamicPrintFunc = undef;
$DynamicPrintFunc = \&PrintMessage;
sub PrintMessage {
    my $rand = int(rand 23);
    my $message;

    SWITCH: {
      $message = "Plug and Pray!";
	last SWITCH if ($rand==0);
      $message = "Buy out or Kill, that's the Micro\$oft way.";
	last SWITCH if ($rand==1);
      $message = "To tell a lie 100 times makes People believe.";
	last SWITCH if ($rand==2);
      $message = "No technical support sometimes costs 20,000 yen.";
	last SWITCH if ($rand==3);
      $message = "Windoze 98 is easier than rocket science.";
	last SWITCH if ($rand==4);
      $message = "If IE is a part of OS, Office could be.";
	last SWITCH if ($rand==5); 
      $message = "Security Holes are function of products.";
	last SWITCH if ($rand==6);
      $message = "No security model is Micro\$oft's security model.";
	last SWITCH if ($rand==7);
      $message = "Bug is the function of product.";
	last SWITCH if ($rand==8);
      $message = "Have a great day without Windoze :-)";
	last SWITCH if ($rand==9);
      $message = "Where do you want to reinstall today?";
	last SWITCH if ($rand==10);
      $message = "Windoze NT doesn't stop if you reboot everyday.";
	last SWITCH if ($rand==11);
      $message = "Windoze NT doesn't stop if you don't give heavy loads.";
	last SWITCH if ($rand==12);
      $message = "Windoze 98 is 95.1 indeed.";
	last SWITCH if ($rand==13);
      $message = "Service Pack is Micro\$oft's free service. Don't claim it.";
	last SWITCH if ($rand==14);
      $message = "Service Pack is not bug fixes. New bugs inside.";
	last SWITCH if ($rand==15);
      $message = "Word 95 is a different product from Word 97. Don't claim file compatibility.";
	last SWITCH if ($rand==16);
      $message = "If you pay a penny to Micro\$oft, you support Micro\$oft.";
	last SWITCH if ($rand==17);
      $message = "Think Monopoly.";
	last SWITCH if ($rand==18);
      $message = "Think Negative Campaign.";
	last SWITCH if ($rand==19);
      $message = "Think Lies.";
	last SWITCH if ($rand==20);
      $message = "Think RFC.";
	last SWITCH if ($rand==21);
      $message = "Think Darkside of Micro\$oft.";
	last SWITCH if ($rand==22);
      $message = "Free in Micro\$oft means a part of cost of Gates OS.";
	last SWITCH if ($rand==23);
    }
 
    print qq(
	<div align="center">
	<a accesskey="L" 
	href="http://www.mrcharlie.com/awwu/"><img alt="Anti Windows World Union Logo" src="anti-windoze/002.png" width="172" height="58"></a>
	<br>
	<font size="+2">
	);
    print qq($message<br>);
    print qq(</font>
	</div>
	);
}
################################################################
package HNS::Collection;
# %num : number of showing diarys
$FootMessages{'HasContent'} = "<font>以上、%num 日分です。</font>\n";
$FootMessages{'NoContent'} = "<font>該当するものはありません。</font>\n";


################################################################
# PIM
# Schedule
package HNS::PIM::Schedule;
@WeekString = ('<font color="red">日</font>', '月', '火', '水', '木', '金', '<font color="blue">土</font>');
@ABCString = ('上', '中', '下');
$Unfixed = '??';
$Range = 1;
$ContentTemplate = qq(<li><strong>%month/%day%week</strong> %content</li>\n);
$BeginTemplate = "<ul>";
$EndTemplate = "</ul>";

# TODO
package HNS::PIM::Todo;
$ContentTemplate = "<li><strong>%priority</strong> %content</li>\n";
$BeginTemplate = "<ul>";
$EndTemplate = "</ul>";

################################################################
# Calendar
package HNS::Calendar::Table;
@WeekString = ('<font color="red">日</font>', '月', '火', '水', '木', '金', '<font color="blue">土</font>');
$TableBorder = 0;
$NextTemplate = qq(<a href="$HNS::System::MyDiaryURI?%year%month">来月</a>);
$PrevTemplate = qq(<a href="$HNS::System::MyDiaryURI?%year%month">先月</a>);
$ThisTemplate = qq(<a href="$HNS::System::MyDiaryURI?%year%month">%year年%month月</a>);
$DayCurrentTemplate = qq(<a href="%ruri#%{ymd}0">%day</a>);
$DayNonCurrentTemplate = qq(<a href="$HNS::System::MyDiaryURI?%year%month%abc#%{ymd}0">%day</a>);

package HNS::Calendar::NoTable;
$NextTemplate = qq(<a href="$HNS::System::MyDiaryURI?%year%month">&gt;&gt;</a>);
$PrevTemplate = qq(<a href="$HNS::System::MyDiaryURI?%year%month">&lt;&lt;</a>);
$ThisTemplate = qq(<a href="$HNS::System::MyDiaryURI?%year%month">%year/%month</a>);
$DayCurrentTemplate = qq(<a href="%ruri#%{ymd}0">%day</a>);
$DayNonCurrentTemplate = qq(<a href="$HNS::System::MyDiaryURI?%year%month%abc#%{ymd}0">%day</a>);

################################################################
# DateSelect
package HNS::DateSelect;
$YearTemplate = "%year年";
$MonthTemplate = "%month月";
$DayTemplate = "%start_day〜%end_day日";
$AllLabel = "全て";

################################################################
# Direct Ctalendar
package HNS::Calendar::Direct;
$SubmitLabel = "Go!";

################################################################
# Style
package HNS::Style;
$Templates{Table}->{pim} = qq(
<hr>
<table summary="pim" width="100%">
<tr><th align="left">予定</th><th align="left">TODO</th></tr>
<tr><td valign="top">
%schedule
</td>
<td valign="top">
%todo
</td></tr>
</table>
);

$Templates{Table}->{head_style} = qq( 
%pim
<hr>
<table summary="calendar">
<tr>
<td rowspan="2" valign="top">
%calendar
</td>
<td valign="top">
%unagi
</td>
</tr>
<tr>
<td valign="bottom">
%direct_calendar
</td>
</tr>
</table>
<hr>
);

$Templates{Table}->{foot_style} = "\n<hr>\n%category_list";

# template for no table browser
$Templates{NoTable} = {
    pim => qq(<hr>\n%schedule %todo),
    head_style => qq(%pim\n<hr>\n%unagi\n<hr>\n%calendar
		      %direct_calendar\n<hr>\n),
    foot_style=> "<hr>\n%category_list"
    };

# unagi template
$UnagiTemplate = qq( 
<a href="%namazu_url">Namazu</a> for hns による簡易全文検索<br>
詳しくは <a href="%unagi_url">詳細指定/ヘルプ</a>を参照して下さい
<form method="GET" action="%unagi_url">
<strong>検索式:</strong>
<input type="TEXT" name="key" size="30" value="">
<input type="SUBMIT" name="submit" value="Search!">
<input type="HIDDEN" name="whence" value="0">
</form>
);

$NoUnagiTemplate = qq(
<a href="http://www.h14m.org/"><img src="$HNS::System::Theme/hns-logo-2.png" width="200" height="40" align="right" alt="HNS logo"></a>
);



################################################################
# Warning
package HNS::Hnf::Warning;
$Head = "<br><font color=\"red\">\[- 日記システム警告：";
$Foot = "-\]</font><br>\n";

# parameters:
#  %c : the command name
#  %p : command name of inserted position
#
$Messages{'IllegalHeader'} = "ヘッダ部が不正です";
$Messages{'UndefinedUserVar'} = "定義されていないユーザ変数が使われています";
$Messages{'Reserved'} = "コマンド %c は予約されています。";
$Messages{'NoMatch'} = "コマンド %p の中にコマンド %c を含めることはできません。コマンド /%c が抜けている可能性があります。";
$Messages{'NotDefined'} = "コマンド %c の引数として %t は定義されていません。";

################################################################
# Version Message
# paramter:
#  %homepage
#  %public_version
#  %current_version

package HNS;
$VersionMessages{'Public'} = q(<hr>
<div>hns - 日記自動生成システム - Version %public</div>);

$VersionMessages{'NonPublic'} = qq(<hr>
<div>
<font color="red">注意：</font> 
今現在使用されているこの日記自動生成システムは 
Version %current です。<br>
公開されている日記自動生成システムは 
Version %public です。
</div>
);

################################################################
# Template
# usable parameter (%[A-Za-z0-9_]) is:
#  date:
#   %year, %month, %day : year, month, day
#   %high               : int(day/10)
#   %abc		: day 1-10 -> a, 11-20 -> b, 21-31 -> c 
#  counter:
#   %new, %sub, %fn     : counter of NEW, SUB, FN
#   %mark               : for GRP mark, if not in GRP the same as %new

package HNS::Diary;
################
# diary limited parameter:
#   %week               : week string
#
#  user-variable
#   %user{VARNAME}      : string as which user-var-format is expanded using
#                         value of user-variable VARNAME.
@WeekString = ('<font color="red">日</font>', '月', '火', '水', '木', '金', '<font color="blue">土</font>');

$Head = qq(
<h2><a href="$HNS::System::MyDiaryURI?%year%month%abc&amp;to=%year%month%{day}0#%year%month%{day}0"
name="%year%month%{day}0">%year年%month月%day日(%week)</a>
 %user{TENKI}%user{BASHO}%user{TAIJU}%user{TAION}%user{SUIMIN}%user{BGM}</h2>);

$Foot = qq(<hr>\n);

package HNS::Hnf::Command::NEW;
$Template = qq(
<h3 class="new"><a name="%year%month%day%new" title="%year%month%day%new" 
href="$HNS::System::MyDiaryURI?%year%month%abc&amp;to=%year%month%day%new#%year%month%day%new">#%mark</a>
%cat %content</h3>
<div class="section">);
$EndTemplate = "</div><!-- end of NEW -->\n";

package HNS::Hnf::Command::LNEW;
$Template = qq(
<h3 class="new"><a name="%year%month%day%new" title="%year%month%day%new" 
href="$HNS::System::MyDiaryURI?%year%month%abc&amp;to=%year%month%day%new#%year%month%day%new">#%mark</a>
%cat <a href="%1">%content</a></h3>
<div class="section">);
$EndTemplate = "</div><!-- end of LNEW -->\n";

package HNS::Hnf::Command::RLNEW;
$Template = qq(
<h3 class="new"><a name="%year%month%day%new" title="%year%month%day%new" 
href="$HNS::System::MyDiaryURI?%year%month%abc&amp;to=%year%month%day%new#%year%month%day%new">#%mark</a>
%cat <a href="%url%2">%content</a></h3>
<div class="section">);
$EndTemplate = "</div><!-- end of RLNEW -->\n";

package HNS::Hnf::Command::SUB;
$Template = qq(
<h4><a name="%year%month%day%{new}S%sub" title="%year%month%day%{new}S%sub"
href="$HNS::System::MyDiaryURI?%year%month%abc&amp;to=%year%month%day%{new}S%sub#%year%month%day%{new}S%sub">＠</a>
%content:</h4> 
<div class="sub">
);
$EndTemplate = "</div><!-- end of SUB -->\n";

package HNS::Hnf::Command::LSUB;
$Template = qq(
<h4><a name="%year%month%day%{new}S%sub" title="%year%month%day%{new}S%sub"
href="$HNS::System::MyDiaryURI?%year%month%abc&amp;to=%year%month%day%{new}S%sub#%year%month%day%{new}S%sub">＠</a>
<a href="%1">%content</a>:</h4> 
<div class="sub">
);
$EndTemplate = "</div><!-- end of LSUB -->\n";
$NumAttr = 1;

package HNS::Hnf::Command::RLSUB;
$Template = qq(
<h4><a name="%year%month%day%{new}S%sub" title="%year%month%day%{new}S%sub"
href="$HNS::System::MyDiaryURI?%year%month%abc&amp;to=%year%month%day%{new}S%sub#%year%month%day%{new}S%sub">＠</a>
<a href="%url%2">%content</a>:</h4> 
<div class="sub">
);
$EndTemplate = "</div><!-- end of RLSUB -->\n";
$NumAttr = 2;

################################################################
# Inline Elements
# these element has no content commands,
# so $EndTemplate, $AllowCommands has no means.

package HNS::Hnf::Command::LINK;
$Template = qq(<a href="%1">%content</a> );
$NumAttr = 1;

package HNS::Hnf::Command::RLINK;
$Template = qq(<a href="%url%2">%content</a> );
$NumAttr = 2;
# overriden AsHTML

package HNS::Hnf::Command::URL;
$Template = qq(<div class="url">
<img alt="*" src="./icons/mark01.png" width="16" height="16"><a href="%1">%content (%1)</a>
</div>);
$NumAttr = 1;

package HNS::Hnf::Command::STRIKE;
#$Template = q(<strike>%content</strike>);

package HNS::Hnf::Command::LSTRIKE;
$Template = q(<strike><a href="%1">%content</a></strike>);
$NumAttr = 1;

package HNS::Hnf::Command::STRONG;
$Template = q(<strong>%content</strong>);

package HNS::Hnf::Command::FONT;
$Template = q(<font %1="%2">%content</font>);
$NumAttr = 2;

package HNS::Hnf::Command::IMG;
$Template = q(<img %align src="%2" alt="%content" width="%width" height="%height">);
$NumAttr = 2;
# overriden AsHTML

package HNS::Hnf::Command::MARK;
$Template = qq(<img src="%src" alt="%1" width="%width" height="%height">\n);
$NumAttr = 1;
# overriden AsHTML

package HNS::Hnf::Command::ALIAS;
$Template = "%term";
# overriden AsHTML

################################################################
# Block Commands
package HNS::Hnf::Command::PRE;
$Template = "<pre>\n";
$EndTemplate = "</pre>\n";

package HNS::Hnf::Command::CITE;
$Template = "<blockquote>\n";
$EndTemplate = "</blockquote>\n";

package HNS::Hnf::Command::UL;
$Template = "<ul>\n";
$EndTemplate = qq(</ul>\n);

package HNS::Hnf::Command::OL;
$Template = "<ol>\n";
$EndTemplate = qq(</ol>\n);

package HNS::Hnf::Command::LI;
$Template = q(<li>%content);
$EndTemplate = "</li>\n";

package HNS::Hnf::Command::HR;
$Template = q(<hr>\n);

package HNS::Hnf::Command::FN;
$Template = qq(
<a href="$ENV{'REQUEST_URI'}#%year%month%day%{new}F%fn"><small>*%fn</small></a>
);

$HeaderTemplate = qq(<hr class="section" width="40%" align="left">
<div class="fn">);
$FooterTemplate = qq(</div>);

$ContentTemplate = qq(
<a name="%year%month%day%{new}F%fn"
href="$HNS::System::MyDiaryURI?%year%month%abc&amp;to=%year%month%day%{new}F%fn#%year%month%day%{new}F%fn"><small>*%fn</small></a>: %content<br>
);

################################################################
# title.cgi
package HNS::Tools::Title;
$NewStart = qq(<strong>);
$NewEnd = qq(</strong>);
$SubStart = qq(<strong>);
$SubEnd = qq(</strong>);
################################################################
1;
