// aqm.js  created on 5/22/2008.
function postSwap(post_id, cat_id){

	var url = 'http://www.allisonqmccarthy.com/post.php?p='+post_id;
	var purl = 'http://www.allisonqmccarthy.com/prev.php?p='+post_id+"&c="+cat_id;

	//new Ajax.Updater({ success: 'post' }, url);	   

	new Ajax.Request( url,
	{ method: 'get', onSuccess: function (transport) {
	  var data = transport.responseText;
	  new Effect.Fade('post', { 
	    duration: 1.0,
	  	afterFinish: function () {
			$('post').update(data);
		 	new Effect.Appear('post',{ delay:0.5, duration: 1.0, from: 0.05, to:1} );
			new Ajax.Updater({ success: 'post_nav' }, purl);
			new Effect.ScrollTo('post',{offset:-140}); 
		 }
	   });
	}
	}); 
	

}



function imageSwap(image_id, post_id, image_height){

	var url = 'http://www.allisonqmccarthy.com/image.php?p='+post_id+'&i='+image_id;
	image_height =  310;
	new Ajax.Request( url, { 
		method: 'get',
		onSuccess: function (transport) {
			var data = transport.responseText;
			$('post_image').morph('height:'+image_height+'px;');
			new Effect.Fade('post_image', { 
				duration: 0.25,
				from: 1.0,
				to: 0.02,
				afterFinish: function () {
					$('post_image').update(data);
					new Effect.Appear('post_image',{ delay:0.5, duration: 0.25, from: 0.1, to:1.0, 
					afterFinish: function(){
					 $('post_image').morph('height:'+image_height+'px;');
		 			}		 	
		 		}); // end effect.appear.
		 	} // end after finish
	   	});	// end effect.fade
		} // end onSuccess
	});  // end ajax.request
} // end function