function calendario(month,year,d_x_nota,nota,ac) {
	llamar('../includes/ajax_calendario.asp?m='+month+'&y='+year+'&d_x_nota='+d_x_nota+'&nota='+nota+'&ac='+ac+'&nocache='+Math.random(),'calendario_ajax','','GET');
}

function calendario_notas(day,month,year,pag) {
	if (!pag) {
		pag='';
	}
	llamar('../includes/ajax_calendario_notas.asp?d='+day+'&m='+month+'&y='+year+'&pag='+pag+'&nocache='+Math.random(),'calendario_notas_ajax','','GET','');
}

function forgot_password(f_email) {
	llamar('../includes/ajax_forgot.asp?f_email='+f_email+'&nocache='+Math.random(),'ajax_forgot','','GET');
}

function recomendar_TCC(f_nombre,f_email) {
	llamar('../includes/ajax_recomendar.asp?f_nombre='+f_nombre+'&f_email='+f_email+'&nocache='+Math.random(),'ajax_recomendar','','GET');
}

function usuario_baja(f_email,f_password) {
	llamar('../includes/ajax_baja.asp?f_email='+f_email+'&f_password='+f_password+'&nocache='+Math.random(),'ajax_baja','','GET');
}

function send_comentario(nombre,apellidos,direccion,poblacion,provincia,cp,pais,telefono,email,comentario,contact_ac) {
	llamar('../modals/contactar.asp','TB_ajaxContent','nombre='+nombre+'&apellidos='+apellidos+'&direccion='+direccion+'&poblacion='+poblacion+'&provincia='+provincia+'&cp='+cp+'&pais='+pais+'&telefono='+telefono+'&email='+email+'&comentario='+comentario+'&contact_ac='+contact_ac+'&nocache='+Math.random(),'POST','');
}

function send_direccion_postal(direccion,poblacion,cp,direccion_postal_ac,action) {
	llamar('../modals/direccion_postal.asp','TB_ajaxContent','direccion='+direccion+'&poblacion='+poblacion+'&cp='+cp+'&direccion_postal_ac='+direccion_postal_ac+'&action='+action+'&nocache='+Math.random(),'POST','');
}

function cmp_usuario(f_mail) {
	var acciones="";
	acciones="document.getElementById('form_user').email.select();";
	acciones=acciones+"document.getElementById('ajax_cmp_usuario').style['display']='block';";
	llamar('../functions/ajax.asp?f=cmp_usuario&f_mail='+f_mail+'&nocache='+Math.random(),'ajax_cmp_usuario','','GET',acciones);
}

function cmp_login(f_mail,f_password,f_inicio,f_cookie) {
	if (f_cookie==true) {
		f_cookie=1
	} else {
		f_cookie=0;
	}
	var acciones="";
	acciones=acciones+"if(respuesta.indexOf('http://')>=0 || respuesta.indexOf('../home/index.asp')>=0){";
	acciones=acciones+"window.location=respuesta.replace('validacion','usuario');";
	acciones=acciones+"} else {";
	acciones=acciones+"alert(respuesta);";
	acciones=acciones+"}";
	acciones=acciones+"document.getElementById('form_login').email.select();";
	llamar('../functions/ajax.asp?f=cmp_login&f_mail='+f_mail+'&f_password='+f_password+'&f_inicio='+f_inicio+'&f_cookie='+f_cookie+'&nocache='+Math.random(),'','','GET',acciones);
}

function articulos_destacados(tipo,seccion,corte,num) {   //corte -> a partir de que registro hace el select (en este caso, la fecha de registro)
	llamar('../includes/ajax_articulos_destacados.asp','ajax_articulos_destacados','tipo='+tipo+'&seccion='+seccion+'&corte='+corte.replace(' ','%20')+'&num='+num+'&nocache='+Math.random(),'POST');
}

function articulos_destacados_2(tipo,seccion,corte,num) {   //corte -> a partir de que registro hace el select (en este caso, la fecha de registro)
	llamar('../includes/ajax_articulos_destacados_2.asp','ajax_articulos_destacados','tipo='+tipo+'&seccion='+seccion+'&corte='+corte.replace(' ','%20')+'&num='+num+'&nocache='+Math.random(),'POST');
}

