$(document).ready(function() {
	
//Vertical Sliding

$('.boxgrid_1.caption').hover(function(){
$(".cover", this).stop().animate({top:'65px'},{queue:false,duration:140});
}, function() {
$(".cover", this).stop().animate({top:'110px'},{queue:false,duration:140});
});	
	
//Overlay						   
$("a[rel='#overlay']").overlay({
	mask: '#333',
	effect: 'apple',
	onBeforeLoad: function() {
		var wrap = this.getOverlay().find(".contentWrap");
		wrap.load(this.getTrigger().attr("href") + " #hijax");
	}
});
  
  
// Twitter
	
	function linkify(string){  
         string = string.replace(  
         /((https?\:\/\/)|(www\.))(\S+)(\w{2,4})(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/gi,  
         function(url){  
              var full_url = url;  
              if (!full_url.match('^https?:\/\/')) {  
              full_url = 'http://' + full_url;  
         }  
         return '<a href="' + full_url + '">' + url + '</a>';  
         }  
    );  
    return string;  
    }  
	
	if( $('#tweet1').length) {		
		$.getJSON('http://api.twitter.com/1/statuses/user_timeline/tincanpippip.json?count=10&callback=?',function(tweet){  
			 tweet1 = linkify(tweet[0].text);  
			 tweet2 = linkify(tweet[1].text); 
			 tweet3 = linkify(tweet[2].text); 
			 $("#tweet1").html(tweet1);  
			 $("#tweet2").html(tweet2);  
			 $("#tweet3").html(tweet3);
		});	
	};
	
	// Stage Slideshow
	$(".slidetabs").tabs(".slides > div.item", {

	// enable "cross-fading" effect
	effect: 'fade',
	fadeOutSpeed: "slow",

	// start from the beginning after the last tab
	rotate: true

	// use the slideshow plugin. It accepts its own configuration
		}).slideshow({
			interval: 15000, 
			autoplay: true
			});

	
});
