function httpRequest(url, callback) {
    var httpObj = false;
    if (typeof XMLHttpRequest != 'undefined') {
        httpObj = new XMLHttpRequest();
    } else if (window.ActiveXObject) {
        try{
            httpObj = new ActiveXObject('Msxml2.XMLHTTP');
        } catch(e) {
            try{
                httpObj = new ActiveXObject('iMicrosoft.XMLHTTP');
            } catch(e) {}
        }
    }
    if (!httpObj) return;

    httpObj.onreadystatechange = function() {
        if (httpObj.readyState == 4) { // when request is complete
            callback(httpObj.responseText);
        }
    };
    httpObj.open('GET', url, true);
    httpObj.send(null);
}

function fillSearchResults(JSON) {
		
    // fill with new options from JSON array
    var data = eval(JSON);

	document.getElementById('countdown').innerHTML = data[0];
}

function onSelectChange() {
    httpRequest('ajax.php?do=countdown&timestamp=' + Date(), fillSearchResults);           

}

window.onload = function() {
/*
	if(document.getElementById('countdown')){
		var hascountdown = document.getElementById('countdown').innerHTML;
    	setInterval('onSelectChange()', '60000');
	}
*/
}