////////////////////////////////////////////////
// HIC INCIPIT PROGRAMMA QUOD UMECHANDO FECIT //
//      http://www.umechando.com/             //
////////////////////////////////////////////////


//if (parent.frames.length > 0) location.href = "no_frame_link.html"; 

ie=0;
n=0;
n=0;
ie=1;
fShow="visible";
fHide="hidden";
bbcidsubmenu=0;


function showToolbar()
{
  home='http://www.umechando.com/';
  tips=home+'tips/';
  play=home+'playroom/';
  js=home+'javascript/';
  soft=home+'software/';
  view=home+'view/';
  link=home+'links/';
  ranking='http://cgi.members.interq.or.jp/engineer/umechan/access/access.cgi?count';
  blog='http://umechando.blogspot.com/';
  bbs=home+'forum/';
  
  Agent=navigator.userAgent;
  if(document.all && Agent.indexOf("Opera")==-1)
  {
    menu = new Menu();
    with(menu)
    {

      addItem("homeid", "ホーム", "ホーム",  home, "#ffffcc");
      addItem("tipsid", "HTML Tips", "HTML Tips",  tips, "#dddddd");
      addItem("jsid", "JavaScript 入門", "HTML Tips",  js, "#ffcccc");
      addItem("softwareid", "お役立ちソフト", "お役立ちソフト",  soft, "#ffccff");
      addItem("playroomid", "頭の体操", "頭の体操",   play, "#ffe4c4");
      addItem("viewid", "視　角", "視角",   view, "#99ffff");
      addItem("bbsid", "掲示板", "ザ・掲示板",   bbs, "#98fb98");
      addItem("linkid", "その他", "その他",   link, "#ccccff");

      addSubItem("homeid", "トップページ", "トップページ\n"+home,  home);
      addSubItem("homeid", '<HR class="groove" width="100%">', "", "");
      addSubItem("homeid", "はじめに", "はじめに\n"+home+"intro.htm",  home+"intro.htm");
      addSubItem("homeid", "テキスト版ホーム", "テキスト版ホーム\n"+home+"text.htm",  home+"text.htm");
      addSubItem("homeid", "サイトマップ", "サイトマップ\n"+home+"sitemap.htm",  home+"sitemap.htm");
      addSubItem("homeid", "更新履歴", "更新履歴\n"+home+"history.htm",  home+"history.htm");
      addSubItem("homeid", "梅ちゃん堂トップページの変遷", "梅ちゃん堂トップページの変遷\n"+home+"history/",  home+"history/");

      addSubItem("tipsid", "色の設定", "色の設定\n"+tips+"01.htm",  tips+"01.htm");
      addSubItem("tipsid", "デジタル時計を作る", "デジタル時計を作る\n"+tips+"03.htm",  tips+"03.htm");
      addSubItem("tipsid", "カレンダーを作る（１）", "カレンダーを作る（１）\n"+tips+"06.htm",  tips+"06.htm");
      addSubItem("tipsid", "カレンダーを作る（２）", "カレンダーを作る（２）\n"+tips+"07.htm",  tips+"07.htm");
      addSubItem("tipsid", "動く掲示板を作る", "動く掲示板を作る\n"+tips+"13.htm",  tips+"13.htm");
//      addSubItem("tipsid", "パスワードでアクセス制限", "パスワードでアクセス制限\n"+tips+"14.htm",  tips+"14.htm");
      addSubItem("tipsid", "Image オブジェクトを使う", "Image オブジェクトを使う\n"+tips+"15.htm",  tips+"15.htm");
      addSubItem("tipsid", "Dynamic HTMLの基礎（３）", "Dynamic HTMLの基礎（３）\n"+tips+"23.htm",  tips+"23.htm");
      addSubItem("tipsid", "キャラクタ・セットを使う", "キャラクタ・セットを使う\n"+tips+"28.htm",  tips+"28.htm");
      addSubItem("tipsid", "スタートページを作ろう", "スタートページを作ろう\n"+tips+"32.htm",  tips+"32.htm");
      addSubItem("tipsid", "改行の研究", "改行の研究\n"+tips+"35.htm",  tips+"35.htm");
      addSubItem("tipsid", "MIDI CHANGER を作る", "MIDI CHANGER を作る\n"+tips+"36.htm",  tips+"36.htm");
      addSubItem("tipsid", "リンク先のウィンドウ", "リンク先のウィンドウ\n"+tips+"37.htm",  tips+"37.htm");
      addSubItem("tipsid", "スケジュール型カレンダー", "スケジュール型カレンダー\n"+tips+"38.htm",  tips+"38.htm");
      addSubItem("tipsid", "デスクトップにスクロールバー", "デスクトップにスクロールバー\n"+tips+"39.htm",  tips+"39.htm");
      addSubItem("tipsid", "フレーム２題", "フレーム２題\n"+tips+"41.htm",  tips+"41.htm");
      addSubItem("tipsid", "Web 拡大鏡を作る", "Web 拡大鏡を作る\n"+tips+"42.htm",  tips+"42.htm");
      addSubItem("tipsid", "５分で作る Google ストリートビュー", "５分で作る Google ストリートビュー\n"+tips+"43.htm",  tips+"43.htm");
      addSubItem("tipsid", '<HR class="groove" width="100%">', "", "");
      addSubItem("tipsid", "その他のメニュー", tips,  tips);

      addSubItem("jsid", "JavaScript とは", "JavaScript とは\n"+js+"01.htm",  js+"01.htm");
      addSubItem("jsid", "JavaScript の特徴", "JavaScript の特徴\n"+js+"02.htm",  js+"02.htm");
      addSubItem("jsid", "Dynamic HTML について", "Dynamic HTML について\n"+js+"03.htm",  js+"03.htm");
      addSubItem("jsid", '<HR class="groove" width="100%">', "", "");
      addSubItem("jsid", "JavaScript の作り方", "JavaScript の作り方\n"+js+"04.htm",  js+"04.htm");
      addSubItem("jsid", "イベントを理解する", "イベントを理解する\n"+js+"05.htm",  js+"05.htm");
      addSubItem("jsid", "プログラムを呼び出す", "プログラムを呼び出す\n"+js+"06.htm",  js+"06.htm");
      addSubItem("jsid", "メソッドとユーザー定義関数", "メソッドとユーザー定義関数\n"+js+"07.htm",  js+"07.htm");
      addSubItem("jsid", "変数と定数", "変数と定数\n"+js+"08.htm",  js+"08.htm");
      addSubItem("jsid", "JavaScript の式", "JavaScript の式\n"+js+"09.htm",  js+"09.htm");
      addSubItem("jsid", "演算子", "演算子\n"+js+"10.htm",  js+"10.htm");
      addSubItem("jsid", "オブジェクト", "オブジェクト\n"+js+"11.htm",  js+"11.htm");
      addSubItem("jsid", "条件分岐", "条件分岐\n"+js+"12.htm",  js+"12.htm");
      addSubItem("jsid", "繰り返し処理", "繰り返し処理\n"+js+"13.htm",  js+"13.htm");
      addSubItem("jsid", "効果的な書き方", "効果的な書き方\n"+js+"14.htm",  js+"14.htm");
      addSubItem("jsid", '<HR class="groove" width="100%">', "", "");
      addSubItem("jsid", "デバッグのコツ", "デバッグのコツ\n"+js+"15.htm",  js+"15.htm");
      addSubItem("jsid", "クロスブラウザなスクリプトのために", "クロスブラウザなスクリプトのために\n"+js+"16.htm",  js+"16.htm");
      addSubItem("jsid", "ユーザー情報の取得", "ユーザー情報の取得\n"+js+"17.htm",  js+"17.htm");
      addSubItem("jsid", "ページ情報の取得", "ページ情報の取得\n"+js+"18.htm",  js+"18.htm");
      addSubItem("jsid", "フォームとの対話", "フォームとの対話\n"+js+"19.htm",  js+"19.htm");
      addSubItem("jsid", "画像の制御", "画像の制御\n"+js+"20.htm",  js+"20.htm");
      addSubItem("jsid", "クッキー調理法", "クッキー調理法\n"+js+"21.htm",  js+"21.htm");
      addSubItem("jsid", "レイヤーの制御", "レイヤーの制御\n"+js+"22.htm",  js+"22.htm");
      addSubItem("jsid", "フレームの制御", "フレームの制御\n"+js+"23.htm",  js+"23.htm");
      addSubItem("jsid", "ウィンドウの制御", "ウィンドウの制御\n"+js+"24.htm",  js+"24.htm");

      addSubItem("softwareid", "Website Explorer", "Website Explorer\n"+home+"webex/",  home+"webex/");
      addSubItem("softwareid", '<HR class="groove" width="100%">', "", "");
      addSubItem("softwareid", "TCP Explorer", "TCP Explorer\n"+soft+"#TCP Explorer",  soft+"#TCP Explorer");
      addSubItem("softwareid", "Auto Whois", "Auto Whois\n"+soft+"#Auto Whois",soft+"#Auto Whois");
      addSubItem("softwareid", "CopitX", "CopitX\n"+soft+"#CopitX",  soft+"#CopitX");
      addSubItem("softwareid", "コピット！", "コピット！\n"+soft+"#Copit",  soft+"#Copit");
//      addSubItem("softwareid", "リンクテスター", "リンクテスター\n"+soft+"#LinkTester",  soft+"#LinkTester");
      addSubItem("softwareid", "Ex-Icon（エクスアイコン）", "Ex-Icon（エクスアイコン）\n"+soft+"#ExIcon",  soft+"#ExIcon");
      addSubItem("softwareid", "JayOne（ジェイ・ワン）", "JayOne（ジェイ・ワン）\n"+soft+"#JayOne",  soft+"#JayOne");
//      addSubItem("softwareid", "A-CLIP（エー・クリップ）", "A-CLIP（エー・クリップ）\n"+soft+"#AClip",  soft+"#AClip");
      addSubItem("softwareid", "ポップレンズ", "ポップレンズ\n"+soft+"#PopLens",  soft+"#PopLens");
      addSubItem("softwareid", '<HR class="groove" width="100%">', "", "");
      addSubItem("softwareid", "QuickPass PRO", "QuickPass PRO\n"+home+"quickpasspro/",  home+"quickpasspro/");
      addSubItem("softwareid", '<HR class="groove" width="100%">', "", "");
      addSubItem("softwareid", "お役立ちソフト一覧", soft,  soft);

      addSubItem("playroomid", "日本語クロスワードパズル", "日本語クロスワードパズル\n"+play+"01.htm",  play+"01.htm");
      addSubItem("playroomid", "英語クロスワードパズル", "英語クロスワードパズル\n"+play+"02.htm",  play+"02.htm");
      addSubItem("playroomid", "数字記憶力テスト", "数字記憶力テスト\n"+play+"03.htm", play+"03.htm");
      addSubItem("playroomid", "３人の宣教師と３人の土人", "３人の宣教師と３人の土人\n"+play+"04.htm",  play+"04.htm");
      addSubItem("playroomid", "お宝探し", "お宝探し\n"+play+"05.htm",  play+"05.htm");
//      addSubItem("playroomid", "CRANKY!", "CRANKY!\n"+play+"06.htm",  "javascript:Cranky()");
//      addSubItem("playroomid", "カメを捕まえろ", "カメを捕まえろ\n"+play+"07.htm",  play+"07.htm");
      addSubItem("playroomid", "残り物には福がない？", "残り物には福がない？\n"+play+"08.htm",  play+"08.htm");
      addSubItem("playroomid", "神経衰弱", "神経衰弱\n"+play+"09.htm",  play+"09.htm");
      addSubItem("playroomid", "マンホールパラダイス", "マンホールパラダイス\n"+play+"10.htm",  play+"10.htm");
      addSubItem("playroomid", '<HR class="groove" width="100%">', "", "");
      addSubItem("playroomid", "その他のメニュー", play,  play);

      addSubItem("viewid", "インターネット", "インターネット\n"+view+"01.htm",  view+"01.htm");
      addSubItem("viewid", "チラシの寄せ集め？", "チラシの寄せ集め？\n"+view+"02.htm",  view+"02.htm");
      addSubItem("viewid", "パソコン", "パソコン\n"+view+"03.htm", view+"03.htm");
      addSubItem("viewid", "教　育", "教育\n"+view+"04.htm",  view+"04.htm");
      addSubItem("viewid", "科学と情報", "科学と情報\n"+view+"05.htm",  view+"05.htm");
      addSubItem("viewid", "哲　学", "哲学\n"+view+"06.htm",  view+"06.htm");
      addSubItem("viewid", "アダルトは悪か", "アダルトは悪か\n"+view+"07.htm",  view+"07.htm");
      addSubItem("viewid", "インタラクティブとは何か", "インタラクティブとは何か\n"+view+"08.htm",  view+"08.htm");
      addSubItem("viewid", "セキュリティのこと考えていますか", "セキュリティのこと考えていますか\n"+view+"11.htm",  view+"11.htm");
      addSubItem("viewid", "ホームページって何だ？", "ホームページって何だ？\n"+view+"12.htm", view+"12.htm");
      addSubItem("viewid", "コンピュータと人間", "コンピュータと人間\n"+view+"14.htm", view+"14.htm");
      addSubItem("viewid", "<HR class='groove' width='100%'>", "", "");
      addSubItem("viewid", "その他のメニュー", view,  view);

      addSubItem("bbsid", "ザ・掲示板", "ザ・掲示板\n"+bbs, bbs);

      addSubItem("linkid", "リンクについて", "梅ちゃん堂関連リンク\n"+link, link);
      addSubItem("linkid", "気ままなネットライフ", "気ままなネットライフ\n"+blog, blog);

      showMenu();
    }
  } else
  {
    source='<TABLE border=0 cellspacing=0 cellpadding=5 summary="QuickLink"><TR>';
    source+='<TD bgcolor="#ffffcc" nowrap><A href="'+home+'" target="_top" class="TOP" title="ホーム">ホーム</A></TD>';
    source+='<TD bgcolor="#dddddd" nowrap><A href="'+tips+'" target="_top" class="TOP" title="HTML Tips">HTML Tips</A></TD>';
    source+='<TD bgcolor="#ffcccc" nowrap><A href="'+js+'" target="_top" class="TOP" title="JavaScript 入門">JavaScript 入門</A></TD>';
    source+='<TD bgcolor="#ffccff" nowrap><A href="'+play+'" target="_top" class="TOP" title="頭の体操">頭の体操</A></TD>';
    source+='<TD bgcolor="#ffe4c4" nowrap><A href="'+soft+'" target="_top" class="TOP" title="お役立ちソフト">お役立ちソフト</A></TD>';
    source+='<TD bgcolor="#99ffff" nowrap><A href="'+view+'" target="_top" class="TOP" title="視角">視　角</A></TD>';
    source+='<TD bgcolor="#98fb98" nowrap><A href="'+bbs+'" target="_top" class="TOP" title="ザ・掲示板">掲示板！</A></TD>';
    source+='<TD bgcolor="#ccccff" nowrap><A href="'+link+'" target="_top" class="TOP" title="リンクについて">リンクについて</A></TD>';
    source+='</TR></TABLE>';
    document.write(source);
  }
}

