/*
function showModels(value,path){
obj = document.getElementById('idModel');
obj.length = null;
obj.style.color = '#999';
if(obj.length == 0){
obj.options[0] = new Option("Идет загрузка...", "0");
}
JsHttpRequest.query(
'http://r93.ru/ajax_autocat.php?act=cat',
{q: value},
function(result, errors) {
document.getElementById('models').innerHTML = result['q'];
},
false
);
}
*/
/* выводим марки и модели 1 */
/*function ShowLoadSelect(type,value,action){
obj = document.getElementById('id_'+type);
obj.length = null;
obj.style.color = '#999';
if(obj.length == 0){
obj.options[0] = new Option("Идет загрузка...", "0");
}
JsHttpRequest.query(
'http://r93.ru/ajax_autocat.php?act='+action,
{q: value},
function(result, errors) {
document.getElementById('load_'+type).innerHTML = result['q'];
},
false
);
}
конец */
/* выводим марки и модели 2 */
/*function ShowLoadSelect2(type,value,action){
obj = document.getElementById('id_'+type);
obj.length = null;
obj.style.color = '#999';
if(obj.length == 0){
obj.options[0] = new Option("Идет загрузка...", "0");
}
JsHttpRequest.query(
'http://r93.ru/ajax_autocat.php?act='+action,
{q: value},
function(result, errors) {
document.getElementById('load_'+type).innerHTML = result['q'];
},
false
);
}
конец */
/* Подгружаем форму - отредактировать объявление */
function updateForm(value) {
send_form_res = document.getElementById('send_result');
send_load_res = document.getElementById('send_load');
send_form_res.className = 'form_info_loading';
send_load_res.innerHTML = '
Загрузка...';
JsHttpRequest.query(
'http://r93.ru/ajax_autocat.php?act=update',
{
q: value
},
function(result, errors) {
send_form_res.innerHTML = '';
if (result['q']) {
send_form_res.innerHTML = '
';
send_form_res.className = 'send_form_error';
send_load_res.innerHTML = '';
document.getElementById("send_form").style.display = 'block';
}else{
send_form_res.innerHTML = '';
send_form_res.className = 'send_form_ok';
send_load_res.innerHTML = '';
document.getElementById("send_form").style.display = 'none';
}
},
false // не кэшировать
);
}
/* конец */
/* выводим E-mail */
function email_view(id){
var req = new JsHttpRequest();
req.onreadystatechange = function(){
var obj=document.getElementById('email_load'+id);
obj.innerHTML='
';
if(req.readyState == 4){
document.getElementById('email_result'+id).innerHTML = req.responseJS.q;
document.getElementById('email_load'+id).innerHTML = '';
}
};
req.caching=true;
req.open("POST",'http://r93.ru/ajax_autocat.php?act=email_view&id='+id, true);
req.send(null);
};
/* конец */
/* выводим источник */
function www_view(id){
var req = new JsHttpRequest();
req.onreadystatechange = function(){
var obj=document.getElementById('www_load'+id);
obj.innerHTML='
';
if(req.readyState == 4){
document.getElementById('www_result'+id).innerHTML = req.responseJS.q;
document.getElementById('www_load'+id).innerHTML = '';
}
};
req.caching=true;
req.open("POST",'http://r93.ru/ajax_autocat.php?act=www_view&id='+id, true);
req.send(null);
};
/* конец */
/* Подгружаем инфу: при поиске, в разделах, букмариках, и т.п.. */
function showInfo(id,tpl){
var req = new JsHttpRequest("utf8");
req.onreadystatechange = function(){
if(req.readyState == 4) {
if(req.responseJS){
document.getElementById(id).innerHTML = req.responseJS.q;
document.getElementById('view_info'+id).innerHTML = req.responseText;
}
}
}
req.caching = true;
req.open("POST",'http://r93.ru/ajax_autocat.php?act=view_id&id='+id+'&tpl='+tpl, true);
req.send(null);
}
function ShowExtInfo(blockid,tpl){
document.getElementById("info-block" + blockid).style.display = 'block';
document.getElementById("info_" + blockid).style.display = 'none';
showInfo(blockid,tpl);
return false;
}
function HideExtInfo(blockid){
document.getElementById("info-block" + blockid).style.display = 'none';
document.getElementById("info_" + blockid).style.display = 'block';
return false;
}
/* конец */
/* Подгружаем блоки */
function loadBlock(id,tpl){
var req = new JsHttpRequest("utf8");
req.onreadystatechange = function(){
if(req.readyState == 4) {
if(req.responseJS){
document.getElementById(id).innerHTML = req.responseJS.q;
document.getElementById('view_block-'+id).innerHTML = req.responseText;
}
}
}
req.caching = true;
req.open("POST",'http://r93.ru/ajax_autocat.php?act=block_load&tpl='+tpl, true);
req.send(null);
}
function ShowBlock(blockid,tpl){
document.getElementById("block-" + blockid).style.display = 'block';
document.getElementById("load_" + blockid).style.display = 'none';
loadBlock(blockid,tpl);
return false;
}
function HideBlock(blockid){
document.getElementById("block-" + blockid).style.display = 'none';
document.getElementById("load_" + blockid).style.display = 'block';
return false;
}
/* конец */
/* Подгружаем форму - отправить предложение */
function sendForm(value){
send_form_res = document.getElementById('send_result');
send_load_res = document.getElementById('send_load');
var url_site = 'http://r93.ru/';
send_form_res.className = 'form_info_loading';
send_load_res.innerHTML = '
Загрузка...';
JsHttpRequest.query(
'http://r93.ru/ajax_autocat.php?act=send_mail',
{
q: value
},
function(result, errors) {
send_form_res.innerHTML = '';
if (result['q']) {
send_form_res.innerHTML = '';
send_form_res.className = 'send_form_error';
send_load_res.innerHTML = '';
document.getElementById("send_form").style.display = 'block';
}else{
send_form_res.innerHTML = '';
send_form_res.className = 'send_form_ok';
send_load_res.innerHTML = '';
document.getElementById("send_form").style.display = 'none';
}
},
false // не кэшировать
);
}
/* конец */
/* Подгружаем форму - добавить объявление */
function addForm(value) {
send_form_res = document.getElementById('send_result');
send_load_res = document.getElementById('send_load');
send_form_res.className = 'form_info_loading';
send_load_res.innerHTML = '
Загрузка...';
JsHttpRequest.query(
'http://r93.ru/ajax_autocat.php?act=add',
{
q: value
},
function(result, errors) {
send_form_res.innerHTML = '';
if (result['q']) {
send_form_res.innerHTML = '';
send_form_res.className = 'send_form_error';
send_load_res.innerHTML = '';
document.getElementById("send_form").style.display = 'block';
}else{
if(result['action'] == '3') {
send_form_res.innerHTML = '';
}else{
send_form_res.innerHTML = '';
}
send_form_res.className = 'send_form_ok';
send_load_res.innerHTML = '';
document.getElementById("send_form").style.display = 'none';
}
},
false // не кэшировать
);
}
/* конец */
/* Подгружаем форму - отредактировать объявление */
function editForm(value) {
send_form_res = document.getElementById('send_result');
send_load_res = document.getElementById('send_load');
send_form_res.className = 'form_info_loading';
send_load_res.innerHTML = '
Загрузка...';
JsHttpRequest.query(
'http://r93.ru/ajax_autocat.php?act=edit',
{
q: value
},
function(result, errors) {
send_form_res.innerHTML = '';
if (result['q']) {
send_form_res.innerHTML = '';
send_form_res.className = 'send_form_error';
send_load_res.innerHTML = '';
document.getElementById("send_form").style.display = 'block';
}else{
send_form_res.innerHTML = '';
send_form_res.className = 'send_form_ok';
send_load_res.innerHTML = '';
document.getElementById("send_form").style.display = 'none';
}
},
false // не кэшировать
);
}
/* конец */
/* Подгружаем форму - отредактировать объявление */
function updateForm(value) {
send_form_res = document.getElementById('send_result');
send_load_res = document.getElementById('send_load');
send_form_res.className = 'form_info_loading';
send_load_res.innerHTML = '
Загрузка...';
JsHttpRequest.query(
'http://r93.ru/ajax_autocat.php?act=update',
{
q: value
},
function(result, errors) {
send_form_res.innerHTML = '';
if (result['q']) {
send_form_res.innerHTML = '';
send_form_res.className = 'send_form_error';
send_load_res.innerHTML = '';
document.getElementById("send_form").style.display = 'block';
}else{
send_form_res.innerHTML = '';
send_form_res.className = 'send_form_ok';
send_load_res.innerHTML = '';
document.getElementById("send_form").style.display = 'none';
}
},
false // не кэшировать
);
}
/* конец */
/* Подгружаем форму - отредактировать объявление */
function deleteForm(value) {
send_form_res = document.getElementById('send_result');
send_load_res = document.getElementById('send_load');
send_form_res.className = 'form_info_loading';
send_load_res.innerHTML = '
Загрузка...';
JsHttpRequest.query(
'http://r93.ru/ajax_autocat.php?act=delete',
{
q: value
},
function(result, errors) {
send_form_res.innerHTML = '';
if (result['q']) {
send_form_res.innerHTML = '';
send_form_res.className = 'send_form_error';
send_load_res.innerHTML = '';
document.getElementById("send_form").style.display = 'block';
}else{
send_form_res.innerHTML = '';
send_form_res.className = 'send_form_ok';
send_load_res.innerHTML = '';
document.getElementById("send_form").style.display = 'none';
}
},
false // не кэшировать
);
}
/* конец */