	$(document).ready(
	function(){
	$(".slideshow").oneTime(500,"slidedelay",
		function(){
			$(".slideshow").image("images/inicio/2.jpg","1",function(){});
			$(".slideshow").image("images/inicio/3.jpg","2",function(){});
			$(".slideshow").image("images/inicio/4.jpg","3",function(){});
			$(".slideshow").image("images/inicio/5.jpg","4",function(){});		
			$(".slideshow").everyTime(8000,"slideauto",function(){
				$("a.next").trigger("click");
			},5,true);
		});
		
		$("a.next").click(
		function(){
			current=$(".slideshow img:visible").attr("id");
			next=parseInt(current)+1;
			if(next>4)
				next=0;
			jump(next);
			return false;
		});
		
		$("a.prev").click(
		function(){
			current=$(".slideshow img:visible").attr("id");
			next=parseInt(current)-1;
			if(next<0)
				next=4;
			jump(next);
			return false;
		});
		
		$("a.jump").click(
		function(){
			next=$(this).attr("id");
			next=next.substr(4,1); //alert('sd '+next);
			jump(next);
			return false;
		});
	});
	
	function jump(next){
		current=$(".slideshow img:visible").attr("id");
		if(next!=current){
			$(".slideshow img#"+next).show();
			$(".slideshow img#"+current).fadeOut(1200,
			function(){
				$(".slideshow img").removeClass("current");
				$(".slideshow img:visible").addClass("current");
			});
		}
	}
	
	$.fn.image=function(src,id,f){
		return this.each(
			function(){
				var i=new Image();
				$(i).load(function(){}).error(function(){}).attr('src',src).attr('id',id).hide();
				this.appendChild(i);
			});
	}