/**
 * Common Class
 * by wirexmedia (info@wirexmedia.com)
 **/

// Initiate cufon before document is ready for IE reasons
/* Navigation */
Cufon.replace('.main .navigation li a', {
	fontFamily: 'Verve Std',
	hover: true,
	separate: 'none'
});

var _Common = new Common();
function Common() {
	var _l0 = this;
	$(document).ready(function() {
		_l0.build();
	});
};

Common.prototype.build = function() {
	var _l0 = this;
	// Update elements on stage
	$(window).resize(function() {		
		_l0.updateElementsOnStage();
	});
	_l0.updateElementsOnStage();
	
	// Disable ontouch for ipad/iphone to avoid scrolling
	if (isMobileClient(navigator.userAgent)) {
		document.body.addEventListener('touchmove', function(e){ e.preventDefault(); });
		//document.body.addEventListener('touchstart', function(e){ e.preventDefault(); }); 
	}
};

Common.prototype.updateElementsOnStage = function() {
	var _l0 = this;
	$('.main .left-col .bottom-bg', _l0.doc).css({'top' : -Math.max(0, $('.main .left-col .bottom-bg', _l0.doc).height()-$('body').height()-45)});
	$('.main .left-col .navigation', _l0.doc).css({
		'top' : Math.round(Math.min(900, $('.main .left-col', _l0.doc).height())/2-50),
		'margin-top' : -Math.round($('.main .left-col .navigation', _l0.doc).height()/2)
	});
};
