MJL.event.add(window, "load", function(event) {
    MJL.enable.styleSwitcher("nav-styleswitcher");
    MJL.enable.flash("flash");
    MJL.enable.heightEqualizer("column-col2", {groupBy : 2});
    MJL.enable.heightEqualizer("image-col2", {groupBy : 2});
    MJL.enable.heightEqualizer("column-col2", {
        groupBy : 2,
        collect : function(parent) {
            return MJL.getElementsByClassName(parent, "box-relation-02");
        }
    });
    MJL.enable.heightEqualizer("column-col3", {groupBy : 3});
    MJL.enable.heightEqualizer("column-col4", {groupBy : 4});
    MJL.enable.heightEqualizer("box-about", {
        groupBy : 2,
        collect : function(parent) {
            return MJL.getElementsByClassName(parent, "segment");
        }
    });
    MJL.enable.heightEqualizer("lyt-index-01", {groupBy : 2});
    MJL.enable.heightEqualizer("lyt-index-02", {groupBy : 3});
    MJL.enable.tab("tabs");
    MJL.enable.rollover("roll", {disable : "unroll"});
    MJL.enable.rollover("roll-active", { active : "active" });

}, false);


// MJL と無関係なコードはこの先に記述

/* Add print function */
function PrintPage(){
    if(window.print){
        window.print();
    }
}


/* Plugins */

// setLinkIndication
(function($){var name_space="setLinkIndication";$.fn[name_space]=function(options){var elements=$(this);var settings=$.extend({window_icon:false,popup_icon:false,pdf_icon:false,xls_icon:false,dl_icon:false,mail_icon:false},options);function add(){return function(){var $this=$(this);var img=new Image();$(img).attr("alt","").addClass("icon-link");if(settings.window_icon){img.setAttribute("src",settings.window_icon);img.setAttribute("alt","別ウィンドウでリンクを開きます。");$this.not("[href$=pdf]").not("[href$=EXE]").not("[href$=exe]").not("[href$=lzh]").not("[href$=zip]").not("[href$=xls]").not("[href$=xlsx]").append(img)}if(settings.popup_icon){img.setAttribute("src",settings.popup_icon);img.setAttribute("alt","ポップアップでリンクを開きます。");$this.not("[href$=pdf]").not("[href$=xls]").not("[href$=zip]").append(img)}if(settings.pdf_icon){img.setAttribute("src",settings.pdf_icon);img.setAttribute("alt","PDF");$this.append(img);$this.click(function(){window.open(this.href,"_blank");return false})}if(settings.xls_icon){img.setAttribute("src",settings.xls_icon);img.setAttribute("alt","XLS");$this.append(img)}if(settings.dl_icon){img.setAttribute("src",settings.dl_icon);img.setAttribute("alt","ダウンロード");$this.append(img)}if(settings.mail_icon){img.setAttribute("src",settings.mail_icon);img.setAttribute("alt","メーラーを立ち上げます。");$this.append(img)}}}elements.each(add());return this}})(jQuery);


// setFileSize
(function(B){var A="setFileSize";B.fn[A]=function(){var E=B(this);function D(F,H,G){var I=false;I=window.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest();I.open(H,F,G);I.send(null);return I}function C(){return function(){var I=B(this);var G=this.href+"?nocash="+Math.floor(Math.random()*10000);var F=D(G,"HEAD",true);F.onreadystatechange=function(){if(F.readyState==4&&F.status==200){var J=F.getResponseHeader("Content-Length");var K=F.getResponseHeader("Content-Type");J=parseInt(J,10);var M=[[1024*1024*1024,"GB"],[1024*1024,"MB"],[1024,"KB"],[1,"bytes"]];for(var N=0;N<M.length;N++){var L=M[N][0];var O=M[N][1];if(J>=L){J=J/L;J=Math.ceil(J*10)/10;break}}K=K.split("/")[1].toUpperCase();return H(K,J,O)}};function H(K,J,L){if(I.next("img").length==0){I.after(" （"+J+L+"）")}else{(I.next("img").attr("src").match(/pdf/))?I.next().after(" （"+J+L+"）"):I.after(" （"+J+L+"）")}}}}E.each(C());return this}})(jQuery);


