$(document).ready(function() {

  //abre fecha os itens do guia de produtos
  $('.guia_produtos .open').click(function(){
    $('.open').removeClass('on').children('input').attr('checked','');
    $(this).addClass('on').children('input').attr('checked','checked');
  })
  
  //abre em nova janela sem o target=blank
  $('a[rel="external"]').click( function() {
    window.open( $(this).attr('href') );
    return false;
  });
  
  /*
  //abre e fecha o menu, desabilitado
  $("#menuTree").treeview({
		animated: "fast",
		collapsed: true,
		unique: true,
		persist: "cookie",
		toggle: function() {
			window.console && console.log("%o was toggled", this);
		}
	});
  */
  
});

// onchange de select
function goUrl(listObj){
	if(listObj.options[listObj.options.selectedIndex].value != '')
		window.location.href = listObj.options[listObj.options.selectedIndex].value;
}


// abrir popup
function windowOpener(url,width,height,name,scrolls) { 
  browserName = navigator.appName; 
  browserVer = navigator.appVersion.substring(0,1);
  if (scrolls==true) { 
    scrollsOption="yes"; 
  } else { 
    scrollsOption="no"; 
  } 
  var l = ( (window.screen.width - width) / 2 );
  var t = ( (window.screen.height - height) / 2 );
  if (browserName != "Netscape" || browserVer != 2) { 
    controlWindow=window.open( 
    url,name,"toolbar=no,height="+height+",width="+width+",location=no,directories=no,status=no,menubar=no,top="+t+",left="+l+",screenX="+l+",screenY="+t+",scrollbars="+scrollsOption+",resizable=no" 
    ); 
  } 
} 

//windowOpener('arquivo.html',300,200,'pop',false);