function getNewInfo(noticia) {
	llamar('../includes/ajax_noticia.asp?n='+noticia+'&nocache='+Math.random(),'ajax_noticia','','GET');
}

function setFavorites(noticia,ac) {
	if (!noticia) {
		noticia='';
	}
	if (!ac) {
		ac='';
	}
	//alert('si');
	llamar('../includes/ajax_favoritos.asp?n='+noticia+'&ac='+ac+'&nocache='+Math.random(),'ajax_favoritos','','GET','');
	if (noticia!='' && document.getElementById('auxiliar_favoritos_all')) {
		llamar('../includes/ajax_favoritos_all.asp?n='+noticia+'&ac='+ac+'&nocache='+Math.random(),'ajax_favoritos_all','','GET');
	}
}

function setFavorites_ALL(noticia,ac) {
	llamar('../includes/ajax_favoritos_all.asp?n='+noticia+'&ac='+ac+'&nocache='+Math.random(),'ajax_favoritos_all','','GET');
	llamar('../includes/ajax_favoritos.asp?n='+noticia+'&ac='+ac+'&nocache='+Math.random(),'ajax_favoritos','','GET');
}

function addRecordatorioInput(fecha,valor,acont_id,emoticono) {
	if (document.getElementById('add_yn') && document.getElementById('calendario_notes')) {
	var element = document.getElementById("calendario_notes");
	while (element.firstChild) {
	  element.removeChild(element.firstChild);
	}
	document.getElementById('add_yn').value=1;		
	}
	llamar('../functions/ajax.asp?f=addRecordatorioInput&fecha='+fecha+'&valor='+valor+'&acont_id='+acont_id+'&emoticono='+emoticono+'&nocache='+Math.random(),'calendario_notas_ajax_2','','GET');
}

function addCalendarioNota(m,y,d_x_nota,texto,fecha,ac,acont_id,emoticono) {
	fecha=document.getElementById('fecha_nota_aux').value;
	partes=fecha.split("/");
	//alert('m='+partes[1]+'&y='+partes[2]+'&d_x_nota='+partes[0]+'&txt_recordatorio='+escape(texto)+'&nota_fecha='+fecha+'&ac='+ac+'&acont_id='+acont_id+'&emoticono='+emoticono+'&nocache='+Math.random());
	llamar('../includes/ajax_calendario.asp','calendario_ajax','m='+partes[1]+'&y='+partes[2]+'&d_x_nota='+partes[0]+'&txt_recordatorio='+escape(texto)+'&nota_fecha='+fecha+'&ac='+ac+'&acont_id='+acont_id+'&emoticono='+emoticono+'&nocache='+Math.random(),'POST');
	removeCalendarioInput();
}

function myspace_add_note(valor) {
	llamar('../functions/ajax.asp?f=myspace_add_note&valor='+valor+'&nocache='+Math.random(),'','','GET');
}

