// Bloqueia a copia da matéria
function copyright ()
{
	var dt = new Date()
	
	alert('Caro usuário, não é possível copiar este conteúdo.\nCaso seja de seu interesse, lembramos que você pode enviar qualquer matéria do Ambiente Vital por e-mail quantas vezes desejar: Basta clicar no link que fica no cabeçalho dos textos.\nPara qualquer outro tipo de transmissão, é necessária autorização prévia. Sendo este o caso, entre em contato conosco. Obrigado');
	event.returnValue=false;
}

	var message = "Caro usuário, não é possível copiar este conteúdo.\nCaso seja de seu interesse, lembramos que você pode enviar qualquer matéria do Ambiente Vital por e-mail quantas vezes desejar: Basta clicar no link que fica no cabeçalho dos textos.\nPara qualquer outro tipo de transmissão, é necessária autorização prévia. Sendo este o caso, entre em contato conosco. Obrigado";

document.onkeypress = function (evt) {
  var r = '';
  var ctrl = 0;
  
  if (document.getElementById && (!document.all)) {
    ctrl = evt.ctrlKey;
    r = String.fromCharCode(evt.which).toUpperCase();
  }
  else if (document.layers) {
    ctrl = Event.CONTROL_MASK;
    r = String.fromCharCode(evt.which).toUpperCase();
  }
  
  if (ctrl){
  	if (r=='A'||r=='C'){
		alert(message);
		return false;
		}
	}
}


// Aumenta a fonte
var tam=12;
function mudaFonte(tipo)
{

	if (tipo=="mais"){
		tam+=3;
	}else{
		tam-=3;
	}
	if (tam >= 12 )
	{
		document.getElementById('tx').style.fontSize=tam;
		document.getElementById('tx1').style.fontSize=tam;
		document.getElementById('tx2').style.fontSize=tam;

	}else
	  tam = 12;
}

// Left trim method: strltrim
function strltrim()
{
//Match spaces at beginning of text and replace with a null string
return this.replace(/^\s+/,'');
}
  

// Right trim method: strrtrim
function strrtrim()
{
//Match spaces at end of text and replace with a null string
return this.replace(/\s+$/,'');
}

//Trim method: strtrim

function strtrim()
{
//Match spaces at beginning and end of text and replace
//with null strings
return this.replace(/^\s+/,'').replace(/\s+$/,'');
}
String.prototype.ltrim = strltrim;
String.prototype.rtrim = strrtrim;
String.prototype.trim  = strtrim;

// Manejo de Ventanas

function CloseWindow()
{
    close();
}

function OpenProcura( Page)
{

pop_up = window.open(Page,'','location=no,scrollbars=yes,resizable=no,height=5,width=5,top=0,left=0');

}

function OpenWindow( Page, Winheight, Winwidth )
{

var hauteur_popup = Winheight;
var H = (screen.availHeight - hauteur_popup) / 2;
var largeur_popup = Winwidth;
var L = (screen.availWidth - largeur_popup) / 2;

pop_up = window.open(Page,'','location=no,scrollbars=yes,resizable=no,height=' + hauteur_popup + ',width=' + largeur_popup + ',top=' + H + ',left=' + L);
pop_up.focus();

}

function OpenWindowEx( Page, Winheight, Winwidth, top, left )
{

var hauteur_popup = Winheight;
var H = top;
var largeur_popup = Winwidth;
var L = left;

pop_up = window.open(Page,'','location=no,scrollbars=yes,resizable=no,height=' + hauteur_popup + ',width=' + largeur_popup + ',top=' + H + ',left=' + L);
pop_up.focus();

}

function OpenWindowNotScroll( Page, Winheight, Winwidth )
{

var hauteur_popup = Winheight;
var H = (screen.availHeight - hauteur_popup) / 2;
var largeur_popup = Winwidth;
var L = (screen.availWidth - largeur_popup) / 2;

pop_up = window.open(Page,'','location=no,scrollbars=no,resizable=no,height=' + hauteur_popup + ',width=' + largeur_popup + ',top=' + H + ',left=' + L);
pop_up.focus();

}

// Voltamos uma pagina para atras
function Volver()
{
    history.go(-1);
}

