var errorLog = '';
function bookmarksite(object){
  if(document.all){
    window.external.AddFavorite(object.href , object.title);
    return false;
  }
   return true;
}

function printIt(getSlug){
    var getTitle = $('#B h1').html();
    $.post("print.php",{
        title: getTitle,
        content: $('#B .txt').html(),
        siteName: 'JWorld - Animes, Mangás e Presentes',
        siteURL: 'http://www.jworld.com.br',
        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);
    });
}

$(document).ready(function(){
  try{
    $('#flashHome').cycle({fx: 'fade',timeout: 7000, speed:  1000});
  }
  catch(e){
    errorLog = e.code;
  }
  $('#parametros').focus(function(){ $(this).css('background-position','81px -30px'); });
  $('#parametros').blur( function(){ if( $(this).val().length == 0 ) $(this).css('background-position','81px 4px'); });
  
  $('div.item:has(a.clique_aqui)').click(function(){
    var index = $('div.item:has(a.clique_aqui)').index(this);
    var getLink = $('a.clique_aqui:eq('+index+')').attr('href');
    window.location.href=getLink;
  });

  $('div.multipleBoxes h3').click(function (e) {
    var index = $('div.multipleBoxes h3').index(this);
    var getBox = 'div.multipleBoxes:eq('+index+') div';
    if($(getBox).css('display') == 'none'){ 
      $(getBox).show('slow');
    } else {
      $(getBox).hide('slow');
    }
  });

});


function ajustarLayout(){
  if( $(window).height() > $("#master").height() )
      $("#A").css({'height':( $(window).height()-184)+ 'px'});
} 

$(window).resize(function(){
  ajustarLayout();
}).load(function(){ //pega objeto window
  ajustarLayout();
});