function crop_image(obj,id,tipo) {
	var coords=obj.coords;
	//alert(coords);
	var partes=coords.split(",");
	llamar('../includes/ajax_crop_image_'+tipo+'.asp?x1='+partes[0]+'&x2='+partes[1]+'&x3='+partes[2]+'&x4='+partes[3]+'&id='+id+'&nocache='+Math.random(),'ajax_crop_image_'+tipo,'','GET');
	//crop_image_upImage(id,tipo);
}
/*ARREGLO UPDATE IMAGENES AL CORTAR (AL CORTAR NO SE ACTUALIZA LA VISIÓN)*/
/*
function crop_image_upImage(id,tipo) {   
	llamar('../includes/ajax_crop_image_arreglo_'+tipo+'.asp?id='+id+'&nocache='+Math.random(),'ajax_crop_image_'+tipo,'','GET');
}
*/
function recomendar(articulo,tunombre,tusapellidos,tuemail,tuamiga,suemail,comentario,recomendar_ac) {
	llamar('../modals/recomendar.asp','TB_ajaxContent','articulo='+articulo+'&tunombre='+tunombre+'&tusapellidos='+tusapellidos+'&tuemail='+tuemail+'&tuamiga='+tuamiga+'&suemail='+suemail+'&comentario='+comentario.replace('%','%25').replace('&','%26')+'&recomendar_ac='+recomendar_ac+'&nocache='+Math.random(),'POST','');
}
function recomendar_newsletters(newsletter,tunombre,tusapellidos,tuemail,tuamiga,suemail,comentario,recomendar_ac) {
	llamar('../modals/recomendar_newsletter.asp','TB_ajaxContent','newsletter='+newsletter+'&tunombre='+tunombre+'&tusapellidos='+tusapellidos+'&tuemail='+tuemail+'&tuamiga='+tuamiga+'&suemail='+suemail+'&comentario='+comentario.replace('%','%25').replace('&','%26')+'&recomendar_ac='+recomendar_ac+'&nocache='+Math.random(),'POST','');
}

/*function add_rss_widget(url,nombre_widget,add_rss_ac) {
	var acciones="";
	acciones=acciones="if (respuesta=='1') {"
	acciones=acciones+"alert('El contenido seleccionado se ha agregado correctamente.'); ";
	acciones=acciones+"window.location='index.asp';";
	acciones=acciones+"}";
	llamar('../includes/ajax_add_rss.asp','add_feed_list','fuente_rss='+url+'&nombre_widget='+nombre_widget+'&add_rss_ac='+add_rss_ac+'&nocache='+Math.random(),'POST',acciones);	
}*/


function display_div_rss(div,url) {
	if (!url) {
		url='';
	}
	var div1=document.getElementById(div);
	if (div1.style['display']=='block') {
		div1.style['display']='none';
	} else {
		div1.style['display']='block';
		add_rss_widget(url);
	}
}

function setPositionBBDD(rel,x,y) {
	llamar('../functions/ajax.asp?f=setPositionBBDD&rel='+rel+'&x='+x+'&y='+y+'&nocache='+Math.random(),'','','GET','');	
}
/*function widget_close(widget) {
	var element=document.getElementById(widget);
	partes=widget.split("_");
	pare=element.parentNode;
	while (element.firstChild) {
	  element.removeChild(element.firstChild);
	}
	pare.removeChild(element);	
	llamar('../functions/ajax.asp?f=removeWidget&rel='+partes[1]+'&nocache='+Math.random(),'','','GET','');
}*/

function widget_weather_add_provincia(wu,valor) {
	llamar('../includes/ajax_weather_add_provincia.asp?valor='+valor+'&wu='+wu+'&nocache='+Math.random(),'ajax_weather_add_provincia','','GET');
}

function widget_weather_update_city(wu,city) {
	llamar('../functions/ajax.asp?f=widget_weather_update_city&wu='+wu+'&city='+city+'&nocache='+Math.random(),'','','GET','');	
	llamar ('../widgets/weather/widget.asp?wu='+wu+'&nocache='+Math.random(),'id_widget_middle_'+wu,'','GET');
}

function send_ecard(ecard,tuamiga,suemail,comentario,ecard_ac) {
	llamar('../modals/ecard.asp','TB_ajaxContent','ecard='+ecard+'&tuamiga='+tuamiga+'&suemail='+suemail+'&comentario='+comentario+'&ecard_ac='+ecard_ac+'&nocache='+Math.random(),'POST','');
}

function admin_list_subsecciones(id) {
	llamar('../includes/ajax_admin_subsecciones.asp?id='+id+'&nocache='+Math.random(),'ajax_admin_subsecciones','','POST','');
}

function admin_add_subsecciones(id,nombre) {
	llamar('../includes/ajax_admin_subsecciones.asp?id='+id+'&ac=add&nombre='+nombre+'&nocache='+Math.random(),'ajax_admin_subsecciones','','GET','');
}

