﻿// JScript File


function CreateXmlHttpGLE()
{
   
		//Creating object of XMLHTTP in IE
		try
		{
			XmlHttpGLE = new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch(e)
		{
			try
			{
				XmlHttpGLE = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch(oc)
			{
				XmlHttpGLE = null;	
			}
		}
		//Creating object of XMLHTTP in Mozilla and Safari 
		if(!XmlHttpGLE && typeof XMLHttpRequest != "undefined") 
		{
			XmlHttpGLE = new XMLHttpRequest();
		}



}




function GetInternationalData(id)
{
	  CreateXmlHttpGLE();
	
	
	var requestUrl = "AjaxInternationalIndices.aspx?timeStamp="+new Date().getTime();
	if(XmlHttpGLE!=null)	
	        {
				XmlHttpGLE.onreadystatechange = function(){ChangeResponseInternational()}
				XmlHttpGLE.open('GET', requestUrl,  true);
				XmlHttpGLE.send(null);
			}
			 return false; 
}	
	
function ChangeResponseInternational()
{
   var td_Id
	// To make sure receiving response data from server is completed
	
	if(XmlHttpGLE.readyState == 4)
	{
	
		// To make sure valid response is received from the server, 200 means response received is OK
		
		
		if(XmlHttpGLE.status == 200)//
		{
		   try
		   {
		    
		     document.getElementById("tdInterIndices").innerHTML =  XmlHttpGLE.responseText;
				
			document.body.style.cursor = "auto";
		      
		   }
		   catch(oc)
		   {  
		  
		     GetInternationalData();
		  
		    }
		
		
		
		}
		else
		{
			    document.getElementById("tdInterIndices").innerHTML =  "There was a problem retrieving data from the server.";
			
			document.body.style.cursor = "auto";
		}
	}
}	