window.onerror=new Function("return true")

rightX = 0;
function Menu()
{
  this.bgColor     = "#cccccc";
  this.addItem    = addItem;
  this.addSubItem = addSubItem;
  this.showMenu   = showMenu;
  this.mainPaneBorder = 0;
  this.subMenuPaneBorder = 0;
  this.subMenuPaneWidth = 150;

  lastMenu = null;
  rightY = 0;
  leftY = 0;
  leftX = 0;

  HTMLstr = "";
  HTMLstr += "<DIV id='MainTable'>\n";
  HTMLstr += "<TABLE cellspacing=0 cellpadding=5 border='"+this.mainPaneBorder+"'>\n";
  HTMLstr += "<TR>";
  HTMLstr += "<!-- UMECHANDO_MAIN_MENU -->\n";
  HTMLstr += "</TR>\n";
  HTMLstr += "</TABLE>\n";
  HTMLstr += "\n";
  HTMLstr += "<!-- UMECHANDO_SUB_MENU -->\n";
  HTMLstr += "\n";
  HTMLstr+= "</DIV>\n";
}

function addItem(idItem, text, hint, location, bgColor)
{
  var Lookup = "<!-- ITEM "+idItem+" -->";
  if (HTMLstr.indexOf(Lookup) != -1)
  {
    alert(idParent + " は既にあります。");
    return;
  }
  var MENUitem = "";
  MENUitem += "\n<!-- ITEM "+idItem+" -->\n";
  MENUitem += "<TD class='Bar' align='center' bgcolor='"+bgColor+"' nowrap>\n";
  MENUitem += "<DIV id='"+idItem+"''>\n";
  MENUitem += "<A class='TOP' ";
  //if (text == "ホーム") MENUitem += "target ='_top' ";
  MENUitem += "target ='_top' ";
  if (hint != null) MENUitem += "title='"+hint+"' ";
  if (location != null) MENUitem += "href='"+location+"' ";
  MENUitem += "onmouseover=\"displaySubMenu('"+idItem+"')\" ";
  MENUitem += ">"+text+"</A></DIV></TD>\n";
  MENUitem += "<!-- UMECHANDO_MAIN_MENU -->\n";
  HTMLstr = HTMLstr.replace("<!-- UMECHANDO_MAIN_MENU -->\n", MENUitem);
}