function admin_edit_subsecciones(id,id_seccion) {
	llamar('../includes/ajax_admin_subsecciones.asp?id='+id+'&ac=edit&id_seccion='+id_seccion+'&nocache='+Math.random(),'ajax_admin_subsecciones','','GET','');
}

function admin_cedit_subsecciones(id,id_seccion,nombre) {
	llamar('../includes/ajax_admin_subsecciones.asp?id='+id+'&acc=edit&id_seccion='+id_seccion+'&nombre='+nombre+'&nocache='+Math.random(),'ajax_admin_subsecciones','','GET','');
}
function admin_del_subsecciones(id,id_seccion) {
	llamar('../includes/ajax_admin_subsecciones.asp?id='+id+'&ac=del&id_seccion='+id_seccion+'&nocache='+Math.random(),'ajax_admin_subsecciones','','GET','');
}




function admin_list_encuestas_preguntas(id) {
	llamar('../includes/ajax_admin_encuestas_preguntas.asp?id='+id+'&nocache='+Math.random(),'ajax_admin_encuestas_preguntas','','POST','');
}

function admin_add_encuestas_preguntas(id,pregunta,votos) {
	llamar('../includes/ajax_admin_encuestas_preguntas.asp?id='+id+'&ac=add&pregunta='+pregunta+'&votos='+votos+'&nocache='+Math.random(),'ajax_admin_encuestas_preguntas','','GET','');
}

function admin_edit_encuestas_preguntas(id,id_pregunta) {
	llamar('../includes/ajax_admin_encuestas_preguntas.asp?id='+id+'&ac=edit&id_pregunta='+id_pregunta+'&nocache='+Math.random(),'ajax_admin_encuestas_preguntas','','GET','');
}

function admin_cedit_encuestas_preguntas(id,id_pregunta,pregunta,votos) {
	llamar('../includes/ajax_admin_encuestas_preguntas.asp?id='+id+'&acc=edit&id_pregunta='+id_pregunta+'&pregunta='+pregunta+'&votos='+votos+'&nocache='+Math.random(),'ajax_admin_encuestas_preguntas','','GET','');
}
function admin_del_encuestas_preguntas(id,id_pregunta) {
	llamar('../includes/ajax_admin_encuestas_preguntas.asp?id='+id+'&ac=del&id_pregunta='+id_pregunta+'&nocache='+Math.random(),'ajax_admin_encuestas_preguntas','','GET','');
}





function admin_list_newsletter_contenido(id) {
	llamar('../includes/ajax_admin_newsletter_contenido.asp?id='+id+'&nocache='+Math.random(),'ajax_admin_newsletter_contenido','','POST','');
}

function admin_add_newsletter_contenido(id,contenido_ID,tipo_contenido,url) {
	llamar('../includes/ajax_admin_newsletter_contenido.asp?id='+id+'&ac=add&contenido_ID='+contenido_ID+'&tipo_contenido='+tipo_contenido+'&url='+url+'&nocache='+Math.random(),'ajax_admin_newsletter_contenido','','GET','');
}

function admin_edit_newsletter_contenido(id,id_list) {
	llamar('../includes/ajax_admin_newsletter_contenido.asp?id='+id+'&ac=edit&id_list='+id_list+'&nocache='+Math.random(),'ajax_admin_newsletter_contenido','','GET','');
}

function admin_cedit_newsletter_contenido(id,id_list,contenido_ID,tipo_contenido,url) {
	llamar('../includes/ajax_admin_newsletter_contenido.asp?id='+id+'&acc=edit&id_list='+id_list+'&contenido_ID='+contenido_ID+'&tipo_contenido='+tipo_contenido+'&url='+url+'&nocache='+Math.random(),'ajax_admin_newsletter_contenido','','GET','');
}
function admin_del_newsletter_contenido(id,id_list) {
	llamar('../includes/ajax_admin_newsletter_contenido.asp?id='+id+'&ac=del&id_list='+id_list+'&nocache='+Math.random(),'ajax_admin_newsletter_contenido','','GET','');
}





