$(document).ready(function() {
	var footer= "&copy;"  + new Date().getFullYear() + " Burgers, Shakes & Fries - All Rights Reserved";
	$('#footer').append(footer);

//	insert4sq("php/4sq-greenwich.php",'greenwich');
//	insert4sq("php/4sq-darien.php",'darien');
	
	$('#contentHolder').masonry({
  		columnWidth: 10, 
  		animate: true,
  		animationOptions: {
    		duration: 500,
    		easing: 'linear',
    		queue: false,
			saveOptions: true,
  		}
	});
	
	new nfMap('greenwich_map', 16,41.0028576, -73.6535331,"http://maps.google.com/maps/ms?ie=UTF8&hl=en&t=h&msa=0&msid=203944393542505796403.00000112d575855e18e7b&ll=41.002931,-73.653484&spn=0.00164,0.002253&z=19&iwloc=lyrftr:h,3800371858184403715,41.002865,-73.653545");
	new nfMap('darien_map', 16,41.0790325, -73.4683526,"http://maps.google.com/maps/ms?ie=UTF8&hl=en&t=h&msa=0&msid=203944393542505796403.00000112d575855e18e7b&ll=41.07909,-73.468398&spn=0.001638,0.002253&z=19&iwloc=0004976c49f0508b7abc2");
	
	$('a.lightbox').lightBox({overlayBgColor:"#CCCCCC",overlayOpacity:0.6});
});

 function insert4sq(file,div){
	$.ajax({url:file, success:function(d){
			$('#' + div + "4sq").append(d);
			$('#' + div + "tips").hide();
			$('#' + div + "read-open").hide();
			$('#' + div + "read").readReviews(div);
			$('#contentHolder').masonry();
			}
		}
	)	
}

jQuery.fn.readReviews = function(div){
	this.open = false
	this.each(function(){
		$(this).click(function(){
			this.open = !this.open
			if(this.open){
				$('#' + div + "tips").show();
				$('#' +div + "read-open").show();
				$('#' +div + "read-closed").hide();
			}else{
				$('#' + div + "tips").hide();
				$('#' +div + "read-open").hide();
				$('#' +div + "read-closed").show();
			}
			$('#contentHolder').masonry();
		})
	});
	return this;
};

