var xmlhttp;
var no;
function showUser(str,n){
 no = n;
 xmlhttp=GetXmlHttpObject();
 if (xmlhttp==null){
  alert ("Browser does not support HTTP Request");
  return;
 }
 var url="highLOwChange.php";
 url=url+"?q="+str+"&no="+no;
 xmlhttp.onreadystatechange=stateChanged;
 xmlhttp.open("GET",url,true);
 xmlhttp.send(null);
}

function stateChanged(){
 if (xmlhttp.readyState==4){
  document.getElementById("volume_control").innerHTML=xmlhttp.responseText;
  if(no=="1"){
	document.getElementById("play_cb_div").innerHTML='<div id="low_quality"><img src="images/low_q_off.png" alt="Low Quality" title="Low Quality" width="90" height="12" onclick="showUser(this.value,0)" /></div>';
	document.getElementById("play_cb_div_high").innerHTML='<div id="high_quality"><img src="images/high_q_on.png" alt="High Quality" title="High Quality"  width="90" height="12" onclick="showUser(this.value,1)" /></div>';
        document.getElementById("radio_left").innerHTML='<img width="22" height="33" src="images/player_off.png" alt="Click to stop" title="Click to stop" onclick="javascript: player_stop();"/>';
  }else if(no=="0"){
	document.getElementById("play_cb_div").innerHTML='<div id="low_quality"><input type ="image" src="images/low_q_on.png" width="90" height="12" border="0"  alt="Low Quality" title="Low Quality" onclick="showUser(this.value,0)" /></div>';
	document.getElementById("play_cb_div_high").innerHTML='<div id="high_quality"><input type ="image" src="images/high_q_off.png" width="90" height="12" border="0"  alt="Low Quality" title="Low Quality" onclick="showUser(this.value,1)" /></div>';
        document.getElementById("radio_left").innerHTML='<img width="22" height="33" src="images/player_off.png" alt="Click to stop" title="Click to stop" onclick="javascript: player_stop();"/>';
  }
 }
}
function GetXmlHttpObject(){
 if (window.XMLHttpRequest){
  // code for IE7+, Firefox, Chrome, Opera, Safari
  return new XMLHttpRequest();
 }
 if (window.ActiveXObject){
  // code for IE6, IE5
  return new ActiveXObject("Microsoft.XMLHTTP");
 }
 return null;
}

