/* выводим источник */
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_news.php?act=www_view&id='+id, true);
req.send(null);
};
/* конец */
/* Подгружаем инфу: при поиске, в разделах, букмариках, и т.п.. */
function showInfo(id,tpl){
var req = new JsHttpRequest("UTF-8");
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_news.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("UTF-8");
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_news.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() {
send_form_res = document.getElementById('send_result');
send_load_res = document.getElementById('send_load');
u_id = document.getElementById("u_id");
name_from = document.getElementById("name_from");
email_from = document.getElementById("email_from");
name_to = document.getElementById("name_to");
email_to = document.getElementById("email_to");
title = document.getElementById("title");
captcha = document.getElementById("captcha");
send_form_res.className = 'form_info_loading';
send_load_res.innerHTML = 'Загрузка...';
JsHttpRequest.query(
'http://r93.ru/ajax_news.php?act=send_mail',
{
'u_id': u_id.value,
'name_from': name_from.value,
'email_from': email_from.value,
'name_to': name_to.value,
'email_to': email_to.value,
'title': title.value,
'captcha': captcha.value
},
function(result, errors) {
send_form_res.innerHTML = '';
if (result['q']) {
send_form_res.innerHTML = '