// --------------------------------------------------------------------------------------

function popup_Show(address, width, height){
	window.open(address, 'popup_Show', 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, width=' + width + ', height=' + height + ', left=' + (390 - (width / 2)) + ', top=' + (290 - (height / 2)));
}

function popup_Photos(phgal_id){
	window.open('modules.php?page=Photos&amp;amp;op=pop_show&amp;amp;phgal_id=' + phgal_id, 'popup_Photos', 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, width=380, height=355, left=200, top=120');
}

// --------------------------------------------------------------------------------------

function validate_Form(form, test_name, test_email, test_message){
	if(test_Fields(form, test_name, test_email, test_message))
		document.validate.submit();
}

function test_Fields(form, test_name, test_email, test_message){
	input_name = form.input_name;
	input_email = form.input_email;
	input_message = form.input_message;
	
	if(test_name && input_name.value == ""){
		alert("O campo Nome foi deixado em branco. Preenchimento obrigatório!");
		input_name.focus();
		return false;
	}
	
	if(test_email && input_email.value == ""){
		alert("O campo E-mail foi deixado em branco. Preenchimento obrigatório!");
		input_email.focus();
		return false;
	}
	
	if(test_message && input_message.value == ""){
		alert("O campo Menssagem foi deixado em branco. Preenchimento obrigatório!");
		input_message.focus();
		return false;
	}
	
	if(test_email){
		if(input_email.value.indexOf('@', 0) == -1 || input_email.value.indexOf('.', 0) == -1){
			alert("O e-mail submetido está incorreto. Por favor tente novamente!");
			input_email.focus();
			return false;
		}else
			return true;
	}else
		return true;
}

// --------------------------------------------------------------------------------------