// ---------------------------------------------------------------------------------------------------------------------- CAMPO INPUT
function clickField(f,v) {
  if (f.value == v) { f.value = ""; return; }
  if (f.value == "") f.value = v; }
function logaWM(f) { f.submit(); f.reset(); f.reset(); return false;}
	
// ---------------------------------------------------------------------------------------------------------------------- CSS BROWSER SELECTOR 
var css_browser_selector = function() {
	var 
		ua=navigator.userAgent.toLowerCase(),
		is=function(t){ return ua.indexOf(t) != -1; },
		h=document.getElementsByTagName('html')[0],
		b=(!(/opera|webtv/i.test(ua))&&/msie (\d)/.test(ua))?('ie ie'+RegExp.$1):is('gecko/')? 'gecko':is('opera/9')?'opera opera9':/opera (\d)/.test(ua)?'opera opera'+RegExp.$1:is('konqueror')?'konqueror':is('applewebkit/')?'webkit safari':is('mozilla/')?'gecko':'',
		os=(is('x11')||is('linux'))?' linux':is('mac')?' mac':is('win')?' win':'';
	var c=b+os+' js';
	h.className += h.className?' '+c:c;
}();

// ---------------------------------------------------------------------------------------------------------------------- MUDA CSS
function MudaCor(A,B) {
document.body.style.backgroundImage = "url(css/img_site/" + A + ".jpg)";
document.body.style.backgroundColor = "#" + B;
document.getElementById("rodape").style.backgroundImage = "url(css/img_rodape/" + A + ".png)";
document.getElementBtId("rodape").style.backgroundPosition="center center";
}
// ---------------------------------------------------------------------------------------------------------------------- TAMANHO DE LETRA
// Início do código de Aumentar/ Diminuir a letra
 
// Para usar coloque o comando: "javascript:mudaTamanho('tag_ou_id_alvo', -1);" para diminuir
// e o comando "javascript:mudaTamanho('tag_ou_id_alvo', +1);" para aumentar
 
var tagAlvo = new Array('p'); //pega todas as tags p//
 
// Especificando os possíveis tamanhos de fontes, poderia ser: x-small, small...
var tamanhos = new Array('11px','12px','13px','14px','15px','16px' );
var tamanhoInicial = 2;
 
function mudaTamanho( idAlvo,acao ){
 
  if (!document.getElementById) return
  var iframeBennett = parent.document.getElementById('BENNETT');
  var selecionados = null,tamanho = tamanhoInicial,i,j,tagsAlvo;
  tamanho +=  acao;
  if ( tamanho < 0 ) tamanho = 0;
  if ( tamanho > 5 ) tamanho = 5;
  tamanhoInicial = tamanho;
  if ( !( selecionados = document.getElementById( idAlvo ) ) ) selecionados = document.getElementsByTagName( idAlvo )[ 0 ];
  
  selecionados.style.fontSize = tamanhos[ tamanho ];
 
  
  for ( i = 0; i < tagAlvo.length; i++ ){
    tagsAlvo = selecionados.getElementsByTagName( tagAlvo[ i ] );
    for ( j = 0; j < tagsAlvo.length; j++ ) tagsAlvo[ j ].style.fontSize = tamanhos[ tamanho ];
  }
	//REAJUSTAR TAMANHO DO IFRAME DE ACORDO COM O CONTENT DOCUMENT 					
	if (iframeBennett.contentDocument && iframeBennett.contentDocument.body.offsetHeight){ //ns6 syntax
			
		if(iframeBennett.contentDocument.body.offsetHeight<1025){ 
			 iframeBennett.height = 1025;
		}else{
					
	         iframeBennett.height = iframeBennett.contentDocument.body.offsetHeight; 
			 }
	}else if (iframeBennett.Document && iframeBennett.Document.body.scrollHeight){ //ie5+ syntax
					
		if(iframeBennett.Document.body.scrollHeight<1025){ 
	    		iframeBennett.height = 1025;
		}else{
				iframeBennett.height = iframeBennett.Document.body.scrollHeight; 
			}
		}
	//REAJUSTAR TAMANHO DO IFRAME DE ACORDO COM O CONTENT DOCUMENT 		
	}
// Fim do código de Aumentar/ Diminuir a letra



function fonte(op) {
  var inc = 0.2;//valor que será in(de)crementado no tamanho
  var min = 1;//tamanho mínimo da fonte
  var max = 1.4;//tamanho máximo da fonte
  font = document.getElementById("noticias");
  if (font.style.fontSize == "") size = 1;
  if (op == "+") {
    size += inc;
  } else if (op == "-") {
    size -= inc;
  }
  if (size < min) size = min;
  if (size > max) size = max;
  font.style.fontSize = size+"em";
}

// ---------------------------------------------------------------------------------------------------------------------- IMPRIMIR
function imprimir(){
	if(confirm('Clique em OK para imprimir.')){
	window.print();
	}
}  


// ---------------------------------------------------------------------------------------------------------------------- BLOQUEIO BOTAO DIREITO

		function right(e) {
   if (navigator.appName == 'Netscape' && (e.which == 3 || e.which == 2))
      return false;
   else if (navigator.appName == 'Microsoft Internet Explorer' && (event.button == 2 || event.button == 3)) {
      alert("Acesso Negado.\nAdministração de Informática " );
      return false;
   }
   return true;
}

document.onmousedown = right;
document.onmouseup = right;

if (document.layers) 
   window.captureEvents(Event.MOUSEDOWN);
if (document.layers) 
   window.captureEvents(Event.MOUSEUP);
   
window.onmousedown = right;
window.onmouseup = right;




