/*
Page:           vote_status.js
Created:        Jan'29 2009
Last Mod:       Jan'29 2009
Handles actions and requests for 
--------------------------------------------------------- 
Created : ArulKumar.V
--------------------------------------------------------- */

var xmlhttp;
var clubid;
var dayid

if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
 try {
  xmlhttp = new XMLHttpRequest();
 } catch (e) {
  xmlhttp=false
 }
}
function myXMLHttpRequest() {
	  var xmlhttplocal;
	  try {
	    xmlhttplocal= new ActiveXObject("Msxml2.XMLHTTP")
	 } catch (e) {
	  try {
	    xmlhttplocal= new ActiveXObject("Microsoft.XMLHTTP")
	  } catch (E) {
	    xmlhttplocal=false;
	  }
	 }

	if (!xmlhttplocal && typeof XMLHttpRequest!='undefined') {
	 try {
	  var xmlhttplocal = new XMLHttpRequest();
	 } catch (e) {
	  var xmlhttplocal=false;
	  alert('couldn\'t create xmlhttp object');
	 }
	}
	return(xmlhttplocal);
}

function statusComments(BASE_URL,club_id,day_id,limit) {
		
		clubid = club_id;
		dayid = day_id;
		//alert('ajax_includes/ajax_dominant_rating.php?clubid='+clubid+'&dayid='+dayid+'&dominantid='+dominant);
		xmlhttp.open('get', BASE_URL+'ajax_includes/ajax_comments_vote_status.php?clubid='+clubid+'&dayid='+dayid+'&limit'+limit);
		//xmlhttp.onreadystatechange = handleResponse(clubid,dayid,commentid) ;
		xmlhttp.onreadystatechange = comments_votes_statusResponse;
		xmlhttp.send(null);
}

//function handleResponse(clubid,dayid,commentid) {
function comments_votes_statusResponse() {
  if(xmlhttp.readyState == 4){
		if (xmlhttp.status == 200){
			var response = xmlhttp.responseText;
				if(response != '') {
					update = response.split('|');
					var len = update.length;
					for(i=0;i<len;i++){
						document.getElementById(update[i]).onclick = '';
					}
						
				}
				
			/*document.getElementById('sel_dominant_'+clubid+'_'+dayid).selectedIndex = 0;
			document.getElementById('sel_dominant_'+clubid+'_'+dayid).selectedIndex = 0;*/
		}
    }
}

