$(document).ready(function(){

	$('a[rel=external]').click(function(){
		window.open( $(this).attr('href') );
		return false;
	}); 


	$('.replybtn').click(function(){
	

		var comment = $(this).parent();
		
		$.get("/inc/forms/form-comments.php", { blogid: $('#blogid').val(), commentid: $(this).attr('id') },
			function(data){
			comment.append(data);
		});
		
		$(this).remove();
	});



	$(".fancy").each( function() {

		var linkto = $(this).attr("src");
		var title = $(this).attr("alt");
		var path = linkto.split("/");
		var filename = path[path.length-1];
		
		var fullsize = "userfiles/full/" + filename;
		
		path.pop();
		path.pop();
		path.push(fullsize);
		
		var newpath = path.join("/");

		
		$(this).wrap("<a href='" + newpath + "' title='" + title + "' class='fancylink'></a>");
	
	});


	$("a.fancylink").fancybox({
		'zoomSpeedIn'			: 600,
		'zoomSpeedOut'			: 500,
		'easingIn'				: 'easeOutBack',
		'easingOut'				: 'easeInBack',
		'hideOnContentClick': true
	});



	
});


