$.extend($.expr[':'], { external: function(a,i,m) { if(!a.href) {return false;} return a.hostname && a.hostname !== window.location.hostname; } });

$.fn.center = function (absolute) {
    return this.each(function () {
        var t = $(this);

        t.css({
            position:    absolute ? 'absolute' : 'fixed', 
            left:        '50%', 
            zIndex:      '99'
        }).css({
            marginLeft:    '-' + (t.outerWidth() / 2) + 'px', 
        });

        if (absolute) {
            t.css({
                marginLeft:    parseInt(t.css('marginLeft'), 10) + $(window).scrollLeft()
            });
        }
    });
};

$(function() {
	
	$("html").css({"overflowY": "scroll"});
	$("a:external").attr('target', '_blank');
	$("#sidebar img, .specials-block img").each(function() { var ext = $(this).attr('src').split('.').pop().toLowerCase(); if((ext && /^(jpg|jpeg)$/.test(ext))){ $(this).addClass('img-border'); } });
	
	$(".specials-block img").center(true);

});