function changeAv(uid) {
popupWnd('/change_av.php?uid=' + uid,
'changeAvatar', 400, 300);
}
function deleteAv(uid) {
if (confirm("Вы уверены что хотите удалить аватар?")) {
var ajaxReq = new CXMLHttp();
ajaxReq.onDone = function(xmlhttp) {
response = xmlhttp.responseXML.documentElement;
error = response.getElementsByTagName('error');
if (error.length != 0)
get_by_id('err').innerHTML = "" + error[0].firstChild.data + "";
else {
get_by_id('err').innerHTML = "Профиль изменен";
get_by_id('userav').src = '/av/noavatar.gif';
}
};
get_by_id('err').innerHTML = "Отправляю данные на сервер...";
var req = 'a=deleteav&user_id=' + uid;
ajaxReq.postQuery('/ajax_profile_personal.php', req);
}
}
function saveObjView() {
var ajaxReq = new CXMLHttp();
ajaxReq.onDone = function(xmlhttp) {
response = xmlhttp.responseXML.documentElement;
error = response.getElementsByTagName('error');
if (error.length == 0)
alert("Профиль изменен");
else
alert(error[0].firstChild.data);
}
var view = 0;
var btn = null;
btn = get_by_id('gallery_tab');
if (btn && btn.style.display == 'block')
view |= 1;
btn = get_by_id('vote_tab');
if (btn && btn.style.display == 'block')
view |= 2;
btn = get_by_id('info_tab');
if (btn && btn.style.display == 'block')
view |= 4;
btn = get_by_id('category_tab');
if (btn && btn.style.display == 'block')
view |= 8;
btn = get_by_id('community_tab');
if (btn && btn.style.display == 'block')
view |= 16;
var req = "a=updateView&view=" + view;
ajaxReq.postQuery('/ajax_profile_personal.php', req);
}
function changePersonal() {
var ajaxReq = new CXMLHttp();
ajaxReq.onDone = function(xmlhttp) {
document.forms['personalForm'].submitData.disabled = false;
response = xmlhttp.responseXML.documentElement;
error = response.getElementsByTagName('error');
if (error.length != 0)
get_by_id('err').innerHTML = "" + error[0].firstChild.data + "";
else {
get_by_id('err').innerHTML = "Профиль изменен";
alert("Профиль изменен");
}
}
ajaxReq.onError = function(xmlhttp) {
document.forms['personalForm'].submitData.disabled = false;
}
get_by_id('err').innerHTML = "Отправляю данные на сервер...";
var req = collectFormItems('a=update', 'personalForm');
ajaxReq.postQuery('/ajax_profile_personal.php', req);
}
function changeIface() {
var ajaxReq = new CXMLHttp();
ajaxReq.onDone = function(xmlhttp) {
document.forms['interfaceForm'].submitIfData.disabled = false;
response = xmlhttp.responseXML.documentElement;
error = response.getElementsByTagName('error');
if (error.length != 0)
get_by_id('errIf').innerHTML = "" + error[0].firstChild.data + "";
else {
get_by_id('errIf').innerHTML = "Профиль изменен";
alert("Профиль изменен");
}
}
ajaxReq.onError = function(xmlhttp) {
get_by_id('errIf').innerHTML = 'AJAX error (' + xmlhttp.status + ')';
document.forms['interfaceForm'].submitIfData.disabled = false;
}
get_by_id('errIf').innerHTML = "Отправляю данные на сервер...";
var req = collectFormItems('a=update', 'interfaceForm');
document.forms['interfaceForm'].submitIfData.disabled = true;
ajaxReq.postQuery('/ajax_profile_interface.php', req);
}
function changeTheme() {
var ajaxReq = new CXMLHttp();
ajaxReq.onDone = function(xmlhttp) {
document.forms['themeForm'].submitThData.disabled = false;
response = xmlhttp.responseXML.documentElement;
error = response.getElementsByTagName('error');
if (error.length != 0)
get_by_id('errTh').innerHTML = "" + error[0].firstChild.data + "";
else {
get_by_id('errTh').innerHTML = "Профиль изменен";
alert("Профиль изменен");
window.location.reload();
}
}
ajaxReq.onError = function(xmlhttp) {
get_by_id('errTh').innerHTML = 'AJAX error (' + xmlhttp.status + ')';
document.forms['themeForm'].submitThData.disabled = false;
}
get_by_id('errTh').innerHTML = "Отправляю данные на сервер...";
var req = collectFormItems('a=update', 'themeForm');
document.forms['themeForm'].submitThData.disabled = true;
ajaxReq.postQuery('/ajax_profile_theme.php', req);
}
function changePanels() {
var ajaxReq = new CXMLHttp();
ajaxReq.onDone = function(xmlhttp) {
document.forms['panelsForm'].submitData.disabled = false;
response = xmlhttp.responseXML.documentElement;
error = response.getElementsByTagName('error');
if (error.length != 0)
get_by_id('errPan').innerHTML = "" + error[0].firstChild.data + "";
else {
get_by_id('errPan').innerHTML = "Профиль изменен";
alert("Профиль изменен");
}
};
ajaxReq.onError = function(xmlhttp) {
document.forms['panelsForm'].submitData.disabled = false;
get_by_id('errPan').innerHTML = "Error";
}
get_by_id('errPan').innerHTML = "Отправляю данные на сервер...";
var req = collectFormItems('a=update', 'panelsForm');
ajaxReq.postQuery('/ajax_profile_panels.php', req);
}
function changeAnketa() {
var ajaxReq = new CXMLHttp();
ajaxReq.onDone = function(xmlhttp) {
document.forms['anketaForm'].submitAnkData.disabled = false;
response = xmlhttp.responseXML.documentElement;
error = response.getElementsByTagName('error');
if (error.length != 0)
get_by_id('errAnk').innerHTML = "" + error[0].firstChild.data + "";
else {
get_by_id('errAnk').innerHTML = "Профиль изменен";
alert("Профиль изменен");
}
}
ajaxReq.onError = function(xmlhttp) {
document.forms['anketaForm'].submitAnkData.disabled = false;
get_by_id('errAnk').innerHTML = "Error";
}
get_by_id('errAnk').innerHTML = "Отправляю данные на сервер...";
var req = collectFormItems('a=update', 'anketaForm');
ajaxReq.postQuery('/ajax_profile_anketa.php', req);
}
function changeBans() {
var ajaxReq = new CXMLHttp();
ajaxReq.onDone = function(xmlhttp) {
document.forms['bansForm'].submitBanData.disabled = false;
response = xmlhttp.responseXML.documentElement;
error = response.getElementsByTagName('error');
if (error.length != 0)
get_by_id('errBan').innerHTML = "" + error[0].firstChild.data + "";
else {
get_by_id('errBan').innerHTML = "Профиль изменен";
alert("Профиль изменен");
window.location.reload();
}
}
ajaxReq.onError = function(xmlhttp) {
document.forms['bansForm'].submitBanData.disabled = false;
get_by_id('errBan').innerHTML = "Error";
}
get_by_id('errBan').innerHTML = "Отправляю данные на сервер...";
var req = collectFormItems('a=update', 'bansForm');
ajaxReq.postQuery('/ajax_profile_bans.php', req);
}