﻿jQuery.noConflict();

function cargar_datos(urlreq, actualizar, sentencia){
var myFx = new Fx.Slide(actualizar, {
			duration: 1000//,
			//transition: Fx.Transitions.Bounce.easeOut
			}).slideOut().chain(function(){
			$('cargando').style.display="block";
				var ajax = new Request.HTML({url:urlreq, 
		//update:actualizar,

		onSuccess: function(html) {
			//Clear the text currently inside the results div.
			/*alert(responseTree);
			alert(responseElements);
			alert(responseHTML);
			alert(responseJavaScript);*/
			//Inject the new DOM elements into the results div.
			//$('result').set();
			//myFx.slideIn();
			//$(actualizar).set('html', html);
			$('cargando').style.display="none";
			$(actualizar).set('text', '');
			$(actualizar).adopt(html);
			myFx.slideIn('vertical', {
					duration: 1000//,
					//transition: Fx.Transitions.Bounce.easeOut
				}).chain(function(){
					new Fx.Scroll(window).toElement("menu_negro_picos_lista");
				});
				
			switch(sentencia){
			case "noticias":
			noticias();
			break;
			case "propuestas":
			tabs_propuestas();
			break;
			case "smoothbox":
			cargar_smoothbox();
			tabs_propuestas();
			break;
			default:
			}

		},
		//Our request will most likely succeed, but just in case, we'll add an
		//onFailure method which will let the user know what happened.
		onFailure: function() {
			$('cargando').style.display="none";
			$(actualizar).set('text', 'Su petición no pudo ser procesada.');
			myFx.slideIn('vertical', {
					duration: 1000//,
					//transition: Fx.Transitions.Bounce.easeOut
				})
		}
	}).send();
			});
	

}