//Chama flash no site (correção do IE)
function exibeFash(swf, width, height, wmode, cache){
noCache = cache || cache == undefined ? "" : "?" + new Date();
wmode = wmode || wmode == undefined ? "opaque" : "transparent";

monta_swf = "";
monta_swf += "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0\" width=\""+ width +"\" height=\""+ height +"\" title=\"\">";
monta_swf += "<param name=\"movie\" value=\""+ swf + noCache +"\" />";
monta_swf += "<param name=\"quality\" value=\"high\" />";
monta_swf += "<param name=\"menu\" value=\"0\" />";
monta_swf += "<param name=\"wmode\" value=\""+ wmode +"\" />";
monta_swf += "<embed src=\""+ swf + noCache +"\" quality=\"high\" wmode=\""+ wmode +"\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" width=\""+ width +"\" height=\""+ height +"\"></embed>";
monta_swf += "</object>";

document.write(monta_swf);
}

function confirmaExclusao(aURL) {
	if(confirm('Você tem certeza que deseja excluir?')) {
	location.href = aURL;
	}
}

// FUNCAO SELEIONA TODOS REGISTROS PRA EXCLUIR
cont321 = 0;
function SelectAll() { 
	for (var i=0; i<document.FORMLISTA.elements.length; i++){
	var x = document.FORMLISTA.elements[i];
    	if (x.id == 'check_sel') { 
	   		if (cont321 == 0){
	       	x.checked = true;
		   	} else {
        	x.checked = false;
			}
		} 
	}

	if (cont321 == 0){    
	var elem = document.getElementById("sel_todos");
	elem.value = "Desmarcar todos";
	cont321 = 1;
	} else {
	var elem = document.getElementById("sel_todos");
	elem.value = "Selecionar todos";
	cont321 = 0;
	}	  
}
function Enviar(URL) {
  var width = 504; 
  var height = 273;
  var left = 50;
  var top = 10
  window.open(URL, 'Enviar', 'width='+width+', height='+height+', top='+top+', left='+left+', scrollbars=no, status=no, toolbar=no, location=no, directories=no, menubar=no, resizable=no, fullscreen=no');
}

// FUNCAO SELEIONA TODOS REGISTROS PRA EXCLUIR
function checkdeletetion(){
   if (!confirm("Você realmente deseja deletar este registro.") == false )
   FORMLISTA.submit();
}

// FUNCAO DE IMPRIMIR
function Imprimir(URL) {
  var width = 650;
  var height = 500;
  var left = 50;
  var top = 10
  window.open(URL, 'imprimir', 'width='+width+', height='+height+', top='+top+', left='+left+', scrollbars=yes, status=no, toolbar=no, location=no, directories=no, menubar=no, resizable=no, fullscreen=no');
}

function ValidaEmail(email) {
	return email.search(/(\w[\w[\w\.\+]+)@(.+)\.(\w+)$/)==0; 
}

function gE(ID) {
	return document.getElementById(ID);
}

function gEs(tag) {
	return document.getElementsByTagName(tag);
}


// FUNCAO AUMENTA E DIMINUI FONTE DAS NOTICIAS
function aumentar(campo){
fontSize += 5;
gE(campo).style.fontSize = fontSize + "px";
}
  
function diminuir(campo){
fontSize -= 5;
gE(campo).style.fontSize = fontSize + "px";
}