/**
 * jQuery setToggleMenu plugin
 * 開閉可能なメニューを設定する
 * 
 * Attributes:
 * -@options: オプションのハッシュ
 *  -setter: 処理を仕掛ける要素。対象要素のclass名を指定
 *  -target: 表示／非表示にする要素。対象要素のclass名を指定
 *  -speed: 要素を見せるときのスピードミリセカンドで、デフォルトは0(アニメーションなし)
 * 
 */
(function(b){var a="setToggleMenu";b.fn[a]=function(d){var f=b(this);var e=b.extend({setter:false,target:false,speed:false},d);function c(){return function(h){var l=b("."+e.setter,this),k=b("."+e.target,this),j=e.speed,g=b("img",l);if(!l.attr("class").match("open")){k.hide()}else{if(g.length>0){g.attr("src",g.attr("src").replace("_o.","_a."))}l.removeClass("active")}l.css("cursor","pointer");l.wrapInner('<a href="#"></a>');l.toggle(function(){if(g.length>0){g.attr("src",g.attr("src").replace("_o.","_a."))}l.addClass("active");k.slideDown(j)},function(){if(g.length>0){g.attr("src",g.attr("src").replace("_a.","_o."))}k.slideUp(j);l.removeClass("active")})}}f.each(c());return this}})(jQuery);


/***
 *
 * $.set_links
 *
 * Demo:
 * <ul>
 * <li><a href="http://www.mitsue.co.jp" rel="popup">popup1</a></li>
 * <li><a href="http://www.yahoo.com" rel="popup">popup2</a></li>
 * <li><a href="http://www.google.com" rel="popup">popup3</a></li>
 * <li><a href="http://www.yahoo.com" rel="popup">external link</a></li>
 * <li><a href="http://www.yahuu.com" class="yahuulink" rel="popup">popup by class</a></li>
 * <li><a href="http://www.yahuu.com" class="yahuulink" rel="popup">popup by class</a></li>
 * </ul>
 *
 * Presentation:
 * ポップアップリンクと「_blank」リンクを設定を設定する。
 * 「rel="popup"」になってるリンクはポップアップで開き、「rel="external"」のリンクを _blank と同じように開きます。
 * 設定はpopupのURLかaタグのクラスネームで設定できます。クラスネームの場合は「.クラスネーム」で設定になります。
 *
 *
 * Use:
 * set_links( @options )
 *
 * Attributes:
 * settings: 設定のハッシュ、{ "popupURL|.className": { 設定 }, "openerURL>>popupURL": { 設定 } }
 * 設定は { width:800, height: 600, toolbar: "yes", scrollbars: "yes" } のように設定できます。
 *
 * Examples:
 * :$.set_links({ "google.com": { width:800, height: 600, toolbar: "yes", scrollbars: "yes" } });
 * =rel=popup と href="google.com" を含むリンクをポップアップで開きます、幅は 800px、縦は 600px、ツールバーとスクロールバーつき。
 * =rel=external のリンクを _blank で開きます。
 *
 ***/
(function(a){a.set_links=function(b){a("a[rel=popup],a[rel=external],area[rel=popup],area[rel=external]").click(function(){if(this.rel=="external"){window.open(this.href,"_blank");return false}var j="";var d=0;var c="";for(i in b){if(i.match(">>")){data=i.split(">>");if(String(window.location).match(data[0])&&this.href.match(data[1])){c=i;break}}if(i.match(/^\.(.*)/)){var e=new RegExp("\\b"+RegExp.$1+"\\b");if(this.className.match(e)){for(param in b[i]){if(param=="name"){continue}j+=param+"="+b[i][param]+","}if(this.href.match(/width=(\d+).*height=(\d+)/)){var f=RegExp.$1;var h=RegExp.$2;if(j.match("width")&&j.match("height")){j=j.replace(/width=\d+/,"width="+f);j=j.replace(/height=\d+/,"height="+h)}else{j+="width="+f+",height="+h}}var g=b[i]["name"]?b[i]["name"]:"popup";window.open(this.href,g,j.split(/,$/)[0]).focus();this.blur();return false}}else{if(this.href.match(i)&&i.length>d){c=i;d=i.length}}}for(param in b[c]){if(param=="name"){continue}j+=param+"="+b[c][param]+","}var g=b[c]["name"]?b[c]["name"]:"popup";window.open(this.href,g,j.split(/,$/)[0]).focus();this.blur();return false});return this}})(jQuery);



