function abreCapa(codigo) {
		jan1=window.open("CapaGrandePortal.asp?CodigoLivro="+codigo,"janelaNet","scrollbars=yes,width=350,height=450,left=130,top=150'");
}

function abreJanelaIndice(codigolivro,tipo) {
		jan1=window.open("IndicePortal.asp?CodigoLivro="+codigolivro+"&Tipo="+tipo,"janelaNet","width=500,height=320,left=130,top=150,scrollbars=yes");
	}
	
	function abreJanelaResenha(codigolivro) {
		jan2=window.open("Cria_ResenhaPortal.asp?Codigo_produto="+codigolivro,"janelaNet","width=500,height=320,left=130,top=150,scrollbars=yes");
	}


function menu(){
	submenu = [];
	for(i=0; i<1; i++) submenu[i] = [];
	textmenu = [];
	for(i=0; i<1; i++) textmenu[i] = [];
	textmenu[0][0] = ["Teste"]
	textmenu[0][1] = ["Pag.asp"];
	
	menus = [];
	if(document.getElementById){
		menus[0] = document.getElementById("Layer1");
		menuinterno = document.getElementById("menu");
		//menu.setAttribute("position","absolute")
		function over(){ this.style.backgroundColor = '#B2B4BF'; }
		function out(){ this.style.backgroundColor = '#ffffff'; }
		function show(){ this.style.visibility='visible'; }
		function hide(){ this.style.visibility='hidden'; }
		for(j=0; j<textmenu.length; j++){	
			for (i=0; i<textmenu[j][0].length; i++){
				//alert(textmenu[j][0][i])
				textmenu[j][0][i] = "<a href='"+textmenu[j][1][i]+"' >" + textmenu[j][0][i] + "</a>";
				submenu[j][i] = document.createElement("DIV");
				submenu[j][i].setAttribute("className", "special");
				submenu[j][i].innerHTML = textmenu[j][0][i];
				submenu[j][i].style.padding = "5px";
				submenu[j][i].onmouseover = over;
				submenu[j][i].onmouseout = out;
				menus[j].appendChild(submenu[j][i]);
			}
			menus[j].style.top = (parseInt(menuinterno.style.top)+parseInt(menuinterno.style.height));
			menus[j].onmouseover = show;
			menus[j].onmouseout = hide;
		}
		
	}
}

function valida() {
	if (document.formSelecao.Categoria.length == 0) {
		alert("A categoria é obrigatória !");
		document.formSelecao.Categoria.focus(); 
		return false;
	}
	
	if (document.formSelecao.Estado.value.length == 0) {
		alert("O estado é obrigatorio!");
		document.formSelecao.Estado.focus();
		return false;
	}
}

function validaformcadastro() {
	if (document.formcadastro.NomeCadastro.value.length == 0) {
		alert("O nome é obrigatório!");
		document.formcadastro.NomeCadastro.focus(); 
		return false;
	}
	
	if (document.formcadastro.EmailCadastro.value.length == 0) {
		alert("O email é obrigatório!");
		document.formcadastro.EmailCadastro.focus(); 
		return false;
	}

}


