function preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.p=new Array();
　var i,j=d.p.length,a=preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.p[j]=new Image; d.p[j++].src=a[i];}}
}

function swapImgRestore() { //v3.0
  var i,x,a=document.sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function swapImage() { //v3.0
  var i,j=0,x,a=swapImage.arguments; document.sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=findObj(a[i]))!=null){document.sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

var accordion=function(){
	var tm=15; var sp=5;
	function slider(n){
		this.nm=n; this.arr=[]; this.sel='close'
	}
	slider.prototype.init=function(t,c,k){
		var a,h,s,l,i;
		a=document.getElementById(t);
		h=a.getElementsByTagName('dt'); s=a.getElementsByTagName('dd');
		l=h.length;
		for(i=0;i<l;i++){
			var d=h[i]; this.arr[i]=d; d.className='close'; d.onclick=new Function(this.nm+".process(this)");
			if(k!=null&&c==i){this.sel=d.className=k}
		}
		l=s.length;
		for(i=0;i<l;i++){
			var d=s[i]; d.maxh=d.offsetHeight;
			if(c!=i){d.style.height='0'; d.style.display='none'}
		}
	}
	slider.prototype.process=function(d){
		var i,l; l=this.arr.length;
		for(i=0;i<l;i++){
			var h=this.arr[i]; var s=h.nextSibling;
			if(s.nodeType!=1){s=s.nextSibling}
			clearInterval(s.timer);
			if(h==d&&s.style.display=='none'){
				s.style.display=''; setup(s,1); h.className=this.sel}
			else if(s.style.display==''){setup(s,-1); h.className='close'}
		}
	}
	function setup(c,f){c.timer=setInterval(function(){slide(c,f)},tm)}
	function slide(c,f){
		var h,m,d; h=c.offsetHeight; m=c.maxh; d=(f==1)?Math.ceil((m-h)/sp):Math.ceil(h/sp);
		c.style.height=h+(d*f)+'px'; c.style.opacity=h/m; c.style.filter='alpha(opacity='+h*100/m+')';
		if(f==1&&h>=m){clearInterval(c.timer)}
		else if(f!=1&&h==1){c.style.display='none'; clearInterval(c.timer)}
	}
	return{slider:slider}
}();

/**
 * iBox 2.18 (Build 1576)
 * For more info & download: http://www.ibegin.com/labs/ibox/
 * Created as a part of the iBegin Labs Project - http://www.ibegin.com/labs/
 * For licensing please see readme.html (MIT Open Source License)
*/
var iBox = function() {
  var _pub = {
    // label for the close link
    close_label: '閉じる',

    // show iframed content in the parent window
    // this *does not* work with #containers
    inherit_frames: false,

    // how fast to fade in the overlay/ibox (this is each step in ms)
    fade_in_speed: 300,
    fade_out_speed: 300,

    // our attribute identifier for our iBox elements
    attribute_name: 'rel',
    
    // tags to hide when we show our box
    tags_to_hide: ['select', 'embed', 'object'],

    // default width of the box (when displaying html only)
    // height is calculated automatically
    default_width: 450,

    // public version number
    version_number: '2.18',
    // internal build number
    build_number: '1576',

    // browser checks    
    is_opera: navigator.userAgent.indexOf('Opera/9') != -1,
    is_ie: navigator.userAgent.indexOf("MSIE ") != -1,
    is_ie6: false /*@cc_on || @_jscript_version < 5.7 @*/,
    is_firefox: navigator.appName == "Netscape" && navigator.userAgent.indexOf("Gecko") != -1 && navigator.userAgent.indexOf("Netscape") == -1,
    is_mac: navigator.userAgent.indexOf('Macintosh') != -1,

    // url for including images/external files
    base_url: '',
    
    /**
     * Updates the base_url variable.
     * @param {String} path Relative or absolute path to this file.
     */
    setPath: function(path) {
      _pub.base_url = path;
    },
    
    /**
     * Checks a container for specified tags containing rel="ibox"
     * @param {Object} container
     * @param {String} tag_name
     */
    checkTags: function(container, tag_name) {
      if (!container) var container = document.body;
      if (!tag_name) var tag_name = 'a';
      var els = container.getElementsByTagName(tag_name);
      for (var i=0; i<els.length; i++) {
        if (els[i].getAttribute(_pub.attribute_name)) {
          var t = els[i].getAttribute(_pub.attribute_name);
          if ((t.indexOf("ibox") != -1) || t.toLowerCase() == "ibox") { // check if this element is an iBox element
            els[i].onclick = _pub.handleTag;
          }
        }
      }
    },
    
    /**
     * Binds arguments to a callback function
     */
    bind: function(fn) {
        var args = [];
        for (var n=1; n<arguments.length; n++) args.push(arguments[n]);
        return function(e) { return fn.apply(this, [e].concat(args)); };
    },

    /**
     * Sets the content of the ibox
     * @param {String} content HTML content
     * @param {Object} params
     */
    html: function(content, params) {
      if (content === undefined) return els.content;
      if (params === undefined) var params = {};
      if (!active.is_loaded) return;
      _pub.clear();

      _pub.updateObject(els.wrapper.style, {display: 'block', visibility: 'hidden', left: 0, top: 0, height: '', width: ''});
      
      if (typeof(content) == 'string') els.content.innerHTML = content;
      else els.content.appendChild(content);

      var pagesize = _pub.getPageSize();

      if (params.can_resize === undefined) params.can_resize = true;
      if (params.fade_in === undefined) params.use_fade = true;

      if (params.fullscreen) {
        params.width = '100%';
        params.height = '100%';
      }
      
      // reset offsets
      offset.container = [els.wrapper.offsetLeft*2, els.wrapper.offsetTop*2];
      offset.wrapper = [els.wrapper.offsetWidth-els.content.offsetWidth, els.wrapper.offsetHeight-els.content.offsetHeight];

      // TODO: remove the +4 when issue is solved with calculations
      offset.wrapper[1] += 4;

      if (params.width) var width = params.width;
      else var width = _pub.default_width;

      if (params.height) var height = params.height;
      else {

        els.content.style.height = '100%';
        var height = els.content.offsetHeight + 12;
        els.content.style.height = '';
      }
      active.dimensions = [width, height];
      active.params = params;
      _pub.reposition();

      // XXX: Fix for inline containers which had elements that were hidden
      for (var i=0; i<_pub.tags_to_hide.length; i++) {
        showTags(_pub.tags_to_hide[i], els.content);
      }

      els.wrapper.style.visibility = 'visible';
    },
    
    /**
     * Empties the content of the iBox (also hides the loading indicator)
     */
    clear: function() {
      els.loading.style.display = "none";
      while (els.content.firstChild) els.content.removeChild(els.content.firstChild);
    },
    
    /**
     * Loads text into the ibox
     * @param {String} url
     * @param {String} title
     * @param {Object} params
     */
    show: function(text, title, params) {
      showInit(title, params, function() {
        _pub.html(text, active.params);
      });
    },
    /**
     * Loads a url into the ibox
     * @param {String} url
     * @param {String} title
     * @param {Object} params
     */
    showURL: function(url, title, params) {
      showInit(title, params, function() {
        for (var i=0; i<_pub.plugins.list.length; i++) {
          var plugin = _pub.plugins.list[i];
          if (plugin.match(url)) {
            active.plugin = plugin;
            plugin.render(url, active.params);
            break;
          }
        }
      });
    },

    /**
     * Hides the iBox
     */
    hide: function() {
      if (active.plugin) {
        // call the plugins unload method
        if (active.plugin.unload) active.plugin.unload();
      }
      active = {}
      _pub.clear();
      // restore elements that were hidden
      for (var i=0; i<_pub.tags_to_hide.length; i++) showTags(_pub.tags_to_hide[i]);

      els.loading.style.display = 'none';
      els.wrapper.style.display = 'none';
      _pub.fade(els.overlay, _pub.getOpacity(null, els.overlay), 0, _pub.fade_out_speed, function() { els.overlay.style.display = 'none';});
      _pub.fireEvent('hide');
    },

    /**
     * Repositions the iBox wrapper based on the params set originally.
     */
    reposition: function() {
      if (!active.is_loaded) return;

      // center loading box
      if (els.loading.style.display != 'none') _pub.center(els.loading);
      
      // update ibox width/height/position
      if (active.dimensions) {
        var pagesize = _pub.getPageSize();

        var width = active.dimensions[0];
        var height = active.dimensions[1];
        
        if (height.toString().indexOf('%') != -1) {
          els.wrapper.style.height = (Math.max(document.documentElement.clientHeight, document.body.clientHeight, pagesize.height) - offset.container[0])*(parseInt(height)/100) + 'px';
        }
        else if (height) {
          els.content.style.height = height + 'px';
          // TODO: if we dont set wrapper height, it doesnt restrict the height and the box is fine
          // so offset.wrapper[1] must not be correct
          els.wrapper.style.height = els.content.offsetHeight + offset.wrapper[1] + 'px';
        }
        else {
          els.wrapper.style.height = els.content.offsetHeight + offset.wrapper[1] + 'px';
        }
        var container_offset = (els.content.offsetHeight - els.content.firstChild.offsetHeight);
        if (width.toString().indexOf('%') != -1) {
          els.wrapper.style.width = (Math.max(document.documentElement.clientWidth, document.body.clientWidth, pagesize.width) - offset.container[1])*(parseInt(width)/100) + 'px';
          var container_offset = 0;
        }
        else {
          els.content.style.width = width + 'px';
          els.wrapper.style.width = els.content.offsetWidth + offset.wrapper[0] + 'px';
        }

        _pub.updateObject(els.content.style, {width: '', height: ''});

        var width = parseInt(els.wrapper.style.width);
        var height = parseInt(els.wrapper.style.height);

        // if we can resize this, make sure it fits in our page bounds
        if (active.params.can_resize) {
          var x = pagesize.width;
          var y = pagesize.height;
          
          x -= offset.container[0];
          y -= offset.container[1];
          if (width > x) {
            if (active.params.constrain) height = height * (x/width);
            width = x;
          }
          if (height > y) {
            if (active.params.constrain) width = width * (y/height);
            height = y;
          }
          _pub.updateObject(els.wrapper.style, {width: width + 'px', height: height + 'px'});
        }

        //els.content.style.width = width - offset.wrapper[0] + 'px';
        // TODO: this isn't adjusting to the right height for containers that are smaller than the page height
        // resize the wrappers height based on the content boxes height
        // this needs to be height - ibox_content[margin+padding+border]
        els.content.style.height = height - offset.wrapper[1] + 'px';
        if (active.dimensions != ['100%', '100%']) _pub.center(els.wrapper);
      }
      
      // fix overlay width/height (cant use css fixed on ie6 or fx or any
      // browser really due to issues)
      els.overlay.style.height = Math.max(document.body.clientHeight, document.documentElement.clientHeight) + 'px';
    },

    updateObject: function(obj, params) {
      for (var i in params) obj[i] = params[i];
    },

    /**
     * Centers an object
     * @param {Object} obj
     */
    center: function(obj) {
      var pageSize = _pub.getPageSize();
      var scrollPos = _pub.getScrollPos();
      var emSize = _pub.getElementSize(obj);
      var x = Math.round((pageSize.width - emSize.width) / 2 + scrollPos.scrollX);
      var y = Math.round((pageSize.height - emSize.height) / 2 + scrollPos.scrollY);
      if (obj.offsetLeft) x -= obj.offsetLeft;
      if (obj.offsetTop) y -= obj.offsetTop;
      if (obj.style.left) x += parseInt(obj.style.left);
      if (obj.style.top) y += parseInt(obj.style.top);
      // this nearly centers it due to scrollbars
      x -= 10;
      _pub.updateObject(obj.style, {top: y + 'px', left: x + 'px'});
    },
    
    getStyle: function(obj, styleProp) {
      if (obj.currentStyle)
        return obj.currentStyle[styleProp];
      else if (window.getComputedStyle)
        return document.defaultView.getComputedStyle(obj,null).getPropertyValue(styleProp);
    },

    /**
     * Gets the scroll positions
     */
    getScrollPos: function() {
      var docElem = document.documentElement;
      return {
        scrollX: document.body.scrollLeft || window.pageXOffset || (docElem && docElem.scrollLeft),
        scrollY: document.body.scrollTop || window.pageYOffset || (docElem && docElem.scrollTop)
      };
    },

    /**
     * Gets the page constraints
     */
    getPageSize: function() {
      return {
        width: window.innerWidth || (document.documentElement && document.documentElement.clientWidth) || document.body.clientWidth,
        height: window.innerHeight || (document.documentElement && document.documentElement.clientHeight) || document.body.clientHeight
      };
    },

    /**
     * Gets an objects offsets
     * @param {Object} obj
     */
    getElementSize: function(obj) {
      return {
        width: obj.offsetWidth || obj.style.pixelWidth,
        height: obj.offsetHeight || obj.style.pixelHeight
      };
    },
    
    fade: function(obj, start, end, speed, callback) {
      if (start === undefined || !(start >= 0) || !(start <= 100)) var start = 0;
      if (end === undefined || !(end >= 0) || !(end <= 100)) var end = 100;
      if (speed === undefined) var speed = 0;

      if (obj.fader) clearInterval(obj.fader);

      if (!speed) {
        _pub.setOpacity(null, obj, end);
        if (callback) callback();
      }
      
      var opacity_difference = end - start; 
      var time_total = speed; // time is speed (jQuery compat)
      var step_size = 25; // step size in ms
      var steps = time_total / step_size; // total number of steps
      var increment = Math.ceil(opacity_difference / steps); // how much to incr per step
      
      obj.fader = setInterval(_pub.bind(function(e, obj, increment, end, callback) {
        var opacity = _pub.getOpacity(e, obj) + increment;
        _pub.setOpacity(e, obj, opacity);
        if ((increment < 0 && opacity <= end) || (increment > 0 && opacity >= end)) {
          _pub.setOpacity(e, obj, end);
          clearInterval(obj.fader);
          if (callback) callback();
        }
      }, obj, increment, end, callback), step_size);
    },

    /**
     * Sets the opacity of an element
     * @param {Object} obj
     * @param {Integer} value
     */
    setOpacity: function(e, obj, value) {
      value = Math.round(value);
      obj.style.opacity = value/100;
      obj.style.filter = 'alpha(opacity=' + value + ')';
    },
    
    /**
     * Gets the opacity of an element
     * @param {Object} obj
     * @return {Integer} value
     */
    getOpacity: function(e, obj) {
      return _pub.getStyle(obj, 'opacity')*100;
    },
    
    /**
     * Creates a new XMLHttpRequest object based on browser
     */
    createXMLHttpRequest: function() {
      var http;
      if (window.XMLHttpRequest) { // Mozilla, Safari,...
        http = new XMLHttpRequest();
        if (http.overrideMimeType) {
          // set type accordingly to anticipated content type
          http.overrideMimeType('text/html');
        }
      }
      else if (window.ActiveXObject) { // IE
        try {
          http = new ActiveXObject("Msxml2.XMLHTTP");
        } catch (e) {
          try {
            http = new ActiveXObject("Microsoft.XMLHTTP");
          } catch (e) {}
        }
      }
      if (!http) {
        alert('Cannot create XMLHTTP instance');
        return false;
      }
      return http;
    },
    
    addEvent: function(obj, evType, fn) {
      if (obj.addEventListener) {
        obj.addEventListener(evType, fn, false);
        return true;
      }
      else if (obj.attachEvent) {
        var r = obj.attachEvent("on"+evType, fn);
        return r;
      }
      else {
        return false;
      }
    },
    
    addEventListener: function(name, callback) {
      if (!events[name]) events[name] = new Array();
      events[name].push(callback);
    },
    
    /**
     * Causes all event listeners attached to `name` event to
     * execute.
     * @param {String} name Event name
     */
    fireEvent: function(name) {
        if (events[name] && events[name].length) {
          for (var i=0; i<events[name].length; i++) {
            var args = [];
            for (var n=1; n<arguments.length; n++) args.push(arguments[n]);
            // Events returning false stop propagation
            if (events[name][i](args) === false) break;
          }
        }
    },
    
    /**
     * Parses the arguments in the rel attribute
     * @param {String} query
     */
    parseQuery: function(query) {
       var params = new Object();
       if (!query) return params; 
       var pairs = query.split(/[;&]/);
       var end_token;
       for (var i=0; i<pairs.length; i++) {
          var keyval = pairs[i].split('=');
          if (!keyval || keyval.length != 2) continue;
          var key = unescape(keyval[0]);
          var val = unescape(keyval[1]);
          val = val.replace(/\+/g, ' ');
          if (val[0] == '"') var token = '"';
          else if (val[0] == "'") var token = "'";
          else var token = null;
          if (token) {
            if (val[val.length-1] != token) {
              do {
                i += 1;
                val += '&'+pairs[i];
              }
              while ((end_token = pairs[i][pairs[i].length-1]) != token)
            }
            val = val.substr(1, val.length-2);
          }
          if (val == 'true') val = true;
          else if (val == 'false') val = false;
          else if (val == 'null') val = null;
          params[key] = val;
       }
       return params;
    },
    /**
     * Handles the onclick event for iBox anchors.
     * @param {Event} e
     */
    handleTag: function(e) {
      var t = this.getAttribute('rel');
      var params = _pub.parseQuery(t.substr(5,999));
      if (params.target) var url = params.target;
      else if (this.target && !params.ignore_target) var url = this.target;
      else var url = this.href;
      var title = this.title;
      if (_pub.inherit_frames && window.parent) window.parent.iBox.showURL(url, title, params);
      else _pub.showURL(url, title, params);
      return false;
    },
    
    plugins: {
      list: new Array(),
      register: function(func, last) {
        if (last === undefined) var last = false;
        if (!last) {
          _pub.plugins.list = [func].concat(_pub.plugins.list);
        }
        else {
          _pub.plugins.list.push(func);
        }
      }
    }
  };
  
  // private methods and variables
  var active = {};
  
  // events
  var events = {};

  // some containers
  // we store these in memory instead of finding them each time
  var els = {};
  
  var offset = {};
  
  /**
   * Creates the iBox container and appends it to an element
   * @param {HTMLObject} elem Container to attach to
   * @return {HTMLObject} iBox element
   */
  var create = function(elem) {
    pagesize = _pub.getPageSize();
    
    // TODO: why isnt this using DOM tools
    // a trick on just creating an ibox wrapper then doing an innerHTML on our root ibox element
    els.container = document.createElement('div');
    els.container.id = 'ibox';

    els.overlay = document.createElement('div');
    els.overlay.style.display = 'none';
    _pub.setOpacity(null, els.overlay, 0);
    // firefox mac has issues with opacity and flash
    if (!_pub.is_firefox) els.overlay.style.background = '#191919';
    else els.overlay.style.backgroundImage = "url('" + _pub.base_url + "images/bg.png')";
    els.overlay.id = 'ibox_overlay';
    params = {position: 'absolute', top: 0, left: 0, width: '100%'};
    _pub.updateObject(els.overlay.style, params);
    els.overlay.onclick = _pub.hide;
    els.container.appendChild(els.overlay);

    els.loading = document.createElement('div');
    els.loading.id = 'ibox_loading';
    els.loading.innerHTML = 'Loading...';
    els.loading.style.display = 'none';
    els.loading.onclick = _pub.hide
    els.container.appendChild(els.loading);

    els.wrapper = document.createElement('div')
    els.wrapper.id = 'ibox_wrapper';
    _pub.updateObject(els.wrapper.style, {position: 'absolute', top: 0, left: 0, display: 'none'});

    els.content = document.createElement('div');
    els.content.id = 'ibox_content';
    _pub.updateObject(els.content.style, {overflow: 'auto'})
    els.wrapper.appendChild(els.content);
  
    var child = document.createElement('div');
    child.id = 'ibox_footer_wrapper';
  
    var child2 = document.createElement('a');
    child2.innerHTML = _pub.close_label;
    child2.href = 'javascript:void(0)';
    child2.onclick = _pub.hide;
    child.appendChild(child2);
  
    els.footer = document.createElement('div');
    els.footer.id = 'ibox_footer';
    els.footer.innerHTML = '&nbsp;';
    child.appendChild(els.footer);
    els.wrapper.appendChild(child);

    els.container.appendChild(els.wrapper);

    elem.appendChild(els.container);
        
    _pub.updateObject(els.wrapper.style, {right: '', bottom: ''});
    
    return els.container;
  };
  
  /**
   * Hides tags within the container
   * @param {String} tag The name of the tag (e.g. 'a')
   * @param {HTMLObject} container The container to restore tags within (defaults to document)
   */
  var hideTags = function(tag, container) {
    if (container === undefined) var container = document.body;
    var list = container.getElementsByTagName(tag);
    for (var i=0; i<list.length; i++) {
      if (_pub.getStyle(list[i], 'visibility') != 'hidden' && list[i].style.display != 'none') {
        list[i].style.visibility = 'hidden';
        list[i].wasHidden = true;
      }
    }
  };
  
  /**
   * Shows all previously hidden tags in a container.
   * @param {String} tag The name of the tag (e.g. 'a')
   * @param {HTMLObject} container The container to restore tags within (defaults to document)
   */
  var showTags = function(tag, container) {
    if (container === undefined) var container = document.body;
    var list = container.getElementsByTagName(tag);
    for (var i=0; i<list.length; i++) {
      if (list[i].wasHidden) {
        list[i].style.visibility = 'visible';
        list[i].wasHidden = null;
      }
    }
  };
  
  var showInit = function(title, params, callback) {
    if (!_initialized) initialize();
    if (params === undefined) var params = {};
    if (active.plugin) _pub.hide();

    active.is_loaded = true;
    active.params = params;
    
    els.loading.style.display = "block";
    
    _pub.center(els.loading);
    _pub.reposition();

    // hide tags
    for (var i=0; i<_pub.tags_to_hide.length; i++) {
      hideTags(_pub.tags_to_hide[i]);
    }

    // set title here
    els.footer.innerHTML = title || "&nbsp;";

    // setup background
    els.overlay.style.display = "block";
    
    if (!_pub.is_firefox) var amount = 70;
    else var amount = 100;
    _pub.fade(els.overlay, _pub.getOpacity(null, els.overlay), amount, _pub.fade_in_speed, callback);
    
    _pub.fireEvent('show');
  };
  
  var drawCSS = function() {
    // Core CSS (positioning/etc)
    var core_styles = "#ibox {z-index:1000000;text-align:left;} #ibox_overlay {z-index:1000000;} #ibox_loading {position:absolute;z-index:1000001;} #ibox_wrapper {margin:30px;position:absolute;top:0;left:0;z-index:1000001;} #ibox_content {z-index:1000002;margin:27px 5px 5px 5px;padding:2px;} #ibox_content object {display:block;} #ibox_content .ibox_image {width:100%;height:100%;margin:0;padding:0;border:0;display:block;} #ibox_footer_wrapper a {float:right;display:block;outline:0;margin:0;padding:0;} #ibox_footer_wrapper {text-align:left;position:absolute;top:5px;right:5px;left:5px;white-space:nowrap;overflow:hidden;}";
    
    // Default style/theme/skin/whatever
    var default_skin = "#ibox_footer_wrapper {font-weight:bold;height:20px;line-height:20px;} #ibox_footer_wrapper a {text-decoration:none;background:#000;border:1px solid #000;line-height:16px;padding:0 5px;color:#fff;font-weight:bold;font-family:Verdana, Arial, Helvetica, sans-serif;font-size:10px;} #ibox_footer_wrapper a:hover {background-color:#000;color:#fff;} #ibox_footer_wrapper {font-size:12px;font-family:Verdana, Arial, Helvetica, sans-serif;color:#111;} #ibox_wrapper {border:1px solid #000;} #ibox_wrapper {background-color:#000;}#ibox_content {background-color:#000;border:1px solid #000;} #ibox_loading {padding:50px; background:#000;color:#fff;font-size:16px;font-weight:bold;}";

    var head = document.getElementsByTagName("head")[0];

    // tricky hack for IE
    // because IE doesn't like when you insert stuff the proper way
    // and we cant use relative paths to include this as an external
    // stylesheet
    var htmDiv = document.createElement('div');

    htmDiv.innerHTML = '<p>x</p><style type="text/css">'+default_skin+'</style>';
    head.insertBefore(htmDiv.childNodes[1], head.firstChild);

    htmDiv.innerHTML = '<p>x</p><style type="text/css">'+core_styles+'</style>';
    head.insertBefore(htmDiv.childNodes[1], head.firstChild);
  };

  var _initialized = false;
  var initialize = function() {
    // make sure we haven't already done this
    if (_initialized) return;
    _initialized = true;
    // elements here start the look up from the start non <a> tags
    drawCSS();
    create(document.body);
    _pub.checkTags(document.body, 'a');
    _pub.http = _pub.createXMLHttpRequest();
    _pub.fireEvent('load');
  };
  
  _pub.addEvent(window, 'keypress', function(e){ if (e.keyCode == (window.event ? 27 : e.DOM_VK_ESCAPE)) { iBox.hide(); }});
  _pub.addEvent(window, 'resize', _pub.reposition);
  _pub.addEvent(window, 'load', initialize);
  _pub.addEvent(window, 'scroll', _pub.reposition);

  // DEFAULT PLUGINS

  /**
   * Handles embedded containers in the page based on url of #container.
   * This _ONLY_ works with hidden containers.
   */
  var iBoxPlugin_Container = function() {
    var was_error = false;
    var original_wrapper = null;
    return {
      /**
       * Matches the url and returns true if it fits this plugin.
       */
      match: function(url) {
        return url.indexOf('#') != -1;
      },
      /**
       * Called when this plugin is unloaded.
       */
      unload: function() {
        if (was_error) return;
        var elemSrc = _pub.html().firstChild;
        if (elemSrc) {
          elemSrc.style.display = 'none';
          original_wrapper.appendChild(elemSrc);
        }
      },
      /**
       * Handles the output
       * @param {iBox} ibox
       * @param {String} url
       * @return {iBoxContent} an instance or subclass of iBoxContent
       */
      render: function(url, params) {
        was_error = false;
        var elemSrcId = url.substr(url.indexOf("#") + 1);
        var elemSrc = document.getElementById(elemSrcId);
        // If the element doesnt exist, break the switch
        if (!elemSrc) {
          was_error = true;
          _pub.html(document.createTextNode('There was an error loading the document.'), params);
        }
        else {
          original_wrapper = elemSrc.parentNode;
          elemSrc.style.display = 'block';
          _pub.html(elemSrc, params);
        }
      }
    }
  }();
  _pub.plugins.register(iBoxPlugin_Container, true);

  /**
   * Handles images
   */
  var iBoxPlugin_Image = function() {
    // Image types (for auto detection of image display)
    var image_types = /\.jpg|\.jpeg|\.png|\.gif/gi;

    return {
      match: function(url) {
        return url.match(image_types);
      },

      render: function(url, params) {  
        var img = document.createElement('img');
        img.onclick = _pub.hide;
        img.className = 'ibox_image'
        img.style.cursor = 'pointer';
        img.onload = function() {
          _pub.html(img, {width: this.width, height: this.height, constrain: true})
        }
        img.onerror = function() {
          _pub.html(document.createTextNode('There was an error loading the document.'), params);
        }
        img.src = url;
      }
    }
  }();
  _pub.plugins.register(iBoxPlugin_Image);

  var iBoxPlugin_YouTube = function() {
    var youtube_url = /(?:http:\/\/)?(?:www\d*\.)?(youtube\.(?:[a-z]+))\/(?:v\/|(?:watch(?:\.php)?)?\?(?:.+&)?v=)([^&]+).*/;
    return {
      match: function(url) {
        return url.match(youtube_url);
      },

      render: function(url, params) {
        var _match = url.match(youtube_url);
        var domain = _match[1];
        var id = _match[2];
        params.width = 425;
        params.height = 355;
        params.constrain = true;
        var html = '<object width="100%" height="100%" style="overflow: hidden; display: block;"><param name="movie" value="http://www.' + domain + '/v/' + id + '"/><param name="wmode" value="transparent"/><embed src="http://www.' + domain + '/v/' + id + '" type="application/x-shockwave-flash" wmode="transparent" width="100%" height="100%"></embed></object>';
        _pub.html(html, params);
      }
    }
  }();
  _pub.plugins.register(iBoxPlugin_YouTube);

  var iBoxPlugin_Document = function() {
    return {
      match: function(url) {
        return true;
      },

      render: function(url, params) {
        _pub.http.open('get', url, true);

        _pub.http.onreadystatechange = function() {
          if (_pub.http.readyState == 4) {
            // XXX: why does status return 0?
            if (_pub.http.status == 200 || _pub.http.status == 0) {
              _pub.html(_pub.http.responseText, params);
            }
            else {
              _pub.html(document.createTextNode('There was an error loading the document.'), params);
            }
          }
        }
        _pub.http.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
        try {
          _pub.http.send(null);
        }
        catch (ex) {
          _pub.html(document.createTextNode('There was an error loading the document.'), params);
        }
      }
    };
  }();
  _pub.plugins.register(iBoxPlugin_Document, true);

  return _pub;
}();

/* mjl.js
 * MITSUE-LINKS JavaScript Library
 * Version 2.0.7
 * Copyright (C) 2008-2009 MITSUE-LINKS
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
/*@cc_on eval((function(){var ps="document external self top parent setInterval clearInterval setTimeout clearTimeout".split(" ");var c=[];for(var i=0,l=ps.length,p=null;i<l;i++){p=ps[i];window["_"+p]=window[p];c.push(p+"=_"+p);}return "var "+c.join(",");})()); @*/var MJL={};MJL.version="2.0.7";MJL.inherit=function(c,a){if(undefined!==c.__proto__&&undefined!==c.prototype.__proto__){c.prototype.__proto__=a.prototype;c.__proto__=a;if(a.prototype.isPrototypeOf&&a.prototype.isPrototypeOf(c.prototype)){return c}}c.prototype=new a();try{c.prototype.constructor=c}catch(b){throw Error("can't substitution 'constructor': "+b)}return c};MJL.convArray=function(d){if(d instanceof Array){return d}try{return Array.prototype.slice.call(d)}catch(c){var b=d.length;var a=new Array(b);for(var f=0;f<b;f++){a[f]=d[f]}return a}};MJL.sanitize=(function(){var a=/^[\s\t]+/;var b=/[\s\t]+$/;return function(c){return c.replace(a,"").replace(b,"")}})();MJL.ua=(function(){/*@cc_on @if (@_jscript) var type = "trident"; @else @*/var type=(undefined!==window.opera)?"opera":(undefined!==window.Components)?"gecko":(undefined!==window.defaultstatus)?"webkit":"unknown";/*@end @*/var ret={gecko:false,opera:false,webkit:false,trident:false,unknown:false,quirks:("BackCompat"==document.compatMode),version:("opera"==type)?Number(window.opera.version()):("webkit"==type)?document.evaluate?3:2:("trident"==type)?("undefined"!=typeof document.documentMode)?document.documentMode:("undefined"!=typeof external.SqmEnabled)?7:6:0,activex:("undefined"!=typeof ActiveXObject)};ret[type]=true;return ret})();MJL.convNode=function(f){var b=document.createElement("div");b.innerHTML=f;var d=b.childNodes;var e=d.length;var a=null;if(e<=1){a=d[0]}else{a=document.createDocumentFragment();for(var g=0;g<e;g++){a.appendChild(d[0])}}return a};MJL.getClassNameRegExp=(function(){var a={};return function(b){if(undefined===a[b]){a[b]=new RegExp("(?:^|[\\s\\t]+)"+b+"(?:[\\s\\t]+|$)")}return a[b]}})();MJL.hasClassName=function(b,a){if("string"!=typeof a){return false}return MJL.getClassNameRegExp(a).test(b.className)};MJL.addClassName=function(b,a){if(MJL.hasClassName(b,a)){return}b.className=b.className?b.className+" "+a:a};MJL.removeClassName=function(c,a){if(!MJL.hasClassName(c,a)){return}var b=MJL.sanitize(c.className.replace(MJL.getClassNameRegExp(a)," "));if(b){c.className=b}else{c.removeAttribute("class");c.removeAttribute("className")}};MJL.getElementsByClassName=(function(){if(document.getElementsByClassName){return function(b,a){return MJL.convArray(b.getElementsByClassName(a))}}else{if(document.querySelectorAll){return function(b,a){return MJL.convArray(b.querySelectorAll("."+a))}}else{if(document.evaluate){return function(d,b){var e=document.evaluate('.//*[contains(concat(" ",@class," ")," '+b+' ")]',d,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);var f=e.snapshotLength;var a=new Array(f);for(var c=0;c<f;c++){a[c]=e.snapshotItem(c)}return a}}else{return function(e,c){var b=e.getElementsByTagName("*");var d=b.length;var a=[];for(var f=0;f<d;f++){if(MJL.hasClassName(b[f],c)){a.push(b[f])}}return a}}}}})();MJL.getElementsByChildNodes=(function(){if(document.evaluate){return function(d,g,a){var e=document.evaluate(!g?"./*":(false===a)?"./*[not(self::"+g+")]":"./"+g,d,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);var f=e.snapshotLength;var b=new Array(f);for(var c=0;c<f;c++){b[c]=e.snapshotItem(c)}return b}}else{return function(e,g,a){var c=e.childNodes;var d=c.length;var b=[];if(false!==a){a=true}for(var f=0;f<d;f++){if(1==c[f].nodeType&&(!g||a==(g==c[f].nodeName.toLowerCase()))){b.push(c[f])}}return b}}})();MJL.vp=(function(){var a=MJL.ua.quirks?"body":"documentElement";return{getInnerSize:function(){var b=0;var c=0;if(MJL.ua.webkit&&MJL.ua.version<3){b=window.innerWidth;c=window.innerHeight}else{if(MJL.ua.opera&&MJL.ua.version<9.5){b=document.body.clientWidth;c=document.body.clientHeight}else{b=document[a].clientWidth;c=document[a].clientHeight}}return{width:b,height:c}},getFullSize:function(){return{width:document[a].scrollWidth,height:document[a].scrollHeight}},getScrollPosition:function(){return{x:(window.pageXOffset||document[a].scrollLeft),y:(window.pageYOffset||document[a].scrollTop)}}}})();MJL.event={add:function(f,d,g,a,e){var c=e?g:this._wrapAfterCare(g);var b=c;if(this._origins[d]){b=this._origins[d].add(f,c,a)}else{if(f.addEventListener){f.addEventListener(d,c,a)}else{if(f.attachEvent){f.attachEvent("on"+d,c)}else{b=null}}}if(!e&&null!==b&&"unload"!=d){this._store(f,d,b,a)}return b},remove:function(d,c,e,a){var b=e;if(this._origins[c]){b=this._origins[c].remove(d,e,a)}else{if(d.removeEventListener){d.removeEventListener(c,e,a)}else{if(d.detachEvent){d.detachEvent("on"+c,e)}}}return b},getCurrentNode:function(a){return a.currentTarget?a.currentTarget:a.srcElement?a.srcElement:window.event.srcElement?window.event.srcElement:null},windowLoaded:false,_types:{},_store:function(c,b,d,a){if(undefined===this._types[b]){this._types[b]=[]}this._types[b].push({node:c,listener:d,useCapture:a})},_origins:{},_createStack:function(a){if(undefined===this._origins[a]._callStack){this._origins[a]._callStack={id:0,listeners:{}}}},_getStack:function(a){return this._origins[a]._callStack},_addStack:function(b,c){this._createStack(b);var a=this._getStack(b);var d=a.id;a.listeners[d]=c;a.id++;return d},_removeStack:function(b,c){var a=this._getStack(b);if(undefined===a||undefined===a.listeners[c]){return false}delete a.listeners[c];return true},_runStack:function(c){var a=this._getStack(c);if(undefined===a){return}for(var b in a.listeners){a.listeners[b]()}},_wrapAfterCare:function(a){return function(c){var b=a.apply(a,arguments);if(false===b){if(c.preventDefault){c.preventDefault()}else{c.returnValue=false}if(c.stopPropagation){c.stopPropagation()}else{c.cancelBubble=true}}}}};MJL.event.add(window,"unload",function(){var b=MJL.event._types;for(var c in b){var e=b[c];var d=e.length;for(var a=0;a<d;a++){MJL.event.remove(e[a].node,c,e[a].listener,e[a].useCapture)}}},false,true);MJL.event.add(window,"load",function(){MJL.event.windowLoaded=true},false);MJL.event._origins.resize=(MJL.ua.trident&&7<=MJL.ua.version)?{add:(function(){var a=true;function b(){a=true}var c=0;window.attachEvent("onresize",function(){if(a){a=false;MJL.event._runStack("resize");setTimeout(b,0)}});return function(e,f,d){return MJL.event._addStack("resize",f)}})(),remove:function(b,c,a){return MJL.event._removeStack("resize",c)}}:undefined;MJL.event._origins.fontresize={add:(function(){if(MJL.ua.trident){return function(c,d,b){return MJL.event.add(MJL.style._getUnitElem(),"resize",d,b)}}else{var a=false;return function(c,d,b){var e=MJL.event._addStack("fontresize",d);if(!a){a=true;setInterval(function(){if(MJL.style.isZoomed()){MJL.event._runStack("fontresize")}},1000)}return e}}})(),remove:(function(){if(MJL.ua.trident){return function(b,c,a){return MJL.event.remove(MJL.style._getUnitElem(),"resize",c,a)}}else{return function(b,c,a){return MJL.event._removeStack("fontresize",c)}}})()};MJL.style={getWithTitles:function(){var d=MJL.ua.webkit?this._getList():document.styleSheets;var a=d.length;var b={};for(var c=0;c<a;c++){var e=d[c].title;if(!e){continue}if(undefined==b[e]){b[e]=[]}b[e].push(d[c])}return b},switchAlt:function(e){var c=this.getWithTitles();if(undefined===c[e]){return false}for(var i in c){var a=c[i];var f=a.length;for(var b=0;b<f;b++){a[b].disabled=true}}var d=c[e];var h=d.length;for(var g=0;g<h;g++){d[g].disabled=false}return true},getComputed:(function(){var a={height:{enable:(MJL.ua.trident||(MJL.ua.opera&&MJL.ua.version<9.5)),calc:function(f,i,c){var h=parseInt(this.getComputed(f,"paddingTop"))||0;var g=parseInt(this.getComputed(f,"paddingBottom"))||0;var d;if(MJL.ua.trident&&7<=MJL.ua.version&&!f.currentStyle.hasLayout){var e=f.style.zoom;f.style.zoom=1;d=f.clientHeight;f.style.zoom=e}else{d=f.clientHeight}return(d<=0)?0:(d-h-g)+"px"}},fontSize:{enable:(MJL.ua.trident||(MJL.ua.webkit&&MJL.ua.webkit<3)),calc:function(d,e,c){return this._getUnitElem().offsetWidth+"px"}}};if(document.defaultView&&document.defaultView.getComputedStyle){var b=document.defaultView;return function(d,e){var c=b.getComputedStyle(d,null)[e];if(a[e]&&a[e].enable){c=a[e].calc.apply(this,[d,e,c])}return c}}else{if(document.documentElement&&document.documentElement.currentStyle){return function(e,g){var d=e.currentStyle[g];if(a[g]&&a[g].enable){d=a[g].calc.apply(this,[e,g,d])}else{if(!this._cond.px.test(d)&&this._cond.num.test(d)){var f=e.style.left;var c=e.runtimeStyle.left;e.runtimeStyle.left=e.currentStyle.left;e.style.left=d||0;d=e.style.pixelLeft;e.style.left=f;e.runtimeStyle.left=c}}return d}}else{throw Error("not supported getting computed style")}}})(),isZoomed:(function(){if(MJL.ua.opera){var a=0;var c=0;MJL.event.add(window,"load",function(){innerSize=MJL.vp.getInnerSize();c=MJL.style.getComputed(document.body,"fontSize")},false);return function(){var e=MJL.vp.getInnerSize();var d=MJL.style.getComputed(document.body,"fontSize");if(innerSize.width==e.width&&innerSize.height==e.height&&c==d){return false}innerSize=e;c=d;return true}}else{var b=0;MJL.event.add(window,"load",function(){b=MJL.style.getComputed(document.body,"fontSize")},false);return function(){var d=MJL.style.getComputed(document.body,"fontSize");if(b==d){return false}b=d;return true}}})(),_cond:{px:/\d\s*px$/i,num:/^\d/,rel:/(?:^|\s)stylesheet(?:\s|$)/i},_unitElem:null,_getUnitElem:function(){if(null===this._unitElem){var a=document.createElement("div");a.style.display="block";a.style.width="1em";a.style.height="1em";a.style.position="absolute";a.style.top="-999em";a.style.left="-999em";document.body.appendChild(a);this._unitElem=a}return this._unitElem},_getList:function(){var b=document.getElementsByTagName("link");var d=b.length;var c=[];for(var a=0;a<d;a++){if(this._cond.rel.test(b[a].getAttribute("rel"))){c.push(b[a])}}return c}};MJL.style.Switcher=function(){this.parent=null;this.targets=[];var a=this;this.options={collect:a._collectDefault};this._cookie=new MJL.Cookie(this._COOKIE_STATUS.name,this._COOKIE_STATUS.optional);this.setOptions.apply(this,arguments)};MJL.style.Switcher.prototype={setOptions:function(b,a){if(arguments.length<1){return}this.parent=b;if(null!==a&&"object"==typeof a){for(var c in this.options){if(undefined===a[c]){continue}this.options[c]=a[c]}}},create:function(){this.setOptions.apply(this,arguments);this._setTargets();this._setEvent();this._getCookie()},set:function(a){MJL.style.switchAlt(a);this._setCookie(a)},_COOKIE_STATUS:{name:"MJL.style.Switcher",key:"title",optional:{path:"/",fileUnit:false}},_collectDefault:function(f){var g=("a"==f.nodeName.toLowerCase())?[f]:f.getElementsByTagName("a");var h=g.length;var d=[];for(var c=0;c<h;c++){var b=g[c].getAttribute("href");var e=b.lastIndexOf("#");var i=(-1==e)?"":b.substring(e+1);if(i){d.push({node:g[c],title:i})}}return d},_setTargets:function(){this.targets=this.options.collect.call(this,this.parent)},_setEvent:function(){var a=this.targets.length;for(var b=0;b<a;b++){MJL.event.add(this.targets[b].node,"click",this._getEventListener(b),false)}},_getEventListener:function(b){var a=this;return function(){a.set(a.targets[b].title);return false}},_getCookie:function(){var a=this._cookie.get(this._COOKIE_STATUS.key);if(a){this.set(a)}},_setCookie:function(a){this._cookie.set(this._COOKIE_STATUS.key,a)}};MJL.Cookie=function(){this.name="";this.params={path:"",domain:"","max-age":31536000,secure:false};this.options={fileUnit:true,index:"index.html"};this._nameCond={str:"",regexp:null};this.setOptions.apply(this,arguments)};MJL.Cookie.prototype={setOptions:function(b,a){if(null!==a&&"object"==typeof a){for(var d in this.options){if(undefined===a[d]){continue}this.options[d]=a[d]}for(var c in this.params){if(undefined===a[c]){continue}this.params[c]=a[c]}}this.setName(b)},setName:function(a){if(!a||"string"!=typeof a){throw Error("invalid cookie name ("+a+")")}if(this.options.fileUnit){var b=window.location.pathname;if(this._DIR_COND.test(b)&&this.options.index){b+=this.options.index}a+="@"+b}this.name=a;this._nameCond.str=a+"=";this._nameCond.regexp=new RegExp("^"+a+"=")},get:function(a){var b=this._getAll();return("string"==typeof a)?b[a]:b},set:function(d,e){if(undefined===d||undefined===e){return}var b=this._getAll();var a=[];b[d]=e;for(var c in b){if(undefined===b[c]){continue}a.push(encodeURIComponent(c)+":"+encodeURIComponent(b[c]))}if(0<a.length){document.cookie=this.name+"="+a.join(",")+this._getParamStr()}},remove:function(){var a=this.params["max-age"];this.params["max-age"]=0;document.cookie=this.name+"="+this._getParamStr();this.params["max-age"]=a},_DIR_COND:/\/$/i,_DELIMITERS:{item:/\s*;\s*/,value:/\s*\,\s*/,hash:/\s*:\s*/},_param2:{path:{cond:function(a){return a},conv:function(a){return a}},domain:{cond:function(a){return a},conv:function(a){return a}},"max-age":{cond:function(a){return !isNaN(a)},conv:function(a){return a}},secure:{cond:function(a){return a},conv:function(a){return(a?"sequre":"")}}},_getAll:function(){var h=document.cookie;if(!h){return{}}var f={};var c=h.split(this._DELIMITERS.item);var a=c.length;for(var e=0;e<a;e++){if(0==c[e].indexOf(this._nameCond.str)){var i=c[e].replace(this._nameCond.regexp,"").split(this._DELIMITERS.value);var g=i.length;for(var j=0;j<g;j++){var b=i[j].split(this._DELIMITERS.hash);f[decodeURIComponent(b[0])]=decodeURIComponent(b[1])}break}}return f},_getParamStr:function(){var c=[];for(var b in this.params){if(this._param2[b].cond(this.params[b])){c.push(b+"="+this._param2[b].conv(this.params[b]))}}var a=this._getExpiresStr();if(a){c.push(a)}var d=c.join(";");return((""==d)?"":";"+d)},_getExpiresStr:function(){var b=this.params["max-age"];if(isNaN(b)){return""}var a=new Date();a.setTime(a.getTime()+b);return"expires="+a.toGMTString()}};MJL.Rollover=function(){this.targets=[];this.enable="";this.options={disable:"",switchers:{on:{cond:/(\.[^\.]+)$/g,replace:"_o$1"},off:{cond:"",replace:""}}};this.setOptions.apply(this,arguments)};MJL.Rollover.prototype={setOptions:function(b,a){if(arguments.length<1){return}this.enable=b;if(null!==a&&"object"==typeof a){for(var c in this.options){if(undefined===a[c]){continue}this.options[c]=a[c]}}},create:function(){this.setOptions.apply(this,arguments);this._setTargets();this._setEvents()},_TYPES:(function(){function a(c){return function(d){var e=d.getAttribute("src").replace(this.options.switchers[c].cond,this.options.switchers[c].replace);this._addCache(e);return function(){d.setAttribute("src",e)}}}function b(c){return function(g){var j=g.getElementsByTagName("img");var h=j.length;var f=a(c);var e=new Array(h);for(var d=0;d<h;d++){e[0]=f.call(this,j[d])}return function(){for(var k=0;k<h;k++){e[k]()}}}}return{img:{isTarget:function(){return true},getters:{mouseover:a("on"),mouseout:a("off")}},input:{isTarget:function(c){return("image"==c.getAttribute("type"))},getters:{mouseover:a("on"),mouseout:a("off"),focus:a("on"),blur:a("off")}},a:{isTarget:function(c){var d=c.getElementsByTagName("img");return(0<d.length)},getters:{focus:b("on"),blur:b("off")}}}})(),_isEnable:function(a){if(!this.options.disable){return true}do{if(MJL.hasClassName(a,this.options.disable)){return false}if(MJL.hasClassName(a,this.enable)){return true}a=a.parentNode}while(a);return false},_isTarget:function(b){var a=b.nodeName.toLowerCase();if(undefined===this._TYPES[a]){return false}if(this._TYPES[a].isTarget(b)&&this._isEnable(b)){return true}return false},_getElements:function(){var d=[];var a=MJL.getElementsByClassName(document,this.enable);var b=a.length;for(var g=0;g<b;g++){if(this._isTarget(a[g])){d.push(a[g])}for(var j in this._TYPES){var f=a[g].getElementsByTagName(j);var h=f.length;for(var i=0;i<h;i++){if(this._isTarget(f[i])){d.push(f[i])}}}}return d},_setTargets:function(){var b=this._getElements();var d=b.length;for(var h=0;h<d;h++){var c=b[h].nodeName.toLowerCase();var g={element:b[h],events:{}};var f=this._TYPES[c].getters;for(var a in f){g.events[a]=f[a].call(this,b[h])}this.targets.push(g)}},_setEvents:function(){var a=this.targets.length;for(var b=0;b<a;b++){for(var c in this.targets[b].events){MJL.event.add(this.targets[b].element,c,this.targets[b].events[c],false)}}},_addCache:(function(){var a={};return function(b){if(a[b]){return}a[b]=document.createElement("img");a[b].setAttribute("src",b)}})()};MJL.Flash=function(){this.node=null;this.alt=null;this.options={activate:false,version:0,minVerMsg:null};this.params={};this.validCreated=false;this.setOptions.apply(this,arguments)};MJL.Flash.prototype={type:"application/x-shockwave-flash",pluginurl:"http://www.adobe.com/go/getflashplayer",classid:"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000",codebase:"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab",version:(function(){var d="";try{d=navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin.description;d.match(/(\d+)\.(\d+)(?:\s*[r\.](\d+))?(?:\s*[bd](\d+))?$/)}catch(c){try{d=(new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7")).GetVariable("$version")}catch(c){try{var b=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");d="6,0,21,0";b.AllowScriptAccess="always";d=b.GetVariable("$version")}catch(c){try{d=(new ActiveXObject("ShockwaveFlash.ShockwaveFlash")).GetVariable("$version")}catch(c){d=""}}}d.match(/(\d+),(\d+),(\d+),(\d+)/)}var a={major:0,minor:0,revision:0,debug:0};if(d){a.major=parseInt(RegExp.$1)||0;a.minor=parseInt(RegExp.$2)||0;a.revision=parseInt(RegExp.$3)||0;a.debug=parseInt(RegExp.$4)||0}return a})(),enable:(function(){try{return !!navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin}catch(a){try{return !!(new ActiveXObject("ShockwaveFlash.ShockwaveFlash"))}catch(a){}}return false})(),compVersion:function(b,d,c,a){b=parseInt(b);d=parseInt(d);c=parseInt(c);a=parseInt(a);return((this.version.major<b)?1:(this.version.major>b)?-1:isNaN(d)?0:(this.version.minor<d)?1:(this.version.minor>d)?-1:isNaN(c)?0:(this.version.revision<c)?1:(this.version.revision>c)?-1:isNaN(a)?0:(this.version.debug<a)?1:(this.version.debug>a)?-1:0)},setOptions:function(b,a){if(arguments.length<1){return}if(1!=b.nodeType||"object"!=b.nodeName.toLowerCase()){throw Error("invalid 'object' element node: "+elem)}this.node=b;this.validCreated=false;if(null!==a&&"object"==typeof a){for(var c in this.options){if(undefined===a[c]){continue}this.options[c]=a[c]}}this._setParams();this._setOptionsByParams()},create:function(){this.setOptions.apply(this,arguments);this._switchNode();this._activate();return this.node},_setParams:function(){var c=MJL.getElementsByChildNodes(this.node,"param");var a=c.length;for(var b=0;b<a;b++){this.params[c[b].getAttribute("name")]=c[b].getAttribute("value")}},_setOptionsByParams:function(){for(var a in this.options){if(undefined===this.params[a]){continue}this.options[a]=this.params[a]}},_switchNode:function(){if(this.enable){if(this.compVersion(this.options.version)<=0){this.validCreated=true;return}this.alt=(this.options.minVerMsg)?this._createMinVerMsg():this._createAlt();var b=this.alt;var a=this.node;this.node=this.alt;a.parentNode.replaceChild(b,a)}},_createMinVerMsg:function(){return("string"==typeof this.options.minVerMsg)?MJL.convNode(this.options.minVerMsg):this.options.minVerMsg},_createAlt:(function(){if(MJL.ua.trident){return function(){return MJL.convNode(this.node.innerHTML)}}else{return function(){var d=document.createDocumentFragment();var a=MJL.getElementsByChildNodes(this.node,"param",false);var b=a.length;for(var c=0;c<b;c++){d.appendChild(a[c].cloneNode(true))}return d}}})(),_activate:function(){if(MJL.ua.activex&&this.options.activate&&this.validCreated){this._setCopyObject();this.node.setAttribute("classid",this.classid)}},_setCopyObject:function(){var g=document.createElement("object");var d=this.node.attributes;var e=d.length;for(var b=0;b<e;b++){if(""==d[b].value||"null"===d[b].value||"type"==d[b].name||"classid"==d[b].name){continue}g.setAttribute(d[b].name,d[b].value)}var f=this.node.childNodes;var h=f.length;for(var i=0;i<h;i++){g.appendChild(f[i].cloneNode(true))}this.node.parentNode.replaceChild(g,this.node);this.node=g}};MJL.Flash.version=MJL.Flash.prototype.version;MJL.Flash.enable=MJL.Flash.prototype.enable;MJL.Flash.compVersion=MJL.Flash.prototype.compVersion;MJL.Window=function(){this.parent=null;this.targets=[];var a=this;this.options={name:"_blank",collect:a._collectDefault};this.params={left:null,top:null,height:null,width:null,menubar:"yes",toolbar:"yes",location:"yes",status:"yes"};this.setOptions.apply(this,arguments)};MJL.Window.prototype={setOptions:function(b,a){if(arguments.length<1){return}this.parent=b;if(null!==a&&"object"==typeof a){for(var d in this.options){if(undefined===a[d]){continue}this.options[d]=a[d]}for(var c in this.params){if(undefined===a[c]){continue}this.params[c]=this._normalizeParam(a[c])}}},create:function(){this.setOptions.apply(this,arguments);this._setTargets();this._setEvents()},open:function(b){var a=window.open(this.targets[b].uri,this.options.name,this._getParamStr());this.targets[b].ref=a?a:null},_IMMUTABLE_PARAMS:{resizable:"yes",scrollbars:"yes"},_NODE2URI:{a:function(a){return a.getAttribute("href")}},_collectDefault:function(a){return(("a"==a.nodeName.toLowerCase())?[a]:a.getElementsByTagName("a"))},_collectHTTP:function(k){var c=[];if("a"==k.nodeName.toLowerCase()){var d=k.getAttribute("href");if(d&&"http"==d.substring(0,4)){c=[k]}}else{if(document.evaluate){var h=document.evaluate('.//a[starts-with(@href, "http")]',k,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);var f=h.snapshotLength;c.length=f;for(var g=0;g<f;g++){c[g]=h.snapshotItem(g)}}else{var b=k.getElementsByTagName("a");var e=b.length;for(var j=0;j<e;j++){var d=b[j].getAttribute("href");if(d&&"http"==d.substring(0,4)){c.push(b[j])}}}}return c},_setTargets:function(){var a=this.options.collect.call(this,this.parent);var b=a.length;for(var c=0;c<b;c++){var d=a[c].nodeName.toLowerCase();this.targets[c]={node:a[c],uri:this._NODE2URI[d](a[c]),ref:null}}},_setEvents:function(){var a=this.targets.length;for(var b=0;b<a;b++){MJL.event.add(this.targets[b].node,"click",this._getEventListener(b),false)}},_getEventListener:function(b){var a=this;return function(){a.open(b);return false}},_getParamStr:function(){var a=[];for(var c in this.params){if(null===this.params[c]){continue}a.push(c+"="+this.params[c])}for(var b in this._IMMUTABLE_PARAMS){a.push(b+"="+this._IMMUTABLE_PARAMS[b])}return a.join(",")},_normalizeParam:function(a){return((true===a)?"yes":(false===a)?"no":a)}};MJL.Window.collectDefault=MJL.Window.prototype._collectDefault;MJL.Window.collectHTTP=MJL.Window.prototype._collectHTTP;MJL.Tab=function(){this.container=null;this.content=null;this.list=null;this.id="";this.activeId="";this.stat=false;this.classes={container:"tabContainer",list:"tabList",panel:"tabPanel",title:"tabTitle",active:"active",stat:"static"};var a=this;this.options={cookie:{},collect:a._collectDefault};this.items={};this.nitems=0;this._cookie=null;this._cookieName="MJL.Tab";this.setOptions.apply(this,arguments)};MJL.Tab.prototype={setOptions:function(b,a){if(arguments.length<1){return}this.content=b;this.id=b.getAttribute("id");if(null!==a&&"object"==typeof a){for(var c in this.options){if(undefined===a[c]){continue}this.options[c]=a[c]}}if(!this.id){this.options.cookie=null}},create:function(){this.setOptions.apply(this,arguments);this._distStatic();this._getContents();this._createContainer();this._createList();this._setEvents();this._createCookie()},replace:function(){var b=document.createComment("");var a=this.content.parentNode;a.replaceChild(b,this.content);for(var c in this.items){MJL.addClassName(this.items[c].panel,this.classes.panel)}if(this.stat){a.replaceChild(this.content,b)}else{this.container.appendChild(this.list);this.container.appendChild(this.content);a.replaceChild(this.container,b)}this.active()},active:function(d){var a=this._getActiveId();var b=this.classes.active;if(d==a){return}else{if(!this._isValidId(d)){d=a}}MJL.removeClassName(this.items[a].list,b);MJL.removeClassName(this.items[a].panel,b);MJL.addClassName(this.items[d].list,b);MJL.addClassName(this.items[d].panel,b);this._setActiveId(d);this._setCookie()},_ID_PREFIX:"MJL_TAB_ITEM_",_URI2ID:/^[^#]*#/,_collectDefault:function(a){return MJL.getElementsByChildNodes(a)},_distStatic:function(){this.stat=MJL.hasClassName(this.content,this.classes.stat);if(this.stat){MJL.removeClassName(this.content,this.classes.stat)}},_isValidId:function(a){return(""!=a&&undefined!==this.items[a])},_getActiveId:function(){var c=this._getActiveIdByMarkup();var a=this._getCookie();if(!this._isValidId(a)){var b=window.location.hash;a=b?b.replace(this._URI2ID,""):"";if(!this._isValidId(a)){a=c;if(!this._isValidId(a)){for(var d in this.items){a=d;break}}}}this._setActiveId(a);this._getActiveId=this._getActiveIdBySelf;return a},_getActiveIdByMarkup:function(){var a="";for(var b in this.items){if(MJL.hasClassName(this.items[b].panel,this.classes.active)){a=b;break}}if(a){MJL.removeClassName(this.items[b].panel,this.classes.active);if(this.stat){MJL.removeClassName(this.items[b].list,this.classes.active)}}return a},_getActiveIdBySelf:function(){return this.activeId},_setActiveId:function(a){if(this._isValidId(a)){this.activeId=a}},_getId:(function(){var a=0;return function(b){var c="";if(this.stat){c=b.getAttribute("id");if(!c){throw Error("invalid id attribute value '"+c+"'")}}else{c=this._ID_PREFIX+a;a++}return c}})(),_getIdByHref:function(b){var a=b.getAttribute("href");if(!a){throw Error("invalid href attribure value '"+a+"'")}var c=a.replace(this._URI2ID,"");if(!this._isValidId(c)){throw Error("invalid reference ID '"+c+"' in '"+a+"'")}return c},_getContents:function(){var a=this.options.collect.call(this,this.content);var b=a.length;for(var c=0;c<b;c++){var d=this._getId(a[c]);if(undefined===this.items[d]){this.items[d]={panel:a[c],title:this._getTitle(a[c]),list:null,event:null}}else{throw Error("overlapping id value '"+d+"'")}}this.nitems=b},_getTitle:function(a){var c="";if(this.stat){}else{var b=MJL.getElementsByClassName(a,this.classes.title);if(b.length<1){throw Error("not found title-use element")}c=b[0]}return c},_cloneTitle:function(f){var d=document.createDocumentFragment();var a=this.items[f].title.childNodes;var b=a.length;for(var e=0;e<b;e++){d.appendChild(a[e].cloneNode(true))}return d},_createContainer:function(){var a=null;if(this.stat){a=this.content.parentNode;while(a&&!MJL.hasClassName(a,this.classes.container)){a=a.parentNode}if(!a){throw Error("not found tab container element")}}else{a=document.createElement("div");MJL.addClassName(a,this.classes.container)}this.container=a},_createList:function(){var f=null;if(this.stat){f=MJL.getElementsByClassName(this.container,this.classes.list)[0];if(!f){throw Error("not found tab list element")}var e=MJL.getElementsByChildNodes(f);var g=e.length;if(g!=this.nitems){throw Error("not equal tab list items ("+this.nitems+") and contents ("+g+")")}for(var i=0;i<g;i++){var d=this._getEventElement(e[i]);var h=this._getIdByHref(d);this.items[h].list=e[i];this.items[h].event=d}}else{f=document.createElement("ul");MJL.addClassName(f,this.classes.list);for(var h in this.items){var b=document.createElement("li");var d=document.createElement("a");d.setAttribute("href","#"+h);f.appendChild(b).appendChild(d).appendChild(this._cloneTitle(h));this.items[h].list=b;this.items[h].event=d}}this.list=f},_getEventElement:function(a){var b=a.getElementsByTagName("a")[0];if(!b){throw Error("not found valid event element")}return b},_setEvents:function(){for(var a in this.items){MJL.event.add(this.items[a].event,"click",this._getEventListener(a),false)}},_getEventListener:function(b){var a=this;return function(){a.active(b);return false}},_createCookie:function(){if(null===this.options.cookie||null!==this._cookie){return}this._cookie=new MJL.Cookie(this._cookieName,this.options.cookie)},_setCookie:function(){if(null===this.options.cookie){return}this._cookie.set(this.id,this._getActiveId())},_getCookie:function(){return((null===this.options.cookie)?"":this._cookie.get(this.id))}};MJL.HeightEqualizer=function(){this.parent=null;this.targets=[];var a=this;this.options={groupBy:0,collect:a._collectDefault,resize:true};this._listeners={resize:null,fontresize:null};this.setOptions.apply(this,arguments)};MJL.HeightEqualizer.prototype={setOptions:function(b,a){if(arguments.length<1){return}this.parent=b;if(null!==a&&"object"==typeof a){for(var c in this.options){if(undefined===a[c]){continue}this.options[c]=a[c]}}},create:function(){this.setOptions.apply(this,arguments);this.targets=this.options.collect.call(this,this.parent);this.set();this._setAutoResize()},set:function(){this.release();var c=this._getHeights();var a=this.targets.length;for(var b=0;b<a;b++){this.targets[b].style.height=c[b]}},release:function(){var a=this.targets.length;for(var b=0;b<a;b++){this.targets[b].style.height=""}},_UNIT:"px",_collectDefault:function(a){return MJL.getElementsByChildNodes(a)},_getHeights:function(e){var c=this.targets.length;var f=new Array(c);for(var d=0;d<c;d++){f[d]=parseInt(MJL.style.getComputed(this.targets[d],"height"))}var b=this.options.groupBy;var a=0;if(b<2||c<=b){a=Math.max.apply(Math,f)+this._UNIT;for(var d=0;d<c;d++){f[d]=a}}else{for(var d=0;d<c;d++){if(0==d%b){a=Math.max.apply(Math,f.slice(d,d+b))+this._UNIT}f[d]=a}}return f},_setAutoResize:function(){if(this.options.resize){var b=this;for(var a in this._listeners){this._listeners[a]=MJL.event.add(window,a,function(){b.set()},false)}}}};MJL.enable={rollover:function(c,b){var a=new MJL.Rollover(c,b);a.create();return a},flash:function(f,c){var a=MJL.getElementsByClassName(document,f);var d=a.length;var b=new Array(d);for(var h=0;h<d;h++){var g=new MJL.Flash(a[h],c);g.create();b.push(g)}return b},window:function(f,c){var a=MJL.getElementsByClassName(document,f);var d=a.length;var b=new Array(d);for(var h=0;h<d;h++){var g=new MJL.Window(a[h],c);g.create();b[h]=g}return b},tab:function(f,c){var a=MJL.getElementsByClassName(document,f);var d=a.length;var b=new Array(d);for(var h=0;h<d;h++){var g=new MJL.Tab(a[h],c);g.create();g.replace();b[h]=g}return b},styleSwitcher:function(f,c){var a=MJL.getElementsByClassName(document,f);var d=a.length;var b=new Array(d);for(var h=0;h<d;h++){var g=new MJL.style.Switcher(a[h],c);g.create();b[h]=g}return b},heightEqualizer:function(f,c){var a=MJL.getElementsByClassName(document,f);var d=a.length;var b=new Array(d);for(var h=0;h<d;h++){var g=new MJL.HeightEqualizer(a[h],c);g.create();b[h]=g}return b}};

MJL.event.add(window, "load", function(event) {
    // MJL に関係するコードはこの中に記述
    MJL.enable.rollover("roll");
}, false);

// MJL と無関係なコードはこの先に記述
