/**
 * Master Class
 *
 * @version 1.00
 */

window.$Master = new function() {

	
	/* Instance */
	
	var $this = this;
	

	/* Public Vars (this.var) */
		
	
	/* Private Vars (var var)*/
	

	/* Constructor */
	
	$(function(){ 


		/* Current */
		
		var current = '/' + $('meta[name=current]').attr('content');
		if (current != '/') current += '/';
		
		$('.Menu > p > a').each(function(){
			var el = $(this);
			var href = el.attr('href');
			if (href == current) el.addClass('Current');
		});
	

		/* Fixed */
		
		if ($.browser.safari || $.browser.mozilla) $('body').addClass('Fixed');

		if ($.browser.msie && $.browser.version > 6) $('body').addClass('Fixed');
				
		
		/* Layout */
		
		$(window).bind('resize', $this.layout);
		
		$this.layout();


		/* Scroll */
		
		$('#ScrollToPizza').attr('href','javascript:void(0);').click(function(){
			
			var offset = $('.Section#Pizza').offset();
			
			$('html,body').animate({scrollTop:offset.top-145},700,'easeInOutExpo');
		
		});
		
		$('#ScrollToLunch').attr('href','javascript:void(0);').click(function(){
			
			var offset = $('.Section#Lunch').offset();
			
			$('html,body').animate({scrollTop:offset.top-145},700,'easeInOutExpo');
		
		});


		/* Facebook */
		
		setTimeout(function(){ $this.tm(); },30000);
		
		$this.tm = function() {
			FB.Insights.impression({ 'id' : 6002466127390, 'h' : '455aad4762' });
		};
		
		
	});
		

	/* Public Methods */
	
	this.layout = function() {
	
		var wh = $(window).height();
		
		if (wh > 480) {
			$('body').removeClass('Tiny');
		} else {
			$('body').addClass('Tiny').removeClass('Fixed');
		};
	
	};
	

	/* Private Methods */
	

};


/*
Cufon.replace('h1,h2,h3,h4,h5,h6,p',{
	fontFamily: 'Bodoni',
	textShadow: '1px 1px #fff'
});
*/


