/* フレームが用意されていない場合の設定 */
if(parent.location.href == location.href){
lf = location.href;
cap = "";
if(lf.indexOf("/zaurus/") != -1 || lf.indexOf("/test/") != -1 || lf.indexOf("/shopping/") != -1 || lf.indexOf("/point/") != -1){
cap = "../";
}
while(lf.indexOf("/") != -1){
lf = lf.replace("/","<>");
}
location.href = cap + "index.htm" + "?" + lf;
}
// ドキュメント関連のプログラム
document.open();
/* 現在のページがrootディレクトリかどうか */
function isRoot(){
lf = location.href;
if(lf.indexOf("/zaurus/") != -1 || lf.indexOf("/test/") != -1 || lf.indexOf("/shopping/") != -1 || lf.indexOf("/point/") != -1){
return 0;
} else {
return 1;
}
}
/*
文字列から指定部分を抽出するプログラム
引数 gc2_s 切り取り開始文字列
gc2_e 切り取り終了文字列
gc2 切り取り対象文字列
返り値 gc2_s と gc2_e の間にはさまれた文字列
*/
function getCut2(gc2_s, gc2_e, gc2){
gc2_i = gc2.indexOf(gc2_s);
gc2_j = gc2.indexOf(gc2_e, gc2_i+gc2_s.length);
return gc2.substring(gc2_i+gc2_s.length, gc2_j);
}
/*
文字列にリンクを貼り付けるプログラム
l_opt は拡張用引数
[]指定でフルタイトル、[[]]指定で入力文字列が挿入される
*/
function l(l_src,l_opt){
l_book = parent.topFrame.document.manager.autolink.value;
output = "";
/* 現在のページがルートディレクトリ以外に存在する場合 */
if(isRoot() == 0){
output_root = "../";
} else {
output_root = "";
}
while(l_src.indexOf("[[") != -1){
/* キーワードの抽出 */
word = getCut2("[[","]]",l_src);
/* リンク色設定 */
if(l_opt.indexOf("-gray") != -1){
l_color = "c-gray";
} else {
l_color = "c-blue";
}
if(l_book.indexOf(word) != -1){
/* キーワードが登録用語内に存在する場合 */
if(word.indexOf(".htm") != -1){
/* キーワードがリンクで指定されている場合 */
output_i = l_book.indexOf(word);
} else {
/* キーワードが登録用語で指定されている場合 */
output_i = l_book.indexOf(word+" ");
}
/* キーワードのリンクを取得 */
output_j = l_book.indexOf(",",output_i);
output_k = l_book.lastIndexOf(" ",output_j);
output_link = l_book.substring(output_k+1, output_j);
} else {
/* キーワードが登録用語内に存在しない場合 */
if(word.indexOf("http://") != -1){
/* キーワードにアドレスが指定されている場合 */
output_link = word;
} else {
output_link = "error.html";
l_color = "c-red";
}
}
if(output_link.indexOf(".htm") != -1 || output_link.indexOf("/") != -1){
/* リンク指定されている場合 */
if(output_link.indexOf("http://") == -1){
/* ローカルでリンクする場合 */
output = "" + word + "";
} else {
/* 他のサイトへリンクする場合 */
output = "" + word + "";
}
} else {
/* リンク以外の機能を必要とする場合 */
if(output_link.indexOf("(small)") != -1){
/* small オプションが指定されている場合 */
output_link = output_link.replace("(small)", "");
output = "" + word + "";
} else {
output = "" + word + "";
}
}
/* 最終置換処理 */
l_src = l_src.replace("[["+word+"]]", output);
}
while(l_src.indexOf("[") != -1){
/* キーワードの抽出 */
word = getCut2("[","]",l_src);
keep = word;
/* リンク色設定 */
if(l_opt.indexOf("-gray") != -1){
l_color = "c-gray";
} else {
l_color = "c-blue";
}
if(l_book.indexOf(word) != -1){
/* キーワードが登録用語内に存在する場合 */
if(word.indexOf(".htm") != -1){
/* キーワードがリンクで指定されている場合 */
output_i = l_book.indexOf(word);
} else {
/* キーワードが登録用語で指定されている場合 */
output_i = l_book.indexOf(word+" ");
}
/* キーワードの正式名を取得 */
output_j = l_book.lastIndexOf(",",output_i);
output_k = l_book.indexOf(" ",output_j);
word = l_book.substring(output_j+1, output_k);
/* キーワードのリンクを取得 */
output_j = l_book.indexOf(",",output_i);
output_k = l_book.lastIndexOf(" ",output_j);
output_link = l_book.substring(output_k+1, output_j);
} else {
/* キーワードが登録用語内に存在しない場合 */
if(word.indexOf("http://") != -1){
/* キーワードにアドレスが指定されている場合 */
output_link = word;
} else {
output_link = "error.html";
l_color = "c-red";
}
}
if(output_link.indexOf(".htm") != -1 || output_link.indexOf("/") != -1){
/* リンク指定されている場合 */
if(output_link.indexOf("http://") == -1){
/* ローカルでリンクする場合 */
output = "" + word + "";
} else {
/* 他のサイトへリンクする場合 */
output = "" + word + "";
}
} else {
/* リンク以外の機能を必要とする場合 */
if(output_link.indexOf("(small)") != -1){
/* small オプションが指定されている場合 */
output_link = output_link.replace("(small)", "");
output = "" + word + "";
} else {
output = "" + word + "";
}
}
/* 最終置換処理 */
l_src = l_src.replace("["+keep+"]", output);
}
if(l_opt.indexOf("-pt") != -1){
p_title = l_src;
} else if(l_opt.indexOf("-href") != -1){
p_title = output_link;
} else {
document.write(l_src);
}
}
/* 参照ジャンプ(未実装) */
function refer(ref, word){
l(word,"-lk");
parent.document.manager.refer.value = ref;
location.href = p_title; // p_title にジャンプ
}
/* 時間変数定義関数 */
function define_clock(){
year = parent.topFrame.document.manager.time_year.value - 0; /* 年 */
month = parent.topFrame.document.manager.time_month.value - 0; /* 月 */
date = parent.topFrame.document.manager.time_date.value - 0; /* 日 */
day = parent.topFrame.document.manager.time_day.value - 0; /* 曜日 */
hour = parent.topFrame.document.manager.time_hour.value - 0; /* 時 */
min = parent.topFrame.document.manager.time_min.value - 0; /* 分 */
sec = parent.topFrame.document.manager.time_sec.value - 0; /* 秒 */
}
/* 参照ジャンプ先処理(未実装) */
// refer が用語をストックしている場合
if(parent.topFrame.document.manager.refer.value != ""){
refer = parent.topFrame.document.manager.refer.value;
document.write("< [" + refer + "] >から転送
");// 灰色で「<[<>]>から転送」と表示
parent.topFrame.document.manager.refer.value = ""; // refer の値をクリアする
}
/* account manager */
if(parent.topFrame.document.manager.id_code.value.indexOf("-ht") != -1){
parent.document.title = "Administrator < " + parent.topFrame.document.manager.id_user.value + " >";
} else {
if(parent.topFrame.document.title == parent.mainFrame.document.title){
parent.document.title = parent.mainFrame.document.title;
} else {
parent.document.title = parent.topFrame.document.title + "『" + parent.mainFrame.document.title + "』";
}
}
/* fontサイズの設定 */
document.write('');
/* リナックス環境でなければ画像を表示するスクリプト */
function judge_linux(fname){
if(navigator.platform != "Linux"){
document.write('');
}
}
/* ウェブツールの表示(メインページ以外) */
if(location.href.indexOf("index_") == -1){
document.write("");
/* あなたのメモリーに関するボタンのページ内貼り付け */
document.write("ウェブツール:リロード あなたのメモリーに追加 ");
/* ページ内情報の新旧度を表示 */
level = new Array(
"???",
"新しい",
"まだ新しい",
"少し古い",
"だいぶ古い",
"かなり古い",
"遺産"
);
level_doc_date = new Date(document.lastModified);
level_pre_date = new Date();
level_date = (level_pre_date - level_doc_date) / (86400 * 1000);
level_date = level_date - (level_date % 1);
if(0 <= level_date && level_date < 10){
level_no = 1;
} else if(10 <= level_date && level_date < 30){
level_no = 2;
} else if(30 <= level_date && level_date < 50){
level_no = 3;
} else if(50 <= level_date && level_date < 100){
level_no = 4;
} else if(100 <= level_date && level_date < 365){
level_no = 5;
} else if(365 <= level_date){
level_no = 6;
} else {
level_no = 0;
}
document.write("このページの情報は " + level[level_no] + " です。 ");
document.write("背景色を白に変更 ");
document.write("フォントサイズ:+ ");
document.write("−");
/* ウェブツールを閉じる */
document.write("
");
/* 設定の引き継ぎ */
setBGColor(parent.topFrame.docBGColor);
setFontSize(parent.topFrame.docFontSize);
}
function popupReview(level_no){
level_doc_date = new Date(document.lastModified);
level_pre_date = new Date();
level_date = (level_pre_date - level_doc_date) / (86400 * 1000);
level_date = level_date - (level_date % 1);
level_message = "・タイトル\n" + document.title + "\n\n";
level_message += "・URL\n" + location.href + "\n\n";
level_message += "このページの情報は " + level[level_no] + " です。\n\n";
level_message += "最終更新日 : " + level_doc_date + "\n\n";
level_message += "現在の日付 : " + level_pre_date + "\n\n";
level_message += " 経過日数 : " + level_date + " 日\n\n";
alert(level_message);
}
function setBGColor(color){
document.body.style.backgroundColor = color;
parent.topFrame.docBGColor = color;
}
function setFontSize(add){
document.body.style.fontSize = add;
parent.topFrame.docFontSize = add;
}
/* メンテナンス実施時は次の行を有効にしてください */
//document.write('サイトメンテナンス中
');
/* テストページの明記 */
if(location.pathname.indexOf("_test.htm")!=-1){
document.write("
このページはテストページです。
");
}
/* リンクカラー設定 */
document.write('');
document.write('');
document.write('');
document.write('');
/* ドキュメント編集用設定 */
document.write("");