function AjaxFunctionsub(semester_id)
{
semester_id;
var httpxml;
try
  {
  // Firefox, Opera 8.0+, Safari
  httpxml=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
		  try
   			 		{
   				 httpxml=new ActiveXObject("Msxml2.XMLHTTP");
    				}
  			catch (e)
    				{
    			try
      		{
      		httpxml=new ActiveXObject("Microsoft.XMLHTTP");
     		 }
    			catch (e)
      		{
      		alert("Your browser does not support AJAX!");
      		return false;
      		}
    		}
  }
function stateck() 
    {
    if(httpxml.readyState==4)
      {

var myarray1=eval(httpxml.responseText);
// Before adding new we must remove previously loaded elements
for(j=document.form1.subject.options.length-1;j>=0;j--)
{
document.form1.subject.remove(j);
}


for (i=0;i<myarray1.length;i=i+2)
{
var optn = document.createElement("OPTION");
optn.text = myarray1[i+1];
optn.value = myarray1[i];
document.form1.subject.options.add(optn);

} 
      }
    }
	var url="questionbank/getsubject.php";
url=url+"?semester_id="+semester_id;
url=url+"&sid="+Math.random();
httpxml.onreadystatechange=stateck;
httpxml.open("GET",url,true);
httpxml.send(null);
  }