// JavaScript Document
function abre_site(width, height, nome,barra) {
	var top; var left; 
	if (barra == "") {
		barra = 0;
	}
	top = ( (screen.height/2) - (height/2) )
	left = ( (screen.width/2) - (width/2) )
	window.open(nome, "","toolbar=0,location=0,directories=0,status=0,menubar=0,resizable=0,scrollbars=1,width="+width+",height="+height+",left="+left+",top="+top);
}
function abrir_comprar_foto(){
	foto = document.getElementById("enderecofoto").value;
	abre_site(400,250,'comprar_foto.php?enderecofoto='+foto);	
}
function _validaFormulario(frm){
		var campos = new Array();
		var mensagem = new Array();
		var temp1 = frm.campos_obrigatorios.value;
		var temp2 = frm.mensagem_preenchidos.value;
		campos = temp1.split(",");
		mensagem = temp2.split(",");
		for(i = 0; i < campos.length; i++){		
			if(campo = document.getElementById(campos[i])){
				if(campo.type == "text" || campo.type == "password" || campo.type == "textarea"){
					if(campo.value == ""){
						alert(mensagem[i]);
						campo.focus();
						return false;
					}
				} else if(campo.type == "select-one"){
					if(campo.value == "0"){
						alert(mensagem[i]);
						campo.focus();
						return false;
					}
				} 
			}
		}
	}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}