// Utilizado em conjunto com a CSS destaque.css, ids oculta e framePop
function fecha()
{
document.getElementById("oculta").style.display="none"; 
}
// destaque.css FIM

function permite_num(input)
{
	if ((event.keyCode<48)||(event.keyCode>57))	
	{
		event.returnValue = false;
	}
		else 
		{
			input.value=input.value;
		}
}

function filme(url)
{
window.open (url,'video','toolbar=no,location=no,directories=no,status=yes,scrollbars=no,resizable=no,width=330,height=315,top=100,left=235');
}

function metacafe(url)
{
window.open (url,'videoext','toolbar=no,location=no,directories=no,status=yes,scrollbars=no,resizable=no,width=400,height=345,top=100,left=235');
}

function detalhe(url)
{
window.open (url,'detalhado','toolbar=yes,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,width=650,height=480,top=10,left=10');
}

function confirmaRemocao()
{
	var resposta = confirm('Confirma remoção?');
	if(!resposta)
	{
  	window.alert('Remoção cancelada.');
		return (false);
	}
	else
	{
		return (true);
	}
}

//FUNÇÃO PARA EXIBIR UMA IMAGEM NUMA POPUP CENTRALIZADA E EM SEU TAMANHO NATURAL
//E SE PASSAR DE 800X600 GERA SCROLLBARS
function openImg(img_url,title){
	document.MyImg = new Image();
	document.MyImg.onload = function(){
		var img = document.MyImg.src;
		var w = document.MyImg.width, h = document.MyImg.height;
		var s = (h > 525 || w > 700) ? ",scrollbars,resizable" : "";
		w = (w > 700) ? 700 : w; h = (h > 525) ? 525 : h; if(title) h += 40;
		var x = (window.screen.availWidth - w) / 2, y = (window.screen.availHeight - h) / 2;
		var win = window.open("","imagens","left="+x+",top="+y+",width="+w+",height="+h+s);
	    win.document.open();
	    win.document.write("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n<html>\n<head>\n<title>CTTE - "+title+"</title>\n</head>\n");
			win.document.write("<body style=\"background-color: #9aadc7; margin:0px;\">\n<div style=\"text-align: center\">\n");
		if(title)win.document.write("<p style=\"font: bold 8pt arial; color: #073476;\">\n"+title+"");
	    win.document.write("\n<a href=\"javascript:window.close()\"><img src=\""+img+"\" border=\"0\" alt=\"\" title=\"Fechar janela\"></a>\n");
	    win.document.write("&copy; Centro de Treinamento de Técnicas e Táticas Especiais - RS</p>\n</div>\n</body>\n</html>\n");
	    win.document.close();
	}
	document.MyImg.src = img_url;
}

//OBTEM AS DIMENSÕES DA IMAGEM E AS ATRIBUI AO value DO obj_param
function getImgSize(obj_img,obj_param){
	document.NewImg = new Image();
	document.NewImg.onload = function(){
		obj_param.value = document.NewImg.width+"|";
		obj_param.value += document.NewImg.height;
	};
	document.NewImg.src = obj_img.value;
}


