function showhide(id){
if (document.getElementById){
obj = document.getElementById(id);
if (obj.style.display == "none"){
obj.style.display = "";
} else {
obj.style.display = "none";
}
}
} 




function get_tc_pagina(pagina) {
var url = pagina;

xmlHttp = GetXmlHttpObject();
xmlHttp.onreadystatechange = function() { getresponse(xmlHttp, 'content_html'); };
xmlHttp.open("GET", url , true);
xmlHttp.send( null );
}

function post_tc_pagina(pagina) {


var data = '';

xmlHttp = GetXmlHttpObject();
xmlHttp.onreadystatechange = function() { getresponse(xmlHttp, 'userstats'); };
xmlHttp.open("POST", pagina , true);
xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xmlHttp.send( data );

}


function updateuserstats() {
var url = "ustats.php";

xmlHttp = GetXmlHttpObject();
xmlHttp.onreadystatechange = function() { getresponse(xmlHttp, 'userstats'); };
xmlHttp.open("GET", url , true);
xmlHttp.send( null );
}

function updateforumtopics() {
var url = "forumtopics.php";

xmlHttp2 = GetXmlHttpObject();
xmlHttp2.onreadystatechange = function() { getresponse2(xmlHttp2, 'forumtopics'); };
xmlHttp2.open("GET", url , true);
xmlHttp2.send( null );
}

function getresponse(xmlHttp, Cfield) {

if (xmlHttp.readyState == 4 || xmlHttp.readyState == "complete") {

 if ( xmlHttp.status == 200 ) {

 document.getElementById( Cfield ).innerHTML = xmlHttp.responseText;

} else alert ( xmlHttp.statusText );

}
}

function getresponse2(xmlHttp2, Cfield) {

if (xmlHttp2.readyState == 4 || xmlHttp2.readyState == "complete") {

 if ( xmlHttp2.status == 200 ) {

 document.getElementById( Cfield ).innerHTML = xmlHttp2.responseText;

} else alert ( xmlHttp2.statusText );

}
}
