//AJAX
function openAjaxXx() {
var AjaxXx;
try {AjaxXx = new XMLHttpRequest(); // XMLHttpRequest para browsers mais populares, como: Firefox, Safari, dentre outros.
}catch(ee){
try {AjaxXx = new ActiveXObject("Msxml2.XMLHTTP"); // Para o IE da MS
}catch(e){
try {AjaxXx = new ActiveXObject("Microsoft.XMLHTTP"); // Para o IE da MS
}catch(e){AjaxXx = false;}
}
}
return AjaxXx;
}

//Seleciona GO (Ir)
function SelGo(id, pagina){
	if(id != ""){
		window.open('?p='+pagina+'&nome='+id, '_parent');
	}
}

//Abre Rádio
function AbreRadio(){
    window.open('radio.php','','resizable=0,Menubar=no,toolbar=no,scrollbars=0,status=0,top=0,left=0,screenX='+window.screenLeft+',screenY='+window.screenTop+',width=468,height=225');
}

//ABRIR JANELA
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

//SHOW
function show(id){
  caixa = document.getElementById(id);
  caixa.style.display = "";
}
//HIDE
function hide(id){
caixa = document.getElementById(id);
caixa.style.display = "none";
}

//Excluir
function Excluir(id, bd, pasta, img, pagina){
  if (confirm("Confirma a exclusão? (Isso será um ato irreversível!)")){
    window.location="_php/Excluir.php?Id="+id+"&Bd="+bd+"&Pasta="+pasta+"&Img="+img+"&Pagina="+pagina;
  }
}

//LIMPA CAMPO
function limparCampo(id, cont){
  var campo = document.getElementById(id);
  if (campo.value == cont){
  campo.value = '';
  }else if(campo.value == ''){
  campo.value = cont;
  }
}

//Escreve o Flash
function flash(largura, altura, arquivo){
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+largura+'" height="'+altura+'" id="teste" align="middle">');
	document.write('<param name="allowScriptAccess" value="sameDomain" />');
	//document.write('<param name="allowScriptAccess" value="sameDomain" />');
	document.write('<param name="movie" value="'+arquivo+'" /><param name="quality" value="best" /><embed src="'+arquivo+'" quality="best" width="'+largura+'" height="'+altura+'" name="teste" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
	document.write('</object>');
}
