// JavaScript Document

function paginacao(fator,atual,maximo) {
	atual = atual + (1*fator);
	atual = (atual<1) ? 1 : atual;
	atual = (atual>maximo) ? maximo : atual;
	return atual;
}
//preCarregamento
var carregaImagem = function(w, h, url, target, urlLink) {
	if (h == 0) {
		h = (509*w)/360;
	}
	var img = new Image(w, h);
	img.src = url;
	img.style.visibility = "hidden";
	var molde = document.createElement("div");
	molde.setAttribute("id", "molde");
	var style = molde.style;
	style.border = "0";
	style.background = "#FFFFFF url('http://www.radioburiti.com.br/imagem/preCarregador.gif') no-repeat center center";
	style.width = img.width+"px";
	style.height = img.height+"px";
	document.getElementById(target).appendChild(molde);
	molde.appendChild(img);
	img.onload = function() {
		this.style.visibility = "visible";
		molde.style.background = "#dddddd";
	}
}
//
URLcarregar = '<?=URL_sitio."/".arquivosUsuario."/"?>';
//Abre e fecha Div
function abreFecha(id,obj) {
	if (document.getElementById(id).style.display == 'none') {
		document.getElementById(id).style.display = 'inline';
		obj.innerHTML = '[-]';
	} else {
		document.getElementById(id).style.display = 'none';
		obj.innerHTML = '[+]';
	}
}
