_MC.DocumentReady([function() {
	resize();
	var oWin = window;
	var oAboutLink = $('about_link');
	var oContactLink = $('contact_link');
	_MC.AddEvent(oWin, {'resize':resize}, true);
	_MC.AddEvent(
		oAboutLink,
		{
			'click': ShowHideAbout,
			'mouseover':function(){
				_MC.SetClass($('about_link'), 'pseudolink_', 'pseudolink');
			},
			'mouseout':function(){
				_MC.SetClass($('about_link'), 'pseudolink', 'pseudolink_');
			}
		},
		true
	);
	_MC.AddEvent(
		oContactLink,
		{
			'click': ShowHideContact,
			'mouseover':function(){
				_MC.SetClass($('contact_link'), 'pseudolink_', 'pseudolink');
			},
			'mouseout':function(){
				_MC.SetClass($('contact_link'), 'pseudolink', 'pseudolink_');
			}
		},
		true
	);
}]);

function resize() {
	var oFooter = $('footer');
	var oLayout = $('layout');
	var iLayoutWidth = oLayout.offsetWidth;
	var iHeight = 1848;
	var iHeightPercent = Math.round(1089/(iHeight/100));
	var iWidth = 1680;
	var iRatio = iLayoutWidth/iWidth;
	var iFooter = Math.round( iHeight * iRatio / 100 * iHeightPercent ) ;
	oFooter.style.height = iFooter+'px';
}

function ShowHideAbout() {
	ShowHideText( 'about' );
}

function ShowHideContact() {
	ShowHideText( 'contact' );
}

var bStart = false;
function ShowHideText( sId ) {
	if(bStart)
		return;
	bStart = true;
	var _this = this;
	this.oContainer = $( sId+'_text_container' );
	this.oText = $( sId+'_text' );
	
	this.iCurrHeight = oContainer.offsetHeight;
	this.iHeight = oText.offsetHeight;
	
	this.iTime = 1000;
	this.iStep = Math.round(this.iHeight/15);
	this.iInterval = 10;
	
	if(iCurrHeight == 0) {
		this.oShow = window.setInterval(function(){
			if( _this.oContainer.offsetHeight >= _this.iHeight ) {
				_this.oContainer.style.height = '100%';
				bStart = false;
				window.clearInterval(_this.oShow);
				return;
			}
			else {
				var iCurrHeight = ( (_this.iHeight - _this.oContainer.offsetHeight*1) < this.iStep*1 ) ? _this.oContainer.offsetHeight*1 + (_this.iHeight - _this.oContainer.offsetHeight*1) : _this.oContainer.offsetHeight*1 + this.iStep*1;
				_this.oContainer.style.height = iCurrHeight+'px';
			}
		}, this.iInterval);
	}
	else {
		this.oShow = window.setInterval(function(){
			if( _this.oContainer.offsetHeight <= 0 ) {
				_this.oContainer.style.height = '0px';
				bStart = false;
				window.clearInterval(_this.oShow);
				return;
			}
			else {
				var iCurrHeight = ( _this.oContainer.offsetHeight*1 < this.iStep*1 ) ? 0 : _this.oContainer.offsetHeight*1 - this.iStep*1;
				_this.oContainer.style.height = iCurrHeight+'px';
			}
		}, this.iInterval);
	}
}