function shadow(menu)
{
  menu.style.backgroundColor = "#000080"
  menu.style.color = "#ffffff"
}

function hilite(menu)
{
  menu.style.backgroundColor = "#cccccc"
  menu.style.color = "#000000"
}

function setTarget(url)
{
  if (parent.frames.length == 0) self.location.href = url;
  else parent.location.href = url;
}

function addSubItem(idParent, text, hint, loc)
{
  var MENUitem = "";
  Lookup = "<!-- ITEM "+idParent+" -->";
  if (HTMLstr.indexOf(Lookup) == -1)
  {
    alert(idParent + " が見つかりません。");
    return;
  }
  Lookup = "<!-- UMECHANDO "+ idParent +" -->";
  if (HTMLstr.indexOf(Lookup) == -1)
  {
    MENUitem += "\n";
    MENUitem += "<DIV id='"+idParent+"submenu' style='position:absolute; visibility: hidden; width: "+this.subMenuPaneWidth+"; top: -300;border:outset thin;background:#cccccc'>\n";
    MENUitem += "<TABLE style='cursor:arrow;background:#cccccc' cellpadding=0 border='"+this.subMenuPaneBorder+"' bgcolor='#cccccc'><TR><TD nowrap>\n";
    MENUitem += "<!-- UMECHANDO "+ idParent +" -->\n";
    MENUitem += "</TD></TR></TABLE>\n";
    MENUitem += "</DIV>\n";
    MENUitem += "\n";

    MENUitem += "<!-- UMECHANDO_SUB_MENU -->\n";
    HTMLstr = HTMLstr.replace("<!-- UMECHANDO_SUB_MENU -->\n", MENUitem);
  }

  Lookup = "<!-- UMECHANDO "+ idParent +" -->\n";
  if (loc != "")
   //MENUitem = "<DIV style=';text-align:left;cursor:default;font-size:85%;padding-left:6pt;padding-right:6pt;padding-top:1pt;' onmouseover=shadow(this);status='"+loc+"' onmouseout=hilite(this);status='' title='"+hint+"' onClick=location.href='"+loc+"'>"+text+"</DIV>\n";
   MENUitem = "<DIV style=';text-align:left;cursor:default;font-size:85%;padding-left:6pt;padding-right:6pt;padding-top:1pt;' onmouseover=shadow(this);status='"+loc+"' onmouseout=hilite(this);status='' title='"+hint+"' onClick=setTarget('"+loc+"')>"+text+"</DIV>\n";
  else 
   MENUitem = "<DIV style='font-size:80%'>"+text+"</DIV>\n";


  MENUitem += Lookup;
  HTMLstr = HTMLstr.replace(Lookup, MENUitem);

}

