/* utils */
$(function() {

$('#facebook').hover(function(){
				$(this).animate({left:'0px'},{queue:false,duration:500});
			}, function(){
				$(this).animate({left:'-292px'},{queue:false,duration:500});
			});
			
			// equalHeight($("#nav"));
			// equalHeight($("#content"));

	sA();
	window.onresize = sA;
	
	$("#gomap").goMap({ 
			markers: [{  
				latitude: 52.40755,
				longitude: 16.691837,
				html: {
					content: 'Paso Sp. z o.o.<br />Sierosław<br />ul. Skrajna 1<br />62-080 Tarnowo Podgórne',
					popup: false
				}
			}], zoom: 9, maptype: 'ROADMAP'
		});
});

function sA() {
	if ($(window).height() > $('#nav').height()) {
		$('.safearea').css('min-height', $(window).height());
	} else {
		$('.safearea').css('min-height', $('#nav').height());
	}
	var cH = $('.pageimage').css('height', $(window).height());
	var iH = $('.pageimage img').css('height', $(window).height());
	
	var cW = $('.pageimage').width();
	var iW = $('.pageimage img').width();
	
	if ( iW > cW ) {
		$('.pageimage img').css('margin-left', (cW - iW)/2);
	} else {
		$('.pageimage img').css('margin-left', 0);
	}
}

function equalHeight(group) {
	var tallest = 0;
	group.each(function() {
		var thisHeight = $(this).height();
		if(thisHeight > tallest) {
			tallest = thisHeight;
		}
	});
	group.height(tallest);
}
