// remote scripting library
// (c) copyright 2005 modernmethod, inc
var sajax_debug_mode = false;
var sajax_request_type = "POST";
function sajax_debug(text) {
if (sajax_debug_mode)
alert("RSD: " + text)
}
function sajax_init_object() {
sajax_debug("sajax_init_object() called..")
var A;
try {
A=new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
A=new ActiveXObject("Microsoft.XMLHTTP");
} catch (oc) {
A=null;
}
}
if(!A && typeof XMLHttpRequest != "undefined")
A = new XMLHttpRequest();
if (!A)
sajax_debug("Could not create connection object.");
return A;
}
function sajax_do_call(func_name, args) {
var i, x, n;
var uri;
var post_data;
uri = "/centre1/ajax.php";
if (sajax_request_type == "GET") {
if (uri.indexOf("?") == -1)
uri = uri + "?rs=" + escape(func_name);
else
uri = uri + "&rs=" + escape(func_name);
for (i = 0; i < args.length-1; i++)
uri = uri + "&rsargs[]=" + escape(args[i]);
uri = uri + "&rsrnd=" + new Date().getTime();
post_data = null;
} else {
post_data = "rs=" + escape(func_name);
for (i = 0; i < args.length-1; i++)
post_data = post_data + "&rsargs[]=" + escape(args[i]);
}
rss_sajax_busy();
x = sajax_init_object();
x.open(sajax_request_type, uri, true);
if (sajax_request_type == "POST") {
x.setRequestHeader("Method", "POST " + uri + " HTTP/1.1");
x.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
}
x.onreadystatechange = function() {
if (x.readyState != 4)
return;
sajax_debug("received " + x.responseText);
var status;
var data;
status = x.responseText.charAt(0);
data = x.responseText.substring(2);
if (status == "-") {
alert("Error: " + data);
} else {
args[args.length-1](data);
}
rss_sajax_unbusy();
}
sajax_debug(func_name + " uri = " + uri + "\n/post = " + post_data);
x.send(post_data);
sajax_debug(func_name + " waiting..");
delete x;
}
function rss_sajax_unbusy() {
span = document.getElementById('ajax_throbber');
if (span) {
devnull = span.parentNode.removeChild(span);
}
}
function rss_sajax_busy() {
var span=document.createElement('span');
span.id='ajax_throbber';
span.style.position=(document.all?'absolute':'fixed');
span.style.left = '5px';
span.style.top = '5px';
span.style.padding = '3px';
span.className = 'frame';
span.innerHTML = '
';
document.body.appendChild(span);
}
// wrapper for __exp__submitTag
function x___exp__submitTag() {
sajax_do_call("__exp__submitTag",
x___exp__submitTag.arguments);
}
// wrapper for __exp__getSideContent
function x___exp__getSideContent() {
sajax_do_call("__exp__getSideContent",
x___exp__getSideContent.arguments);
}
// wrapper for __exp__getFeedContent
function x___exp__getFeedContent() {
sajax_do_call("__exp__getFeedContent",
x___exp__getFeedContent.arguments);
}
// wrapper for __exp_addChannel
function x___exp_addChannel() {
sajax_do_call("__exp_addChannel",
x___exp_addChannel.arguments);
}
/// End Sajax javscript
/// From here on: Copyright (C) 2003 - 2006 Marco Bonetti, gregarius.net
/// Released under GPL
function miniloginform() {
span = document.getElementById('loginformcontainer');
if (span.style.display == 'none') {
span.style.display = 'block';
} else {
span.style.display = 'none';
}
}
function loginHandler() {
pw = document.getElementById('password');
username = document.getElementById('username');
var re = /[0-9a-f]{32}/ ;
if (! re.test(pw.value)) {
pw.value = hex_md5(pw.value + username.value);
}
return true;
}
function setTags(id,tagss) {
tags = tagss.split(' ');
var fld=document.getElementById("t" + id);
var html = "";
for (i=0;i" + tags[i] + " ";
}
fld.innerHTML = html;
var aspan=document.getElementById("ta" + id);
aspan.innerHTML = "edit";
}
function submit_tag_cb(ret) {
data= ret.split(',');
//replace(/[^a-zA-Z0-9\ _\.,]/gi,"")
id=data[0];
tags=data[1];
setTags(id,tags);
}
function submit_tag(id,tags) {
x___exp__submitTag(id, tags, submit_tag_cb);
}
function _et(id) {
var actionSpan = document.getElementById("ta" + id);
var toggle = actionSpan.firstChild;
if (toggle.innerHTML == "submit") {
var fld = document.getElementById("tfield" + id);
toggle.innerHTML="...";
submit_tag(id,fld.value);
} else if (toggle.innerHTML == "edit") {
var isIE=document.all?true:false;
// the tag container
var tc=document.getElementById("t"+id);
var tags = tc.innerHTML.replace(/<\/?a[^>]*>(\ $)?/gi,"");
//.replace(//gi,"");
// submit link
toggle.innerHTML="submit";
// cancel link
cancel = document.createElement("a");
cancel.style.margin="0 0 0 0.5em";
cancel.innerHTML = "cancel";
cancel.setAttribute("href","#");
if (isIE) {
// the IE sucky way
cancel.onclick = function() { setTags(id,tags); return false;}
} else {
// the proper DOM way
cancel.setAttribute("onclick","setTags("+id+",'"+tags+"'); return false;");
}
actionSpan.appendChild(cancel);
tc.innerHTML = "";
// set the caret to the end of the field for bloody IE
var control = tc.firstChild;
control.onkeyup = function(e) {
if (!e) { e = event; e.which = e.keyCode; }
switch (e.which) {
case 10: case 13: _et(id); return false; break;
default: return true; break;
}
};
control.focus();
if (control.createTextRange) {
var range = control.createTextRange();
range.collapse(false);
range.select();
} else if (control.setSelectionRange) {
control.focus();
var length = control.value.length;
control.setSelectionRange(length, length);
}
}
return false;
}
cs = getCookie('side');
if (!cs) {
cs = '1';
}
document.currentSide = cs;
document.currentSideCache = new Array();
for (i=0;i<3;i++) {
document.currentSideCache[i] = null;
}
function _side(what) {
if (document.currentSide == what) {
return 0;
}
document.currentSideCache[document.currentSide] = document.getElementById('channels').innerHTML;
if ((content = document.currentSideCache[what]) != null) {
_setSideContent_cb( what + "#@#" + content );
} else {
x___exp__getSideContent(what, _setSideContent_cb);
}
}
function _setSideContent_cb(ret) {
data=ret.split('#@#');
kind=data[0];
content=data[1];
c = document.getElementById('channels').innerHTML;
ul = document.getElementById('sidemenu');
lis= ul.getElementsByTagName('li');
for (j=0;j 0) {
cidsCookie = cidsCookie + cidsArr[i];
if (i