function call_ajax(urlserver,accion,params,asincronico){
	
	if(arguments.length==4)
		var async = asincronico;
	else
		var async = true;

	xmlobj=new Ajax.Request(urlserver,{method:'post',	
							asynchronous:async,
							postBody: 'accion=' + accion + params,
							onSuccess:function(){},
							onFilure:function(){alert ('Problema de comunicación con el Server')},
							evalJS:true
							});
	
}//fin call_ajax()	


//Función llamada por el formulario modal de recomendaciones
function validarFormulario(){
   if( modal_recomendacion.validateForm()){
		var datospost='&recomendacion='+escape($('txt2').value)+'&nombre='+escape($('txt3').value)+'&mail='+escape($('txt4').value)+'&amigo='+escape($('txt5').value)+'&mailamigo='+escape($('txt6').value);
		call_ajax('ajax/recomendaciones_ajax.php','agregar_registro',datospost,'');
   } 
}//validarFormulario


//Función llamada por el formulario modal de registración
function validarFormularior(){
   if( modal_registracion.validateForm()){
	    var news = 0;
		if ($('txt6').checked)
			var news = 1;
			
		var datospost='&nombre='+escape($('txt1').value)+'&fecha='+escape($('txt2').value)+'&mail='+escape($('txt3').value)+'&telefono='+escape($('txt4').value)+'&ciudad='+escape($('txt5').value)+'&newsletter='+news;
		call_ajax('ajax/registracion_ajax.php','agregar_registro',datospost,'');
   }
    
}//validarFormularior


//Función llamada por el formulario modal de recomendaciones
function validarFormularioc(){
   if( modal_contacto.validateForm()){
   	    var news = 0;
   		if ($('txt6').checked)
   			var news = 1;
   			
   		var datospost='&nombre='+escape($('txt1').value)+'&fecha='+escape($('txt2').value)+'&mail='+escape($('txt3').value)+'&telefono='+escape($('txt4').value)+'&ciudad='+escape($('txt5').value)+'&newsletter='+news;
   		call_ajax('ajax/contacto_ajax.php','agregar_registro',datospost,'');
   }
}//validarFormularioc


//Función llamada por el formulario modal de Dicono di Noi
function validarFormD(){
   if( modal_diconodinoi.validateForm()){
 			
	var datospost='&autor='+escape($('txt3').value)+'&email='+escape($('txt4').value)+'&titulo='+escape($('txt5').value)+'&desarrollo='+escape($('txt1').value);
	call_ajax('ajax/diconodinoi_ajax.php','agregar_registro',datospost,'');
   }
}//validarFormularioc


document.observe("dom:loaded",function(){

	$('Raccomandaci').stopObserving("click");
	$('Raccomandaci').observe('click',function(){
		call_ajax('ajax/recomendaciones_ajax.php','ver_formulario','','');
	;})

	$('Raccomandaci1').stopObserving("click");
	$('Raccomandaci1').observe('click',function(){
		call_ajax('ajax/recomendaciones_ajax.php','ver_formulario','','');
	;})

	$('Newsletter2').stopObserving("click");
	$('Newsletter2').observe('click',function(){
		call_ajax('ajax/registracion_ajax.php','ver_formulario','','');
	;})
	
	$('Newsletter11').stopObserving("click");
	$('Newsletter11').observe('click',function(){
		call_ajax('ajax/registracion_ajax.php','ver_formulario','','');
	;})

	
});//fin document.observe
