	var clientWidth, clientHeight;
	var popup_left;
//--------------------------------------------------------- Высота документа --
	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 - 600)/2;

		$('#outer_shadow').css('height', getDocumentHeight());
	}
	function ShowPopUp(titleval, dateval, smval, authval, moreval){
		$('#outer_shadow').css('display', 'block');
		$('#export_pop').css('left', popup_left);
		$('#export_pop').css('top', window.scrollY + 50);
		$('#blog_title').html(titleval);
		$('#blog_date').html(dateval);
		$('#blog_smcont').html(smval);
		$('#blog_author').html(authval);
		$('#blog_more a').attr('href',moreval);
		$('#html_blog textarea').html($('#preview_blog').html());
	}	
	function ClosePopUp(){
		$('#outer_shadow').css('display', 'none');
		$('#export_pop').css('left', '-999999px');
	}
	$('document').ready(function() {
		getNewSizes();
		$(window).resize(function(){getNewSizes();});
		window.onscroll = function () {$('#export_pop').css('top', window.scrollY + 50);};
	});	
