function tabEvent(){
  $("#tabContainer").children("h3").click(function(){
    $("#tabContainer h3").attr("class","");
    $("#tabContainer dl").hide();
    $('dl.'+$(this).attr("id").split("_")[1]).show();
    $(this).attr("class","selected");
  });
};
function information(){
  $("dd.noscript").remove();
  var month={"Jan":"01","Feb":"02","Mar":"03","Apr":"04","May":"05","Jun":"06","Jul":"07","Aug":"08","Sep":"09","Oct":"10","Nov":"11","Dec":"12"};
  var category;
  var gametitle = location.href.split("/")[3];
  var datacount=0;
  $.ajax({
    url: '/'+gametitle+'/info/godius.xml',
    type: 'GET',
    dataType: 'xml',
    timeout: 1000,
    error: function(){
      console.log("xmlファイルの読み込みに失敗しました");
    },
    success: function(xml){
      $(xml).find("item").each(function(){
        var pubdate = $(this).children("pubDate").text().split(" ");
          pubdate = "["+pubdate[3]+"/"+month[pubdate[2]]+"/"+pubdate[1]+"]";
        var title = $(this).children("title").text();
        var link = $(this).children("link").text();
        var newflag = $(this).children("new").text();
        var list = "";
        var icon = "";
        category={0:"notice",1:"maintenance",2:"event"};
        (newflag==0)?(list="<dd></dd>",icon=""):list="<dd class='new'></dd>";
        $(list).html(pubdate + '<a href="' + link + '">' + title + '</a>' + icon).appendTo('dl.'+category[$(this).children("category").text()]);
      });
    }
  });
};
function accordionMenu(){
  $('#list1a').accordion({
    header: '.head',
    event: 'mouseover',
    active: '.selected',
    selectedClass: 'active'
  });
};

function jFlowInit(){
  $("#controller").jFlow({
      slides: "#charBox",
      width: "215px",
      height: "325px"
  });
};
function sitemapShow(){
  sitemapShow._flag = true;
  $('#sitemapLink a').click(function(){
    if(sitemapShow._flag){
    $("#siteMap").show();
    $.scrollTo( '#siteMap', 750);
    sitemapShow._flag = false;
   }else{
    $("#siteMap").slideUp('fast');
    sitemapShow._flag = true;
   }
  });
};


function gs24content(){
var gs = gs24content;
gs.tpl = ''; gs.tpl_gs24 = []; gs.tpl_vector = [];
gs._title = $("#menu_gs24_title");
gs._btn = $("#menu_gs24_btn");
gs._boxid = "gsAllContentMenu";
gs.pos = $("#menu_gs24_btn").offset();
gs._btn.flag = false;
$.getJSON('/js/gscontent.json',function(data){
  $("head").append('<link rel="stylesheet" type="text/css" href="'+data.css+'" />');
  $.each(data.item,function(i,item){
      gs["tpl_"+item.category].push('<li><a target="'+item.target+'" href="'+item.link+'"><img src="'+item.img+'" alt="'+item.title+'" /></a></li>');
  });
  //template html
  gs.tpl = '<div class="ipf" id="'+gs._boxid+'">\
              <div id="'+gs._boxid+'_dmy"></div>\
              <div id="'+gs._boxid+'_gs24">\
                <ul>'
                  +gs.tpl_gs24.join('')+
                '</ul>\
              </div>\
              <div id="'+gs._boxid+'_vector">\
                <ul>'
                  +gs.tpl_vector.join('')+
                '</ul>\
              </div>\
           </div>';
  $("#menu_gs24_title").append(gs.tpl);
  $("#"+gs._boxid).hide();
  //boxPosition
  $("#"+gs._boxid)
    .css({"left":gs.pos.left-8+'px'})
      .mouseover(function(){
        gs._btn.addClass("select");
        $(this).show();
        gs._btn.flag = true;
      })
      .mouseout(function(){
        gs._btn.removeClass("select");
        $(this).hide();
        gs._btn.flag = false;
      });
});
//Click Event
gs._btn.bind("click",function(e){
  e.preventDefault();
  if(gs._btn.flag == false){
    $("#"+gs._boxid).show();
    gs._btn.addClass("select");
    gs._btn.flag = true;
  }else{
    $("#"+gs._boxid).hide();
    gs._btn.removeClass("select");
    gs._btn.flag = false;
  }
}).bind("dblclick",function(e){
  e.preventDefault();
  window.open("http://gamespace24.net/");
});
};
