/**
 * @author Jose Carlos Soares de Souza <josecarlos@globtec.eti.br>
 * @link http://www.globtec.eti.br/
 */

// Objeto jquery
$j = jQuery.noConflict();


/**
 * Mascaras
 * 
 * @param {Object} $j
 */
jQuery(function($j) {
	
	if (location.href.indexOf('filmes') != -1) {
		
		$j('#ano_producao').mask('99/99/9999');		
	}
});

/**
 * 
 * @param {Object} imagem
 */
function exibeImagem(imagem) {
	
	return overlib('<img src="' + imagem + '">');
	
}

/**
 * 
 * @param {Object} conteudo
 */
function exibeResposta(conteudo) {
	
	return overlib('<div>' + conteudo + '</div>');
	
}


/**
 * 
 * @param {Object} url
 */
function deletar(url) {
	
	if (confirm('Deseja realmente excluir'))
		location.href = url;
	
}

function startIndex(){
	$j(window).unload(function(){$j.ajax({
										type: 'GET',
										async: false,
										cache: false,
										data: "user_id="+$j("#user_id").attr('value'),
										url: "interfaces/logout.php",
										error: function(xml,status,t){ alert('error:'+status); },
										});
							   });
}