        function PopUp1( path, width, height, comment ) {
		var scr = screen.height;

		height = height + 90;
		width  = width  + 40;

		if( scr > 0 && height > scr - 100 )
	                var winCmd = window.open( 'http://www.mezhutoki.ru/popup1.php?images='+ path +'&description='+ comment, 'Mezhutoki', 'height='+ (scr-80) +', width='+ width +', top=0, left=0, toolbar=0, titlebar=0, status=0, menubar=0, scrollbars=1, resizable=1' );
		else if( height > 710 )
	                var winCmd = window.open( 'http://www.mezhutoki.ru/popup1.php?images='+ path +'&description='+ comment, 'Mezhutoki', 'height='+ height +', width='+ width +', top=0, left=0, toolbar=0, titlebar=0, status=0, menubar=0, scrollbars=1, resizable=1' );
		else
	                var winCmd = window.open( 'http://www.mezhutoki.ru/popup1.php?images='+ path +'&description='+ comment, 'Mezhutoki', 'height='+ height +', width='+ width +', top=0, left=0, toolbar=0, titlebar=0, status=0, menubar=0, scrollbars=0, resizable=0' );

		winCmd.focus();
        }

        function PopUp2( path, width, height, count ) {
		var scr = screen.height;

		height = height + 390;
		width  = width  + 60;

		if( scr > 0 && height > scr - 100 )
	                var winCmd = window.open( 'http://www.mezhutoki.ru/popup2.php?images='+ path +'&count='+ count, 'Mezhutoki', 'height='+ (scr-80) +', width='+ width +', top=0, left=0, toolbar=0, titlebar=0, status=0, menubar=0, scrollbars=1, resizable=1' );
		else if( height > 710 )
	                var winCmd = window.open( 'http://www.mezhutoki.ru/popup2.php?images='+ path +'&count='+ count, 'Mezhutoki', 'height='+ height +', width='+ width +', top=0, left=0, toolbar=0, titlebar=0, status=0, menubar=0, scrollbars=1, resizable=1' );
		else
	                var winCmd = window.open( 'http://www.mezhutoki.ru/popup2.php?images='+ path +'&count='+ count, 'Mezhutoki', 'height='+ height +', width='+ width +', top=0, left=0, toolbar=0, titlebar=0, status=0, menubar=0, scrollbars=0, resizable=0' );

		winCmd.focus();
        }

	function PopUp3( pages, width, height )
	{
		var scr = screen.height;

		if( scr > 0 && height > scr - 80 )
	                var winCmd = window.open( 'http://www.mezhutoki.ru/'+ pages, 'Mezhutoki', 'height='+ (scr-80) +', width='+ width +', top=0, left=0, toolbar=0, titlebar=1, status=0, menubar=0, scrollbars=1, resizable=1' );
		else
	                var winCmd = window.open( 'http://www.mezhutoki.ru/'+ pages, 'Mezhutoki', 'height='+ height +', width='+ width +', top=0, left=0, toolbar=0, titlebar=1, status=0, menubar=0, scrollbars=1, resizable=1' );

		winCmd.focus();
	}

    function PopUp4( path, width, height ) {
		var scr = screen.height;

		height = height + 390;
		width  = width  + 60;

		if( scr > 0 && height > scr - 100 )
	                var winCmd = window.open( 'http://www.mezhutoki.ru/popup3.php?live='+ path, 'Mezhutoki', 'height='+ (scr-80) +', width='+ width +', top=0, left=0, toolbar=0, titlebar=0, status=0, menubar=0, scrollbars=1, resizable=1' );
		else if( height > 710 )
	                var winCmd = window.open( 'http://www.mezhutoki.ru/popup2.php?live='+ path, 'Mezhutoki', 'height='+ height +', width='+ width +', top=0, left=0, toolbar=0, titlebar=0, status=0, menubar=0, scrollbars=1, resizable=1' );
		else
	                var winCmd = window.open( 'http://www.mezhutoki.ru/popup2.php?live='+ path, 'Mezhutoki', 'height='+ height +', width='+ width +', top=0, left=0, toolbar=0, titlebar=0, status=0, menubar=0, scrollbars=0, resizable=0' );

		winCmd.focus();
    }
	
