function iniciar_ready(mod){
	switch(mod[0]){
		case 'intro':
			break;
	}

	$('#bsas').click(function(){
		$('.casa').removeClass('sanpablo');
		return false;
	});
	$('#sapa').click(function(){
		$('.casa').addClass('sanpablo');
		return false;
	});
	
	
	$('.disabled').find('a').click(function(){return false;});
	
	if(imgs.length>0){
		preload_img(imgs,function(){
			
		});
	}
	
	$('.gallery').find('a').mouseover(function(){
		n=$(this).find('input').val();
		$('#video_title2').find('img').hide();
		$('#video_title2').find('img').eq(n).show();
	});
	$('.gallery').find('a').mouseout(function(){
		n=$(this).find('input').val();
		$('#video_title2').find('img').eq(n).hide();
	});
	
	if(slider){
		pasar(0);
		$('#izq').click(function(){
			pasar(-1);
		});
		$('#der').click(function(){
			pasar(1);
		});
		//t=$('.gallery').find('li').length;
		//if(t>6)
	}
}

p=0;
function pasar(s){
	t=$('.gallery').find('li').length;
	if(t<=6){
		$('#izq').hide();
		$('#der').hide();
		return;
	}
	p+=s;
	$('#izq').show();
	$('#der').show();
	if(p<=0){
		p=0;
		$('#izq').hide();
	}
	if(p>=t-6){
		p=t-6;
		$('#der').hide();
	}
	$('.gallery').find('ul').animate({"left": (-p*111)+'px'}, 500,"easeInOutExpo",function(){});
}

function preload_img(_imgs,func){
	$ci = 0;
	$ti = _imgs.length;
	$(_imgs).each(function(k,v){
		var img = new Image();
		$(img)
		.load(function(){
			$ci++;
			if($ci==$ti)func($(this));
		})
		.error(function(){
			$ci++;
			if($ci==$ti)func($(this));
		})
		.attr('src', v);
	});
};


jQuery.extend( jQuery.easing, // from the jquery.easing plugin
{
	easeInOutExpo: function (x, t, b, c, d) {
		if (t==0) return b;
		if (t==d) return b+c;
		if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
		return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
	}
});


