function rateQuery(rating,qid,label,stars,topicid) { 
  var url = "http://www.ammas.com/ajax/updaterate.cfm?";
  document.getElementById(label).innerHTML = "<img src='/images/icons/loading.gif' align='absmiddle'> Plz wait...</div>";
  url = url +'topicid='+topicid+'&qid='+qid+'&rating='+rating+'&rand=' +  Math.floor(Math.random() * 1101);
  http.open("GET", url, true); 
  http.onreadystatechange = function() {
	if (http.readyState == 4) { 
    results = http.responseText; 
	document.getElementById(label).innerHTML = results;
    rating = rating * 25;
    document.getElementById(stars).style.width = rating+'px';
    } 
  }
  http.send(null); 
}
function rateResponse(rating,rid,label,stars,qid,topicid) { 
  var url = "http://www.ammas.com/ajax/updaterate.cfm?";
  document.getElementById(label).innerHTML = "<img src='/images/icons/loading.gif' align='absmiddle'> Plz wait...</div>";
  url = url +'topicid='+topicid+'&qid='+qid +'&rid='+rid+'&rating='+rating+'&rand=' +  Math.floor(Math.random() * 1101);
  http.open("GET", url, true); 
  http.onreadystatechange = function() {
	if (http.readyState == 4) { 
    results = http.responseText; 
	document.getElementById(label).innerHTML = results;
    rating = rating * 25;
    document.getElementById(stars).style.width = rating+'px';
    } 
  }
  http.send(null); 
}
function getCATHTTPObject() {
  var req;
  if (window.XMLHttpRequest) {
    try { req = new XMLHttpRequest(); }
    catch (e) {}
  } else if (window.ActiveXObject) {
    try { req = new ActiveXObject("Msxml2.XMLHTTP"); }
    catch (e) {
      try { req = new ActiveXObject("Microsoft.XMLHTTP"); }
      catch (e) {}
    }
  }
  return req;
}
var http = getCATHTTPObject(); 

/*
function updatecatpanl() { 
  var url = "http://www.ammas.com/ar/jobs/html_catpanel.cfm?bid=0&topicid=";
  document.getElementById('catpanelun').innerHTML = "Loading...Please wait..."; 
  cathttp.open("GET", url + escape(topicid), true); 
  cathttp.onreadystatechange = handleCATHttpResponse; 
  cathttp.send(null); 
} 

function handleCATHttpResponse() { 
  if (cathttp.readyState == 4) { 
    results = cathttp.responseText; 
	document.getElementById('catpanelun').innerHTML = results;
  } 
} 
*/
