jQuery(document).ready(function(){
	/* fixed bug in IE with setting innerWidth to variable
	*
	* -Chris Baldelomar
	*/
	
	var screen_size = jQuery(window).width();
	var body_width = jQuery(document).width();
	
	if(screen_size < body_width) {
		var number = (body_width - screen_size)/2;
		window.scrollTo(number, 0);
	}
	
	jQuery('a.postpopup').click(function(){
		id = jQuery(this).attr('rel');
		jQuery('<div id="ajax-popup"></div>').show().appendTo('body').load('/ajax-post/?id='+id).modal({
			overlayClose:true,
			opacity:80,
			minHeight:500,
			minWidth: 800
		});
		return false;
	});
	
	jQuery.modal.close();
});