//Smartbird Web & Graphic Solutions, Eventual Colima 
$(document).ready(function(){

//Formulario de busqueda
$('input[type="text"]').focus(function() {
    		    if (this.value == this.defaultValue){ 
    		    	this.value = '';
				}
				if(this.value != this.defaultValue){
	    			this.select();
	    		}
    		});
    		$('input[type="text"]').blur(function() {
    		    if ($.trim(this.value) == ''){
			    	this.value = (this.defaultValue ? this.defaultValue : '');
				}
    		});

//Arriba
$(".arriba a").click(function(e){
								e.preventDefault();
								$('html, body').animate({scrollTop:0}, '40000');
	 });

//Publicidad
$(".publicidad a").removeAttr("href");
$("#bottom-banner a").removeAttr("href");
$("#top-banners a").removeAttr("href");

$('.publicidad div a').append('<div class="sp"></div>');

meerkat({
  close: '.close',
  dontShow: '#meerkat-wrap',
  animation: 'slide',
  animationSpeed: 500,
  dontShowExpire: 0,
  meerkatPosition: 'bottom',
  height: '500px'
});

//Tweets
 $('.mensajes-tweet ul').tweets({
           tweets:1,
           username: "eventualcolima"
       });

//Galerķas recientes
	$(".scrollable").scrollable({size:2, hoverClass: 'hover'}).circular().navigator().mousewheel().autoscroll({interval: 6000});	
	
//Espacio entre galerias
$('#galerialista ul li:nth-child(odd) .cont-galeria').css("margin-right","121px");


//Galeria show caption
$('.cont-galeria').hover(function(){
    $(".descripcion-galeria", this).stop().animate({top:'85px'},{queue:false,duration:260});
	}, function() {
	$(".descripcion-galeria", this).stop().animate({top:'250px'},{queue:false,duration:460});
	
		});

$('.items').hover(function(){
    $(".descripcion-galeria", this).stop().animate({top:'85px'},{queue:false,duration:260});
	}, function() {
	$(".descripcion-galeria", this).stop().animate({top:'250px'},{queue:false,duration:460});
	
		});

//La Devastadora
$('[class^=verCont-]').hide().css('text-align','left');
$('[class^=verInfo]').click(function() {
	 $('[class^=verCont-]').hide();
	$('.verCont-' + $(this).attr("title")).toggle(500);
});


						   });

(function($){
	$.fn.tweets = function(options) {
		$.ajaxSetup({ cache: true });
		var defaults = {
			tweets: 1,
			before: "<li><a href='http://www.twitter.com/eventualcolima' title='S&iacute;guenos en Twitter'>",
			after: "</a></li>"
		};
		var options = $.extend(defaults, options);
		return this.each(function() {
			var obj = $(this);
			$.getJSON('http://search.twitter.com/search.json?callback=?&rpp='+options.tweets+'&q=from:'+options.username,
		        function(data) {
		            $.each(data.results, function(i, tweet) {
		                if(tweet.text !== undefined) {
		                    $(obj).append(options.before+tweet.text+options.after);
		                }
		            });
		        }
		    );
		});
	};
})(jQuery);