function showVideoPopup() {
	var videoPopup = $('<div id="videoPopup">'+
					   '<object id="videoplayer368" type="application/x-shockwave-flash" data="/uppod.swf" width="500" height="375">'+
					   '<param name="allowFullScreen" value="true" />'+
					   '<param name="allowScriptAccess" value="always" /><param name="wmode" value="transparent" />'+
					   '<param name="movie" value="/uppod.swf" />'+
                                           ' <param name="flashvars" value="comment=VideoLogo&amp;st=/flash/video54-267.txt&amp;file=flash/Grand_Arena_09q_2_3.flv" /></object>'+
					   '<a href="#" class="closePopup"><img src="img/blank.gif" width="10" height="10" alt="Закрыть" /></a>'+
					   '</div>');
	
	var blind = $('<div class="blind"></div>');
	pageHeight = (document.documentElement.offsetHeight > document.body.clientHeight) ? document.documentElement.offsetHeight : document.body.clientHeight;
	blind.height(pageHeight).click(function(){
		closeVideoPopup(videoPopup,blind);
		return false;
	}).appendTo('body');
	videoPopup.appendTo('body');
	setCenter(videoPopup);

	$('select').css({visibility: 'hidden'});
	
	videoPopup.find('.closePopup').click(function(){
	closeVideoPopup(videoPopup,blind);
	return false;
	});
	
	blind.show();
	videoPopup.show();
}

function setCenter(item) {
	windowHeight = document.documentElement.clientHeight;
	currentOffset = document.documentElement.scrollTop || document.body.scrollTop;
	
	currentOffset = currentOffset + parseInt((windowHeight - $(item).height()) / 2);
	pLeft = (document.body.clientWidth - $(item).width()) / 2;

	if (currentOffset < 20) { $(item).css({top: 20, left: pLeft}).fadeIn(); }
	else { $(item).css({top: currentOffset, left: pLeft}).fadeIn(); }
	
	return false;
}

function closeVideoPopup(videoPopup,blind){
	videoPopup.remove();
	blind.remove();
	$('select').css({visibility: 'visible'});
}
