jQuery.extend( jQuery.easing,
{
    def: 'easeOutExpo',
    easeInExpo: function (x, t, b, c, d) {
        return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;
    },
    easeOutExpo: function (x, t, b, c, d) {
        return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
    },
    easeInOutExpo: function (x, t, b, c, d) {
        if (t==0) return b;
        if (t==d) return b+c;
        if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
        return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
    }
});

$.fn._hover = function () {
	$(this).hover(
		function(){ $(this).stop(); $(this).animate({ opacity: 0.7}, 300 ); },
		function(){ $(this).stop(); $(this).animate({ opacity: 1}, 300 ); }
	);
};
$.extend({
    _ScrollPage: function (){
        var _url  = location.href.split('#')[0];
        var _hash = location.hash;
        $('a', 'body').each(function() {
            if (this.href.indexOf(_url + '#') == 0) {
                var _id = this.href.split('#')[1];
                $(this).click(function(){
                        var _top = $('#' + _id).offset().top;
                        $($.browser.safari?'body':'html').animate({scrollTop:_top-20},1500,'easeInOutExpo');
                });

                if(!($.browser.msie && $.browser.version==6))
                    $(this).removeAttr('href');

                $(this).css('cursor','pointer');
            }

        });
        if(_hash != ('undefined'|''|null)){
            var _target = $(_hash);
            if(_target.length){
                var _top = _target.offset().top;
                $($.browser.safari?'body':'html').animate({scrollTop:_top-20},1500,'easeInOutExpo');
            }
        }
    }
});
function init(){
    $($.browser.safari?'body':'html').scrollTop(0);
    $("img.hover")._hover();
}

function comp(){
    $._ScrollPage();
}
$(init);
$(window).load(comp);
