function download(tipo, idm) {
	var NomeJanela = 'Downloads';
	var esquerda = screen.width - 550;
	var Parametros = "height=310,width=410, left="+esquerda+", top=100, scrollbars=yes, resizable=yes"
	var newWindow = window.open('exec_download.php?tipo='+tipo+'&idm='+idm, NomeJanela, Parametros); 
	newWindow.focus();
}

function comentario(livro) {
	var NomeJanela = 'Comentários';
	var esquerda = screen.width - 550;
	var Parametros = "height=410,width=410, left="+esquerda+", top=100, scrollbars=yes, resizable=no"
	var newWindow = window.open('pop_comentario.php?livro='+livro, NomeJanela, Parametros); 
	newWindow.focus();
}

function Pega(oque, onde) {
	var newURL = 'pega.php?oque='+oque+'&onde='+onde; 
	var newWindow = window.open(newURL, null,"height=350,width=500,left="+(screen.width-400)/2+",top=120,scrollbars=yes,resizable=yes,location=no,status=yes");
	newWindow.focus();
}

function Procura(oque, onde) {
	var newURL = 'procura.php?oque='+oque+'&onde='+onde; 
	var newWindow = window.open(newURL, null,"height=350,width=400,left="+(screen.width-400)+",top=120,scrollbars=yes,resizable=yes,location=no,status=yes");
	newWindow.focus();
}

function Termo() {
	var newURL = 'pop_termo.php'; 
	var newWindow = window.open(newURL, null,"height=450,width=400,left="+(screen.width-400)/2+",top=120,scrollbars=yes,resizable=yes,location=no,status=yes");
	newWindow.focus();
}

function EscondeMostra(area) {
		document.getElementById("acao_mojo").style.display='none';
		document.getElementById("acao_mojo_comentario").style.display='none';
		document.getElementById("acao_mojo_avalie").style.display='none';
		document.getElementById("acao_mojo_envie").style.display='none';

	if (document.getElementById(area).style.display=='none') {
		document.getElementById("acao_mojo").style.display='block';
		document.getElementById(area).style.display='block';
	}
}

function checkEmail(v) {
	emailok = false;
	if(v.indexOf("@") < 2)	 return false; 
	if(-1 != v.indexOf(",")) return false; 
	if(-1 != v.indexOf("#")) return false; 
	if(-1 != v.indexOf("!")) return false; 
	if(-1 != v.indexOf(" ")) return false; 
	if(v.length == (v.indexOf("@")+1) ) return false; 
	if(v.indexOf("@")+1 > v.indexOf(".",v.indexOf("@")+1)) return false; 
	if(v.length == 0) 		return false; 
	return true;
}
