
 
function makeHttpRequest(url, handler) {
        if (typeof window.ActiveXObject != 'undefined' ) {
          xmlDoc = new ActiveXObject("Microsoft.XMLHTTP");
          xmlDoc.onreadystatechange = handler ;
        }
        else {
          xmlDoc = new XMLHttpRequest();
          xmlDoc.onload = handler;
        }
        xmlDoc.open( "GET", url, true );
        xmlDoc.send( null );
      }
	  
// voting on news page
function rateit(newsid, rank){
    var req = './dhtml/vote.php?submit=true&newsid='+newsid+'&rank='+rank;
	makeHttpRequest(req, process4);

}

function process4(){
  if ( xmlDoc.readyState != 4 ) return ;
  document.getElementById('rateit').innerHTML = xmlDoc.responseText ;
}

function Highligh(id){
	for (i=1; i <= id ; i++ )
	{
		elementname = "vote"+i;
		colorcode="";
		switch (id)
		{
			case '1': 
				colorcode = "#FFFFCC";
				break
			case '2': 
				colorcode = "#FFCCCC";
				break
			case '3': 
				colorcode = "#FFCC00";
				break
			case '4': 
				colorcode = "#FF99CC";
				break
			case '5': 
				colorcode = "#FF9900";
				break
		}
		document.getElementById(elementname).style.background = colorcode;
	}

}

function normalstyle(){
	for (i=1; i < 6 ; i++ )
	{
		elementname = "vote"+i;
		document.getElementById(elementname).style.background = "#FFFFFF";
	}
}