$(document).ready(function() {
	
	$('#about-content').css('height', '235px');
	$('#profile-content').css('height', '235px');
    $('.the-content').css('display', 'none');
		initLS();
	$(".slide-title").click(function(){
		window.location=$(this).find("a").attr("href");
		return false;
	});		
	$('.slide-title').mouseenter(function(event) {
		event.preventDefault();
		$('.the-content').fadeIn('slow')
		});	
	$('.slide-title').mouseleave(function(event) {
		event.preventDefault();
		$('.the-content').fadeOut('slow')
		});
		
	$('a.slide-button').click(function(event) {
		event.preventDefault();		
		slideIt();
		});		 
	$.getJSON("http://api.flickr.com/services/feeds/photos_public.gne?id=47732377@N08&format=json&jsoncallback=?", function(data) {
			   var target = "#flickr ul "; // Where is it going?
			   for (i = 0; i <= 0; i = i + 1) { // Loop through the 10 most recent, [0-9]
					   var pic = data.items[i];
					   var liNumber = i + 1; // Add class to each LI (1-10)
					   $(target).append("<li class='flickr-image no-" + liNumber + "'><a title='" + pic.title + "' href='" + pic.link + "'><img  src='" + pic.media.m + "' /></a></li>");
			   }
	});	 
	$('a').each(function() {
		   var a = new RegExp('/' + window.location.host + '/');
		   if(!a.test(this.href)) {
		       $(this).click(function(event) {
		           event.preventDefault();
		           event.stopPropagation();
		           window.open(this.href, '_blank');
		       });
		   }
		});
});
var down = false;
function slideIt () {
if (!down) {
			$('#about-content').animate({"height": "415px"}, "slow");
			$('#profile-content').animate({"height": "415px"}, "slow");
			$('a.slide-button').css('background-position', '-76px -38px');
			$('a.slide-button').text('Less About Me');

			down = true;
		} else {
			$('#about-content').animate({"height": "235px"}, "slow");
			$('#profile-content').animate({"height": "235px"}, "slow");
			$('a.slide-button').css('background-position', '-38px -38px');
			$('a.slide-button').text('More About Me');
			
			down = false;
		}
}

var more = true; 

function initLS(){
		$.fn.loopedSlider.defaults.addPagination = true;
		$.fn.loopedSlider.defaults.slidespeed = 1000;
		$.fn.loopedSlider.defaults.containerClick = false;
	
		$('#loopedSlider').loopedSlider();
	}




