$(document).ready( function()
{
	$("#overlay").click(function() { hide_overlay(); } );
	$(".close").click(function() { hide_overlay(); });
	
	$.simpleWeather({
		location: 'san jose, guatemala',unit: 'c',
		success: function(weather){	$(".temperature").html('<p>Clima en Aqua Magic: '+weather.temp+'&deg;C</p><img src="'+weather.thumbnail+'">');},
		error: function(error){$(".temperature").html('<div class="temperature">'+"servidor fuera de l&iacute;nea"+'</div>');} 
		});

});

function show_overlay()
{
	$("#overlay").fadeIn(400);
}

function hide_overlay()
{
	$("#overlay").fadeOut(400);
	$("#image_popup").fadeOut(200);
	$("#map_popup").fadeOut(200);
	$("#evento_popup").fadeOut(200);
	$("#contact_popup").fadeOut(200);
}

function scrollToPage($divName)
{
    $.scrollTo('#'+$divName,400);
}

jQuery.fn.center = function () 
{
    this.css("position","absolute");
    this.css("top", ( $(window).height() - this.height() ) / 2+$(window).scrollTop() + "px");
    this.css("left", ( $(window).width() - this.width() ) / 2+$(window).scrollLeft() + "px");
    return this;
}
