//==========================================================
//カテゴリー
dir_nm = new Array("jidou","ippan","zasshi","info","shoten");

//カテゴリーごとのバナー設定
var banner_visible = new Object();
banner_visible['zasshi']  = "1";
banner_visible['ippan']   = "1";
banner_visible['jidou']   = "1";
banner_visible['shoten']  = "1";
banner_visible['company'] = "1";
banner_visible['shop']    = "1";
banner_visible['default'] = "1";

path    = location.pathname;
str     = path.split("/");
//set
cate_nm = str[1];

//------------------------------------------------------------------
//init JSON
if(typeof(newissue)         == 'undefined') newissue = {};
if(typeof(book_pickup)      == 'undefined') book_pickup = {};
if(typeof(jidou_newissue)   == 'undefined') jidou_newissue = {};
if(typeof(jidou_bestseller) == 'undefined') jidou_bestseller = {};
if(typeof(ippan_newissue)   == 'undefined') ippan_newissue = {};
if(typeof(ippan_bestseller) == 'undefined') ippan_bestseller = {};

//------------------------------------------------------------------
function refresh_header() {
  for (i = 0; i < 6; i++) {
		if( cate_nm == dir_nm[i]){
      var temp = Elms("global_menu").innerHTML;
      temp = temp.replace(cate_nm+"TabOff", cate_nm+"TabOn");
      temp = temp.replace("global_menu_hr", "global_menu_hr_"+cate_nm);
      Elms("global_menu").innerHTML = temp;
      Elms("global_menu_hr").innerHTML += "<div class=\"hr_"+cate_nm+"\"></div>";
			break;
		}
	}

  if(cate_nm == "zukkoke-taishou" || cate_nm == "bunbun-taishou"){
    var temp = Elms("global_menu").innerHTML;
    temp = temp.replace("taishouTabOff", "taishouTabOn");
    Elms("global_menu").innerHTML = temp;
    if ( Elms("global_menu_hr")  != null){ 
      Elms("global_menu_hr").innerHTML += "<div class=\"hr_taishou\"></div>";
    }
  }
}

//------------------------------------------------------------------
function refresh_footer() {
  if(cate_nm){
    if(banner_visible[cate_nm]){
      cate_nm = "bnr_set_"+cate_nm;
    }else{
      cate_nm = "bnr_set_default";
    }
  }else{
    cate_nm = "bnr_set_default";
  }
  Elms(cate_nm).style.position = 'static';
  Elms(cate_nm).style.top  = 0;
  Elms(cate_nm).style.left = 0;
}
//------------------------------------------------------------------
// HTTP通信用、共通関数
function Elms(tagId){
  return document.getElementById(tagId);
}

//------------------------------------------------------------------
// guide pop
function guide(page){
  OpenWin = this.open(page, "guide", "toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=yes,status=no,width=730,height=500");
}