function clear_text(id)
{
 document.getElementById(id).value = '';
}



//reg
function reg(email)
{
 send1Request("scripts/ajax/reg.php?email="+email, "div_form_login", get1Request);
}
function check_email()
{ var form_check_email = document.getElementById('form_check_email');
 sendPost1Data(form_check_email.action, "div_check_email", form_check_email);
}
function checkcode()
{
 var form_check_code = document.getElementById('form_check_code');
 sendPost1Data(form_check_code.action, "div_check_code", form_check_code);
}
//reg\\



//login
function login()
{
 var form_check_login = document.getElementById('form_check_login');
 sendPost1Data(form_check_login.action, "div_form_login", form_check_login);
}
function login_kp(event)
{
 if(event.keyCode == 0xD)
 {
  var form_check_login = document.getElementById('form_check_login');
  sendPost1Data(form_check_login.action, "div_form_login", form_check_login);
 }
}
function login_form(email)
{
 send1Request("scripts/ajax/login_form.php?email="+email, "div_form_login", get1Request);
}
function login_forget()
{ var email = document.getElementById('email').value;
 send1Request("scripts/ajax/login_forget.php?email="+email, "div_form_login", get1Request);
}
function pw_send()
{
 var email = document.getElementById('email').value;
 send1Request("scripts/ajax/pw_send.php?email="+email, "div_pw_send", get1Request);
}
function login_exit()
{
 send1Request("scripts/ajax/login_form.php?what=exit", "div_form_login", get1Request);
}
//login\\



//user
function user(view_user_id,what)
{
 if(what.length > 0)
 {
  send1Request("scripts/ajax/user_"+what+".php?view_user_id="+view_user_id, "div_user_profile", get1Request);
 }
 else
 {
  send1Request("scripts/ajax/user_info.php?view_user_id="+view_user_id, "div_user_profile", get1Request);
 }
}
function user_menu(view_user_id,what)
{
 if(what.length > 0)
 {
  send1Request("scripts/ajax/user_"+what+".php?view_user_id="+view_user_id+"&user_menu=1", "div_content", get1Request);
 }
 else
 {
  send1Request("scripts/ajax/user_info.php?view_user_id="+view_user_id+"&user_menu=1", "div_content", get1Request);
 }
}
function user_edit(what)
{
 if(what.length > 0)
 {
  send1Request("scripts/ajax/user_edit_"+what+".php", "div_user_profile", get1Request);
 }
 else
 {
  send1Request("scripts/ajax/user_edit_info.php", "div_user_profile", get1Request);
 }
}
function user_edit_info_save()
{
 var user_edit_form_info = document.getElementById('user_edit_form_info');
 sendPost1Data(user_edit_form_info.action, "div_user_profile", user_edit_form_info);
}
function user_edit_avatar_save()
{ JsHttpRequest.query('scripts/ajax/user_edit_avatar.php',{'user_edit_avatar': document.getElementById("user_edit_avatar")},function(result,errors){document.getElementById("div_user_avatar").innerHTML = errors;});
}
function user_edit_options_save()
{
 var user_edit_form_options = document.getElementById('user_edit_form_options');
 sendPost1Data(user_edit_form_options.action, "div_user_profile", user_edit_form_options);
}

function user_edit_foto_save()
{
 JsHttpRequest.query('scripts/ajax/user_edit_foto_save.php',{'user_edit_foto': document.getElementById("user_edit_foto")},function(result,errors){document.getElementById("div_user_foto_add").innerHTML = errors;});
}
function user_foto_delete(foto_id)
{
 send1Request("scripts/ajax/user_foto_delete.php?foto_id="+foto_id, "div_user_foto["+foto_id+"]", get1Request);
}
function user_foto_restore(foto_id)
{
 send1Request("scripts/ajax/user_foto_restore.php?foto_id="+foto_id, "div_user_foto["+foto_id+"]", get1Request);
}
function user_foto_edit_name(number)
{
 var form_foto_edit_name = document.getElementById('form_foto_edit_name');
 sendPost1Data(form_foto_edit_name.action, "div_user_foto_name["+number+"]", form_foto_edit_name);

 nw.visibility = 'hidden';
}

