jQuery.extend({dimScreen:function(b,a,d){if(jQuery("#__dimScreen").size()>0){return}if(typeof b=="function"){d=b;b=null}if(typeof a=="function"){d=a;a=null}if(b<1){var c=a;a=b;b=c}if(a>=1){var c=b;b=a;a=c}b=(b>0)?b:500;a=(a>0)?a:0.5;return jQuery("<div></div>").attr({id:"__dimScreen",fade_opacity:a,speed:b}).css({background:"#000",height:$(document).height()+"px",left:"0px",opacity:0,position:"absolute",top:"0px",width:$(document).width()+"px",zIndex:999}).appendTo(document.body).fadeTo(b,0.7,d)},dimScreenStop:function(d){var a=jQuery("#__dimScreen");var b=a.attr("fade_opacity");var c=a.attr("speed");a.fadeOut(c,function(){a.remove();if(typeof d=="function"){d()}})}});
jQuery.extend({showAkModal:function(f,g,h,a,b){var c={};var k={margin:1,border:1,padding:1,scroll:0};var d=$(window).width();var e=$(window).scrollLeft();var i=$(window).height();var j=$(window).scrollTop();$("body").append("<div id='ak_modal_div' ><div class='ak_modal_title'><b>"+g+"</b><img src='images/cross.gif' id='ak_close' style='position:absolute;cursor:pointer;right: 0;'></div><iframe width='"+h+"' height='"+a+"'  frameborder=0 marginwidth='0' marginheight='0' scrolling='auto'  name='frmTest' src='"+f+"'></iframe></div>");$("#ak_modal_div").css({left:(((d/2-h/2))+e)+"px",top:(((i/2-a/2))+j)+"px"});$("#ak_close").click(function(){$("#ak_modal_div").fadeOut(500);$("#ak_modal_div").remove();$.dimScreenStop()});$.dimScreen(500,0.7,function(){$("#ak_modal_div").fadeIn(500)});var c={};c=$("#ak_modal_div").offset({scroll:false});X_left=c.left+h-16;X_top=c.top},akModalRemove:function(){$("#ak_modal_div").fadeOut(500);$.dimScreenStop()},akModalHideAndRedirect:function(a){$("#ak_modal_div").fadeOut(500);$.dimScreenStop();window.location=a}});
$.FontSizer={level:12,options:{min:4,max:36},Init:function(options){if(options){$.FontSizer.options=$.extend($.FontSizer.options,options)}$.FontSizer.SetSize(level)},IncreaseSize:function(){if(($.FontSizer.level)+8<=$.FontSizer.options.max){var next=(parseInt($.FontSizer.level)+2);$.FontSizer.SetSize(next)}},DecreaseSize:function(){if(($.FontSizer.level-8)>=$.FontSizer.options.min){var next=(parseInt($.FontSizer.level)-2);$.FontSizer.SetSize(next)}},SetSize:function(level){$.FontSizer.level=level;$("div.txt *").css("font-size",level+"px");$("div.txt *").css("line-height","150%")},Reset:function(){$.FontSizer.SetSize(12)}};
function printIt(getSlug){
    var getTitle = $('h1').html();
    $.post("print.php",{
        title: getTitle,
        remover_classes: $('.txt *').removeClass(),
        remover_extranav: $('.txt #extraNav').remove(),
        content: $('.txt').html(),
        siteName: 'Pedro Bandeira',
        siteURL: 'http://localhost',
        slug: getSlug
    },function(html){
        $('body *').css('display','none');
        $('body').css('background','transparent none');
        $('body').append('<div id="print"><!-- --></div>');
        $('#print').css('display','block');
        $('#print').html(html);
    });
}
var errorLog="";
function bookmarksite(object){
  if(document.all){
    window.external.AddFavorite(object.href , object.title);
    return false;
  }
   return true;
}
$(function(){
    $('a[rel=external]').attr('target','_blank');
    if(!jQuery.support.htmlSerialize)
        $('a[rel=sidebar]').click(function(){ bookmarksite(this); });
    $('a[rel=suggest]').click(function(){$.showAkModal(this.href,this.title,650,450);return false;});
   // $('a[rel=print]').click(function(){ printIt(location.pathname);return false; });
    if($('.boxSlidesShow').size())
        $('.boxSlidesShow')
        .append("<div class=\"boxSlidesShow_page\"></div>")
        .children('.boxSlidesShow_content')
        .cycle({
            fx: 'fade',
            pager: '.boxSlidesShow_page'
        });
});

$(window).load(function(){
    if((location.href).search("version=print")!=-1)
        $('a[rel=print]').click();
});
