function enviaFormBuscadorNoticias(){
	formObj = document.buscador_noticias;
	cat = formObj.categoria.options[formObj.categoria.selectedIndex].value
	any= formObj.anyo.options[formObj.anyo.selectedIndex].value
	me = formObj.mes.options[formObj.mes.selectedIndex].value
	carga_datos(0,2,100,0,cat,any,me,0,0);
}
function enviaFormBuscadorPrensa(){
	formObj = document.buscador_noticias;
	cat = formObj.categoria.options[formObj.categoria.selectedIndex].value
	any= formObj.anyo.options[formObj.anyo.selectedIndex].value
	me = formObj.mes.options[formObj.mes.selectedIndex].value
	carga_datos(0,5,0,0,cat,any,me,0,0);
}
function enviaFormBuscadorOutlet(){
	formObj = document.buscador_outlet;
	cat = formObj.categoria.options[formObj.categoria.selectedIndex].value
	
	carga_datos(0,4,0,0,cat,0,0,0,0);
}
//---------- Functión que crea un nuevo objeto para el formulario----------//
function nuevoAjax(){
var xmlhttp=false;
 try {
 xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
 } catch (e) {
 try {
 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
 } catch (E) {
 xmlhttp = false;
 }
 }

if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
 xmlhttp = new XMLHttpRequest();
}
return xmlhttp;
}
//-------------------------------------------------------//
	function cargarContenido(capa){
	var contenidos_capa;
	var nom, ape,dir,pob,cpo,pro,pai,ema,prof,eda,com,come,news;
	
	contenidos_capa = document.getElementById(capa);
	nom = document.getElementById('nom').value;
	ape = document.getElementById('ape').value;
	dir = document.getElementById('dir').value;
	pob = document.getElementById('pob').value;
	cpo = document.getElementById('cpo').value;
	pro = document.getElementById('pro').value;
	pai = document.getElementById('pai').value;
	ema = document.getElementById('ema').value;
	prof = document.getElementById('prof').value;
	eda = document.getElementById('eda').value;
	com = document.getElementById('com').value;
	come = document.getElementById('come').value;
	news = document.getElementById('news').value;
	ajax = nuevoAjax();
	ajax.open("POST", "secciones/contacto/inserta_contacto.php",true);
	ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	ajax.send("nombre="+nom+"&apellidos="+ape+"&direccion="+dir+"&poblacion="+pob+"&cpostal="+cpo+"&provincia="+pro+"&pais="+pai+"&email="+ema+"&profesion="+prof+"&edad="+eda+"&como="+com+"&comentarios="+come+"&newsletter="+news);
	ajax.onreadystatechange=function() {
		if (ajax.readyState==4) {
			
			contenidos_capa.innerHTML = ajax.responseText;
		}
	}
}
//------------------------------------------------------//

// VALIDACIÓN DE FORMULARIOS

function valida_contacto(){
	var valid = new Validation('form_contacto');
	validado=valid.validate();
	if(validado){
		cargarContenido('contenidos1');
	}
}
function reset_contacto(){
	var valid = new Validation('form_contacto');
	valid.reset();
	}