function notice_delete(notice_id)
{
 send1Request("scripts/ajax/user_notice_delete.php?notice_id="+notice_id, "div_notice_delete_what["+notice_id+"]", get1Request);
}
function notice_delete_all(user_id)
{
 send1Request("scripts/ajax/user_notice_delete_all.php?user_id="+user_id, "notice_delete_all", get1Request);
}
function friend_what(notice_id,what)
{
 send1Request("scripts/ajax/friend_what.php?notice_id="+notice_id+"&what="+what, "div_notice_delete_what["+notice_id+"]", get1Request);
}

function poisk()
{
 var poisk_form = document.getElementById('poisk_form');
 sendPost1Data(poisk_form.action, 'div_poisk', poisk_form);
}
//user\



//write
function showHide(info_id)
{
 if(document.getElementById(info_id).style.display == "block")
 {
  document.getElementById(info_id).style.display = "none";
 }
 else
 {
  document.getElementById(info_id).style.display = "block";
 }
}

function user_wall_view(view_user_id,wall_group_number)
{
 send1Request("scripts/ajax/user_wall.php?view_user_id="+view_user_id+"&wall_group_number="+wall_group_number, "div_user_wall", get1Request);
}
function user_wall_post_write()
{
 var user_wall_post_write_form = document.getElementById('user_wall_post_write_form');
 sendPost1Data(user_wall_post_write_form.action, 'div_user_wall', user_wall_post_write_form);

 showHide('user_wall_post_write');
 document.getElementById('user_wall_post_write_form_textarea').value = "";
}
function user_wall_post_delete(wall_post_id)
{
 send1Request("scripts/ajax/user_wall_post_delete.php?wall_post_id="+wall_post_id, "div_user_wall_post["+wall_post_id+"]", get1Request);
}
function user_wall_post_restore(wall_post_id)
{
 send1Request("scripts/ajax/user_wall_post_restore.php?wall_post_id="+wall_post_id, "div_user_wall_post["+wall_post_id+"]", get1Request);
}

function comments_post_write()
{
 var comments_post_write_form = document.getElementById('comments_post_write_form');
 sendPost1Data(comments_post_write_form.action, 'div_comments', comments_post_write_form);

 showHide('comments_post_write');
 document.getElementById('comments_post_write_form_textarea').value = "";
}
function comments_post_delete(user_string,comments_post_id)
{
 send1Request("scripts/ajax/comments_post_delete.php?user_string="+user_string+"&comments_post_id="+comments_post_id, "div_comments_post_id["+comments_post_id+"]", get1Request);
}
function comments_post_restore(user_string,comments_post_id)
{
 send1Request("scripts/ajax/comments_post_restore.php?user_string="+user_string+"&comments_post_id="+comments_post_id, "div_comments_post_id["+comments_post_id+"]", get1Request);
}

function raznoe_comments_post_write()
{
 var comments_post_write_form = document.getElementById('comments_post_write_form');
 sendPost1Data(comments_post_write_form.action, 'div_comments', comments_post_write_form);

 showHide('comments_post_write');
 document.getElementById('comments_post_write_form_textarea').value = "";
}
function raznoe_comments_post_delete(raznoe_string,comments_post_id)
{
 send1Request("scripts/ajax/raznoe_comments_post_delete.php?raznoe_string="+raznoe_string+"&comments_post_id="+comments_post_id, "div_comments_post_id["+comments_post_id+"]", get1Request);
}
function raznoe_comments_post_restore(raznoe_string,comments_post_id)
{
 send1Request("scripts/ajax/raznoe_comments_post_restore.php?raznoe_string="+raznoe_string+"&comments_post_id="+comments_post_id, "div_comments_post_id["+comments_post_id+"]", get1Request);
}

