Event.observe(document, 'dom:loaded', function(){
	ResizeText.init()
	if ($('center')) {
		$('center').morph('color: #e6ac91;', {duration: 2*60})
	}
})

ResizeText = {
	init: function() {
		if ($('center')) {
			this.container = $('center')
			this.defaultWindowWidth = 1000
			this.defaultWindowHeight = 660
			Event.observe(window, 'resize', this.resize.bindAsEventListener(this))
			this.resize()
			$$('body')[0].setStyle({minWidth: '1px', minHeight: '1px'})
		}
	}
	,getZoomCoeff: function() {
		return Math.min(document.viewport.getWidth()/this.defaultWindowWidth, document.viewport.getHeight()/this.defaultWindowHeight)
	}
	,resize: function() {
		this.container.setStyle({fontSize: 10*this.getZoomCoeff()+'px'})
		this.container.setStyle({marginTop: -this.container.getHeight()/2+'px', 'margin-left': -this.container.getWidth()/2+'px'})
	}
}
