function calcCentre(obj,prop_resize,inside) {

	var parent_width = $(obj).parent().width();
	var parent_height = $(obj).parent().height();
	var child_width = $(obj).width();
	var child_height = $(obj).height();
	
	var debug = 'parent' + parent_width + 'x' + parent_height;
	debug += ' child' + child_width + 'x' + child_height;
	
	if (prop_resize) {
		// Perform proportional rezise to fit child in parent element //
		if (inside) {
			// Touch image to inside of parent (no cropping) //
			if (child_width > child_height) {
				child_height = child_height*(parent_width/child_width);
				child_width = parent_width;
			} else if (child_height > child_width && child_height > parent_height) {
				child_width = child_width*(parent_height/child_height);
				child_height = parent_height;
			}
		} else {
			// Touch image to outside of parent (cropping) //
			if (child_width > child_height) {
				child_width = child_width*(parent_height/child_height);
				child_height = parent_height;
			} else if (child_height > child_width && child_height > parent_height) {
				child_height = child_height*(parent_width/child_width);
				child_width = parent_width;
			}
			
			debug += ' -> child' + child_width + 'x' + child_height;
			//alert(debug);
		}
		
		$(obj).css('width',child_width);
		$(obj).css('height',child_height);
	}
	
	// Calculate and apply centre positioning //
	$(obj).css('top',(parent_height - child_height) / 2);
	$(obj).css('left',(parent_width - child_width) / 2);
}
