	var scroll;
	var clientWidth, clientHeight;
	var popup_left, popup_height;
//--------------------------------------------------------- Высота документа --
	var ua = navigator.userAgent.toLowerCase();
	var isOpera = (ua.indexOf('opera')  > -1);
	var isIE = (!isOpera && ua.indexOf('msie') > -1);
	
	function getDocumentHeight() {
		return Math.max(document.compatMode != 'CSS1Compat' ? document.body.scrollHeight : document.documentElement.scrollHeight, getViewportHeight());
	}
	
	function getViewportHeight() {
		return ((document.compatMode || isIE) && !isOpera) ? (document.compatMode == 'CSS1Compat') ? document.documentElement.clientHeight : document.body.clientHeight : (document.parentWindow || document.defaultView).innerHeight;
	}
//---------------------------------------------------------		
	function getNewSizes(){
		clientWidth = $(window).width();
		clientHeight = $(window).height();

		popup_left = (clientWidth - 450)/2;
		popup_height = (clientHeight - 400)/2;
		
		$('#outer_shadow').css('height', getDocumentHeight());
	}
	function ShowPopUp(){
		$('body').css('overflow', 'hidden');
		$('#outer_shadow').css('display', 'block');
		$('#export_pop').css('left', popup_left);
		$('#export_pop').css('top', scroll + popup_height);
	}	
	function ClosePopUp(){
		$('#outer_shadow').css('display', 'none');
		$('#export_pop').css('left', '-999999px');
		$('#big_pop').attr('src', '');
		$('body').css('overflow', 'auto');
	}
	$('document').ready(function() {
		getNewSizes();
		$(window).resize(function(){getNewSizes();});
		scroll = document.documentElement.scrollTop || document.body.scrollTop;
		window.onscroll = function () {
			scroll = document.documentElement.scrollTop || document.body.scrollTop;
			$('#export_pop').css('top', 30);
		};
	});	
