$(function(){

    $('a[rel~=external]').each(function(){
        $(this).attr('target','_blank');
    });

    $('.email').pMail();

    $('#indices_economicos ul li:even,#twitter ul li:even').addClass('alternate');

    $('#imoveis table.imoveis tr td a').bind('click',function(e){
        specs = {
            width: 800,
            height: 600,
            left: 0,
            top: 0,
            location: 0,
            menubar: 0,
            resizable: 1,
            scrollbars: 1,
            status: 0,
            titlebar: 0,
            toolbar: 0
        };
        center = true;
        if(center){
            specs.left = (screen.width/2)-(specs.width/2);
            specs.top = (screen.height/2)-(specs.height/2);
        }
        var _specs = [];
        $.each(specs,function(k,v){
            _specs.push(k+'='+v);
        });
        _specs = _specs.join(',');
        href = $(this).attr('href')+'/popup:1';
        window.open(href,'_blank',_specs);
        e.preventDefault();
    });

    $.UtilAjax();

});
//ie6 fixes =/
if($.browser.msie && parseInt($.browser.version) < 7){
    //image flickr
    try{
        document.execCommand('BackgroundImageCache', false, true)
    }catch(e){};
    //png
    $(window).load(function(){
        var _ifixpng = [].join(',');
        if($(_ifixpng).length > 0){
            $.addPlugin('ifixpng','ifixpng/ifixpng2');
            $(_ifixpng).ifixpng();
        }
    });
}
