obj_form_start_edit_adv=document.forms.form_start_edit_adv; obj_div_message_connect_start_edit=document.getElementById("message_connect_start_edit"); var id_advert_edit; var password_advert_edit; var category; var podcategory; function start_edit_adt() { id=obj_form_start_edit_adv.id_advert_edit.value; password=obj_form_start_edit_adv.passwrd_edit_adv.value; if (id=="") { alert ("Введите идентификатор объявления!"); return; } if (password=="") { alert ("Введите пароль!"); return; } id_num=id-0; if (isNaN(id_num)) { alert ("Введите пожалуйста число в поле идентификатора объявления!"); return; } //alert (id+" "+password); data_send="id_adv="+decodeURIComponent(id)+"&passwrd_adv="+decodeURIComponent(password); url=dir_http+"/moduls/doska/include/data_edit_adv.php"; HTTPload.open("post",url,true); HTTPload.onreadystatechange=ob_data_edit_adv; HTTPload.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); obj_div_message_connect_start_edit.style.display="block"; HTTPload.send(data_send); id_advert_edit=id; password_advert_edit=password; } function ob_data_edit_adv() { //alert (HTTPload.readyState); if (HTTPload.readyState!=4) return; obj_div_message_connect_start_edit.style.display="none"; if (HTTPload.status != 200) { alert ("Произошла неизвестная ошибка!"); alert (HTTPload.responseText); return; } answer=HTTPload.responseText; //alert (answer); answer=eval("("+answer+")"); if (answer.error.code==1) { alert (answer.error.text); return; } if (answer.data.kolvo==0) { alert ("Не найдено объявление!"); return; } mas_data=answer.data.value; document.getElementById("div_form_start_edit_advert").style.display="none"; document.getElementById("div_form_new_advert").style.display="block"; obj_form.name_adv.value=decodeURIComponent(mas_data.name_adv); obj_form.email.value=decodeURIComponent(mas_data.email); obj_form.site.value=decodeURIComponent(mas_data.site); obj_form.name_user.value=decodeURIComponent(mas_data.name_user); obj_form.telefon.value=decodeURIComponent(mas_data.phone); obj_form.key_words.value=decodeURIComponent(mas_data.key_words); obj_form.text_adv.value=decodeURIComponent(mas_data.text); document.getElementById("block_name_category_toform_adv").innerHTML=decodeURIComponent(mas_data.name_category); document.getElementById("block_name_podcategory_toform_adv").innerHTML=decodeURIComponent(mas_data.name_podcategory); podcategory=mas_data.podcategory; category=mas_data.category; obj_form.category.value=category; obj_form.podcategory.value=podcategory; /* sel=selectOn(obj_form.category,category); if (sel) { on_select_category(); selectOn(obj_form.podcategory,podcategory); } */ obj_form.id_edit_adv.value=id_advert_edit; obj_form.password_edit_adv.value=password_advert_edit; /* type_adv=mas_data.type; for (j=0;j"; t+=" удалить "; t+=""; } obj_div_images_del_adv.innerHTML=t; } /* for (j=0;j