function bookmarksite(object){
  if(document.all){
    window.external.AddFavorite(object.href , object.title);
    return false;
  }
   return true;
}

function printIt(getSlug){
    var getTitle = $('#A h1').html();
    $.post("print.php",{
        title: getTitle,
        content: $('#A .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(){
    $('a[rel=external]').attr('target','_blank');
  //$('ul.comp_list li:odd').addClass('odd');

  //add last em multilivros e clearfull para não encavalar
     if($('.multiLivros.cinco').size())
        $(".multiLivros.cinco a:nth-child(5n), .multiLivros a:last").addClass("last").after('<span class=\"clearFull div10\" style="width: 100%"><!-- --><\/span>');
     if($('.multiLivros.tres').size())
        $(".multiLivros.tres a:nth-child(3n), .multiLivros a:last").addClass("last").after('<span class=\"clearFull div10\" style="width: 100%"><!-- --><\/span>');
     else
        $(".multiLivros a:nth-child(4n), .multiLivros a:last").addClass("last").after('<span class=\"clearFull div10\" style="width: 100%"><!-- --><\/span>');
   
  // tirar valor padrão de forms
  $('input[type=text], textarea').focus(function(){
    if(this.defaultValue == $(this).val())  $(this).val('');
  }).blur(function(){
    if(!$(this).val().length) $(this).val(this.defaultValue);
  });
  // tirar borda tabela e alterbar cor
  $(".txt table tr th:last, .txt table tr td:last").css("border-right", 0);
  $(".txt table tr:odd td").css("background-color", "#F2F0C9");

  $('h4+p, h3+p').css({'margin-top': 0, 'padding-top' : 0})

/* mostrar submenu
    try{
    var selMenu = null;
  $('.listModel1 > li').hover(function(){
    if($(selMenu).index(this)<0)
        $('.subMenu').hide('slow');
    var selMenu = $(this);
    var childrenTitle = selMenu.children('a').children('em').html();
    var children = $('ul[title='+childrenTitle+']');
    children.css({'display':'block','top': $(this).position().top+'px'});
    setTimeout(
        function(){
            if($(selMenu)!==$(this)){
            children.hide('slow');
            }
        },
        20000
   );
  });
 }catch(e){}
*/
    try{
    var selMenu = null;
    var checkhover = true;
  $('.box_catalogo .listModel1 > li').hover(function(){
 
    childrenTitle = '';
    childrenTitle = $(this).children('a').children('em').html();
    var children = $("ul[title='"+childrenTitle+"']");
    
    if($(selMenu).index(this)<0)
        $('.subMenu').css('display','none');
        $("ul[title='"+childrenTitle+"']").css({'top': $(this).position().top+'px','display': 'block'});
   
    
    var selMenu = $(this);
    
     $(".box_catalogo .listModel1 li, ul[title='"+childrenTitle+"'] , ul[title='"+childrenTitle+"'] *").mouseover(function(){
        checkhover = true;
    }).mouseout(function(){
        checkhover = false;
    }).mousemove(function(e){
        window.setTimeout(function(){
          if(checkhover)
            $("ul[title='"+childrenTitle+"']").css({'top': selMenu.position().top+'px','display': 'block'});
          else
            $("ul[title='"+childrenTitle+"']").css('display','none');
        }, 100);
    });
    
  });
  
 }catch(e){} 
});

function fScr(theURL) {
  params  = 'width='+screen.width;
  params += ', height='+screen.height;
  params += ', top=0, left=0'
  params += ', fullscreen=yes';
  params += ', scrollbars=auto';

  window.open(document.getElementsByTagName('base')[0].href+theURL, '', params);
}
