var tgs = new Array('div','td','tr','p');
var szs = new Array('8px', '10px', '12px', '14px', '16px', '18px', '20px');
var startSz = 2;

function ts( trgt,inc ) {
	if (!document.getElementById)
		return
	
	var d = document,cEl = null,sz = startSz,i,j,cTags;
	sz += inc;
	
	if ( sz < 0 )
		sz = 0;
	
	if ( sz > 6 )
		sz = 6;
	
	startSz = sz;
	
	if ( !( cEl = d.getElementById( trgt ) ) )
		cEl = d.getElementsByTagName( trgt )[ 0 ];
	
	cEl.style.fontSize = szs[ sz ];
	
	for ( i = 0; i < tgs.length; i++ ) {
		cTags = cEl.getElementsByTagName( tgs[ i ] );
		for ( j = 0; j < cTags.length; j++ )
			cTags[ j ].style.fontSize = szs[ sz ];
	}
}

function imprimir(){
	window.print();
}

function voltar(){
	history.back()
}

function verImagem(url){
	window.open(url, 'mainPage', 'toolbar=no, directories=no, location=no, status=no, menubar=no, resizable=no, scrollbars=no, width=720px, height=560px');
}

function novaPagina(url, param){

	if(param == "window"){
		window.open(url, 'mainPage', 'toolbar=no, directories=no, location=no, status=no, menubar=no, resizable=no, scrollbars=yes, width=720px, height=535px');
	} else {
		window.open(url);
	}

}

function alternarContato (selSelectObject){
	if (selSelectObject.options[selSelectObject.selectedIndex].value != "") {
		location.href=selSelectObject.options[selSelectObject.selectedIndex].value;
	}
}

function acabamentoFormContato() {
	var textArea = document.getElementById("text")
	if(textArea != null) {
		textArea.value = "";
	}
	
	var inputName = document.getElementById("name")
	if(inputName != null) {
		inputName.focus();
		inputName.select();
	}
	
}

function validarContato(){
	if ((document.emailForm.text.value=="") || (document.emailForm.email.value.search("@")==-1) || (document.emailForm.email.value.search("[.*]")==-1)){
		alert("Por favor, verifique se preencheu o formulário corretamente.");
	} else {
		document.emailForm.submit();
	}
}