// JavaScript Document

function clickme() { window.open("http://www.visualstar.com.br/click.php", "clickme", "width=650, height=550, scrollbars=1, resizable=0"); }

function radio_999fm() {
	
	window.open("http://www.radio99macapa.com/player.php", "player99", "width=359, height=116");
	
	}

 var obj = null;
 
    function checkHover() {
       if (obj) {
          obj.find('ul').fadeOut('fast');
       } //if
    } //checkHover
 
    $(document).ready(function() {
      $('#Nav > li').hover(function() {
         if (obj) {
            obj.find('ul').fadeOut('fast');
            obj = null;
         } //if

         $(this).find('ul').fadeIn('fast');
      }, function() {
         obj = $(this);
         setTimeout(
            "checkHover()",
            300);
      });
   });

function er_grava() {
  erro="0";
  $("#frm_er").block('<img src="img/c1.gif" /><br />Carregando...');
  msg_er=document.envmsg.er_msg.value;
  m_nome=document.envmsg.m_nome.value;
  //msg_er=document.getElementById("er_msg").value;
  //m_nome=document.getElementById("m_nome").value;
 
  //alert(msg_er);
  //alert(m_nome);

  //if (msg_er=='') {
  if ((msg_er==undefined) || (msg_er=='')) {
   alert("Preencha uma mensagem");
   $("#frm_er").unblock();
   erro="1";
  }

  //if (m_nome=='') {
  if ((m_nome==undefined) || (m_nome=='')) {
   alert("Preencha seu nome");
   $("#frm_er").unblock();
   erro="1";
  }
  
  if (erro=="0") {
   $.post("index_mensagens_enviar.php", { mensagem: msg_er, nome: m_nome },
		  function(data){
           if (data=="1") {
			$("#c_er").block;
			$.ajax({
	                type: "GET",
				    url: "index_mensagens_container.php?upd=new",
				    success: function(msg){
				     $("#c_er").html(msg);
					 $("#c_er").unblock;
					 $("#frm_er").unblock();
					 alert('Mensagem enviada com sucesso');
					 $("#recado_envia").hide();
					}
			});
		   }
		  });
 
  }
}

function atv_msg() {
 $("#recado_envia").show();
 //$("a#slink").hide();
} 

function ret_msg() {
 $("#recado_envia").hide("slow");
 //$("a#slink").show();
}

function tocar(id, tipo) {
 window.open('musicas/ouvir.php?id='+id+'&tipo='+tipo,'tocar','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=372,height=350');
}

function imprime(id) {
 window.open('foto_imprimir.php?id='+id, 'imp'+id, 'status=yes,width=520,height=550');
}

function abre_evento(id) {
 window.open('galeria.php?id='+id,'fotos'+id,'status=yes,width=870,height=600');
}

function abre(url, nome, features) { //v2.0
  window.open(url, nome, features);
}

function ls() {
 abre("areavip_lembrasenha.php", "ls", "width=218, height=300, menubar=no");	
}

function addEvent(obj, evt, func) {
  if (obj.attachEvent) {
	return obj.attachEvent(("on"+evt), func);
  } else if (obj.addEventListener) {
	obj.addEventListener(evt, func, true);
	return true;
  }
  return false;
}

function XMLHTTPRequest() {
  try {
	return new XMLHttpRequest(); // FF, Safari, Konqueror, Opera, ...
  } catch(ee) {
	try {
	  return new ActiveXObject("Msxml2.XMLHTTP"); // activeX (IE5.5+/MSXML2+)
	} catch(e) {
	  try {
		return new ActiveXObject("Microsoft.XMLHTTP"); // activeX (IE5+/MSXML1)
	  } catch(E) {
		return false; // doesn't support
	  }
	}
  }
}

    jQuery(document).ready(function($) {
      $('a[rel*=facebox]').facebox() 
    })