// FUNDACAO MT [WWW.FUNDACAOMT.COM.BR]

function mOvr(src,clrOver) {
if (!src.contains(event.fromElement)) {
src.style.cursor = 'hand';
src.bgColor = clrOver;
}
}

function mOut(src,clrIn) {
if (!src.contains(event.toElement)) {
src.style.cursor = 'default';
src.bgColor = clrIn;
}
}

function mClk(src) {
if(event.srcElement.tagName=='TD'){
src.children.tags('A')[0].click();
}
}

function win( hp ){
    x = eval(screen.width);
    y = eval(screen.height);
    h = 215;
    v = 175;
    d = x / 2;
    r = d - h;
    t = y / 2;
    s = t - v;
    window.open(hp,"","top="+s+",left="+r+",resizable=no,location=no,toolbar=no,status=no,menubar=no,copyhistory=no,scrollbars=no,width=430,height=370")
}

function winp( hp, largura, altura ){
    x = eval(screen.width);
    y = eval(screen.height);
    h = largura / 2;
    v = altura / 2;
    d = x / 2;
    r = d - h;
    t = y / 2;
    s = t - v;
    window.open(hp,"","top="+s+",left="+r+",resizable=no,location=no,toolbar=no,status=no,menubar=no,copyhistory=no,scrollbars=yes,width="+largura+",height="+altura+"")
}

function abrirjan( hp ){
    x = eval(screen.width);
    y = eval(screen.height);
    window.open(hp,"","top=0,left=0,resizable=no,location=no,toolbar=no,status=no,menubar=no,copyhistory=no,scrollbars=no,width="+x+",height="+y)
}

function vBotao(theForm) {
     theForm.btf.disabled = true;
     theForm.btf.value = 'Aguarde, carregando...';
     return true;
}

//

var tam = 15;
function mudaFonte(tipo,elemento){
	if (tipo=="mais") {
		if(tam<24) tam+=1;
		createCookie('fonte',tam,365);
	} else {
		if(tam>10) tam-=1;
		createCookie('fonte',tam,365);
	}
	document.getElementById('txt_conteudo').style.fontSize = tam+'px';

}

function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	} else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++)
	{
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function opendown(conteudo) {
	c = document.getElementById(conteudo)
	c.style.display = '';
}

function closedown(conteudo) {
	c = document.getElementById(conteudo)
	c.style.display = 'none';
}

// Format

function formatFoneAgenda(objFormField) {
    intFieldLength = objFormField.value.length;
    pr1 = objFormField.value.substring(0, 1);
    pr2 = objFormField.value.substring(0, 2);

    if ( pr1 != "+" ) {

         if ( pr2 == "08" ) {

              if(intFieldLength == 4){
                   objFormField.value = objFormField.value + "-";
                   return false;
              }

              if(intFieldLength == 8){
                   objFormField.value = objFormField.value + "-";
                   return false;
              }
         }
         else
         {
              if(intFieldLength == 2){
                   objFormField.value = "(" + objFormField.value + ")";
                   return false;
              }

              if(intFieldLength == 8){
                   objFormField.value = objFormField.value + "-";
                   return false;
              }
         }
    }
}

// [FMT]

