function toggleDropDown(id, id2)
{
  var div=document.getElementById(id);
  var lin=document.getElementById(id2);
  if (div.className=="slide-show")
    div.className="slide-hide";
  else
    div.className="slide-show";
  if (lin.className=="plus")
    lin.className="min";
  else
    lin.className="plus";
  return (false);
}

function hide(id, id2)
{
  return (toggleDropDown(id, id2));
}
function otvet()
{
  document.getElementById('tt').innerHTML="Добавить Сообщение";
  document.getElementById('otv').style.display = 'block';
  document.getElementById('loader').style.display = 'block';
  document.getElementById('bbcode').innerHTML = '';
  document.getElementById('load_photo').innerHTML = document.getElementById('load_photo_example').innerHTML;
  return (false);
}
function otvet2(mid,quote,theme_id)
{
  document.getElementById('tt').innerHTML="Добавить ОТВЕТ";
  document.getElementById('otv').style.display = 'block';
  document.getElementById('theme_id').value = theme_id;
  document.getElementById('mid').value = mid;
  document.getElementById('loader').style.display = 'block';
  document.getElementById('bbcode').innerHTML = '';
  if (quote) document.getElementById('bbcode').innerHTML = '[quote]'+document.getElementById('answer_text'+quote).innerHTML+'[/quote]';
  document.getElementById('load_photo').innerHTML = document.getElementById('load_photo_example').innerHTML;
  return (false);
}
function otvet3(mid,theme_id)
{
  document.getElementById('tt').innerHTML="Поправить сообщение";
  document.getElementById('otv').style.display = 'block';
  document.getElementById('mid').value = mid;
  document.getElementById('theme_id').value = theme_id;
  document.getElementById('act').value = 'edit';
  document.getElementById('bbcode').innerHTML = document.getElementById('answer_text'+mid).innerHTML;
  document.getElementById('load_photo').innerHTML = document.getElementById('load_photo'+mid).innerHTML;
  document.getElementById('load_photo'+mid).innerHTML='';

  $('#close_otv').unbind('click');
  $('#close_otv').click(function(){
    document.getElementById('load_photo'+mid).innerHTML=document.getElementById('load_photo').innerHTML;
    clos('otv');return false;
  });

  
  document.getElementById('loader').style.display = 'block';
  return (false);
}
function reg(which)
{
  document.getElementById(which).style.display = 'block';
  document.getElementById('loader').style.display = 'block';
  return (false);
}
function vostanovlenie()
{
  document.getElementById('vp').style.display = 'block';
  document.getElementById('loader').style.display = 'block';
  return (false);
}
function clos(which)
{
  document.getElementById(which).style.display = 'none';
  document.getElementById('loader').style.display = 'none';
  return (false);
}
function send()
{
  document.getElementById('messs').value=document.getElementById('bbcode').value;
  return (true);
}
function check(change_user)
{
  var name=document.getElementById('name');
  var email=document.getElementById('email');
  var pass=document.getElementById('pass');
  var cod=document.getElementById('cod');
  if (name.value == "")
  {
  	alert ("Введите Имя");
  	name.focus();
  	return (false);
  }
  if (email.value == "")
  {
  	alert ("Введите E-mail");
  	email.focus();
  	return (false);
  }
  if (pass.value == "" && !change_user)
  {
  	alert ("Введите Пароль");
  	pass.focus();
  	return (false);
  }
  if (cod.value == "" && !change_user)
  {
  	alert ("Введите Код защиты от регистрации");
  	cod.focus();
  	return (false);
  }
  document.getElementById('s').submit();
  return (false);
}

function show_user_profile(user_id)
{
  $.getJSON('includes/actions.php',{act:'get_profile','user':user_id},function(data){
    if (data[0].result)
    {
      $('#up_ava').html(data[0].up_ava);
      $('#up_name').html(data[0].up_name);
      $('#up_surname').html(data[0].up_surname);
      $('#up_pol').html(data[0].up_pol);
      $('#up_country').html(data[0].up_country);
      $('#up_city').html(data[0].up_city);
      $('#up_birthday').html(data[0].up_birthday);

      $('#user_profile').show();
      $('#loader').show();
      $.scrollTo($('#user_profile'), 1200);
    }
  });

}






