/**
 * @fileOverview *************************
 * @version 0.0.1
 */
/* ----------------------------------------------------------------------------------- */


/**
 * @namespace 
 */
var CBLIB = {};




/* ----------------------------------------------------------------------------------- */
/**
 * heading-02-03用
 */
$(function() {

      $('div.toggle_container').hide();

      $('h1 > small > a').click(function() {
        $('h3.trigger').removeClass().addClass('trigger ' + $(this).text());
        return false;
      });

      $('h3.trigger').click(function() {
        var $this = $(this);
        if ($this.hasClass('active')) {
          $this.removeClass('active');
        }
        else {
          $this.addClass('active');
        }
        //$this.next('.toggle_container').slideToggle(5000);
        $this.next('.toggle_container').slideToggle('slow');
      });

    });
$(function() {

      $('p.close-btn').click(function() {
        $('h3.trigger').removeClass().addClass('trigger');
        return false;
      });


      $('p.close-btn').click(function() {
        var $this = $(this);
        if ($this.hasClass('active')) {
          $this.removeClass('active');
        }
        else {
          $this.addClass('active');
        }
        //$this.next('.toggle_container').slideToggle(5000);
        $this.parent('.toggle_container').slideToggle('slow');
      });

    });


/* ----------------------------------------------------------------------------------- */
$(function() {

	/* for IE6 background image flicker */
	if (jQuery.browser.msie && jQuery.browser.version == 6) {
		try {
			document.execCommand("BackgroundImageCache", false, true);
		} catch(err) {}
	}

	/* Setup RolloverImages */
	var roi = new RolloverImages('rollover', 'on');

	/* Setup CBLIB  */
	for (module in CBLIB) {
		var obj = CBLIB[module];
		if (obj && typeof obj == "function") {
			new CBLIB[module]();
		}
	}

});





/*---------------------------------------------------------------------------*/
/**
 * @version  0.0.1_2009-06-29
 * @requires jquery.js
 * @requires styleswitcher.js
 * @requires rollover.js
 */
/*
FONTSIZE_SELECTOR_ENABLED = true;
FONTSIZE_SELECTOR         = null;


if (FONTSIZE_SELECTOR_ENABLED) {

	$(function() {
		var config = {
			className      : "fontsize",
			blockId        : "fontsize-selector",
			buttonsSetting : {
					"default" : {
								styleId       : "fontsize-default",
								buttonId      : "fontsize-btn-default",
								title         : "文字サイズを「標準」に変更します",
								titleSelected : "現在選択中の文字サイズは「標準」です"
					},
					"large" : {
								styleId       : "fontsize-large",
								buttonId      : "fontsize-btn-large",
								title         : "文字サイズを「大」に変更します",
								titleSelected : "現在選択中の文字サイズは「大」です"
					}
			}
			,rollover : new RolloverImages("rollover-fsbutton", "on", "on")
		};

		FONTSIZE_SELECTOR = new FontSizeSelector(config);
	});

	// 
	document.write(''
	+ '<style  type="text/css" media="screen,print">'
	+ '#fontsize-selector {display: block !important;}'
	+ '</style>');
}
*/
/* -----------------------------------------------------------------------*/
// addClass
/* -----------------------------------------------------------------------*/
function addClass(element,value) {
	if(!element.className) {
		element.className = value;
	} else {
		newClassName = element.className;
		newClassName += ' ';
		newClassName += value;
		element.className = newClassName;
	}
}

/* -----------------------------------------------------------------------*/
// addLoadEvent
/* -----------------------------------------------------------------------*/
function addLoadEvent(func) {
	var oldonload = window.onload;
	if(typeof window.onload != 'function') {
		window.onload = func;
	} else {
		window.onload = function() {
			oldonload();
			func();
		}
	}
}




