$(document).ready(function(){	
	//THIS BIT IS TO CROP IMAGE FOR EVENTS, NEWS IMAGES ON HOMEPAGE
	$(".activity-highlight-image img").each(function(){                       
	$(this).replaceWith(
		$(this)
			.clone()
			.attr('src', '/grayscale.php?w=115&h=115&url=' + this.src + '_gray.jpg')
			.load(function(){				
				$(this).closest("img").css({width:'115px'});
				$(this).closest("img").attr('width','115px');
		})
	)
	});
	
	$("#activity-desc-image img").each(function(){                       
	$(this).replaceWith(
		$(this)
			.clone()
			.attr('src', '/grayscale.php?w=200&h=200&url=' + this.src + '_gray.jpg')
			.load(function(){				
				$(this).closest("img").css({width:'200px;'});
		})
	)
	});
	
	// Activity listting page with pagination
	
	$(".activity-image img").each(function(){                       
	$(this).replaceWith(
		$(this)
			.clone()
			.attr('src', '/grayscale.php?w=78&h=78&url=' + this.src + '_gray.jpg')
			.load(function(){				
				$(this).closest("img").css({width:'78px;'});
		})
	)
	});
	
	
	
	
	//	THIS BIT IS TO CROP IMAGE FOR RESOURCES PAGE
	//	http://lcf.kdwebserver.co.uk/resources/overview/
	
	$("#resource-list img").each(function(){                       
	$(this).replaceWith(
		$(this)
			.clone()
			.attr('src', '/grayscale.php?w=64&h=64&url=' + this.src + '_gray.jpg')
			.load(function(){
				$(this).closest(".resource-image").css({visibility: 'visible'});
		})
	)
	});

	
	
});