// JavaScript Document
$(document).ready
(
	function()
	{
		$('#project-gallery a').each
		(
			function(i)
			{
				$(this).data('href',$(this).attr('href'));
				$(this).removeAttr('href');	
				$(this).click
				(
					function()
					{
						showPic(this);	
					}
				)
			}
		)		
	}
)
function showPic(node)
{
	var id = $(node).attr('id').replace('pic-','');
	$.post(templateDirectory + '/ajax/get_pic.php',{id : id},replacePic);
}
function replacePic(data,statusText)
{
	$('#lg-pic').html(data);	
}
function addLikedSite()
{
	var numSites = $("input[name ^='liked_site']").size() + 1;
	theLink = $('#likedLabel');
	
	var newHTML = '<label>Site URL</label>';
	newHTML += '<input type="text" name="liked_site_' + numSites + '" /><br />';
	newHTML += '<label>What you like</label>';
	newHTML += '<textarea name="liked_site_reason_' + numSites + '"></textarea><br />';
	
	theLink.before(newHTML);
}
