var sizeFont = 1;
var letterSpacing = 0.01;

$(document).ready(function() {
	if( $('#estudoTexto') != null){
		$('#estudoTexto a').click(function(){
			var href = $(this).attr('href');
			if( href.search('nazareno2.com.br') < 0 ){
				$(this).attr('target', '_blank');
				ow(href);
				return false;
			}else{
				window.open(href);
			}
		});
		
		$('.optClick').click(function(){
			return false;
		});
	}
});

function oW(url){
	var i;
	window.open(url, "_blank", "width=780, height=550, scrollbars=yes, location=yes, resizable=yes");
	return i;
}
function pW(nome, id, tip){
	var w = 759, h = 550, i;
	var esquerda = (screen.width - w)/2;
	var topo = (screen.height - h)/2;
	if(nome == "print"){
		window.open("func/imprimir.asp?cod=" + id +"&tip="+ tip, "_blank", "width="+ w +", height="+ h +", top="+ topo +", left="+ esquerda +", scrollbars=yes, location=no");
		return false;
	}
	if(nome == "email"){
		var w = 759, h = 480, i;
		var esquerda = (screen.width - w)/2;
		var topo = (screen.height - h)/2;
		window.open("func/email.asp?cod=" + id +"&tip="+ tip, "_blank", "width="+ w +", height="+ h +", top="+ topo +", left="+ esquerda +", scrollbars=auto, location=no");
		return false;
	}
}
function AumentaFonte(){
	if(sizeFont < 1.2){
		sizeFont += 0.4;
		jQuery("#estudoTexto, #estudoTexto em").css({
			"font-size" : eval(parseInt(6*Math.round(sizeFont*2.4))) + "px",
			"letter-spacing" : (letterSpacing + 0.01) + "em",
		});
		return true;
	}else{
		return false;
	}
}
function DiminuiFonte(){
	if(sizeFont > 1){
		sizeFont -= 0.4;
		jQuery("#estudoTexto, #estudoTexto em").css({
			"font-size" : eval(parseInt(6*Math.round(sizeFont*2.4))) + "px",
			"letter-spacing" : (letterSpacing - 0.01) + "em",
		});
		return true;
	}else{
		return false;
	}
}
