$().ready(function(){
	
	$('.show-popup').click(function(){
		
		$('#overlay').show();
		
		var popup = $(this).parents('.implementation').find('.popup');
		
		var margin = ($('body').width() / 2) - (popup.outerWidth() / 2);
		
		popup.css('left', margin+'px');
		
		popup.show();
	});
	
	$('.close-popup').click(function(){
		
		$(this).parents('.popup').hide();
		$('#overlay').hide();
		
	});
	
	$('#open-english-info').click(function(){
		
		var margin = (($('body').width() - $('#root').outerWidth()) / 2);
		
		$('#top-text-english').css('right', margin+'px');
		
		$('#overlay').show();
		$('#top-text-english').show();
		
		return false;
		
	});
	
	$('#close-english-info').click(function(){
		
		$('#top-text-english').hide();
		$('#overlay').hide();
		
		return false;
		
	});
	
	$('#overlay').click(function(){
		
		$('.popup').hide();
		$('#top-text-english').hide();
		$('.fast-contact-window').hide();
		$(this).hide();
	});
	
	$('#fast-contact').click(function(){
		
		var margin = (($('body').width() - $('.fast-contact-window').outerWidth()) / 2);
		
		$('#overlay').show();
		$('.fast-contact-window').css('left', margin+'px').show();
		
		return false;
		
	});
	
	$('.fast-contact-window-close').click(function(){
		
		$('.fast-contact-window').hide();
		$('#overlay').hide();
		return false;
		
	});
});

