 
 layoutPage = (layer, size) ->
 
-	split = detectHeaderFooter(layer)
+	split = pageLayout(layer)
 
 	return layer unless split.body
 

##############################################################
# Layout helpers

detectHeaderFooter = (layer) ->

	# This function tries to detect a stack of:
	# 1) header / body / footer

		for scroll in [layer, layer.children...]
			@_forwardScrollEvents(layer)

			if scroll instanceof ScrollComponent
				inset = {}
				inset.top = @header?.height or 0 if scroll.y is 0
				inset.bottom = @footer?.height or 0 if scroll.maxY is @height
				scroll.contentInset = inset

		# Set the background color for he created scroll component
		if layer instanceof ScrollComponent
			layer.backgroundColor = @backgroundColor

		return layer

