MJL.event.add(window, "load", function(event) {
    MJL.enable.rollover("roll", {disable : "unroll"});
    MJL.enable.heightEqualizer("equalize", {groupBy : 4});
    MJL.enable.heightEqualizer("box-menu", {groupBy : 2});
//    MJL.enable.window("popup", {
//        name:"pup-window",
//        width:770,
//        menubar:"no",
//        toolbar:"no",
//        location:"no",
//        status:"no"
//        });
    //
    // 画像とテキスト (based on jQuery)
    //
    // 画像とテキストの並列処理を行う関数を返す高階関数
    function getImgParallelStyler(side) {
        // side は既定値しか認めない
        if ("left" != side && "right" != side) {
            throw Error("invalid side type: '"+side+"'");
        }
        // 実行関数
        return function() {
            var obj = $(this);
            var imgBlock = $("div.image:first-child", obj);
            var imgWidth = $("p.image img", imgBlock).width(); // 画像幅
            imgBlock.css("width", imgWidth+"px"); // 画像幅を強制
            // 別カラムの margin を調整
            $("div.column", obj).css("margin-"+side,
                                     imgBlock[0].offsetWidth+"px");
        };
    }
    // 実行
    $(".image-parallel.image-L").each(getImgParallelStyler("left"));
    $(".image-parallel.image-R").each(getImgParallelStyler("right"));
}, false);



$(document).ready(function(){
  // TOPページのWhat's New最初のdtにクラス付与
  $('body.top div.box-new-02 dl dt:first-child').addClass('first-child');

  // 画像上の右クリック禁止(納品時にコメント削除する)
  $('img').bind("contextmenu",function(e){
    return false;
  });

  $('.popup').click(function()
  {
    window.open( this.href,"popup","scrollbars=1,resizable=1,height=700,Width=767" ).focus();
    return false;
  });
  $('.window_close').click(function()
  {
    if( !window.opener || window.opener.closed )
    {window.open( "/", "window_home", "toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1" );}
    window.close();
  });
  $('.window_focus').click(function()
  {
    if( !window.opener || window.opener.closed )
    {window.open( "/", "window_home", "toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1" );}
    window.blur();
  });
});


