/*------------------------------------------------------------------------------------------------
creation date 2009.9.25
http://money.sevenbank.co.jp/
Copyright (C) Seven Bank,Ltd. All Rights Reserved.
------------------------------------------------------------------------------------------------*/
$(function() {
/*------------------------------
slide toggle
------------------------------*/
		$("dl.toggle dd.contents").hide();
		$("dl.simulation dd.contents").show();
		if(($("body").hasClass("security"))&&($("dl").hasClass("market"))){
		$("dl.market dd.contents").show();
		$("dl.market > dt").toggleClass("up");
		}
		
		$("dl.toggle > dt").click(function(){			
				$(this).next().slideToggle('fast');
				$(this).toggleClass("up");
		return false;
		});

/*------------------------------
roll over
------------------------------*/
    $.fn.rollover = function(postfix) {
        postfix = postfix || '_on';
        return this.not('[src*="'+ postfix +'."]').each(function() {
            var img = $(this);
            var src = img.attr('src');
            var src_on = [
                src.substr(0, src.lastIndexOf('.')),
                src.substring(src.lastIndexOf('.'))
            ].join(postfix);
            $('<img>').attr('src', src_on);
            img.hover(
                function() {
                    img.attr('src', src_on);
                },
                function() {
                    img.attr('src', src);
                }
            );
        });
    };
	$('img.on').rollover();

/*------------------------------
:last-child
------------------------------*/
var lastchild = [
		"div#main_contents p:last-child",
		"div#main_contents ul li:last-child",
		"div#main_contents ol li:last-child",
		"div#main_contents dl dd:last-child"
		];

for(i=0; i<lastchild.length; i++){
$($(lastchild)[i]).addClass('lastChild'); 
}

/*------------------------------
:first-child
------------------------------*/
var firstchild = [
		"div#main_contents p:first-child",
		"div#main_contents ul li:first-child",
		"div#main_contents ol li:first-child",
		"div#main_contents dl dt:first-child",
		"div#main_contents dl dd:first-child"
		];

for(i=0; i<firstchild.length; i++){
$($(firstchild)[i]).addClass('firstChild'); 
}



});
