function checkAll()
{
 if ($('#sel_all').attr("checked")==true)
  $("input:checkbox").attr("checked","checked");
 else
  $("input:checkbox").attr("checked","");
}

function timedown(id,plus)
{$('td.bg2').attr("class","bg1"); 
 $('#period').val(id);
 $.cookie('period',id,{expires: 730, path: '/', domain: 'sovetnik.net', secure: false});
 var date=$('#date').val();
  $.post(
  '/ajax/gettime.php',
  {
    period: id,
	plus: plus,
	date: date
  },
  al
 );
 $('#t1').html(aja); 
 $('#t2').html(aja); 
 $('#t3').html(aja); 
}

function al(data)
{
 var data=data.split(":");
 $('#date').val(data[0]);
 $('#t1').html(data[1]);
 $('#t2').html(data[2]);
 $('#t3').html(data[3]);
 if (data[1]!="время не пришло")
  mega($('#action').val(),1);
}

function setperiod(id)
{
  $('td.bg2').attr("class","bg1"); 
  $('#period').val(id); 
  $.cookie('period',id,{expires: 730, path: '/', domain: 'sovetnik.net', secure: false});
  mega($('#action').val(),1);
}

function sh(id)
{var cat=document.getElementById(id);
 if (cat.style.display=='none')
 {cat.style.display='';
  $.cookie(id,1,{expires: 730, path: '/', domain: 'sovetnik.net', secure: false});
 }
 else
 {cat.style.display='none';
  $.cookie(id,0,{expires: 730, path: '/', domain: 'sovetnik.net', secure: false});
 }
}

function page(pid)
{
 $.post(
  '/ajax/page.php',
  {
	pid: pid
  },
  function(data) {$("#allm").html(data);}
 );
 $('a.menu3').css('font-weight','normal');
 $('a.link').css('font-weight','normal');
 $('#p'+pid).css('font-weight','bold');
 $('#allm').html('<center><br>'+loa+'<br><br>'+aja+'</center>');
 $('#other').empty();
}

function hideform()
{
 $('#showform').show();
 $('#enter').hide();
 $.cookie('enterhide',1,{expires: 730, path: '/', domain: 'sovetnik.net', secure: false});
}


