//	**************************************************************
//		... FUNCIONES PROPIAS DEL CMS ...
//	**************************************************************

function deleteContent(url) {
	if (confirm("Estás seguro que quieres eliminar el contenido?")) {
		document.location.href = url;
	}
}
function validate() {
	if ((document.form1.nombre.value.length==0)||(document.form1.apellidos.value.length==0)
	||(document.form1.telefono.value.length==0)||(document.form1.email.value.length==0))
           alert("Por favor, rellene los campos obligatorios (*)");
	  document.form1.submit();
	}


//	**************************************************************
//		... FUNCIONES PARA VISUALIZAR EL FORO ...
//	**************************************************************

// paginación de foros
function pagination(sAction, nPage) {
	document.forumForm.hdn_page.value=nPage;
	document.forumForm.doAction.value='forum_' + sAction;
	document.forumForm.submit();
}


// Muestra el índice de foros
function forumIndex() {
	document.forumForm.doAction.value = "forum_";
	document.forumForm.submit();
}

// lista de mensajes de un foro
function show_Forum(forum_id) {
	document.forumForm.doAction.value = "forum_show_msg_list";
	document.forumForm.frum_id.value = forum_id;
	document.forumForm.submit();
}

// mensaje de un foro
function show_ForumMsg(msg_id) {
	document.forumForm.doAction.value = "forum_show_msg";
	document.forumForm.fmsg_id.value = msg_id;
	document.forumForm.submit();
}

// Mostrar sólo los tópicos
function show_ForumTopics(forum_id) {
	document.forumForm.doAction.value = "forum_show_topics";
	document.forumForm.frum_id.value = forum_id;
	document.forumForm.submit();
}

// Mostrar una conversación completa
function show_ForumMsgChat(msg_id) {
	document.forumForm.doAction.value = "forum_show_msg_chat";
	document.forumForm.fmsg_id.value = msg_id;
	document.forumForm.submit();
}

// Mostrar los últimos mensajes
function show_ForumLastMsgs() {
	document.forumForm.doAction.value = "forum_show_last_msg";
	document.forumForm.submit();
}

// Mostrar los últimos mensajes
function searchOnForum() {
	document.forumForm.doAction.value = "search_on_forum";
	document.forumForm.submit();
}


// nuevo mensaje
function newMsg(msg_id) {
	document.forumForm.doAction.value = "forum_new_msg";
	document.forumForm.fmsg_id.value = msg_id;
	document.forumForm.submit();
}

//	**************************************************************
//		... FUNCIONES DE LISTAS DE DISTRIBUCIÓN
//	**************************************************************

// paginación de foros
function DiscPagination(sAction, nPage) {
	document.distListForm.hdn_page.value=nPage;
	document.distListForm.doAction.value='discu_' + sAction;
	document.distListForm.submit();
}

// Indice de listas de distribución
function DiscussionIndex() {
	document.distListForm.doAction.value = "discu_";
	document.distListForm.submit();
}

// Nuevo mensaje de distribución
function newDistMsg(msg_id) {
	document.distListForm.doAction.value = "discu_new_msg";
	document.distListForm.fmsg_id.value = msg_id;
	document.distListForm.submit();
}


// Mostrar todos los últimos mensajes de la discusión
function show_DistListMsgChat(frum_id) {
	document.distListForm.doAction.value = "discu_show_msg_chat";
	document.distListForm.frum_id.value = frum_id;
	document.distListForm.submit();
}

//	**************************************************************
//		... FUNCIONES GESTION DOCUMENTAL (ECM) ...
//	**************************************************************

// paginación de foros
function ECMPagination(sAction, nPage) {
	document.ecmForm.hdn_page.value=nPage;
	document.ecmForm.doAction.value='ecmgr_' + sAction;
	document.ecmForm.submit();
}

// ir a la home de ECM
function ecmShowHome() {
	document.ecmForm.doAction.value='ecmgr_';
	document.ecmForm.submit();
}

// navegar por categoría
function ecmShowDir(nCat) {
	document.ecmForm.doAction.value='ecmgr_';
	document.ecmForm.sob_cat.value=nCat;
	document.ecmForm.submit();
}

// navegar por categoría
function ecmMyDocuments() {
	document.ecmForm.doAction.value='ecmgr_my_documents';
	document.ecmForm.submit();
}

// editar contenido
function ecmEdit(nObj) {
	document.ecmForm.doAction.value='ecmgr_file_mgr';
	document.ecmForm.sob_cnt.value=nObj;
	document.ecmForm.submit();
}
// mostrar ficha de contenido
function ecmShowObject(nObj) {
	document.ecmForm.doAction.value='ecmgr_show';
	document.ecmForm.sob_cnt.value=nObj;
	document.ecmForm.submit();
}
// navegar por categoría
function newECMContent() {
	document.ecmForm.doAction.value='ecmgr_new_file_mgr';
	document.ecmForm.submit();
}
// establecer visibilidad de contenido
function ecmChangeVisibility() {
	document.ecmForm.doAction.value='ecmgr_visibility_mgr';
	document.ecmForm.submit();
}


//	**************************************************************
//		... FUNCIONES PARA VISUALIZAR BOLETINES ...
//	**************************************************************

function ShowNewsletter() {
		var pathToBoletin
		window.open ('/newsletter/<%=pathNewsLetter%>', 'file_showed', 'titlebar=0, menubar=0, toolbar=0, top=25, left=25, location=0, directories=0, status=0, scrollbars=1, resizable=0, width=690, height=600');
		}

function clear_suscriber_email() {
		var sel;
		var sMail;
		sMail = document.zone_suscriber.suscriber_email.value;
		sel = sMail.indexOf("@");
		if (sel==-1) {
			document.zone_suscriber.suscriber_email.value="";
		  }
		}

function Suscribe() {
		var sMail = document.zone_suscriber.suscriber_email.value;
		var sel = sMail.indexOf("@");
		var icount;
		var anychecksel=true;
		
		   if ( (sMail.length>0) && (sel!=-1) ) {
			//  for (icount=0;icount<document.zone_suscriber.hid_max_number_suscription.value;icount++) {
			 //    if (document.zone_suscriber.elements['chk_cust_alert_'+icount].checked) {
			  //      anychecksel=false;
			  //   }
			  //}      
			  //if (!anychecksel) {                  
				 document.zone_suscriber.submit();
			  //} else {
			  //    aler </form>t('<%=DMSiteTexts( oCustomer("cust_language_cd") & "_MOD_ZONE_SUSCRIBER__ANY_CHECK_SELECTED" )%>');
			  //}
		   } else {
			  alert('El correo electrónico introducido no es correcto');
			  document.zone_suscriber.suscriber_email.focus();
		   }
		}

