function voteCheck()
{
    g=document.getElementById('total').value;
    for (var i=1; i<=g; i++)
    {
        if(document.getElementById('choice'+i).checked)
        {
            return true;
        }
    }
    alert('Выберите вариант!');
    return false;
}
function authCheck()
{
    if(document.getElementById('a1').value!='')
    {
        if(document.getElementById('a2').value!='')
        {
            return true;
        }
        else
        {
            alert('Введите пароль!');
            return false;
        }
    }
    else
    {
        alert('Введите E-mail!');
        return false;
    }
}
var m = 0; 
function winOpen5(pic, width, height, title)
{
	m++;
	x = (640 - width)/2, y = (480 - height)/2;
	if (screen) {
		var y = (screen.availHeight - height)/2;
		var x = (screen.availWidth - width)/2;
	}
		if (screen.availWidth > 1800) {
		var x = ((screen.availWidth/2) - width)/2;
	}
	var win = window.open("", m, 'width='+width+',height='+height+',screenX='+x+',screenY='+y+',top='+y+',left='+x+',titlebar=no,resizable=no,scrollbars=no');
	win.document.open();
	win.document.writeln('<html><head><meta http-equiv="Content-Type" content="text/html; charset=windows-1251"><title>'+title+'</title></head><body topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0" marginwidth="0" marginheight="0">');
	win.document.writeln('<table align="center" width="100%" height="100%" cellpadding="0" cellspacing="0" border="0"><tr><td>');
 	win.document.writeln('<a title="Закрыть окно" href="#" onclick="self.close()"><img src="/'+pic+'" width="'+width+'" height="'+height+'" border="0" alt="'+title+'"></a>');
	win.document.writeln('</td></tr></table></body></html>');
	win.document.close();
}
function open_gallery(st,img, wg, hg, id)
{
	h = document.documentElement.scrollHeight+40;
	w = document.documentElement.clientWidth;
	h1 = document.documentElement.clientHeight;
	p = document.documentElement.scrollTop;
	x = (w-wg)/2;
	y =Math.round((h1-hg)/2)+p;
	if($('#img_gallery').html() == null)
	{
		$('#bg_gallery').after('<div id="img_gallery"><div id="loading" style="display: none;"><img src="/i/loading.gif"/></div><div class="close"><a href="#" onclick="close_gallery(); return false;"><img src="/i/close.gif" width="13" height="13" ></a></div><div id="div_next_l"><div class="a1"><div class="a2"><a href="#" onclick="open_img(\'l\'); return false;"></a></div></div></div><div id="div_next_r"><div class="a1"><div class="a2"><a href="#" onclick="open_img(\'r\'); return false;"></a></div></div></div><img id="gal_big" onclick="return close_gallery();" src="'+img+'" width="'+wg+'" height="'+hg+'"></div>');
		$('#bg_gallery').show();
	}	
	$('#bg_gallery').css({height:h, width:w});
	$('#img_gallery').css({left:x, top:y, width:(parseInt(wg)+2)+'px', height:(parseInt(hg)+2)+'px'});
}
	function close_gallery()
	{
		
		$('#img_gallery').remove();
		$('#bg_gallery').hide();
		$('#sel_type').show();
		$('#sel_status').show();
		return false;
	}
	
	var i=0;
	var j=0;	
	function next_down()
	{
		bl = document.getElementById("block_lenta");
		if(bl.scrollTop != bl.scrollHeight)
		{
			/*for(i=0; i<66; i++)
			{
				t = bl.scrollTop+1;
				bl.scrollTop = t;
			}*/
			b = bl.scrollTop+3;
			bl.scrollTop = b;
			j=j+3;		
			if(j<66)
			{
				t = setTimeout("next_down()", 1);
			}else
			{
				j=0;
			}
		}	
	}
	
	
	function next_up()
	{
		bl = document.getElementById("block_lenta");
		if(bl.scrollTop != 0)
		{
			/*for(i=0; i<66; i++)
			{
				b = bl.scrollTop-1;
				bl.scrollTop = b;
			}*/
			b = bl.scrollTop-3;
			bl.scrollTop = b;
			i=i+3;	
			if(i<66)
			{
				t = setTimeout("next_up()", 1);	
			}else
			{
				i=0;
			}
		}	
	}