/* ボタンの表示 */
/* リクエスト取得 */

var RequestString = new Array;
if (location.search.length > 1) {
  var m_Array = location.search.substr(1).split("&"); 
  for (idx in m_Array) {
    RequestString.push(m_Array[idx].split("="));
 }
}

/* アンカーname取得 */
var JumpString = "Top";
if (location.search.length > 1) {
   if (RequestString[0][0] == 'JumpStr') {
       JumpString = RequestString[0][1];
   }
}

/* キー発行 */
var Today = new Date();
var KeyDate = Today.getYear() + "_" + (Today.getMonth() + 1) + "_" + Today.getDate();

if (location.search.length < 1) {     /* ポータルサイトの検索から開かれた場合 */
    document.write("<DIV align='right'>");
    document.write("<input type='button' value='　戻　る　' onclick=location.href='index.html'>");
    document.write("</DIV>");
} else {
  if ((RequestString[idx][0] == 'OpenMode') && (RequestString[idx][1] == KeyDate)) {     /* 正常な開かれ方の場合 */
    document.write("<DIV align='right'>");
    document.write("<input type='button' value='　閉じる　' onclick='window.close()'>");
    document.write("</DIV>");
  } else {     /* 「お気に入り」など過去に保存されたページから開かれた場合 */
    document.write("<DIV align='right'>");
    document.write("<input type='button' value='　戻　る　' onclick=location.href='index.html'>");
    document.write("</DIV>");
  }
}
location.hash=JumpString;

