
function popup1() {

	function getClientWidth() {
		return document.compatMode=='CSS1Compat' && !window.opera?document.documentElement.clientWidth:document.body.clientWidth;
	}

	function getClientHeight() {
		return document.compatMode=='CSS1Compat' && !window.opera?document.documentElement.clientHeight:document.body.clientHeight;
	}

	$('#fl').css({
		'position' : 'absolute' ,
		'top' : 0 ,
		'left' : 0 ,
		'z-index' : 10000 ,
		'height' : document.height ,
		'width' : getClientWidth() ,
		'background-color' : '#000000' ,
		'opacity' : '0.6'
	});

	$('#flash1 img').css({
		'max-height' : getClientHeight()-100
	});
	if($.browser.msie) {
		$('#fl').css({
			'top' : document.body.scrollTop ,
			'height' : document.body.clientHeight
		});
		$('#flash1 img').css({
			'height' : document.body.clientHeight-100
		});
		$(window).scroll(function() {
			$('#fl').css({
				'top' : document.body.scrollTop
			});
			alert(window.body.scrollTop);
		});
	}
	$('#flash1').css({
		'position' : 'absolute' ,
		'top' : 100 ,
		'left' : (getClientWidth()-$('#flash1').width())/2 ,
		'z-index' : 110000 ,
		'opacity' : '1.0'
	});

	$('#flash1 #close').css({
		'position' : 'absolute' ,
		'top' : 10 ,
		'right' : 10 ,
		'z-index' : 110000 ,
		'background-image' : "url('http://www.rusdel.ru/files/button-close.png')" ,
		'width' : 32 ,
		'height' : 32 ,
		'cursor' : 'pointer'
	});
	
	$('#fl').fadeIn('slow');
	$('#flash1').fadeIn('slow');

	$('#fl').click(function() {
		$('#flash1').fadeOut('slow');
		$('#fl').fadeOut('slow');
//		popup2();
	});
	$('#flash1').click(function() {
		$('#flash1').fadeOut('slow');
		$('#fl').fadeOut('slow');
//		popup2();
	});
	$('#flash1 #close').click(function() {
		$('#flash1').fadeOut('slow');
		$('#fl').fadeOut('slow');
//		popup2();
	});
}

function popup2() {

	function getClientWidth() {
		return document.compatMode=='CSS1Compat' && !window.opera?document.documentElement.clientWidth:document.body.clientWidth;
	}

	function getClientHeight() {
		return document.compatMode=='CSS1Compat' && !window.opera?document.documentElement.clientHeight:document.body.clientHeight;
	}

	var de = document.documentElement;
	$('#flash2 img').css({
		'max-height' : getClientHeight()-100
	});
	if($.browser.msie) {
		$('#flash2 img').css({
			'height' : document.body.clientHeight-100
		});
		$(window).scroll(function() {
			$('#fl').css({
				'top' : document.body.scrollTop
			});
		});
	}
	$('#flash2').css({
		'position' : 'absolute' ,
		'top' : 50 ,
		'left' : (getClientWidth()-$('#flash2').width())/2 ,
		'z-index' : 110000 ,
		'opacity' : '1.0'
	});

	$('#flash2').fadeIn('slow');

	
	$('#flash2 #close').css({
		'position' : 'absolute' ,
		'top' : 10 ,
		'right' : 10 ,
		'z-index' : 110000 ,
		'background-image' : "url('http://www.rusdel.ru/files/button-close.png')" ,
		'width' : 32 ,
		'height' : 32 ,
		'cursor' : 'pointer'
	});
	
	$('#fl').click(function() {
		$('#flash2').fadeOut('slow');
		$('#fl').fadeOut('slow');
	});
	$('#flash2').click(function() {
		$('#flash2').fadeOut('slow');
		$('#fl').fadeOut('slow');
	});
	$('#flash2 #close').click(function() {
		$('#flash2').fadeOut('slow');
		$('#fl').fadeOut('slow');
	});
}
