function bookmarksite(title, url){
  if (document.all)
  window.external.AddFavorite(url, title);
  else if (window.sidebar)
  window.sidebar.addPanel(title, url, "")
}

//Popup
/*
Auto center window script- Eric King (http://redrival.com/eak/index.shtml)
Permission granted to Dynamic Drive to feature script in archive
For full source, usage terms, and 100's more DHTML scripts, visit http://dynamicdrive.com
*/

var win = null;
function NewWindow(mypage,myname,w,h,scroll){
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings =
'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'
win = window.open(mypage,myname,settings)
}
//Popup

function showGen(getPage){
  $('body').append('<div id="popup"><!-- --></div>');
  $('#popup').html('<iframe src="'+getPage+'" frameborder="0" width="600" height="450"></iframe>');
	$('#popup').modal({
    overlay:80
  });
}

function printIt(getSlug){
  $.post("print.php",{
    title: $('div#subColA h1').html(),
    content: $('div#subColA div.txt').html(),
    siteName: 'Granero',
    siteURL: 'http://www.granero.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);
  });
}

function showEstado(uf){
  $('div.boxEstado').hide('slow');
  $('div#box'+uf).show('slow',function(){scrollTo(0,600);});
}

jQuery(function($){
  $("input#s").focus(function () {
    $(this).css('background-position','5px -100px');
  });
  $("input#s").blur(function () {
    if($("input#s").val()==''){
      $(this).css('background-position','5px 5px');
    }
  });
});

$(document).ready(function(){
  $('ul.navTelefones,ul.navUnidades').superfish();
  $('div.fundoHeader,dl.menu,a.modalCloseImg').ifixpng();
});