function anekdot_post_write()
{
 var anekdot_post_write_form = document.getElementById('anekdot_post_write_form');
 sendPost1Data(anekdot_post_write_form.action, "div_raznoe_content", anekdot_post_write_form);

 showHide('anekdot_post_write');
 document.getElementById('anekdot_post_write_form_textarea').value = "";
}
function znaeteli_post_write()
{
 var znaeteli_post_write_form = document.getElementById('znaeteli_post_write_form');
 sendPost1Data(znaeteli_post_write_form.action, "div_raznoe_content", znaeteli_post_write_form);

 showHide('znaeteli_post_write');
 document.getElementById('znaeteli_post_write_form_textarea').value = "";
}
function stixi_post_write()
{
 var stixi_post_write_form = document.getElementById('stixi_post_write_form');
 sendPost1Data(stixi_post_write_form.action, "div_raznoe_content", stixi_post_write_form);

 showHide('stixi_post_write');
 document.getElementById('stixi_post_write_form_textarea').value = "";
}

function zipy_write()
{
 var zipy_write_form = document.getElementById('zipy_write_form');
 sendPost1Data(zipy_write_form.action, "zipy_write", zipy_write_form);
}
//write\



//friend
function friend_tmp_send(view_user_id)
{
 send1Request("scripts/ajax/friend_tmp_send.php?view_user_id="+view_user_id, "div_send_friend_tmp", get1Request);
}
//friend\

//dialog
function dialog_view(dialog_view_user_id)
{
 send1Request("scripts/ajax/dialog_view.php?dialog_view_user_id="+dialog_view_user_id, "div_dialog_view", get1Request);
}
function dialog_write()
{
 var dialog_add_form = document.getElementById('dialog_add_form');
 sendPost1Data(dialog_add_form.action, "div_dialog_view", dialog_add_form);

 document.getElementById('dialog_msg').value = "";
}
//dialog\



//raznoe
function raznoe_view_content(raznoe_string,group_number)
{
 send1Request("raznoe/"+raznoe_string+"/view.php?group_number="+group_number, "div_raznoe_content", get1Request);
}
function fotoprikol_add()
{
 JsHttpRequest.query('raznoe/fotoprikol/add.php',{'fotoprikol': document.getElementById("fotoprikol")},function(result,errors){document.getElementById("div_fotoprikol_add").innerHTML = errors;});
}
function videoprikol_add()
{
 JsHttpRequest.query('raznoe/videoprikol/add.php',{'videoprikol': document.getElementById("videoprikol")},function(result,errors){document.getElementById("div_videoprikol_add").innerHTML = errors;});
}
function audioprikol_add()
{
 JsHttpRequest.query('raznoe/audioprikol/add.php',{'audioprikol': document.getElementById("audioprikol")},function(result,errors){document.getElementById("div_audioprikol_add").innerHTML = errors;});
}
//raznoe\



function view_content(page,group_number)
{
 send1Request("scripts/include/"+page+".php?group_number="+group_number+"&ajax=1", "div_content", get1Request);
}
function view_content_where(page,group_number,div)
{
 send1Request("scripts/ajax/"+page+".php?group_number="+group_number+"&ajax=1", div, get1Request);
}

function text_clear(id)
{ document.getElementById(id).value = "";
}



//a
function rating_edit(wrk_user_id,what)
{
 send1Request("scripts/ajax/rating_edit.php?wrk_user_id="+wrk_user_id+"&what="+what, "div_rating["+wrk_user_id+"]", get1Request);
}
//a\



//temp
function podarok(wrk_id)
{
 send1Request("scripts/ajax/temp/podarok.php?wrk_id="+wrk_id, "podarok["+wrk_id+"]", get1Request);
}
function podarok_8marta(wrk_id)
{
 send1Request("scripts/ajax/temp/podarok_8marta.php?wrk_id="+wrk_id, "podarok["+wrk_id+"]", get1Request);
}

function day_23fevrala_add(wrk_user_id)
{
 send1Request("scripts/ajax/day_23fevrala_add.php?wrk_user_id="+wrk_user_id, "div_comments", get1Request);
}
function day_9may_add(wrk_user_id)
{
 send1Request("scripts/ajax/day_9may_add.php?wrk_user_id="+wrk_user_id, "div_comments", get1Request);
}
function zhara_zadolbala_add()
{
 var form_zhara_zadolbala_add = document.getElementById('form_zhara_zadolbala_add');
 sendPost1Data(form_zhara_zadolbala_add.action, "div_zhara_zadolbala", form_zhara_zadolbala_add);
}
//temp\
