
function load_swf (file, id, width, height) {
	
	
	
	var flashvars = {};   
	var params = {};
	params.wmode = "transparent";
	//params.bgcolor = "#000000";
	
	var attributes = {};
	swfobject.embedSWF(file, id, width, height, "8", "/js/expressInstall.swf", flashvars, params, attributes);
}

//BOTONERA / BANNER TOP
$(document).ready(function() {
	cargar_scroll();	
	//BOTONERA
	$('#botonera ul a')
		.css( {backgroundPosition: "0px 36px"} )
		.mouseover(function(){
			$(this).stop().animate({backgroundPosition:"(0px 18px)"}, {duration:500})
	        $(this).animate( { marginLeft:"20px" }, { queue:false, duration:500 } )	
		})
		.mouseout(function(){
			$(this).stop().animate({backgroundPosition:"(0px 36px)"}, {duration:500})
			$(this).animate( { marginLeft:"0px" }, { queue:false, duration:500 } )
		})
				
});

//BOTONERA / BANNER TOP

function cargar_scroll () {
	//alert("cargando scroll");
	//$('.scroll-pane').jScrollPane({scrollbarWidth:2, scrollbarMargin:10 });	
	//$('.scroll-pane').jScrollPane({scrollbarWidth:2, scrollbarMargin:10 });	
	$('.scroll-pane').jScrollPane({scrollbarWidth:6, scrollbarMargin:10 });
}

function cargar_content(seccion, donde, id) {
	//seccion = Sección a cargar.
	//id = Id donde cargar.
	$(document).ready(function(){
		$("#"+donde).fadeOut(10);
		$("#"+donde).load("seccion/"+seccion+"?id="+id);
	});
	
	$(document).ajaxStart(function(){
		$("#cargador").fadeIn("slow");
		$("#"+donde).addClass("loading");
	});
	
	$(document).ajaxComplete(function(){
		$("#cargador").fadeOut("slow");
		$("#"+donde).fadeIn("slow");
		$("#"+donde).removeClass('loading');
		
		cargar_scroll();
		
	});	
}

function cargar_img(donde, file) {
	$(function () {
		$("#"+donde+" img").remove();
		$("#"+donde+" table").remove();
		var img = new Image();
		// wrap our new image in jQuery, then:
		$("#"+donde).addClass("loading");
		$(img)
		// once the image has loaded, execute this code
		.load(function () {
			// set the image hidden by default    
			$(this).hide();
			// with the holding div #loader, apply:
			$('#'+donde)
			// remove the loading class (so no background spinner), 
			.removeClass('loading')
			// then insert our image
			.append(this);
			// fade our image in to create a nice effect
			$(this).fadeIn();
		})
		
		.error(function () { /* notify the user that the image could not be loaded*/	})
		// *finally*, set the src attribute of the new image to our image
		.attr('src', file);
		window.setTimeout(cargar_scroll, 100)
	});
}





