function envioArticulo() {
	var editor = document.getElementById("editor");
	var devuelve = true;

	// ======
	// Pasamos las categorías seleccionadas del iframe a un INPUT HIDDEN
	var catsN = window.frames['ifrmcat'].document.getElementById('getcat').elements.length;
	var cats = window.frames['ifrmcat'].document.getElementById('getcat');
	var catsS = "";
	for (i = 0; i < catsN; i++) {
		if (cats.elements[i].checked) {
			catsS += cats.elements[i].value + " ";
		}
	}
	//editor.categorias.value = catsS.substring(0, catsS.length - 1);
	editor.categorias.value = catsS;
	//alert(editor.categorias.value);
	// ======

	// ======
	// Miramos que todos los campos y al menos una categoría estén seleccionados
	if ((editor.titulo.value == '') || (editor.textoart.value == '') || (editor.categorias.value == '')) {
		alert("Rellena todo...");
		devuelve = false;
	}
	// ======

	return devuelve;
	//return false;
}

function envioComentario() {
	var editor = document.getElementById("editorcom");
	var devuelve = true;

	if (editor.nombre.value == '') {
		alert("Prefiero que me digas tu nombre...");
		devuelve = false;
	}

	if (editor.texto_com.value == '') {
		alert("¿Ves lógico enviar un comentario sin texto?");
		devuelve = false;
	}

	edCloseAllTags();

	return devuelve;
}

var enviosPin = 0;

function enviaPin(obj) {
	if (enviosPin == 0) {
		obj.s1.value = "Enviando PIN...";
		obj.s1.disabled = true;
		document.body.style.cursor = 'wait';
		obj.submit();
		enviosPin++;
	}
	return false;
}

function limiteLetras(obj, limite) {
	if (obj.value.length > limite) {
		obj.value = obj.value.substring(0, 200);
		obj.scrollTop = obj.scrollHeight;
	}
	return false;
}
