
/*function changePage(page, params) {
	if(xmlhttp) {
		xmlhttp.onreadystatechange = function() {
			if(xmlhttp.readyState==4) {
				httpresponse = xmlhttp.responseText;
				$('#center_container').slideUp('fast', function() {
					document.getElementById('center_container').innerHTML = httpresponse;
					$('#center_container').slideDown('fast');
				});
				xmlhttp.close;
				qotd_createxmlhttp();
			}
		}
		params = typeof(params)!= 'undefined' ? params : '';
		var url = "/content.php?page="+escape(page)+params;
		xmlhttp.open("GET", url, true);
		xmlhttp.send(null);
		return false;
	} else {
		return true;
	}
}*/

function qotd_submitAnswer(answer) {
	if(answer==true) {
		qotd_answer = -1;
		for(i=0;i<document.qotd.answer.length;i++) {
			if(document.qotd.answer[i].checked) {
				qotd_answer = document.qotd.answer[i].value;
			}
		}
	} else {
		qotd_answer = -1;
	}
	if(typeof(qotd_answer)!='undefined') {
		if(xmlhttp) {
			xmlhttp.onreadystatechange = function() {
				if(xmlhttp.readyState==4) {
					response = xmlhttp.responseText;
					$('#qotd').slideUp('slow', function() {
						document.getElementById('qotd').innerHTML = response;
						$('#qotd').slideDown('slow');
					});
					xmlhttp.close;
					createxmlhttp();
				}
			}
			var url = "/qotd.php?do=vote&qid="+escape(document.qotd.qid.value)+"&aid="+escape(qotd_answer);
			xmlhttp.open("GET", url, true);
			xmlhttp.send(null);
			return false;
		}
	}
	return true;
}

function qotd_showResults() {
	if(xmlhttp) {
		xmlhttp.onreadystatechange = function() {
			if(xmlhttp.readyState==4) {
				response = xmlhttp.responseText;
				$('#qotd').slideUp('slow', function() {
					document.getElementById('qotd').innerHTML = response;
					$('#qotd').slideDown('slow');
				});
				xmlhttp.close;
				createxmlhttp();
			}
		}
		var url = "/qotd.php";
		xmlhttp.open("GET", url, true);
		xmlhttp.send(null);
		return false;
	}
	return false;
}
