function getSgIndex()
{
	if (window.XMLHttpRequest)
	  {// code for IE7+, Firefox, Chrome, Opera, Safari
	  xmlhttp=new XMLHttpRequest();
	  }
	else
	  {// code for IE6, IE5
	  xmlhttp=new ActiveXObject("Microsoft.XMLHttp");
	  }
	xmlhttp.onreadystatechange=function()
	  {
	  if (xmlhttp.readyState==4 && xmlhttp.status==200)
	    {
	    document.getElementById("sgindex").innerHTML=xmlhttp.responseText;
	    }
	  }
	xmlhttp.open("GET","get-index.php?t="+ Math.random(),true);
	xmlhttp.send();
}

function getInterIndex()
{
	if (window.XMLHttpRequest)
	  {// code for IE7+, Firefox, Chrome, Opera, Safari
	  xmlhttp2=new XMLHttpRequest();
	  }
	else
	  {// code for IE6, IE5
	  xmlhttp2=new ActiveXObject("Microsoft.XMLHttp");
	  }
	xmlhttp2.onreadystatechange=function()
	  {
	  if (xmlhttp2.readyState==4 && xmlhttp2.status==200)
	    {
	    document.getElementById("interindex").innerHTML=xmlhttp2.responseText;
	    }
	  }
	xmlhttp2.open("GET","get-inter-index.php?t="+ Math.random(),true);
	xmlhttp2.send();
}

function getEod(stock_name,counter,from_date,to_date)
{
	if (window.XMLHttpRequest)
	  {// code for IE7+, Firefox, Chrome, Opera, Safari
	  xmlhttp3=new XMLHttpRequest();
	  }
	else
	  {// code for IE6, IE5
	  xmlhttp3=new ActiveXObject("Microsoft.XMLHttp");
	  }
	xmlhttp3.onreadystatechange=function()
	  {
	  if (xmlhttp3.readyState==4 && xmlhttp3.status==200)
	    {
	    document.getElementById("display_eod").innerHTML=xmlhttp3.responseText;
	    }
	  else { document.getElementById("display_eod").innerHTML="Fetching and calculating data <img src=\"images/remembermilk_orange.gif\" />"; }
	  }
	  
	xmlhttp3.open("POST","get_eod.php",true);
	xmlhttp3.setRequestHeader("Content-type","application/x-www-form-urlencoded");
	xmlhttp3.send("stock_name="+stock_name+"&counter="+counter+"&from_date="+from_date+"&to_date="+to_date);
	//xmlhttp8.send(counter, from_date, to_date);
}