function listArticulosOtherSections(tipo,seccion,corte,actual,num) {   //corte -> a partir de que registro hace el select (en este caso, la fecha de registro)
	llamar('../includes/ajax_articulos_other_secciones.asp','ajax_articulos_other_secciones','tipo='+tipo+'&seccion='+seccion+'&corte='+corte.replace(' ','%20')+'&num='+num+'&actual='+actual+'&nocache='+Math.random(),'POST');
}

/*function listArticulosTags(tipo,tag,corte,num) {   //corte -> a partir de que registro hace el select (en este caso, la fecha de registro)
	llamar('../includes/ajax_articulos_tags.asp','ajax_articulos_tags','tipo='+tipo+'&tag='+escape(tag)+'&corte='+corte.replace(' ','%20')+'&num='+num+'&nocache='+Math.random(),'POST');
}*/
function listArticulosTags(tag,num) {   //corte -> a partir de que registro hace el select (en este caso, la fecha de registro)
	llamar('../includes/ajax_articulos_tags.asp','ajax_articulos_tags','tag='+escape(tag)+'&num='+num+'&nocache='+Math.random(),'POST');
}

function widget_horoscopo_add(wu,simbolo) {
	llamar('../functions/ajax.asp?f=widget_horoscopo_add&wu='+wu+'&simbolo='+simbolo+'&nocache='+Math.random(),'','','GET','');	
	//llamar ('../widgets/horoscopo/widget.asp?id=78&rel='+widget+'&nocache='+Math.random(),'block_'+widget,'','GET');
	$(".widget_middle_"+wu).html("");
	$.get("../widgets/horoscopo/widget.asp",{wu:wu},
		function(data){
			$(".widget_middle_"+wu).html(data);
		}
	);
}

function vale_registro(vale) {
	acciones="alert(respuesta);window.location='../home/index.asp'";
	llamar('../functions/ajax.asp?f=vale_registro&vale='+vale+'&nocache='+Math.random(),'','','GET',acciones);	
}

function galeria_invitar(galeria,tunombre,tusapellidos,tuemail,tuamiga,suemail,comentario,invitar_ac) {
	llamar('../modals/galeria_invitar.asp','TB_ajaxContent','galeria_id='+galeria+'&tunombre='+tunombre+'&tusapellidos='+tusapellidos+'&tuemail='+tuemail+'&tuamiga='+tuamiga+'&suemail='+suemail+'&comentario='+comentario.replace('%','%25').replace('&','%26')+'&invitar_ac='+invitar_ac+'&nocache='+Math.random(),'POST','');
}

function acMisGalerias(galeria,ac) {
	if (!galeria) {
		galeria='';
	}
	if (!ac) {
		ac='';
	}
	llamar('../includes/ajax_misgalerias.asp?galeria='+galeria+'&ac='+ac+'&nocache='+Math.random(),'ajax_misgalerias','','GET','');
	if (ac=='del') {
		if (document.getElementById('galeria_actual_aux').value==galeria) {
			window.location='galeria.asp';
		}
	}
}

function acGaleriasAmigas(galeria,ac) {
	if (!galeria) {
		galeria='';
	}
	if (!ac) {
		ac='';
	}
	llamar('../includes/ajax_galeriasamigas.asp?galeria='+galeria+'&ac='+ac+'&nocache='+Math.random(),'ajax_galeriasamigas','','GET','');
	if (ac=='del') {
		if (document.getElementById('galeria_actual_aux').value==galeria) {
			window.location='galerias.asp'
		}
	}
}

function loadPromo(promo_name) {
	llamar('../includes/ajax_promo_'+promo_name+'.asp?nocache='+Math.random(),'ajax_promo_'+promo_name,'','GET','');
}

function setVoteArticle(articulo,votos) {
	votos_aux=votos.split("_");
	votos_aux2=votos_aux[2];
	llamar('../functions/ajax.asp?f=setVoteArticle&articulo='+articulo+'&votos='+votos_aux2+'&nocache='+Math.random(),'','','GET','');
	tb_remove();
	updateVoteArticle(articulo);
}
function updateVoteArticle(articulo) {
	llamar('../includes/ajax_articulos_votos.asp?articulo='+articulo+'&nocache='+Math.random(),'ajax_articulos_votos','','GET','');
}


