$(document).ready(function() {
 // hides the slickbox as soon as the DOM is ready
  $('#social_activities').hide();
  $('#academic_life').hide();
  $('#professional_career').hide();

  $('#social_tab').click(function() {
    $('#social_activities').fadeIn('fast');
	$('#intro').fadeOut('fast');
	$('#academic_life').fadeOut('fast');
	$('#professional_career').fadeOut('fast');
	
  });
  
  $('#academic_tab').click(function() {
    $('#academic_life').fadeIn('fast');
	$('#social_activities').fadeOut('fast');
	$('#intro').fadeOut('fast');
	$('#professional_career').fadeOut('fast');
  });
  
	
	$('#professional_tab').click(function() {
		$('#professional_career').fadeIn('fast');
		$('#social_activities').fadeOut('fast');
		$('#intro').fadeOut('fast');
		$('#academic_life').fadeOut('fast');
	  });
 
  
});


$(document).ready(function() {
 // hides the slickbox as soon as the DOM is ready
  $('#twitter_container').hide();
  $('#linkedin_container').hide();
  $('#foursquar_container').hide();

  $('#twitter_tab').click(function() {
    $('#twitter_container').fadeIn('slow');
	$('#fb_container').fadeOut('slow');
	$('#linkedin_container').fadeOut('slow');
	$('#foursquar_container').fadeOut('slow');
	$('#twttab_img').attr('src', 'images/twitter_icon_color.png');
	$('#fbtab_img').attr('src', 'images/fb_icon_gray.png');
	$('#lnktab_img').attr('src', 'images/linkedin_icon_gray.png');
	$('#fqtab_img').attr('src', 'images/foursquar_icon_gray.png');
	paginateTweet(0);
	
  });
  
  $('#linkedin_tab').click(function() {
    $('#linkedin_container').fadeIn('slow');
	$('#fb_container').fadeOut('slow');
	$('#twitter_container').fadeOut('slow');
	$('#foursquar_container').fadeOut('slow');
	$('#twttab_img').attr('src', 'images/twitter_icon_gray.png');
	$('#fbtab_img').attr('src', 'images/fb_icon_gray.png');
	$('#lnktab_img').attr('src', 'images/linkedin_icon_color.png');
	$('#fqtab_img').attr('src', 'images/foursquar_icon_gray.png');
	paginateLn(0);
  });
  
  $('#foursquar_tab').click(function() {
    $('#foursquar_container').fadeIn('slow');
	$('#fb_container').fadeOut('slow');
	$('#twitter_container').fadeOut('slow');
	$('#linkedin_container').fadeOut('slow');
	$('#twttab_img').attr('src', 'images/twitter_icon_gray.png');
	$('#fbtab_img').attr('src', 'images/fb_icon_gray.png');
	$('#lnktab_img').attr('src', 'images/linkedin_icon_gray.png');
	$('#fqtab_img').attr('src', 'images/foursquar_icon_color.png');
	paginateFq(0);
  });
  
  $('#fb_tab').click(function() {
    $('#fb_container').fadeIn('slow');
	$('#foursquar_container').fadeOut('slow');
	$('#twitter_container').fadeOut('slow');
	$('#linkedin_container').fadeOut('slow');
	$('#twttab_img').attr('src', 'images/twitter_icon_gray.png');
	$('#fbtab_img').attr('src', 'images/fb_icon_color.png');
	$('#lnktab_img').attr('src', 'images/linkedin_icon_gray.png');
	$('#fqtab_img').attr('src', 'images/foursquar_icon_gray.png');
	paginateFB(0);
  });
  
});
//start the social feed code
$(document).ready(function() {
	$.ajax({
 	 		type: "POST",
 	 		url: "facebook.php",
 	 		success: function(response){
 	 			eval("var obj="+response);
				document.getElementById('fb_posts').innerHTML = obj.fbhtml;
				document.getElementById('fb_pagination').innerHTML = obj.html_pagination;
			}	
 	 		}); 
});
function paginateFB(pageno){
	$.ajax({
 	 		type: "POST",
 	 		url: "facebook.php?page="+pageno,
 	 		success: function(response){
 	 			eval("var obj="+response);
				document.getElementById('fb_posts').innerHTML = obj.fbhtml;
				document.getElementById('fb_pagination').innerHTML = obj.html_pagination;
			}	
 	 		}); 
}
function paginateTweet(pageno){
	$.ajax({
 	 		type: "POST",
 	 		url: "twitter.php?page="+pageno,
 	 		success: function(response){
 	 			eval("var obj="+response);
				document.getElementById('tweet_posts').innerHTML = obj.twithtml;
				document.getElementById('tweet_pagination').innerHTML = obj.html_pagination;
			}	
 	 		}); 
}
function paginateLn(pageno){
	$.ajax({
 	 		type: "POST",
 	 		url: "linkedin.php?page="+pageno,
 	 		success: function(response){
 	 			eval("var obj="+response);
				document.getElementById('ln_posts').innerHTML = obj.lnhtml;
				document.getElementById('ln_pagination').innerHTML = obj.html_pagination;
			}	
 	 	}); 
}
function paginateFq(pageno){
	$.ajax({
 	 		type: "POST",
 	 		url: "foursquare.php?page="+pageno,
 	 		success: function(response){
 	 			eval("var obj="+response);
				document.getElementById('fq_posts').innerHTML = obj.fqhtml;
				document.getElementById('fq_pagination').innerHTML = obj.html_pagination;
			}	
 	 	}); 
}
