/**************************************************************************************************
	Funções do Site
***************************************************************************************************/

// Função para lançamento lozalizada na home (Troca de Posições de imagens)
function visualizaImagem(pos){
	
	var posImg 	= document.getElementById("imgPosicoes");
	var posicao = document.getElementById("posicao"+pos);
	
	for(i=0; i<posImg.childNodes.length; i++){
		if(posImg.childNodes[i].tagName == "DIV"){
			if(posImg.childNodes[i].attributes.id.value == "posicao"+pos){
					posicao.style.display = "block";
			}else{
				posImg.childNodes[i].style.display = "none";
			}
		}
	}
}	

function downloadLivrosPDF(id){
	var frame = document.getElementById("download");
	frame.src = "download.php?download=livros&idLivro="+id;
}

function flash(nome, width, height)
{
	document.writeln('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="'+width+'" height="'+height+'">');	
	document.writeln('<param name="movie" value="'+nome+'" />');
	document.writeln('<param name="quality" value="high" />');
	document.writeln('<param name="WMode" value="Transparent" />');
	document.writeln('<param value="Noborder" name="noScale"/>');
	document.writeln('<embed src="'+nome+'" width="'+width+'" height="'+height+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" WMode="Transparent" scale="noborder"></embed>');
	document.writeln('</object>');
}

function indiqueAmigo() {
	var url = "pages/indique/index.php";
	window.open(url, "indique", "width=450, height=340");
} 

pergunta = function(idLivro)
{
	w = (screen.width - 500) / 2;
	h = (screen.height - 450) / 2;
	window.open('pages/videos/pergunta.php?idLivro='+idLivro,'','top='+h+', left='+w+', width=500, height=400, location=no,scrollbars=auto,toolbar=no,resizable=no');	
}
