
$(document).ready(function() {

//if close button is clicked
$('.windowNesletter .close').click(function (e) {
	//Cancel the link behavior
	e.preventDefault();	
	$('#maskNesletter').hide();
	$('.windowNesletter').hide();
});

//if mask is clicked
$('#maskNesletter').click(function () {
	$(this).hide();
	$('.windowNesletter').hide();
});

});		 


function showNewsletter() {
		//Cancel the link behavior
		//Get the screen height and width
		var maskHeight = $(document).height();
		var maskWidth = $(window).width();
		
		//Set heigth and width to mask to fill up the whole screen
		$('#maskNesletter').css({'width':maskWidth,'height':maskHeight});
		
		//transition effect
		$('#maskNesletter').fadeIn(100);
		$('#maskNesletter').fadeTo("slow",0.4);
		
		//Get the window height and width
		var winH = $(window).height();
		var winW = $(window).width();
		
		//Set the popup window to center
		var objPopup = $('#dialogNesletter');
		$(objPopup).css('top',  winH/2-$(objPopup).height()/2);
		$(objPopup).css('left', winW/2-$(objPopup).width()/2);
		$(objPopup).css('position', 'fixed') 
		
		//transition effect
		$(objPopup).fadeIn(100);
	}





