jQuery(document).ready(function() {
	jQuery('p.comments span.comments a').each(function(){
		jQuery(this).attr('href', 'javascript:void(0)');
		jQuery(this).toggle(function(){
			open(jQuery(this));
		}, function(){
			close(jQuery(this));
		});
	});
		
});
    
function open(here){
	var id= here.parent('span').attr('id').replace('img_','');
	jQuery('div#comments_'+id).fadeIn();
}

function close(here){
	var id= here.parent('span').attr('id').replace('img_','');
	jQuery('div#comments_'+id).fadeOut();
}       

function widthEnforcement(w){
	var width = w;
	jQuery('#content img').each(function(){
	   	var current = jQuery(this);
       	var oPhotoHeight = current.height();
       	var oPhotoWidth = current.width();
       	var aPhotoHeight = (oPhotoHeight*width)/oPhotoWidth;
   	   	if (oPhotoWidth > width){
	   		current.css({height: aPhotoHeight+'px', width: width+'px'}).addClass('scaled');
	   	} 
	}); 
}