function showMenu()
{
  document.writeln(HTMLstr);
}

function displaySubMenu(idMainMenu)
{
  var menu;
  var submenu;

  menu = eval(idMainMenu);
  submenu = eval(idMainMenu+"submenu.style");
  submenu.left = calculateSumOffset(menu, 'offsetLeft') - 3;
  submenu.visibility = fShow;
  if (lastMenu != null && lastMenu != submenu) hideAll();
  leftX  = document.all[idMainMenu+"submenu"].style.posLeft;
  rightX = leftX + document.all[idMainMenu+"submenu"].offsetWidth;
  leftY  = document.all[idMainMenu+"submenu"].style.posTop +
  document.all[idMainMenu+"submenu"].offsetHeight + 74;
  rightY = leftY;
  lastMenu = submenu;
  //document.all("ad").style.visibility = fHide;
}

function hideAll()
{
  if (lastMenu != null) {lastMenu.visibility = fHide;lastMenu.left = 0;}
}

function calculateSumOffset(idItem, offsetName)
{
  var totalOffset = 0;
  var item = eval('idItem');
  do
  {
    totalOffset += eval('item.'+offsetName);
    item = eval('item.offsetParent');
  } while (item != null);
  return totalOffset;
}

function updateIt(e)
{

  var x = window.event.clientX;
  var y = window.event.clientY;

  if (x > rightX || x < leftX) hideAll();
  else if (y > rightY || y < 0) hideAll();
}

with(document.body)
{
  onclick=hideAll;
  onscroll=hideAll;
  onmousemove=updateIt;
}




/* var rclickmsg ="いてて！"

var ie=!!document.all
var n4=!!document.layers
var gk=(navigator.userAgent.match(/Gecko/i)!=null)

function mousedown(e){
if(navigator.platform.indexOf("Mac")!=-1){
if((ie&&event.ctrlKey)||((n4||gk)&&e.modifiers==2)){
//alert(rclickmsg)
return false
}
}else{
if(ie){
e=event
if(e.button>=2){
if(event.type=="mouseup"){document.body.createTextRange().select()}
//alert(rclickmsg)
return false
}
}else{
if(n4||gk){
if(e.which==3){
//alert(rclickmsg)
return false
}
}
}
}
}

function keydown(){
if(ie){
if(event.keyCode==93){alert(rclickmsg)}
if(event.shiftKey&&event.keyCode==121){alert(rclickmsg)}
}
}

if(n4){
document.captureEvents(Event.MOUSEDOWN)
}
document.onkeydown=keydown
document.onmousedown=mousedown
document.onmouseup=mousedown */
