$(function(){
    //rollover
    var aArr   = $("a");
    var imgArr = $("img");
    for (var i = 0; i < imgArr.length; i++) {
        if (imgArr[i].getAttribute("src").match("_off.")) {
            imgArr[i].onmouseover = function() {
                $(this).attr("src", this.getAttribute("src").replace("_off.", "_on."));
            }
            imgArr[i].onmouseout = function() {
                $(this).attr("src", this.getAttribute("src").replace("_on.", "_off."));
            } 
        }
    }
    
    //img border
    $('img.border_photo').hover(
        function(){
            $(this).css({'border-color': '#86c6c4'});
        },
        function () {
            $(this).css({'border-color': '#e5ded2'});
        }
    );
    
    //page scroll
    $('a[href^=#]').click(function() {
        var href= this.hash;
        var $target = $(href == '#_top' ? 'body' : href);
        if($target.size()) {
            var top = $target.offset().top;
            $($.browser.safari ? 'body' : 'html').animate({scrollTop:top}, 600, 'swing');
        }
        return false;
    });
});

