// jquery config

/*-- pagetop --*/

jQuery(function(){
    jQuery('a.pageTop').click(function(){
        jQuery('#wrapper').ScrollTo(1000, 'easeout');
        return false;
    });
    
    jQuery('a.to_music').click(function(){
        jQuery('#music').ScrollTo(1000, 'easeout');
        return false;
    });
    
    jQuery('a.to_gallery').click(function(){
        jQuery('#gallery').ScrollTo(1000, 'easeout');
        return false;
    });
    
    jQuery('a.to_tools_of_creative').click(function(){
        jQuery('#tools_of_creative').ScrollTo(1000, 'easeout');
        return false;
    });
    
    jQuery("img.image_fade").load(function(){
        jQuery(this).fadeTo(500, 1.0);
    });
    jQuery("img.image_fade").hover(
    function(){
        jQuery(this).fadeTo(500, 0.9);
    },
    function(){
        jQuery(this).fadeTo(500, 1.0);
    });
    
    jQuery("img.image_fade2").load(function(){
        jQuery(this).fadeTo(500, 1.0);
    });
    jQuery("img.image_fade2").hover(
    function(){
        jQuery(this).fadeTo(500, 0.8);
    },
    function(){
        jQuery(this).fadeTo(500, 1.0);
    });
});

jQuery(function(){
    //rollover
    var aArr   = jQuery("a");
    var imgArr = jQuery("img");
    for (var i = 0; i < imgArr.length; i++) {
        if (imgArr[i].getAttribute("src") != null) {
            if (imgArr[i].getAttribute("src").match("_off.")) {
                imgArr[i].onmouseover = function() {
                    jQuery(this).stop().attr("src", this.getAttribute("src").replace("_off.", "_on."));
                }
                imgArr[i].onmouseout = function() {
                    jQuery(this).stop().attr("src", this.getAttribute("src").replace("_on.", "_off."));
                } 
            }
        }
    }
});
