// ## No onLoad de todas as telas
$(document).ready(function(){
	$('div.img32').pngFix();
	$(".nav").superfish({
		animation : { opacity: 'fast', speed: 'fast', height: 'show' }
	});
	$.sifr({ path: '../../motion/fontz/', save: true, color: '#777' });
	loadSifrTags();
});
/*
	Função utilizada para escrever as as tags que será utilizadas no sirf
*/
function loadSifrTags()
{
	$('h3').sifr({ font: 'dax' });
}
/*
	Função utilizada para escrever as notificações de alerta
*/
function windowResponseAlert( _title, _content, _closeLabel )
{
	_htmlDiv = '';
	_htmlDiv += '<div id="windowAlert">';
	_htmlDiv += '	<div id="windowAlertTitle"></div>';
	_htmlDiv += '	<div class="buttomClose"><a href="javascript:windowAlertClose();">'+_closeLabel+'</a></div>';
	_htmlDiv += '	<div id="windowAlertContent"></div>';
	_htmlDiv += '</div>';
	
	jQuery(document.body).prepend( _htmlDiv ); // Escreve _div no inicio do BODY 
	jQuery("#windowAlertTitle").empty(); // Limpa o Titulo
	jQuery("#windowAlertContent").empty(); // Limpa o Conteudo
	jQuery("#windowAlertTitle").append( '<h3>'+_title+'</h3>' ); // Escreve o Titulo
	jQuery("#windowAlertContent").append( _content ); // Escreve o Conteudo


	posDivCenter("#windowAlert"); // Posiciona no Centro
	$('#windowAlert').jqm({modal:true}); 
	$('#windowAlert').jqmShow();
	loadSifrTags();
}

/*
	Função utilizada para esconder as notificações de alerta
*/
function windowAlertClose()
{
	$('#windowAlert').jqmHide(); 
}

/*
	Função utilizada para posicionar as notificações de alerta
*/
function posDivCenter(div)
{
	var total_w = jQuery(document.body).width();
	var window_w = jQuery((div)).width();
	
	var total_h = jQuery(document.body).height();
	var window_h = jQuery((div)).height();
	
	var screenWidth = ((total_w - window_w ) / 2) + 'px';
	var screenHeight = ((total_h - window_h ) / 2) + 'px';

	jQuery((div)).css("margin-left", screenWidth);
	jQuery((div)).css("margin-top", 200);
}
function clearInitialValue(obj)
{
	return obj.value='';
}
function writeInitialValue(obj, str)
{
	if(obj.value == '')
	{
		return obj.value=str;
	}
}
function showPass(o, n)
{
	document.getElementById(n).style.display = '';
	document.getElementById(o.id).style.display = 'none';
	document.getElementById(n).focus();
}
function hidePass(o, n, l)
{
	if(o.value == '')
	{
		document.getElementById(n).style.display = '';
		document.getElementById(o.id).style.display = 'none';
		document.getElementById(n).value = l;
	}
}
function doDownloadFile(id, fileName)
{
	document.location.href = '../../includes/download.asp?id='+id+'';
	analytics = '/download/'+fileName+'';
	pageTracker._trackPageview(analytics);
}

function creditos()
{
	html = $("#creditos").html();
	windowResponseAlert( 'Créditos', html, 'fechar' )	
}
