// global javascript

$(function() {
    $(".btn-img")  
        .mouseover(function () {  
            this.src = this.src.replace(/^(.+)(\.[a-z]+)$/, "$1_over$2");  
        })  
        .mouseout(function () {  
            this.src = this.src.replace(/^(.+)_over(\.[a-z]+)$/, "$1$2");  
        })  
        .each(function () {  
            this.preloaded = new Image;  
            this.preloaded.src = this.src.replace(/^(.+)(\.[a-z]+)$/, "$1_over$2");  
    });
    
    $('#loading-box').html('<img src="../img_main/loading_circle.gif" alt="ロード中…" title="ロード中…" width="46" height="46" />');
    
    $('a.pagetop').click(function() {
       $(this).blur();
       $('html,body').animate({scrollTop: 0}, 1000, 'quad');
       return false;
    });
    
    var marquee_opt = { yScroll: "bottom", showSpeed: 1200, scrollSpeed: 30, pauseSpeed: 800 };
    
    $('.marquee').marquee( marquee_opt );
    
    $('#img-v02').hide();
    $('#img-v03').hide();
    
});

jQuery.easing.quad = function (x, t, b, c, d) {
    return -c * ((t=t/d-1)*t*t*t - 1) + b;
};

function pickUp(id_str) {
	$('#'+id_str+' td').addClass('mouseOver');
	$('#'+id_str+' th').addClass('mouseOver');
	
	if (info[id_str]) {
		$('#st-title').html(info[id_str].title);
		$('#st-info').html(info[id_str].info);
		$('#st-desc').html(info[id_str].desc);
		
		$('#st-title-tp').html(info[id_str].title);
		$('#st-info-tp').html(info[id_str].info);
		$('#st-desc-tp').html(info[id_str].desc);
	} else {
		alert( "no found:"+id_str );
	}
}

function throwAway(id_str) {
	$('#'+id_str+' td').removeClass('mouseOver');
	$('#'+id_str+' th').removeClass('mouseOver');
	
	$('#st-title').html();
	$('#st-info').html();
	$('#st-desc').html();
}