function setPromoInternaDirecta(promo) {
	acciones="alert(respuesta);";
	llamar('../functions/ajax.asp?f=setPromoInternaDirecta&promo='+promo+'&nocache='+Math.random(),'','','GET',acciones);	
}

function upSubSecciones(s,articulo){
	llamar('../includes/ajax_admin_subsecciones_select.asp?s='+s+'&articulo='+articulo+'&nocache='+Math.random(),'ajax_admin_subsecciones_select','','GET','');
}

function setEncuestaVoto(pregunta_id,ver_resultados){
	llamar('../includes/ajax_encuesta.asp?pregunta_id='+pregunta_id+'&ver='+ver_resultados+'&nocache='+Math.random(),'ajax_encuesta','','GET','');

}



/*PROMOS*/
function form_promo_69 (promo_name,nombre,mail,ac) {
	llamar(promo_name+'/ajax_'+promo_name+'_1.asp?nombre='+nombre+'&mail='+mail+'&ac='+ac+'&promo_name='+promo_name+'&nocache='+Math.random(),'ajax_'+promo_name+'_1','','GET');
}

function form_promo_84 (promo_name,titulo,receta,ac) {
	llamar(promo_name+'/ajax_'+promo_name+'_1.asp','ajax_'+promo_name+'_1','titulo='+titulo+'&receta='+receta+'&ac='+ac+'&promo_name='+promo_name+'&nocache='+Math.random(),'POST');
}

function form_promo_85 (promo_name,titulo,truco,ac) {
	llamar(promo_name+'/ajax_'+promo_name+'_1.asp','ajax_'+promo_name+'_1','titulo='+titulo+'&truco='+truco+'&ac='+ac+'&promo_name='+promo_name+'&nocache='+Math.random(),'POST');
}

function form_promo_86 (promo_name,titulo,consejo,ac) {
	llamar(promo_name+'/ajax_'+promo_name+'_1.asp','ajax_'+promo_name+'_1','titulo='+titulo+'&consejo='+consejo+'&ac='+ac+'&promo_name='+promo_name+'&nocache='+Math.random(),'POST');
}

function setGanadorPromo(promo,edicion,check,id_actual) {
	if (check.checked) {
		llamar('../functions/ajax.asp?f=setGanadorPromo&promo='+promo+'&edicion='+edicion+'&usuario='+check.value+'&id_actual='+id_actual+'&marcado=1&nocache='+Math.random(),'','','GET','');
		document.getElementById('label_ganador_'+id_actual).style['display']='block';
	} else {
		llamar('../functions/ajax.asp?f=setGanadorPromo&promo='+promo+'&edicion='+edicion+'&usuario='+check.value+'&id_actual='+id_actual+'&marcado=0&nocache='+Math.random(),'','','GET','');
		document.getElementById('label_ganador_'+id_actual).style['display']='none';
	}
	//window.location='promos_internas.asp?id='+promo;
}

function addNota(fecha,ac,nota,emoticono,id) {
	nota2=nota.replace("'","´");
	//alert(nota2);
	llamar('../modals/notas.asp','TB_ajaxContent','fecha='+fecha+'&ac='+ac+'&nota='+escape(nota2)+'&emoticono='+emoticono+'&id='+id+'&nocache='+Math.random(),'POST','');
	partes_fecha=fecha.split("/");
	calendario(partes_fecha[1],partes_fecha[2],partes_fecha[0],'','');
	tb_remove();
	document.getElementById('add_yn').value=0;
}

function setToXML(articulo) {
	if (articulo) {
		if (document.getElementById('xml_'+articulo).checked) {
			llamar('../functions/ajax.asp?f=setToXML&articulo='+articulo+'&marcado=1&nocache='+Math.random(),'','','GET','');

		} else {
			llamar('../functions/ajax.asp?f=setToXML&articulo='+articulo+'&marcado=0&nocache='+Math.random(),'','','GET','');
		}
	}
}