// JavaScript Document
function ir_flash(valor) {
$('procesocarga').show();
$('ficha_editor').hide();
if (valor != '-1')
	valor = 'provincia='+valor+'&';
else
	valor = '';
rand = Math.random();
new Ajax.Updater('editores',
				 'scripts/editores.php?'+valor+'rand='+rand,
				 { method: 'get',
				   onSuccess:function() {
					 $('procesocarga').hide();
					 $('editores').show();
					}
				 }
);
}
function ver_ficha(id) {
	rand = Math.random();
	new Ajax.Updater('info_editor',
					 '/scripts/ver_editor.php?ided='+id+'&rand='+rand,
					 { method: 'get',
					   onSuccess: function() {
						   $('editores').hide();
						   $('ficha_editor').show();
					   }
					 }
	);
}
function volver_editor() {
	$('ficha_editor').hide();
	$('editores').show();
}
function mostrar_noticia(id) {
	cnot = $('noticia');
	cnots = $('noticias');
	cpag = $('paginacion');
	new Ajax.Updater(cnot,'/scripts/noticia_completa.php?id='+id,
		{onSuccess:
			function(resp) {
				cnots.hide();
				cpag.hide();
				cnot.show();
			}});
	
}
function volver_noticia() {
	cnot = $('noticia');
	cnots = $('noticias');
	cpag = $('paginacion');
	
	cnot.hide();
	cnots.show();
	cpag.show();
}
function reset_form() {
	frm = $('frm_ctt');
	frm.reset();
}
function chk_form() {
	e = 0;
	nom = $('nombre');
	emp = $('empresa');
	email = $('mail');
	men = $('msg');
	frm = $('frm_ctt');
	if (nom.value == "") {
		eform('nombre');
		nom.focus();
		e = 1;
	}
	else if (email.value == "") {
		eform('e-mail');
		email.focus();
		e = 1;
	}
	else if (men.value == "") {
		eform('mensaje');
		men.focus();
		e = 1;
	}
	else
		frm.submit();
}
function eform(campo) {
	alert("Debe rellenar el campo "+campo);
}
function mostrar_ficha(id) {
	asc = $('asociados');
	fich = $('ficha_editor');
	edd = $('info_editor');
	
	new Ajax.Updater(fich,'/scripts/ver_editor.php?ided='+id, {onSuccess: function() {
																				   asc.hide();
																				   fich.show();
																				   edd.show();
																				   }});
}
function volver() {
	edd = $('info_editor');
	asc = $('asociados');
	
	edd.hide();
	asc.show();
}
