$(function(){
    $("img.roi").mouseover(function(){
        $(this).attr("src",$(this).attr("src").replace(/^(.+)(\.[a-z]+)$/, "$1_o$2"))
    }).mouseout(function(){
        $(this).attr("src",$(this).attr("src").replace(/^(.+)_o(\.[a-z]+)$/, "$1$2"));
    }).each(function(){
        $("<img>").attr("src",$(this).attr("src").replace(/^(.+)(\.[a-z]+)$/, "$1_o$2"))
    })
})

$(function(){
    $(".popup").click(function(){
        window.open(this.href,"\u65b0\u4f5c\u60c5\u5831","width=600,height=500,resizable=no,scrollbars=no");
        return false;
    });
    $("#print a").click(function(){
        window.open(this.href,"","width=800,height=600,resizable=yes,scrollbars=yes");
        return false;
    });
    /*
        $("#sitemap").treeview({
            collapsed: false,
            animated: "medium",
            control:"#sidetreecontrol",
            persist: "location"
        });
    */
    $('#lbox a').lightBox();
    $('.lbox a').lightBox();
});

jQuery.easing.quart = function (x, t, b, c, d) { return -c * ((t=t/d-1)*t*t*t - 1) + b; };

jQuery(document).ready(function(){
    jQuery('a[href*=#]').click(function() {
        if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
            var $target = jQuery(this.hash);
            $target = $target.length && $target || jQuery('[name=' + this.hash.slice(1) +']');
            if ($target.length) {
                var targetOffset = $target.offset().top;
                jQuery('html,body').animate({ scrollTop: targetOffset }, 1200, 'quart');
                return false;
            }
        }
    });
});




