		var ajax_debug_mode = false;
		
		function ajax_debug(text) {
			if (ajax_debug_mode) {
				alert("RSD: " + text);
			}
		}
		function ajax_init_object() {
			ajax_debug("ajax_init_object() called..");
			
			var RetValue;
			try {
				RetValue = new ActiveXObject("Msxml2.XMLHTTP");
			} catch (e) {
				try {
					RetValue = new ActiveXObject("Microsoft.XMLHTTP");
				} catch (oc) {
					RetValue = null;
				}
			}
			if(!RetValue && typeof XMLHttpRequest != "undefined") {
				RetValue = new XMLHttpRequest();
			}
			if (!RetValue) {
				ajax_debug("Could not create connection object.");
			}
			return RetValue;
		}

		function ajax_run(func_name, args) {
			var i, x, n;
			var uri;
			var post_data;
			
			uri = web_host + "/ajax.php";
			if (ajax_request_type == "GET") {
				if (uri.indexOf("?") == -1) {
					uri = uri + "?rs=" + func_name;
				} else {
					uri = uri + "&rs=" + func_name;
				}
				for (i = 0; i < args.length-1; i++) {
					uri = uri + "&rsargs[]=" + args[i];
				}
				uri = uri + "&rsrnd=" + new Date().getTime();
				post_data = null;
			} else {
				post_data = "rs=" + func_name;
				for (i = 0; i < args.length-1; i++) {
					post_data = post_data + "&rsargs[]=" + urlencode(args[i]);
				}
			}
			x = ajax_init_object();
			x.open(ajax_request_type, uri, true);
			if (ajax_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;
				}
				ajax_debug("received " + x.responseText);
				var status;
				var data;
				status = x.responseText.charAt(0);
				datacache = x.responseText.substring(0);
				data = unescape(datacache);
				if (status == "-") {
					alert("Error: " + data);
				} else {
					args[args.length-1](data);
				}
			};
			x.send(post_data);
			ajax_debug(func_name + " uri = " + uri + "/post = " + post_data);
			ajax_debug(func_name + " waiting..");
			delete x;
		}
		
		function x_ly() {
			ajax_run("ly", x_ly.arguments);
		}

		function x_comments() {
			ajax_run("comments", x_comments.arguments);
		}

		function x_Search_Sight() {
			ajax_run("Search_Sight", x_Search_Sight.arguments);
		}
		
		function x_SPost() {
			ajax_run("SPost", x_SPost.arguments);
		}

		function x_checkusername() {
			ajax_run("checkusername", x_checkusername.arguments);
		}
		
		function x_showcontent() {
			ajax_run("showcontent", x_showcontent.arguments);
		}
		
		function x_doafl() {
			ajax_run("doafl", x_doafl.arguments);
		}
		
		function x_sendmood() {
			ajax_run("sendmood", x_sendmood.arguments);
		}
		
		function x_addcategory() {
			ajax_run("addcategory", x_addcategory.arguments);
		}
