// JavaScript Document

function changeFocus(field)
{
	var elem = document.getElementById(field);
	elem.focus();
}

function checkKey(target)
{
	// checar se é ENTER
	
	// se sim, ativar click do target
}

function confirmaIrParaDevolucao(exemplar, matricula)
{
	if (confirm("Você deseja devolver este exemplar?"))
	{
		location.href = 'emprestimo_devolver.php?exemplar=' + exemplar + "&matricula=" + matricula;
	}
}

function confirmaIrParaRenovacao(exemplar, matricula)
{
	if (confirm("Você deseja renovar este exemplar?"))
	{
		location.href = 'emprestimo_renovar.php?exemplar=' + exemplar + "&matricula=" + matricula;
	}
}

function chamarEtiquetaEmprestimo(exemplar, matricula, data)
{
	window.open("emprestimo_etiqueta.php?exemplar=" + exemplar + "&matricula=" + matricula + "&data=" + data,"mWindow");
}

/* --------------------------------------------------------------------------------------------------------------------- */

function checkSenha(c1, c2)
{
	if ( document.getElementById(c1).value != document.getElementById(c2).value )
	{
		alert("Os campos de SENHA devem ser iguais.");
		return false;
	}
}