function vote(vote,id_num,ip_num) {
	var surveyD = document.getElementById('suremp'+vote);
	
	// switch UL with a loading div
	surveyD.innerHTML = '<div align="center" style="height: 50px;"><img src="workerl.gif" height="24" width="24" /></div>';
	
	xmlhttp.open('get', 'voteaj.php?o='+id_num+'&v='+vote+'&i='+ip_num);
    xmlhttp.onreadystatechange = handleResponseA;
    xmlhttp.send(null);	
}

function handleResponseA() {
  if(xmlhttp.readyState == 4){
		if (xmlhttp.status == 200){
       	
        var response = xmlhttp.responseText;
        var update = new Array();

        if(response.indexOf('||') != -1) {
            update = response.split('||');
            changeTextA(update[0], update[1]);
        }
		}
    }
}

function changeTextA( div2show, text ) {
    // Detect Browser
    var IE = (document.all) ? 1 : 0;
    var DOM = 0; 
    if (parseInt(navigator.appVersion) >=5) {DOM=1};

    // Grab the content from the requested "div" and show it in the "container"
    if (DOM) {
        var viewer = document.getElementById(div2show);
        viewer.innerHTML = text;
    }  else if(IE) {
        document.all[div2show].innerHTML = text;
    }
}


