$(document).ready(function() {
	var path = window.location.toString();

	if(path.match(/\?pid=archive$/g)) {
		$('.archivedLink').click(function(event) {
			baseObj = $(this);
			nextObj = $(baseObj).next()[0];
			if(nextObj.tagName == 'DIV') {
				$('#'+$(nextObj).attr('id')).remove();
			}
			else {

				id = $(this).attr('href').replace(/\?blog=/,'');

				$.get(
					'/getarticle.php?id='+id,
					function(data) {
						$(baseObj).after(data);
					}
				);

			}
			event.preventDefault();
			return false;
		});
	}
});

