<!--

//*****************************************************************************
// Funções
//*****************************************************************************

// Tooltip

// Pop-up

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

// Agenda

function envia_data(tipo){
		document.frmEvento.action = "agenda.asp?op=" + tipo + "&data=" + document.frmEvento.c_dia.value + "/" + document.frmEvento.c_mes.value + "/" + document.frmEvento.c_ano.value + "#ag"
		document.frmEvento.submit();
}

// Formularios

function checkFields() {
missinginfo = "";
	if (document.form.nome.value == "") {
		missinginfo += "\n     -  Nome";
	}
	if ((document.form.email.value == "") || (document.form.email.value.indexOf('@') == -1) || (document.form.email.value.indexOf('.') == -1))  {
		missinginfo += "\n     -  E-mail";
	}
	if (document.form.assunto.value == "") {
		missinginfo += "\n     -  Assunto";
	}
	if (document.form.mensagem.value == "") {
		missinginfo += "\n     -  Mensagem";
	}
	if (document.form.securityCode.value == "") {
		missinginfo += "\n     -  Código de Segurança";
	}
	  
	if (missinginfo != ""){
		missinginfo ="__________________________________\n" +
		" Não preenchido corretamente:\n" +
		missinginfo + "\n__________________________________" +
		"\n Por favor tente novamente.";
		alert(missinginfo);
		return false;
		}
		else { 
		return true;
		}
}		

// Muda Cor

function mudarCor(ref,corEscolhida){   
      ref.style.backgroundColor = corEscolhida;   
   }  


// Tamanho da Fonte

function TamanhoFonte(num, id)
{
document.getElementById(id).className = "fonte"+num;
}

// Mudar Case

function changeCase(frmObj) {
var index;
var tmpStr;
var tmpChar;
var preString;
var postString;
var strlen;
tmpStr = frmObj.value.toLowerCase();
strLen = tmpStr.length;
if (strLen > 0)  {
	for (index = 0; index < strLen; index++)  {
	if (index == 0)  {
		tmpChar = tmpStr.substring(0,1).toUpperCase();
		postString = tmpStr.substring(1,strLen);
		tmpStr = tmpChar + postString;
	}
	else {
		tmpChar = tmpStr.substring(index, index+1);
		if (tmpChar == " " && index < (strLen-1))  {
			tmpChar = tmpStr.substring(index+1, index+2).toUpperCase();
			preString = tmpStr.substring(0, index+1);
			postString = tmpStr.substring(index+2,strLen);
			tmpStr = preString + tmpChar + postString;
         }
      }
   }
}
frmObj.value = tmpStr;
}

// Impressão

function Clickheretoprint()
{ 
  var disp_setting="toolbar=yes,location=no,directories=yes,menubar=yes,"; 
      disp_setting+="scrollbars=yes,width=650, height=600, left=100, top=25"; 
  var content_vlue = document.getElementById("print_content").innerHTML; 
  
  var docprint=window.open("","",disp_setting); 
   docprint.document.open(); 
   docprint.document.write('<html><head><title>::. Igreja Batista do Morumbi .:: - www.ibmorumbi.com.br - © 2010 </title>'); 
   docprint.document.write('</head><body bgcolor=#eeeeee onLoad="self.print()">');          
   docprint.document.write('<font face=arial><center>');
   docprint.document.write(content_vlue);          
   docprint.document.write('<br><hr size=1><br>');
   docprint.document.write('<img src="../images/ibm.gif"/>');
   docprint.document.write(' Igreja Batista do Morumbi © 2010<br>www.ibmorumbi.com.br');
   docprint.document.write('</center></font></body></html>'); 
   docprint.document.close(); 
   docprint.focus(); 
}

// Imprime Anotações

function printNotes() {
	if (document.notes_form.notes.value.trim() == '' || document.notes_form.notes.value.trim() == 'Você pode utilizar esta área para anotações.') {
		alert("Você não fez nenhuma anaotação.");
		return false;
	}

	childWin = open("", "childWin", "toolbar,scrollbars,menubar,status,innerwidth=500,innerheight=400");
    
	//Only prints text up to the last newline so we add one in...
	var text = document.notes_form.notes.value + "\n";
	
	//nl2br
	var regExp=/\n/gi;
	text = text.replace(regExp,'<br>');
	
	//Write the notes to the document.
    childWin.document.write("<p><b><%=titulo%></b></p>");
    childWin.document.write(text);
	childWin.print();
}

String.prototype.trim = function() {
	return this.replace(/^\s+|\s+$/g,"");
}


// Tamanho de Fonte

var min=10;
var max=16;
function increaseFontSize() {
   var p = document.getElementsByTagName('p');
   for(i=0;i<p.length;i++) {
      if(p[i].style.fontSize) {
         var s = parseInt(p[i].style.fontSize.replace("px",""));
      } else {
         var s = 12;
      }
      if(s!=max) {
         s += 1;
      }
      p[i].style.fontSize = s+"px"
   }
}
function decreaseFontSize() {
   var p = document.getElementsByTagName('p');
   for(i=0;i<p.length;i++) {
      if(p[i].style.fontSize) {
         var s = parseInt(p[i].style.fontSize.replace("px",""));
      } else {
         var s = 12;
      }
      if(s!=min) {
         s -= 1;
      }
      p[i].style.fontSize = s+"px"
   }   
}


function winOpen(theUrl,w,h){
window.open(theUrl,'i','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width='+w+',height='+h+',top=100,left=100')
		}

//  End 
-->