
$(window).load(function() {	


  //Get all the LI from the #tabMenu UL
  $('li.tabmenu a').click(function(){
        
    //remove the selected class from all LI    
    $('li.tabmenu a').removeClass('selected');
    
    //Reassign the LI
    $(this).addClass('selected');
    
    //Hide all the DIV in .boxBody
    $('.boxBody div.tab').slideUp('1500');
    
    //Look for the right DIV in boxBody according to the Navigation UL index, therefore, the arrangement is very important.
    $($(this).attr("href")).slideDown('1500');
    
  }).mouseover(function() {

    //Add and remove class, Personally I dont think this is the right way to do it, anyone please suggest    
    $(this).addClass('mouseover');
    $(this).removeClass('mouseout');   
    
  }).mouseout(function() {
    
    //Add and remove class
    $(this).addClass('mouseout');
    $(this).removeClass('mouseover');    
    
  });

 $('li.tabmenu2').click(function(){
           
    //remove the selected class from all LI    
    $('li.tabmenu2').removeClass('selected');
    
    //Reassign the LI
    $(this).addClass('selected');
    
    //Hide all the DIV in .boxBody
    $('.boxBody div.tab2').slideUp('1500');
    
    //Look for the right DIV in boxBody according to the Navigation UL index, therefore, the arrangement is very important.
    $('.boxBody div.tab2:eq(' + $('li.tabmenu2').index(this) + ')').slideDown('1500');
    
  });
	
});

jQuery(function($) {
    var postfix = '_on';
    $('img.app').not('[src*="'+ postfix +'."]').each(function() {
        var img = $(this);
        var src = img.attr('src');
        var src_on = src.substr(0, src.lastIndexOf('.'))
                   + postfix
                   + src.substring(src.lastIndexOf('.'));
        $('<img>').attr('src', src_on);
        img.hover(function() {
            img.attr('src', src_on);
        }, function() {
            img.attr('src', src);
        });
    });
});

jQuery(function($) {
  //ddを一旦非表示に    
  $(".acordion > dd").css("display","none");
  //dtをクリックすると以下を実行  
  $(".acordion > dt").click(function(){
    //もしもクリックしたdtの直後のddが非表示なら 
    if($("+dd",this).css("display")=="none"){
         //他のddをスライドアップ 
         $(this).siblings("dd").slideUp("normal");
         //該当のddをスライドダウン 
          $("+dd",this).slideDown("normal");
  //クリックしたdtの直後のddが表示されていればスライドアップ 
  }else{
    $("+dd",this).slideUp("normal");
  }
  });
});

// 画像ロールオーバー
jQuery(function($){
	$("img.rollover").mouseover(function(){
		$(this).attr("src",$(this).attr("src").replace(/^(.+)(\.[a-z]+)$/, "$1_on$2"));
	}).mouseout(function(){
		$(this).attr("src",$(this).attr("src").replace(/^(.+)_on(\.[a-z]+)$/, "$1$2"));
	});
});
