/* RollOver */

(function(onLoad) {
    try {
        window.addEventListener('load', onLoad, false);
    } catch (e) {
        window.attachEvent('onload', onLoad);
    }
})(function() {
    var over = function() { this.src = this.src.replace('_off.', '_on.'); };
    var out  = function() { this.src = this.src.replace('_on.', '_off.'); };
    var img = document.getElementsByTagName('img');
    for (var i = 0, l = img.length; i < l; i++) {
        if (!img[i].src.match(/_off\./)) continue;
        img[i].onmouseover = over;
        img[i].onmouseout  = out;
    }
	var input = document.getElementsByTagName('input');
    for (var j = 0, l = input.length; j < l; j++) {
        if (!input[j].src.match(/_off\./)) continue;
        input[j].onmouseover = over;
        input[j].onmouseout  = out;
    }
});


/* tab menu */

jQuery(function () {
    var tabContainers = $('#newsList > dl');
    jQuery('#newsList ul a').click(function () {
        tabContainers.hide().filter(this.hash).show();
        jQuery('#newsList ul a').removeClass('selected');
        jQuery(this).addClass('selected');
        return false;
    }).filter(':first').click();
});


/* TABLE */

jQuery(function(){
  jQuery('table tr:odd').addClass('even');
  jQuery('table tr:even').addClass('odd');
  jQuery('dl:odd').addClass('even');
  jQuery('dl:even').addClass('odd');
	jQuery('dl dt:odd').addClass('even');
  jQuery('dl dt:even').addClass('odd');
  jQuery('dl dd:odd').addClass('even');
  jQuery('dl dd:even').addClass('odd');
});

jQuery(document).ready(function() {
	jQuery("ul li:nth-child(1)")
	  .addClass('first');
	jQuery("ul li:nth-child(2)")
	  .addClass('second');
	jQuery("ul li:nth-child(3)")
	  .addClass('third');
});

jQuery(document).ready(function() {
	jQuery("ol li:nth-child(1)")
	  .addClass('first');
	jQuery("ol li:nth-child(2)")
	  .addClass('second');
	jQuery("ol li:nth-child(3)")
	  .addClass('third');
});

jQuery(document).ready(function() {
	jQuery("#detailBox02 table th:nth-child(1)")
	  .addClass('first');
});

