<!--
/*****************************************************************************/
/* ヘッダ挿入用Javascriptファイル                                            */
/*****************************************************************************/
/*===================*/
/* value definitions */
/*===================*/

MODE = "MELFANS";				//meinet1用

/*--------------------*/
/* global definitions */
/*--------------------*/

ENG = 0;
JPN = 1;

var GENURL = '';				//meinet1-URL
var MENURL = '';				//meinet2-URL

KISHU = new Array();
SUB_DIR_JPN = new Array();
SUB_DIR_NAME = new Array();

KISHU[ENG] = "melsoft";
KISHU[JPN] = "FA統合エンジニアリングソフトウェア MELSOFT";

/*==============*/
/* パンくずデータ */
/*==============*/

SUB_DIR_JPN[0] = "コンセプト";
SUB_DIR_NAME[0] = "concept";

SUB_DIR_JPN[1] = "ホットニュース";
SUB_DIR_NAME[1] = "hotnews";

SUB_DIR_JPN[2] = "ラインアップ";
SUB_DIR_NAME[2] = "lineup";

SUB_DIR_JPN[3] = "カタログ";
SUB_DIR_NAME[3] = "catalog";

SUB_DIR_JPN[4] = "新製品ニュース";
SUB_DIR_NAME[4] = "nproduct";

SUB_DIR_JPN[5] = "テクニカルニュース";
SUB_DIR_NAME[5] = "technews";

SUB_DIR_JPN[6] = "動作確認機種";
SUB_DIR_NAME[6] = "conform";

SUB_DIR_JPN[7] = "価格一覧";
SUB_DIR_NAME[7] = "price";

SUB_DIR_JPN[8] = "ライセンス";
SUB_DIR_NAME[8] = "license";

SUB_DIR_JPN[9] = "ソフトウェア登録";
SUB_DIR_NAME[9] = "registration";

SUB_DIR_JPN[10] = "ダウンロード";
SUB_DIR_NAME[10] = "download";

SUB_DIR_JPN[11] = "ダウンロード";
SUB_DIR_NAME[11] = "download2";

/*===============*/
/* function main */
/*===============*/

/* 機種内サブディレクトリ判定 */
var CURRENT_SUB_DIR="";				// 機種内サブディレクトリ
var DIR_COUNT = 0;

BUFFER = new Array();
BUFFER = location.href.split("/");
for(cnt=0;cnt<BUFFER.length;cnt++){
  if(BUFFER[cnt]==KISHU[ENG]){
    if ( BUFFER.length >= cnt+1) {
      CURRENT_SUB_DIR = BUFFER[cnt+1];		// 機種ディレクトリの次が機種内のサブディレクトリ
      DIR_COUNT = cnt+1;
    }
    if(CURRENT_SUB_DIR == null || CURRENT_SUB_DIR.indexOf(".") != -1){	// 拡張子を含む場合はディレクトリではないので
       CURRENT_SUB_DIR = 99;			// 機種内サブディレクトリは空に
    }
    break;
  }
}

/* 主処理 */
function topicpath(){
  var HEADER_BUF = "";
  HEADER_BUF += printThirdLine();
  return HEADER_BUF;
}

function topicpath2(){
  var HEADER_BUF = "";
  HEADER_BUF += printThirdLine2();
  return HEADER_BUF;
}

function printThirdLine(){
  var msg3;
  var subdir_cnt;

  var LINK_TOP = GENURL+"/melfansweb/index_j.htm";
  var LINK_SEIHIN_INDEX = GENURL+"/melfansweb/html/index.html";
  var LINK_SEIHIN_INFO= GENURL+"/melfansweb/html/info.html";
  var LINK_KISHU_TOP = GENURL+"/melfansweb/"+KISHU[ENG]+"/index.html";

  var A_LINK_STYLE = ' style = "text-decoration :underline;"';
  var A_LINK_TOP = ' target = "_top"';

  var DIR_CHK = 0;

  msg3 = '';
  msg3+='<table width="100%" border="0" cellspacing="0" cellpadding="0">';
  msg3+='<tr><td id="pankuzuline" style="display:none"><font style="color:black;font-size:12px">';

  msg3 += '　<a href = "' +LINK_TOP+ '" '+A_LINK_STYLE+A_LINK_TOP+'>TOP</a>　＞　<a href = "'+LINK_KISHU_TOP+'" '+A_LINK_STYLE+A_LINK_TOP+'>'+KISHU[JPN]+'</a>　';

  for(i=0;i<SUB_DIR_NAME.length;i++){
    if(CURRENT_SUB_DIR == SUB_DIR_NAME[i]){
      subdir_cnt = i;
      msg3+='＞　'+SUB_DIR_JPN[subdir_cnt];
      DIR_CHK = 1;
      break;
    }
  }
  if(DIR_CHK == 0){
    if(location.href.indexOf("g_manual")!=-1){
      msg3+='＞　マニュアル';
      DIR_CHK = 1;
    }
    if(location.href.indexOf("manualSearchServlet.do")!=-1){
      msg3+='＞　マニュアル';
      DIR_CHK = 1;
    }
    if(location.href.indexOf("qanda")!=-1){
      msg3+='＞　Q&A';
      DIR_CHK = 1;
    }
    
  }
  if(DIR_CHK==0){
    msg3 = '';
    msg3+='<table width="100%" border="0" cellspacing="0" cellpadding="0">';
    msg3+='<tr><td id="pankuzuline" style="display:none"><font style="color:black;font-size:12px">';
    msg3 += '　<a href = "' +LINK_TOP+ '" '+A_LINK_STYLE+A_LINK_TOP+'>TOP</a>　＞　'+KISHU[JPN];
  }

  msg3+='</font></td></tr>';
  msg3+='</table>'

  return msg3;

}

function printThirdLine2(){
  var msg3;
  var subdir_cnt;

  var LINK_TOP = GENURL+"/melfansweb/index_j.htm";
  var LINK_SEIHIN_INDEX = GENURL+"/melfansweb/html/index.html";
  var LINK_SEIHIN_INFO= GENURL+"/melfansweb/html/info.html";
  var LINK_KISHU_TOP = GENURL+"/melfansweb/"+KISHU[ENG]+"/index.html";
  var LINK_KISHU = GENURL+"/melfansweb/"+KISHU[ENG];

  var A_LINK_STYLE = ' style = "text-decoration :underline;"';
  var A_LINK_TOP = ' target = "_top"';

  msg3 = '';

  msg3 += '　<a href = "' +LINK_TOP+ '" '+A_LINK_STYLE+A_LINK_TOP+'>TOP</a>　＞　<a href = "'+LINK_KISHU_TOP+'" '+A_LINK_STYLE+A_LINK_TOP+'>'+KISHU[JPN]+'</a>　';

  for(i=0;i<SUB_DIR_NAME.length;i++){
    if(CURRENT_SUB_DIR == SUB_DIR_NAME[i]){
      subdir_cnt = i;
      msg3+='＞　'
      if (BUFFER.length > DIR_COUNT + 2 ) {
        msg3+= '<a href = "'+LINK_KISHU+'/'+CURRENT_SUB_DIR+'/index_j.htm" '+A_LINK_STYLE+A_LINK_TOP+'>'+SUB_DIR_JPN[subdir_cnt]+'</a>';
      } else {
        msg3+=SUB_DIR_JPN[subdir_cnt];
      }
      break;
    }
  }

  return msg3;

}

