document.write('<script language="javascript" src="javascript/jquery.js"></script>');
var http_request = false;
function ajax_makeRequest(url, functionName, httpType, sendData) {

	http_request = false;
	if (window.XMLHttpRequest) { // Mozilla, Safari,...
		http_request = new XMLHttpRequest();
		if (http_request.overrideMimeType) {
			http_request.overrideMimeType('text/xml');
		}
	} else if (window.ActiveXObject) { // IE
		try {
			http_request = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
				http_request = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e) {}
		}
	}
	if (!http_request) {
		alert('Giving up :( Cannot create an XMLHTTP instance');
		return false;
	}
	if( functionName != '' )
	{
		var changefunc="http_request.onreadystatechange = "+functionName;
		eval (changefunc);
	}
	// http_request.onreadystatechange = alertContents;
	http_request.open(httpType, url, true);
	http_request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	http_request.send(sendData);
}
function ajax_showTopic(topic_id)
{
	ajax_makeRequest('do.php?op=show&tid='+topic_id, 'ajax_alertTopic', 'GET', null);
}

function ajax_alertTopic()
{
	if (http_request.readyState == 4) {
		if (http_request.status == 200) {
			document.getElementById('show_topic').innerHTML = http_request.responseText;
			popup_showx();
		}
	}
}

function ajax_showTopicInfo(topic_id)
{
	ajax_makeRequest('do.php?op=info&tid='+topic_id, 'ajax_alertTopicInfo', 'GET', null);
}

function ajax_downCount(topic_id)
{
	//ajax_makeRequest('do.php?op=download&tid='+topic_id, '', 'GET', null);
	jquery.get('do.php',{op:'download',tid:topic_id});
}

function ajax_alertTopicInfo()
{
	if (http_request.readyState == 4) {
		if (http_request.status == 200) {
			document.getElementById('btEdit').innerHTML = http_request.responseText;
			popup_showe();
		}
	}
}