var fsSelector = "[href$=\"jpg\"], [href$=\"pdf\"], [href$=\"zip\"], [href$=\"EXE\"], [href$=\"exe\"], [href$=\"DXF\"], [href$=\"dxf\"], [href$=\"LZH\"], [href$=\"lzh\"], [href$=\"xls\"], [href$=\"xlsx\"]";


$(function(){

	//現在地表示-グローバルナビ
	function currentNav(){
		var $base = $("#nav-global-2");
		if($base.length==0) return false;
		var $gNav = $("li",$base);
		var $gNavLength = $gNav.length;
		var $currentGNav;
		var $thisUrl = document.URL.replace(/https?:\/\/.*?\//, "/");
		var $category1 = /^\/products/;
		var $category2 = /^\/development/;
		var $category3 = /^\/company/;
		var $category4 = /^\/ir/;
		var $category5 = /^\/csr/;
		var $category6 = /^\/recruit/;
		var $category7 = /^\/news/;

		if($category1.test($thisUrl)) {
			$currentGNav = "products";
		}
		else if($category2.test($thisUrl)) {
			$currentGNav = "development";
		}
		else if($category3.test($thisUrl)) {
			$currentGNav = "company";
		}
		else if($category4.test($thisUrl)) {
			$currentGNav = "ir";
		}
		else if($category5.test($thisUrl)) {
			$currentGNav = "csr";
		}
		else if($category6.test($thisUrl)) {
			$currentGNav = "recruit";
		}
		else if($category7.test($thisUrl)) {
			$currentGNav = "news";
		}
		else {
			return false;
		}
		
		$gNav.each(function(i){
			if($(this).attr("class").indexOf($currentGNav) != -1) {
				$("a",this).addClass("active");
			}
		})
	}
	currentNav();

	//現在地表示-ローカルナビ
	function currentLocalNav(){
		var $base = $("#nav-local");
		$($base).addClass("close");
		$("ul", $base).addClass("close");
		if($base.length == 0) return false;
		
		var lNav = new Array();
		var level = 0;
		var child = false;
		
		function setlNavArray(lv){
			if(lv == 0){
				lNav[lv] = $("> li", $base);
				if($("li", lNav[lv]).length > 0){
					child = true;
					level += 1;
				}
				if(child == true){return arguments.callee(level);}
			}
			else{
				lNav[lv] =  new Array();
				child = false;
				for(var i=0; i<lNav[lv-1].length; i++){
					lNav[lv][i] = $("> ul > li", lNav[lv-1][i]);
					
					if(child == false && $("li", lNav[lv][i]).length > 0){
						child = true;
						level += 1;
					}
				}
				if(child == true){return arguments.callee(level);}
			}
		return false;
		}
		setlNavArray(level);
		
		var thisUrlq = document.URL.replace(/https?:\/\/.*?\//, "/").replace(/index.[^\/#]+/, "") + "(index.[^\/#]+)?$";
		var current = false;
		var count = 0;
		
		function setActiveNav(){
			for(i=level; i>=0; i--){
				for(j=0; j<lNav[i].length; j++){
					$(lNav[i][j]).each(function(n){
						var a = $(this).children("a");
						if(a.length == 0){return true;}
						
						if($(a).attr("href").match(thisUrlq)){
							$(a).addClass("active");
							current = true;
							
							if(i==0){
								$("> ul", lNav[i][j]).removeClass("close");
							}
							else{
								$(this).parents("ul").removeClass("close");
								$(this).children("ul").removeClass("close");
								//$("> ul", lNav[i][j]).removeClass("close");
							}
						return false;
						}
					})
				}
			}
			count++
			
			if(current == false && count < 5){
				if(!thisUrlq.match(/\/\(/)){
					thisUrlq = thisUrlq.replace(/\/[^\/]*\/[^\/]*?$/, "/") + "(index.[^\/#]+)?$";
				}
				else{
					thisUrlq = thisUrlq.replace(/\/[^\/]*\/[^\/]*\/[^\/]*?$/, "/") + "(index.[^\/#]+)?$";
				}
				if(thisUrlq == "/(index.[^/#]+)?$"){return false;}
				return arguments.callee();
			}
			return false;
		}
		setActiveNav();
	}
	currentLocalNav();
	$("#nav-local").removeClass("close");


	//Plugins
    $("a:not([href^=\"http\"])").filter(fsSelector).setFileSize();
    $('#str-contents a[target$="blank"]').not(':has(img)').setLinkIndication({ window_icon: "/shared/images/common/icon_blank.png" });
    $('#str-contents a[href$="pdf"]').not(':has(img)').setLinkIndication({ pdf_icon: "/shared/images/common/icon_pdf.png" });
    $('#str-contents a[href$="zip"]').not(':has(img)').setLinkIndication({ dl_icon: "/shared/images/common/icon_dl.png" });
    $('#str-contents a[href$="exe"]').not(':has(img)').setLinkIndication({ dl_icon: "/shared/images/common/icon_dl.png" });
    $('#str-contents a[href$="EXE"]').not(':has(img)').setLinkIndication({ dl_icon: "/shared/images/common/icon_dl.png" });
    $('#str-contents a[href$="xls"]').not(':has(img)').setLinkIndication({ xls_icon: "/shared/images/common/icon_xls.png" });
    $('#str-contents a[href$="xlsx"]').not(':has(img)').setLinkIndication({ xls_icon: "/shared/images/common/icon_xls.png" });
    $('.item').setToggleMenu({ setter:'setter', target:'target', speed:0 });
    $.set_links({ ".poplink" : { width:800, height:800, scrollbars: "yes" } });
});

if (location.hash.length > 0 && $.browser.mozilla)
{
  (function()
  {
    var sizeCount = -1;
    var sizeLoaded = 0;
    
    $(document.body).ready(function()
    {
      sizeCount = $("a:not([href^=\"http\"])").filter(fsSelector).length;
      
      if (sizeCount > 0)
      {
        document.documentElement.scrollTop = 0;
        document.documentElement.addEventListener("DOMNodeInserted", function(event)
        {
          if (event.target.nodeType == Node.TEXT_NODE && /^\s*（[\w.]+）\s*$/.test(event.target.data))
              ++sizeLoaded;
          
          if (sizeLoaded == sizeCount)
          {
            event.currentTarget.removeEventListener(
              event.type, arguments.callee, event.bubbles);
            
            location.hash = location.hash;
          }
        }, false);
      }
    });
  })();
}

/**
 * @param {Object} obj 
 */
function LightBox(obj)
{
  var ownerDocument = (obj.ownerDocument || window.document);
  var self = this;
  
  /**
   * @type number
   */
  this.overlayAlpha = 0.6;
  
  /**
   * @type Document
   * @private
   */
  this.ownerDocument = ownerDocument;
  
  /**
   * @type WindowProxy
   * @private
   */
  this.targetWindow = ownerDocument.defaultView || ownerDocument.parentWindow;
  
  /**
   * @type Object
   * @private
   */
  this.content = null;
  
  /**
   * @type Element
   * @private
   */
  this.contentFrameWrapper = ownerDocument.createElement("LIGHTBOX_CONTENT_WRAPPER");
  
  /**
   * @type HTMLIFrameElement
   * @private
   */
  this.contentFrame = this.contentFrameWrapper.appendChild(
    ownerDocument.createElement("IFRAME"));
  
  /**
   * @type Element
   * @private
   */
  this.overlay = ownerDocument.createElement("LIGHTBOX_OVERLAY");
  
  /**
   * @type jQuery
   * @private
   */
  this.$contentFrameWrapper = $(this.contentFrameWrapper);
  
  /**
   * @type jQuery
   * @private
   */
  this.$contentFrame = $(this.contentFrame);
  
  /**
   * @type jQuery
   * @private
   */
  this.$overlay = $(this.overlay);
  
  /**
   * @param {Event} event 
   * @private
   */
  this.window_resize = function(event)
  {
    /** @type LightBox */
    var self = event.data;
    
    if (self.contentFrameWrapper.parentNode == null)
      return;
    
    var $vp = $(self.targetWindow);
    
    self.$contentFrameWrapper.css(
    {
      top : ($vp.height() - self.contentFrameWrapper.offsetHeight) / 2 + $vp.scrollTop() + "px",
      left : ($vp.width() - self.contentFrameWrapper.offsetWidth) / 2 + $vp.scrollLeft() + "px"
    });
    
    self.$overlay.css(
    {
      top : 0,
      left : 0,
      width : self.ownerDocument.documentElement.scrollWidth,
      height : self.ownerDocument.documentElement.scrollHeight
    });
    
    if (self.contentFrameWrapper.offsetTop + self.contentFrameWrapper.offsetHeight
      > self.contentFrameWrapper.ownerDocument.body.offsetHeight)
        self.$contentFrameWrapper.css(
          "top", self.contentFrameWrapper.ownerDocument.body.offsetHeight
            - self.contentFrameWrapper.offsetHeight);
    
    if (self.contentFrameWrapper.offsetLeft + self.contentFrameWrapper.offsetWidth
      > self.contentFrameWrapper.ownerDocument.body.offsetWidth)
        self.$contentFrameWrapper.css(
          "left", self.contentFrameWrapper.ownerDocument.body.offsetWidth
            - self.contentFrameWrapper.offsetWidth);
  };
  
  // Construction
  
  switch (obj.nodeType)
  {
    case 1:
    case 3:
    case 11:
      self.content = obj;
      self.contentFrame.src = "javascript:0";
      break;
      
    default:
      if (typeof obj == "string" || obj instanceof String)
        self.contentFrame.src = obj.toString();
      
      else
        throw new Error(
          "LightBox couldn't display node-objectj that has typed as " + obj.nodeType);
      
      break;
  }
  
  self.$overlay.bind(
    "click", self, self.constructor.closer_click);
  
  self.$overlay.css(
  {
    display : "block",
    position : "absolute",
    top : 0,
    bottom : 0,
    left : 0,
    right : 0,
    width : "auto",
    height : "auto",
    zIndex : self.constructor.OVERLAY_ZINDEX,
    background : "black",
    visibility : "hidden",
    opacity : 0,
    cursor : "pointer"
  });
  
  self.contentFrame.frameBorder = 0;
  self.contentFrame.hspace = 0;
  self.contentFrame.vspace = 0;
  self.contentFrame.allowTransparency = true;
  
  self.$contentFrame.bind(
    "load", self, self.constructor.contentFrame_load);
  
  self.$contentFrame.css(
  {
    display : "block",
    position : "static",
    margin : "0",
    padding : "0",
    border : "none",
    boxSizing : "border-box",
    visibility : "visible"
  });
  
  self.$contentFrameWrapper.css(
  {
    display : "block",
    position : "absolute",
    top : 0,
    left : 0,
    width : "auto",
    height : "auto",
    zIndex : self.constructor.CONTENT_ZINDEX,
    opacity : 0
  });
}

/**
 * 
 */
LightBox.prototype.show = function()
{
  var self = this;
  
  self.bindEvent(self.constructor.EVENT_SHOWN, function(event)
  {
    self.$overlay
      .stop()
      .clearQueue("fx")
      .css("visibility", "visible")
      .animate({ opacity : self.overlayAlpha });
    
    self.$contentFrameWrapper
      .stop()
      .clearQueue("fx")
      .animate({ opacity : 1 });
    
    self.unbindEvent(event.type, arguments.callee);
  });
  
  self.contentFrame.ownerDocument.body.appendChild(self.overlay);
  self.contentFrame.ownerDocument.body.appendChild(self.contentFrameWrapper);
};

/**
 * 
 */
LightBox.prototype.hide = function()
{
  var self = this;
  
  /** @inner */
  function complete()
  {
    this.parentNode.removeChild(this);
  }
  
  /** @inner */
  function finish()
  {
    var $vp = $(self.targetWindow);
    
    complete.call(this);
    $vp.unbind("resize", self.window_resize);
    $vp.unbind("scroll", self.window_resize);
    $(self).trigger(self.constructor.EVENT_HIDDEN);
    self.$overlay.css("visibility", "hidden");
  }
  
  this.$overlay
    .stop()
    .clearQueue("fx")
    .animate({ opacity : 0 }, { complete : complete });
  
  this.$contentFrameWrapper
    .stop()
    .clearQueue("fx")
    .animate({ opacity : 0 }, { complete : finish });
};

/**
 * @param {string} type 
 * @param {Function} listener 
 * @returns {Function} 
 */
LightBox.prototype.bindEvent = function(type, listener)
{
  $(this).bind(type, listener);
  return listener;
};

/**
 * @param {string} type 
 * @param {Function} listener 
 */
LightBox.prototype.unbindEvent = function(type, listener)
{
  $(this).unbind(type, listener);
};

/**
 * @param {Event} event 
 * @private
 */
LightBox.contentFrame_load = function(event)
{
  /** @type LightBox */
  var self = event.data,
      iframeDocument = self.contentFrame.contentWindow.document,
      readies = [],
      $vp = $(self.targetWindow),
      $iframeHead = $("head", iframeDocument),
      $iframeBody = $("body", iframeDocument);
  
  function makeAbsUri(uri)
  {
    /*@cc_on uri = uri.replace(/^about:(?:\w+\b)?/, ""); @*/
    
    if (/^\w+:\/\//.test(uri))
      return uri;
    else
    {
      var u = (self.contentFrame.ownerDocument.parentWindow
           || self.contentFrame.ownerDocument.defaultView).location;
      
      return u.protocol + "//" + u.host
        + (/^\//.test(uri) ? uri : u.pathname.replace(/\/[^\/]*$/, "")
        + "/" + uri);
    }
  }
  
  /**
   * @param {Node} node 
   * @param {Document} ownerDocument 
   * @returns {Node} 
   * @inner
   */
  function importNode(node, ownerDocument)
  {
    if (ownerDocument.implementation.hasFeature("Core", "2.0"))
    {
      return ownerDocument.importNode(node, false);
    }
    else
    {
      var i, name, value;
      
      var newNode =
        (node.nodeType == 1) ?
          ownerDocument.createElement(node.nodeName) :
        (node.nodeType == 3) ?
          ownerDocument.createTextNode(node.nodeValue) :
        (node.nodeType == 4) ?
          ownerDocument.createCDATASection(node.nodeValue) :
        (node.nodeType == 7) ?
          ownerDocument.createProcessingInstruction(node.target, node.data) :
        (node.nodeType == 8) ?
          ownerDocument.createComment(node.nodeValue) :
        (node.nodeType == 11) ?
          ownerDocument.createDocumentFragment() :
        null;
      
      if (newNode != null && newNode.nodeType == 1)
      {
        for (i = 0; i < node.attributes.length; i++)
        {
          if (node.attributes[i].specified)
          {
            name = node.attributes[i].name.toLowerCase();
            value = node.attributes[i].value;
            
            switch (name)
            {
              case "src":
              case "href":
                value = makeAbsUri(value);
                break;
              default:
                break;
            }
            
            newNode.setAttribute(name, value);
            
            if (name == "class")
              newNode.setAttribute(name.replace(/^class$/i, "className"), value);
          }
        }
      }
      return newNode;
    }
  }
  
  if (self.content != null
    && self.content != undefined
    && /^(?:1|3|11)$/.test(self.content.nodeType))
  {
    while (0 < iframeDocument.body.childNodes.length)
      iframeDocument.body.removeChild(iframeDocument.body.firstChild);
    
    (function(node, parentNode)
    {
      var imported, t, i;
      
      switch (node.nodeName)
      {
        case "STYLE":   case "SCRIPT": case "BASE":
        case "COMMAND": case "LINK":   case "META":
          imported = importNode(node, iframeDocument);
          
          if (node.nodeName == "SCRIPT")
          {
            if (node.parentNode.nodeName == "HEAD")
              parentNode.appendChild(imported);
          }
          else
            parentNode.appendChild(imported);
          
          if (imported.readyState != undefined)
            readies.push(imported);
          
          else if (node.nodeName == "LINK" && String(imported.rel).toLowerCase() == "stylesheet")
            readies.push(imported);
          
          parentNode = imported;
          
          break;
          
        case "TITLE":
          for (iframeDocument.title = "", i = 0; i < node.childNodes.length; i++)
            if (node.childNodes[i].nodeType == 3)
              iframeDocument.title += node.childNodes[i].nodeValue;
          break;
        
        default:
          if (parentNode !== $iframeHead[0])
            parentNode.appendChild(importNode(node, iframeDocument));
      }
      
      for (i = 0; i < node.childNodes.length; i++)
        arguments.callee(node.childNodes.item(i), parentNode);
      
    })(self.content, $iframeHead[0]);
    
    (function(node, parentNode)
    {
      var nextParent = parentNode, imported, t, i;
      
      switch (node.nodeName)
      {
        case "BASE":     case "COMMAND": case "LINK":
        case "META":     case "STYLE":   case "TITLE":
        case "FRAMESET": case "FRAME":   case "NOFRAMES":
          break;
        
        default:
          t = (node.nodeName == "BODY")
            ? $iframeBody[0]
            : (node.nodeName == "HEAD")
            ? $iframeHead[0]
            : (node.nodeName == "HTML")
            ? iframeDocument.documentElement
            : null;
          
          if (t != null)
          {
            for (i = 0; i < node.attributes.length; i++)
              if (node.attributes[i].specified)
              {
                t.setAttribute(node.attributes[i].name, node.attributes[i].value);
                
              if (node.attributes[i].name.toLowerCase() == "class")
                t.setAttribute(
                  node.attributes[i].name.replace(/^class$/i, "className"),
                  node.attributes[i].value);
              }
          }
          
          if (node.nodeType != 11 && t == null)
          {
            imported = importNode(node, iframeDocument);
            
            if (node.nodeName == "SCRIPT")
            {
              if (node.parentNode.nodeName == "HEAD")
                $iframeHead.append(imported);
              else
                parentNode.appendChild(imported);
            }
            else
              parentNode.appendChild(imported);
            
            if (node.childNodes.length > 0)
              nextParent = imported;
            
            if (node.nodeName == "IMG")
            {
              readies.push(imported);
            }
          }
          
          for (i = 0; i < node.childNodes.length; i++)
            arguments.callee(node.childNodes.item(i), nextParent);
          
          break;
      }
    })(self.content, $iframeBody[0]);
    
  } // END if (self.content != null)
  
  (function()
  {
    if (readies.length > 0)
    {
      for (var i = 0; i < readies.length; i++)
      {
        switch (readies[i].nodeName)
        {
          case "IMG":
            if (readies[i].complete)
              readies.splice(i, 1);
            break;
          
          default:
            if (readies[i].readyState != undefined)
            {
              if (readies[i].readyState == "complete")
                readies.splice(i, 1);
            }
            else if (readies[i].nodeName == "LINK")
            {
              try
              {
                for (var j = 0; j < readies[i].ownerDocument.styleSheets.length; j++)
                {
                  if (readies[i] === readies[i].ownerDocument.styleSheets[j].ownerNode)
                  {
                    ("number" == typeof readies[i].ownerDocument.styleSheets[j].cssRules.length);
                    readies.splice(i, 1);
                    break;
                  }
                }
              }
              catch (e) { continue; }
            }
            break;
        }
      }
      
      self.contentFrame.contentWindow.setTimeout(arguments.callee, 0);
      return;
    }
    
    var vpw = self.ownerDocument.body.scrollWidth;
    var all = $(iframeDocument.body).find("*").get();
    
    self.$contentFrame.css(
    {
      width  : vpw,
      height : "auto"
    });
    
    self.$contentFrame.width(
      Math.max.apply(null, $.map(all, function(item)
      {
        return (vpw < item.offsetWidth) ? item.offsetWidth
          : (item.ownerDocument.body.clientWidth > item.offsetWidth)
          ? item.offsetWidth : 0;
        
      })) || iframeDocument.body.offsetWidth
    );
    
    self.$contentFrame.height(
      Math.max.apply(null, $.map(all, function(item)
      {
        var ret = item.offsetTop + item.offsetHeight;
        
        for (var p = item.offsetParent;
                 p != null && p.nodeType == 1;
                 ret += p.offsetTop,
                 p = p.offsetParent);
        
        return ret;
        
      })) || iframeDocument.body.offsetHeight
    );
    
    while (iframeDocument.body.offsetWidth < self.contentFrame.offsetWidth)
      self.$contentFrame.height(self.contentFrame.offsetHeight + 1);
    
    $vp.bind("resize", self, self.window_resize);
    $vp.bind("scroll", self, self.window_resize);
    
    $("a", iframeDocument.body).each(function()
    {
      var t = this.attributes.getNamedItem("target");
      if (t == null || false == t.specified)
        this.target = "_parent";
    });
    
    self.window_resize.call(self, { data : self });
    
    $(self).trigger(self.constructor.EVENT_SHOWN);
    
  })();
};

/**
 * @param {MouseEvent} event 
 */
LightBox.closer_click = function(event)
{
  /** @type LightBox */
  var self = event.data;
  
  event.preventDefault();
  
  if (self.$overlay.queue("fx").length > 0
    || self.$contentFrameWrapper.queue("fx").length > 0)
      return;
  
  self.hide();
};

/**
 * @constant
 * @type number
 */
LightBox.OVERLAY_ZINDEX = Math.pow(2, 16);

/**
 * @constant
 * @type number
 */
LightBox.CONTENT_ZINDEX = Math.pow(2, 24);

/**
 * @constant
 * @type string
 */
LightBox.EVENT_SHOWN = "lightBox_shown";

/**
 * @constant
 * @type string
 */
LightBox.EVENT_HIDDEN = "lightBox_hidden";








/**
 * @param {LightBox} lightBox 
 */
function addLightBoxCloseButton(lightBox)
{
  var closeButton = (function()
  {
    var img = document.createElement("DIV")
      .appendChild(document.createElement("A"))
      .appendChild(document.createElement("IMG"));
    
    img.src = "/shared/images/lightbox/btn_close.png";
    img.alt = "閉じる";
    img.parentNode.href = "#";
    img.parentNode.parentNode.align = "right";
    img.parentNode.parentNode.style.width = "600px";
    
    (new MJL.Rollover(img)).create();
    
    $(img.parentNode).bind(
      "click", lightBox, LightBox.closer_click);
    
    return img.parentNode.parentNode;
  })();
  
  lightBox.contentFrameWrapper.insertBefore(closeButton, lightBox.contentFrame);
}

$(function()
{
  $("a.viewer")
    .click(function(event){ event.preventDefault(); })
    .click(function(event)
    {
      var $self = $(this);
      var thisFunc = arguments.callee;
      var lightBox = new LightBox(this.href);
      
      $self.unbind(event.type, thisFunc);
      
      addLightBoxCloseButton(lightBox);
      
      lightBox.bindEvent(LightBox.EVENT_HIDDEN, function()
      {
        $self.bind(event.type, thisFunc);
      });
      
      lightBox.show();
    });
});
