﻿

 

function CreateXmlHttp()
	{
		//Creating object of XmlHttp in IE
		try
		{
			XmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch(e)
		{
			try
			{  
				XmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch(oc)
			{
				XmlHttp = false;	
			}
		}
		//Creating object of XmlHttp in Mozilla and Safari 
		if (!XmlHttp && typeof XMLHttpRequest!='undefined') 
		{
	        try 
	        {
		        XmlHttp = new XMLHttpRequest();
	        } 
	        catch (e) 
	        {
		        XmlHttp=false;
	        }
        }
        if (!XmlHttp && window.createRequest) 
        {
	        try 
	        {
		        XmlHttp = window.createRequest();
	        } 
	        catch (e)
	        {
		        XmlHttp=false;
	        }
        }
	
	}
	
	function GetXmlHttpObject(handler)
{ 
var objXmlHttp=null
if (navigator.userAgent.indexOf("Opera")>=0)
{
alert("This example doesn't work in Opera") 
return 
}
if (navigator.userAgent.indexOf("MSIE")>=0)
{ 
var strName="Msxml2.XMLHTTP"
if (navigator.appVersion.indexOf("MSIE 5.5")>=0)
{
strName="Microsoft.XMLHTTP"
} 
try
{ 
objXmlHttp=new ActiveXObject(strName)
objXmlHttp.onreadystatechange=handler 
return objXmlHttp
} 
catch(e)
{ 
alert("Error. Scripting for ActiveX might be disabled") 
return 
} 
} 
if (navigator.userAgent.indexOf("Mozilla")>=0)
{
objXmlHttp=new XMLHttpRequest()
objXmlHttp.onload=handler
objXmlHttp.onerror=handler 
return objXmlHttp
}
} 


function CreateXmlHttpVV()
	{
		//Creating object of XmlHttp in IE
		try
		{
			XmlHttpVV = new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch(e)
		{
			try
			{  
				XmlHttpVV = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch(oc)
			{
				XmlHttpVV = false;	
			}
		}
		//Creating object of XmlHttp in Mozilla and Safari 
		if (!XmlHttpVV && typeof XMLHttpRequest!='undefined') 
		{
	        try 
	        {
		        XmlHttpVV = new XMLHttpRequest();
	        } 
	        catch (e) 
	        {
		        XmlHttpVV=false;
	        }
        }
        if (!XmlHttpVV && window.createRequest) 
        {
	        try 
	        {
		        XmlHttpVV = window.createRequest();
	        } 
	        catch (e)
	        {
		        XmlHttpVV=false;
	        }
        }
	
	}


function CreateXmlHttp1()
	{
		//Creating object of XmlHttp in IE
		try
		{
			XmlHttp1 = new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch(e)
		{
			try
			{  
				XmlHttp1 = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch(oc)
			{
				XmlHttp1 = false;	
			}
		}
		//Creating object of XmlHttp in Mozilla and Safari 
		if (!XmlHttp1 && typeof XMLHttpRequest!='undefined') 
		{
	        try 
	        {
		        XmlHttp1 = new XMLHttpRequest();
	        } 
	        catch (e) 
	        {
		        XmlHttp1=false;
	        }
        }
        if (!XmlHttp1 && window.createRequest) 
        {
	        try 
	        {
		        XmlHttp1 = window.createRequest();
	        } 
	        catch (e)
	        {
		        XmlHttp1=false;
	        }
        }
	
	}	
	


function LookUpData(str,typ)
{ 


        if (str=="MCX")
        {
    
	     
	       // HomeTicker('MCX','F');
	        ShowVolumeValue('MCX','Val');
	        ShowBseGL('MCX','G')
        }
        else
        {
      
	       // HomeTicker('NCDEX','F');
	        ShowVolumeValue('NCDEX','Val');
	        ShowBseGL('NCDEX','G')
        }
	
} 


 
 
 function HomeTicker(ex,typ)
{
    if (ex == "")
    {
	
	    if (typ=="S")
	    {
	  document.getElementById("tdspt").className = "SelectedTxt";
	  document.getElementById("tdfut").className = "UnSelectedTxt";
	    document.getElementById("SF").value = "S"
	    }
	    else
	    {
	     document.getElementById("tdspt").className = "UnSelectedTxt";
	    document.getElementById("tdfut").className = "SelectedTxt";
	    document.getElementById("SF").value = "F"
	    }
    }
        else
        {
	        if(ex=="MCX")
	        {
             
		        document.getElementById("Ech").value = "MCX"
	        }
	        else
	        {
        	  
		        document.getElementById("Ech").value = "NCDEX"
	        }
        	
        }
        CreateXmlHttp1();
	var requestUrl="CommTicker.aspx?sid=" + Math.random() + "&Exchg="+document.getElementById("Ech").value+"&type="+document.getElementById("SF").value
	
	if(XmlHttp1)	
			{
					//alert("hi");
					XmlHttp1.onreadystatechange = function(){ShowTickerData();}; 
					XmlHttp1.open("GET", requestUrl,  true);
					XmlHttp1.send(null);
			}
	
}

function ShowTickerData() 
{ 

if(XmlHttp1.readyState == 4)
	{
		// To make sure valid response is received from the server, 200 means response received is OK
		if(XmlHttp1.status == 200)
		{			
			var TikerData   = document.getElementById("TikerData");
		var strData = XmlHttp1.responseText;
			//alert(strData);
			if(strData != "")
			{
				TikerData.innerHTML   =  "<marquee onmouseover='this.stop();' onmouseout='this.start();' trueSpeed scrollAmount='1' scrollDelay='40' height='116px' direction='up' loop='repeat' width='100%'>" +strData + "</marquee>";
			}
			document.body.style.cursor = "auto";	
		}
		else
		{
			TikerData.innerHTML = "There was a problem retrieving data from the server.";
			
			document.body.style.cursor = "auto";
		}
	}

	
} 

// for Gainers & Losers

 function ShowBseGL(ex,glctrl)
{

 if (ex == "")
    {
      //  ex=="NCDEX";
         if (glctrl=="G")
	    {
	         document.getElementById("select").className="HomeHeadSelPink";
	         document.getElementById("unselect").className="HomeHeadPink";
	     
	  
	        document.getElementById("GL").value = "G"
	    }
	    else
	    {
	    document.getElementById("select").className="HomeHeadPink";
	      document.getElementById("unselect").className="HomeHeadSelPink";
	    document.getElementById("GL").value = "L"
	    }
	 }
	 else
        {
	        if(ex=="MCX")
	        {

		        document.getElementById("MCXNCD").value = "MCX"
	        }
	        else
	        {
        	
		        document.getElementById("MCXNCD").value = "NCDEX"
	        }
        	
        }
   
        CreateXmlHttp();
        //alert(document.getElementById("GL").value);

	var requestUrl="AjaxGainerLoser.aspx?sid=" + Math.random() + "&Exchg="+document.getElementById("MCXNCD").value+"&typeGL="+document.getElementById("GL").value;
	
	
	if(XmlHttp)	
			{
					//alert("hi");
					XmlHttp.onreadystatechange = function(){ShowShowGLData();}; 
					XmlHttp.open("GET", requestUrl,  true);
					XmlHttp.send(null);
			}
	
}

function ShowShowGLData() 
{ 

if(XmlHttp.readyState == 4)
	{
		// To make sure valid response is received from the server, 200 means response received is OK
		if(XmlHttp.status == 200)
		{			
			var ShowGLData   = document.getElementById("ShowGLData");
		var strData = XmlHttp.responseText;
			//alert(strData);
			if(strData != "")
			{
				ShowGLData.innerHTML   =  strData;
			}
			document.body.style.cursor = "auto";	
		}
		else
		{
			ShowGLData.innerHTML = "There was a problem retrieving data from the server.";
			
			document.body.style.cursor = "auto";
		}
	}

	
} 


// For High & Low

 function ShowVolumeValue(ex,glctrl)
{

 if (ex == "")
    {
         if (glctrl=="Val")
	    {
	      document.getElementById("ValSel").className="HomeHeadSelPink";
	      document.getElementById("VolSel").className="HomeHeadPink";
	     
	  
	    document.getElementById("VV").value = "Val"
	    }
	    else
	    {
	    document.getElementById("ValSel").className="HomeHeadPink";
	      document.getElementById("VolSel").className="HomeHeadSelPink";
	    document.getElementById("VV").value = "Vol"
	    }
	 }
	 else
        {
	        if(ex=="MCX")
	        {
	        
		        document.getElementById("MCXNCD").value = "MCX"
	        }
	        else
	        {
        	
		        document.getElementById("MCXNCD").value = "NCDEX"
	        }
        	
        }
   
        CreateXmlHttpVV();
	var requestUrl="AjaxValueVol.aspx?sid=" + Math.random() + "&Exchg="+document.getElementById("MCXNCD").value+"&typeGL="+document.getElementById("VV").value;
	//alert(requestUrl);
	
	
	if(XmlHttpVV)	
			{
					//alert("hi");
					XmlHttpVV.onreadystatechange = function(){ShowVolumeValueData();}; 
					XmlHttpVV.open("GET", requestUrl,  true);
					XmlHttpVV.send(null);
			}
	
}

function ShowVolumeValueData() 
{ 

if(XmlHttpVV.readyState == 4)
	{
		// To make sure valid response is received from the server, 200 means response received is OK
		if(XmlHttpVV.status == 200)
		{			
			var ShowVolumeValueData   = document.getElementById("ShowVVData");
		var strData = XmlHttpVV.responseText;
			//alert(strData);
			if(strData != "")
			{
				ShowVolumeValueData.innerHTML   =  strData;
			}
			document.body.style.cursor = "auto";	
		}
		else
		{
			ShowVolumeValueData.innerHTML = "There was a problem retrieving data from the server.";
			
			document.body.style.cursor = "auto";
		}
	}

	
}

// For Chart Data

 function HomeChart(ex,symbol)
{

 var Gold=document.getElementById("GoldS");
 var Silver=document.getElementById("SilverS");


        if (symbol=="GOLD" || symbol=="GLDPURMUMK")
	    {
	   
	       document.getElementById("GoldS").style.display="inline";
	       document.getElementById("SilverS").style.display="none"; 
	       document.getElementById("sec_1").className="SensexFontSelect"; 
	       document.getElementById("sec_2").className="SensexFontUnSelect"; 
	      
	    }
	    else
	    {
	      document.getElementById("SilverS").style.display="inline";
	      document.getElementById("GoldS").style.display="none";
	      document.getElementById("sec_1").className="SensexFontUnSelect"; 
	      document.getElementById("sec_2").className="SensexFontSelect"; 
	      
	    }
    if (ex == "")
    {
   
	
	    if (symbol=="GOLD")
	    {
	       
	      
	       document.getElementById("GS").value = "GOLD"
	    }
	    else
	    {
	         
	        document.getElementById("GS").value = "SILVER"
	    }
    }
        else
        {
	        if(ex=="MCX")
	        {
	          

		        document.getElementById("Ech").value = "MCX"
	        }
	            else
	            {
	           
	          
	                
            	
		            document.getElementById("Ech").value = "NCDEX"
	            }
        	
        }
       // CreateXmlHttpSymb();
	        var requestUrl="Chart.aspx?sid=" + Math.random() + "&Exchange="+document.getElementById("Ech").value +"&Symbol="+symbol ;
	    document.getElementById("ChartComm").src=requestUrl;
	//alert(requestUrl);
	
//	if(XmlHttpSymb)	
//			{
//					//alert("hi");
//					XmlHttpSymb.onreadystatechange = function(){ShowGoldData();}; 
//					XmlHttpSymb.open("GET", requestUrl,  true);
//					XmlHttpSymb.send(null);
//			}
	
}

function ShowGoldData() 
{ 

if(XmlHttpSymb.readyState == 4)
	{
		// To make sure valid response is received from the server, 200 means response received is OK
		if(XmlHttpSymb.status == 200)
		{			
			var GoldData   = document.getElementById("Chart");
		var strData = XmlHttpSymb.responseText;
			//alert(strData);
			if(strData != "")
			{
				GoldData.innerHTML   =  strData;
			}
			document.body.style.cursor = "auto";	
		}
		else
		{
			GoldData.innerHTML = "There was a problem retrieving data from the server.";
			
			document.body.style.cursor = "auto";
		}
	}

	
} 


/// Get Quotes


function CreateXmlHttpNew()
	{
		//Creating object of XMLHTTP in IE
		try
		{
			XmlHttpFO = new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch(e)
		{
			try
			{
				XmlHttpFO = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch(oc)
			{
				XmlHttpFO = null;	
			}
		}
		//Creating object of XMLHTTP in Mozilla and Safari 
		if(!XmlHttpFO && typeof XMLHttpRequest != "undefined") 
		{
			XmlHttpFO = new XMLHttpRequest();
		}
		if (!XmlHttpFO && window.createRequest) 
        {
	        try 
	        {
		        XmlHttpFO = window.createRequest();
	        } 
	        catch (e)
	        {
		        XmlHttpFO=false;
	        }
        }
	}


 


 function fillCategory()
    {
		
	    var Excha = document.getElementById("ctl00_ContentPlaceHolder1_Exchg");
	    var Symbol = document.getElementById("ctl00_ContentPlaceHolder1_ddlCategory");
		
 				
		CreateXmlHttpNew();
		document.body.style.cursor = "progress";
		var requestUrl = "CmGetCategoryAjax.aspx?timeStamp="+ new Date().getTime() +"&Excha="+Excha.value;
		//alert(requestUrl)
		if(XmlHttpFO)	{
					XmlHttpFO.onreadystatechange = function(){fillSymbolResp(Symbol)};
					XmlHttpFO.open("GET", requestUrl,  true);
					XmlHttpFO.send(null);
				}
		
    }
 
 //Called when response comes back from server Only For Symbol
function fillSymbolResp(ig_)
{

	// To make sure receiving response data from server is completed
	if(XmlHttpFO.readyState == 4)
	{
		
		// To make sure valid response is received from the server, 200 means response received is OK
		if(XmlHttpFO.status == 200)
		{		
			//alert(ig_)
			//var availSchemes   = document.getElementById(ig_);
			var strData = XmlHttpFO.responseText
			//alert(strData)
			if(strData != "") {	
			    
				var arrSchm = strData.split("|");
				ig_.length = 0; 	
				
				for(i=0; i<arrSchm.length-1; i++) {	
								
					var strSchm = arrSchm[i];
					var arrSchmCode = strSchm.split("~");
					
					ig_.options[i] = new Option();
					
					ig_.options[i].value = arrSchmCode[0];
					ig_.options[i].text = arrSchmCode[1];
				}
				
			}
			else {
					ig_.length = 0;
					ig_.options[0] = new Option(); 
					ig_.options[0].value = "";
					ig_.options[0].text = "Category not available";			
			}
			document.body.style.cursor = "auto";	
		}
		else {
					ig_.length = 0;
					ig_.options[0] = new Option(); 
					ig_.options[0].value = "";
					ig_.options[0].text = "server is not ready";
					document.body.style.cursor = "auto";		
		}
	}
}

var XmlHttpCommNews;

function CreateXmlHttpCommNews()
	{
		//Creating object of XmlHttp in IE
		try
		{
			XmlHttpCommNews = new ActiveXObject("Msxml2.XmlHttp");
		}
		catch(e)
		{
			try
			{
				XmlHttpCommNews = new ActiveXObject("Microsoft.XmlHttp");
			} 
			catch(oc)
			{
				XmlHttpCommNews = null;	
			}
		}
		//Creating object of XmlHttp in Mozilla and Safari 
		if(!XmlHttpCommNews && typeof XmlHttpRequest != "undefined") 
		{
			XmlHttpCommNews = new XmlHttpRequest();
		}
		if (!XmlHttpCommNews && window.createRequest) 
        {
	        try 
	        {
		        XmlHttpCommNews = window.createRequest();
	        } 
	        catch (e)
	        {
		        XmlHttpCommNews=false;
	        }
        }
	}

function GetNewsDetail(secId,SubSecId,NewsID,opt)
{
    //alert(secId);
    var NewsWin = document.getElementById("divNews").style.display='inline';
	var currentDivObj;	
		
	currentDivObj = document.getElementById("TDNews");
	currentDivObj.innerHTML ="<img src='../App_Themes/HomeCommon/Homeimages/loader.gif'>"; 
	CreateXmlHttpCommNews();
	document.body.style.cursor = "progress";
	var requestUrl = "PopupNewsData.aspx?SecId="+ secId +"&SubSecId="+ SubSecId+"&NewsID="+NewsID+"&timeStamp="+new Date().getTime()+"opt="+opt;
		
	if(XmlHttpCommNews)	
	{
	    XmlHttpCommNews.onreadystatechange = function(){getDetailsResp();};
		XmlHttpCommNews.open("GET", requestUrl,  true);
		XmlHttpCommNews.send(null);					
	}
}
	
function getDetailsResp()
{
    
    // To make sure receiving response data from server is completed
	if(XmlHttpCommNews.readyState == 4)
	{
	    // To make sure valid response is received from the server, 200 means response received is OK
		if(XmlHttpCommNews.status == 200)
		{
		    document.getElementById("TDNews").innerHTML = XmlHttpCommNews.responseText;
			//var strData = XmlHttpNew.responseText;
			var News= document.getElementById("divNews").style.display='inline';
			News.innerHTML = "<marquee  onmouseout='this.start();' trueSpeed scrollAmount='1' height=126px scrollDelay='150' direction='up' loop='repeat' width='100%'></marquee>";
			document.body.style.cursor = "auto";
		}
		else
		{
		    document.getElementById("TDNews").innerHTML = "<img src=../App_Themes/Common/images/ajax-loader.gif>";
		}
	}
}


function CreateXmlHttpNew()
	{
		//Creating object of XMLHTTP in IE
		try
		{
			XmlHttpFO = new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch(e)
		{
			try
			{
				XmlHttpFO = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch(oc)
			{
				XmlHttpFO = null;	
			}
		}
		//Creating object of XMLHTTP in Mozilla and Safari 
		if(!XmlHttpFO && typeof XMLHttpRequest != "undefined") 
		{
			XmlHttpFO = new XMLHttpRequest();
		}
		if (!XmlHttpFO && window.createRequest) 
        {
	        try 
	        {
		        XmlHttpFO = window.createRequest();
	        } 
	        catch (e)
	        {
		        XmlHttpFO=false;
	        }
        }
	}
	
	
function CreateXmlHttpEDH()
	{
		//Creating object of XMLHTTP in IE
		try
		{
			XmlHttpEDH = new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch(e)
		{
			try
			{
				XmlHttpEDH = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch(oc)
			{
				XmlHttpEDH = null;	
			}
		}
		//Creating object of XMLHTTP in Mozilla and Safari 
		if(!XmlHttpEDH && typeof XMLHttpRequest != "undefined") 
		{
			XmlHttpEDH = new XMLHttpRequest();
		}
		if (!XmlHttpEDH && window.createRequest) 
        {
	        try 
	        {
		        XmlHttpEDH = window.createRequest();
	        } 
	        catch (e)
	        {
		        XmlHttpEDH=false;
	        }
        }
	}



function fillSymbolhome()
     {
//		alert()
	 var Excha = document.getElementById("Exchg");
	 var Symbol = document.getElementById("Symbol");		

		
		CreateXmlHttpEDH();
		document.body.style.cursor = "progress";
		var requestUrl = "CmGetSymbolAjax.aspx?timeStamp="+ new Date().getTime() +"&Excha="+Excha.value;
		//alert(requestUrl)
		if(XmlHttpEDH)	{
					XmlHttpEDH.onreadystatechange = function(){fillSymbolResphome(Symbol)};
					XmlHttpEDH.open("GET", requestUrl,  true);
					XmlHttpEDH.send(null);
				}
		
 }
 
 //Called when response comes back from server Only For Symbol
function fillSymbolResphome(ig_)
{

	// To make sure receiving response data from server is completed
	if(XmlHttpEDH.readyState == 4)
	{
		
		// To make sure valid response is received from the server, 200 means response received is OK
		if(XmlHttpEDH.status == 200)
		{		
			//alert(ig_)
			//var availSchemes   = document.getElementById(ig_);
			var strData = XmlHttpEDH.responseText
			//alert(strData)
			if(strData != "") {	
			    
				var arrSchm = strData.split("|");
				ig_.length = 0; 	
				
				for(i=0; i<arrSchm.length-1; i++) {	
								
					var strSchm = arrSchm[i];
					var arrSchmCode = strSchm.split("~");
					
					ig_.options[i] = new Option();
					
					ig_.options[i].value = arrSchmCode[0];
					ig_.options[i].text = arrSchmCode[1];
				}
				
			}
			else {
					ig_.length = 0;
					ig_.options[0] = new Option(); 
					ig_.options[0].value = "";
					ig_.options[0].text = "Symbol not available";			
			}
			document.body.style.cursor = "auto";	
		}
		else {
					ig_.length = 0;
					ig_.options[0] = new Option(); 
					ig_.options[0].value = "";
					ig_.options[0].text = "server is not ready";
					document.body.style.cursor = "auto";		
		}
	}
}
function GetExpDatehome()
 {
        var Excha = document.getElementById("Exchg");
  		var Symbol = document.getElementById("Symbol");
 		var ExpiryDate = document.getElementById("ExpDate"); 
 				
		CreateXmlHttpEDH();
		document.body.style.cursor = "progress";
		var requestUrl = "CmGetExpDateAjax.aspx?timeStamp="+ new Date().getTime() +"&Excha="+Excha.value +"&Symbol="+Symbol.value;
	
		if(XmlHttpEDH)	{
					XmlHttpEDH.onreadystatechange = function(){getDateResphome(ExpiryDate)};
					XmlHttpEDH.open("GET", requestUrl,  true);
					XmlHttpEDH.send(null);
				}
		
 }
 
 //Called when response comes back from server Only For Symbol
function getDateResphome(ig_)
{

	// To make sure receiving response data from server is completed
	if(XmlHttpEDH.readyState == 4)
	{
		// To make sure valid response is received from the server, 200 means response received is OK
		if(XmlHttpEDH.status == 200)
		{
			//alert(ig_)
			//var availSchemes   = document.getElementById(ig_);
			var strData = XmlHttpEDH.responseText
			if(strData != "") {	
				var arrSchm = strData.split("|");
				ig_.length = 0; 	
				for(i=0; i<arrSchm.length-1; i++) {	
					var strSchm = arrSchm[i];
					var arrSchmCode = strSchm.split("~");
					ig_.options[i] = new Option();
					ig_.options[i].value = arrSchmCode[0];
					ig_.options[i].text = arrSchmCode[1];
				}
			}
			else {
					ig_.length = 0;
					ig_.options[0] = new Option(); 
					ig_.options[0].value = "";
					ig_.options[0].text = "Date not available";			
			}
			document.body.style.cursor = "auto";	
		}
		else {
					ig_.length = 0;
					ig_.options[0] = new Option(); 
					ig_.options[0].value = "";
					ig_.options[0].text = "server is not ready";
					document.body.style.cursor = "auto";		
		}
	}
}
		


function CreateXmlHttpEDH()
	{
		//Creating object of XMLHTTP in IE
		try
		{
			XmlHttpEDH = new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch(e)
		{
			try
			{
				XmlHttpEDH = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch(oc)
			{
				XmlHttpEDH = null;	
			}
		}
		//Creating object of XMLHTTP in Mozilla and Safari 
		if(!XmlHttpEDH && typeof XMLHttpRequest != "undefined") 
		{
			XmlHttpEDH = new XMLHttpRequest();
		}
		if (!XmlHttpEDH && window.createRequest) 
        {
	        try 
	        {
		        XmlHttpEDH = window.createRequest();
	        } 
	        catch (e)
	        {
		        XmlHttpEDH=false;
	        }
        }
	}
	
function RedirectDataHome()
{

var ChkExchnge = document.getElementById("Exchg");
var Exchnge = document.getElementById("Exchg").value;
var Symbol = document.getElementById("Symbol").value;
var ChkSymbol = document.getElementById("Symbol");
var ExpDate = document.getElementById("ExpDate").value;
var ChkExpDate = document.getElementById("ExpDate");
var strurl= "Home=True|Excha=" + Exchnge + "|Symbol=" + Symbol + "|ExpDate=" + ExpDate;

 if(ChkExchnge.value=="0" )
    { 
      
        alert("Please select Exchange");
        ChkExchnge.focus();
        return false;
       
        
        
    }
    
    if(ChkSymbol.value ==" ")
    {
    
     alert("Please select Symbol");
     ChkSymbol.focus();
     return false;
     
    }
     if(ExpDate ==" ")
    {
    
     alert("Please select Expiry Date");
     ChkExpDate.focus();
     return false;
     
    }
 
 
    

var requestUrl = "http://www.rathionline.com/Commodity/CommodityMain.aspx?Url=Commodity/GetQuoteData.aspx?id=2|"+strurl;
var newWindow = window.open(requestUrl, '_parent');
newWindow.focus(); 
return false;


}
 
var XmlHttpQoutes;

function CreateXmlHttpQoutes()
{
	try
	{
		XmlHttpQoutes = new ActiveXObject("Msxml2.XMLHTTP");
	}
	catch(e)
	{
		try
		{
			XmlHttpQoutes = new ActiveXObject("Microsoft.XMLHTTP");
		} 
		catch(oc)
		{
			XmlHttpQoutes = false;	
		}
	}
	//Creating object of XMLHTTP in Mozilla and Safari 
	if(!XmlHttpQoutes && typeof XMLHttpRequest != "undefined") 
	{
		   try 
	        {
		        XmlHttpQoutes = new XMLHttpRequest();
	        } 
	        catch (e) 
	        {
		        XmlHttpQoutes=false;
	        }
	}
	
	  if (!XmlHttpQoutes && window.createRequest) 
        {
	        try 
	        {
		        XmlHttpQoutes = window.createRequest();
	        } 
	        catch (e)
	        {
		        XmlHttpQoutes=false;
	        }
        }
	
	
}
function RedirectData(opt)
{

     if(opt == "Inner")
	{
	
	 var Excha = document.getElementById("ctl00_ContentPlaceHolder1_FundCatCtrl1_ddlExchange").value;
  	var Symbol = document.getElementById("ctl00_ContentPlaceHolder1_FundCatCtrl1_ddlSymbol").value;
 	var ExpiryDate = document.getElementById("ctl00_ContentPlaceHolder1_FundCatCtrl1_ddlExpDate").value;
 
	if(Excha==" " )
    { 
      
        alert("Please Select Exchange");
        document.getElementById("ctl00_ContentPlaceHolder1_FundCatCtrl1_ddlExchange").focus();   
        return false;
         
    }
   if(Symbol==" " )
    { 
      
        alert("Please Select Symbol");
        document.getElementById("ctl00_ContentPlaceHolder1_FundCatCtrl1_ddlSymbol").focus(); 
        return false;
        
    }
    if(ExpiryDate==" " )
    { 
      
        alert("Please Select Expiry date");
        document.getElementById("ctl00_ContentPlaceHolder1_FundCatCtrl1_ddlExpDate").focus(); 
        return false;
        
    }
    
    var strUrl = document.getElementById("ctl00_ContentPlaceHolder1_txthidden");


	//var GetQuoateTbl = document.getElementById("GetQuoateTbl");
  
//	if(GetQuoateTbl.style.display=="none")
//	{
//	GetQuoateTbl.style.display = "inline";
//    }
	CreateXmlHttpQoutes();
    document.body.style.cursor = "progress";
    
        var requestUrl = "AjaxGetQuotesData.aspx?Excha="+Excha +"&Symbol="+Symbol+"&ExpDate="+ExpiryDate;
       // document.ChartCommodity.src="GetPriceChart.aspx?Excha="+Excha +"&Symbol="+Symbol+"&ExpDate="+ExpiryDate;

      
    }
    else
    {
   var strUrl = document.getElementById("ctl00_ContentPlaceHolder1_txthidden");

	//var GetQuoateTbl = document.getElementById("GetQuoateTbl");
 
    //if(GetQuoateTbl.style.display=="none")GetQuoateTbl.style.display = "inline";

	    CreateXmlHttpQoutes();
        document.body.style.cursor = "progress";
        var requestUrl = "AjaxGetQuotesData.aspx?"+strUrl.value;
       //document.ChartCommodity.src="GetPriceChart.aspx?"+strUrl.value;
     
    }
    
    
    if(XmlHttpQoutes)	
    {
	    XmlHttpQoutes.onreadystatechange = function(){getFODataResp()};
		XmlHttpQoutes.open("GET", requestUrl,  true);
		XmlHttpQoutes.send(null);
	}
	
	return false;
	
	
}

function getFODataResp()
{
  
    if(XmlHttpQoutes.readyState == 4)
	{
	   
	    if(XmlHttpQoutes.status == 200)
		{
		   // var FO_QuoteData = XmlHttpQoutes.responseText;
		    document.getElementById("TdGetQuotesData").innerHTML = XmlHttpQoutes.responseText;
		    document.body.style.cursor = "auto";
			
//			if(FO_QuoteData != "") 
//			{
//			    var arrRow = FO_QuoteData.split("|");
//				
//				for(i=0; i<arrRow.length-1; i++)
//				{
//				   document.getElementById("GQ"+i).innerHTML = arrRow[i];
//				}
//				document.body.style.cursor = "auto";
//			}	
		}
	else
	    {
			document.getElementById("TdGetQuotesData").src = " ../App_Themes/Images/ajax-loader.gif";
        }
	
	}
}

function onload()
{
RedirectData('Home');
}
var schemeObject=null;
var Fund ;
var scheme;  
var category;
 
function ProcessSearchData()
{        
    try 
    { 
        schemeObject = new ActiveXObject('Msxml2.XMLHTTP');
    }
    catch(e)
    {
        try 
        {
            schemeObject = new ActiveXObject('Microsoft.XMLHTTP'); 
        } 
        catch(e1) 
        { 
            schemeObject = null; 
        } 
    }
   if(!schemeObject && typeof XMLHttpRequest != "undefined") 
    {
	    schemeObject = new XMLHttpRequest();
	}
	if (!schemeObject && window.createRequest) 
        {
	        try 
	        {
		        schemeObject = window.createRequest();
	        } 
	        catch (e)
	        {
		        schemeObject=false;
	        }
        }
 
    
    Exch = document.getElementById("ctl00_ContentPlaceHolder1_FundCatCtrl1_ddlExchange");                  
    scheme = document.getElementById("ctl00_ContentPlaceHolder1_FundCatCtrl1_ddlExpDate");                                
    category = document.getElementById("ctl00_ContentPlaceHolder1_FundCatCtrl1_ddlSymbol");   

            
    if(schemeObject != null)
    {   
        var queryString = "CommodityData.aspx?timeStamp="+ new Date().getTime() +"&Excha="+Exch.value;  
        schemeObject.onreadystatechange = function(){ProcessSchemeData(Exch);};  
        schemeObject.open('GET', queryString ,  true); 
        schemeObject.send(null);  
    } 
    
   
    ProcessCategoryData();
     
    return false; 
    
}

function ProcessSchemeData(Exch)
{

    if(schemeObject.readyState == 4)
    {
        if(schemeObject.status == 200)
        {     
            var listItemc;       
            var dsRoot = schemeObject.responseXML.documentElement;
               
           document.getElementById("ctl00_ContentPlaceHolder1_FundCatCtrl1_txtFund").value =Exch.options[Exch.selectedIndex].value;
            if(dsRoot != null)        
            {                                   
                var ddlCat = category;  
                ddlCat.options.length=0; 
                var ddlExpDate = scheme;  
                listItem = new Option("Select Category", "");
		        ddlCat.length=0;
                ddlCat.options[0] = listItem; 
                                     
                if(dsRoot.getElementsByTagName('comname')!=null)
                {
                    var textc; 
                    var valuec;
                    var CatName = dsRoot.getElementsByTagName('comname');                        
                    var CatCodes = dsRoot.getElementsByTagName('comsymbol');
                    ddlCat.length=0;
                    
                    for (var count = 0; count < CatName.length; count++)
                    {
                        textc = (CatName[count].textContent || CatName[count].innerText || CatName[count].text);
                        valuec = (CatCodes[count].textContent || CatCodes[count].innerText || CatCodes[count].text);
                        listItemc = new Option(textc, valuec,  false, false);
                        ddlCat.options[ddlCat.length] = listItemc;    
                    }
                }
            }  
            else
            {                                             
                listItemc = new Option("Category is not available", "");
	            ddlCat.length = 1;
                ddlCat.options[0] = listItemc;      
            }
        }    
    }
}
         
//category
var XmlHttpCat;
function CreateXmlHttpCat()
{
    try
	{
	    XmlHttpCat = new ActiveXObject("Msxml2.XMLHTTP");
    }
	catch(e)
	{
	    try
		{
		    XmlHttpCat = new ActiveXObject("Microsoft.XMLHTTP");
		} 
		catch(oc)
		{
		    XmlHttpCat = null;
	    }
	}
	
	if(!XmlHttpCat && typeof XMLHttpRequest != "undefined") 
    {
	    XmlHttpCat = new XMLHttpRequest();
	}
	if (!XmlHttpCat && window.createRequest) 
        {
	        try 
	        {
		        XmlHttpCat = window.createRequest();
	        } 
	        catch (e)
	        {
		        XmlHttpCat=false;
	        }
        }
}
         
function ProcessCategoryData()
{
   
    CreateXmlHttpCat();
          
    if(XmlHttpCat)
    {   
   
        Fund = document.getElementById("ctl00_ContentPlaceHolder1_FundCatCtrl1_ddlExchange");
        scheme = document.getElementById("ctl00_ContentPlaceHolder1_FundCatCtrl1_ddlExpDate");                
        category = document.getElementById("ctl00_ContentPlaceHolder1_FundCatCtrl1_ddlSymbol"); 
        //cateogry.value ="GOLD";
       // var d="GOLD";
        var queryString = "CmGetExpDateAjax.aspx?timeStamp="+new Date().getTime()+"&Excha=" + Fund.value +"&Symbol=" + category.value;  
        XmlHttpCat.onreadystatechange = function(){ProcessData(scheme);};  
        XmlHttpCat.open('GET', queryString ,  true); 
        XmlHttpCat.send(null);  
       document.getElementById("<%=txtCategory.ClientID%>").value=category.value;

    } 
   
    return false; 
}
        
function ProcessData(ig_)
{
    if(XmlHttpCat.readyState == 4)
	{
	    if(XmlHttpCat.status == 200)
	    {
		    var strData = XmlHttpCat.responseText
			
			if(strData != "") 
			{	
			    var arrSchm = strData.split("|");
				ig_.length = 0; 	
				
				for(i=0; i<arrSchm.length-1; i++) 
				{	
					var strSchm = arrSchm[i];
					var arrSchmCode = strSchm.split("~");
					ig_.options[i] = new Option();
					ig_.options[i].value = arrSchmCode[0];
					ig_.options[i].text = arrSchmCode[1];
				}
			}
			else
			{
			    ig_.length = 0;
				ig_.options[0] = new Option(); 
				ig_.options[0].value = "";
				ig_.options[0].text = "Date not available";			
			}
			document.body.style.cursor = "auto";	
		}
		else 
		{
		    ig_.length = 0;
			ig_.options[0] = new Option(); 
			ig_.options[0].value = "";
			ig_.options[0].text = "server is not ready";
			document.body.style.cursor = "auto";		
		} 
	}
}


var tempX = 0;
 var tempY = 0;


 //setInterval("hide_popup1()",1000);
 
 var IE = document.all?true:false
 
 if (!IE) document.captureEvents(Event.MOUSEMOVE)
 document.onmousemove = getMouseXY;
 
 function getMouseXY(e) 
 {
 	if(IE)
 	{
 	     tempY = document.body.scrollTop+50;
 	}
 	else
 	{
 		 tempY = document.body.scrollTop+50;
 	}
 	return true;
 }
 
 /* Commodity home gain-loss and val-vol control */
 
 
 var XmlHttpComm;
function CreateXmlHttpComm()
{
	try
		{
			XmlHttpComm = new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch(e)
		{
			try
			{  
				XmlHttpComm = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch(oc)
			{
				XmlHttpComm = false;	
			}
		}
		//Creating object of XmlHttp in Mozilla and Safari 
		if (!XmlHttpComm && typeof XMLHttpRequest!='undefined') 
		{
	        try 
	        {
		        XmlHttpComm = new XMLHttpRequest();
	        } 
	        catch (e) 
	        {
		        XmlHttpComm=false;
	        }
        }
        if (!XmlHttpComm && window.createRequest) 
        {
	        try 
	        {
		        XmlHttpComm = window.createRequest();
	        } 
	        catch (e)
	        {
		        XmlHttpComm=false;
	        }
        }
}






function CommChangeControl(Opt)
{
    var GNLef=document.getElementById("ComGNLef");
            var GNRef=document.getElementById("ComGNRef");
            var GNRig=document.getElementById("CommRig");
          
            var LOLef=document.getElementById("ComLOLef");
            var LORef=document.getElementById("ComLORef");
            var LORig=document.getElementById("ComLORig");
          
            var VOLef=document.getElementById("ComVOLef");
            var VORef=document.getElementById("ComVORef");
            var VORig=document.getElementById("ComVORig");
          
            var ADVLef=document.getElementById("ComVaLef");
            var ADVBck=document.getElementById("ComVaRef");
            var ADVRig=document.getElementById("ComVaRig");  
       
           
       if(Opt=='G')
        {  
       
          GNLef.innerHTML="<img src=../App_Themes/HomeCommon/Homeimages/OrTabLef1.gif align=absbottom />";
          GNRef.className="TabTextSel";
          GNRig.innerHTML="<img src=../App_Themes/HomeCommon/Homeimages/OrTabRig1.gif align=absbottom />"; 
          GNRef.style.cursor = "text";
          LORef.style.cursor = "Pointer";
          VORef.style.cursor = "Pointer";
          ADVBck.style.cursor = "Pointer";
          LOLef.innerHTML="";
          LORef.className="TabTextUnSel";
          LORig.innerHTML="";
          
          VOLef.innerHTML="";
          VORef.className="TabTextUnSel";
          VORig.innerHTML="";
          
          ADVLef.innerHTML="";
          ADVBck.className="TabTextUnSel";
          ADVRig.innerHTML="";
          
        } 
        if(Opt=='L')
        {  
        
          LOLef.innerHTML="<img src=../App_Themes/HomeCommon/Homeimages/OrTabLef1.gif align=absbottom />";
          LORef.className="TabTextSel";
          LORig.innerHTML="<img src=../App_Themes/HomeCommon/Homeimages/OrTabRig1.gif align=absbottom />";  
          GNRef.style.cursor = "Pointer";
          LORef.style.cursor = "text";
          VORef.style.cursor = "Pointer";
          ADVBck.style.cursor = "Pointer";
          GNLef.innerHTML="";
          GNRef.className="TabTextUnSel";
          GNRig.innerHTML="";
          
          VOLef.innerHTML="";
          VORef.className="TabTextUnSel";
          VORig.innerHTML="";
          
          ADVLef.innerHTML="";
          ADVBck.className="TabTextUnSel";
          ADVRig.innerHTML="";
        }  
         if(Opt=='Vol')
        {        
          VOLef.innerHTML="<img src=../App_Themes/HomeCommon/Homeimages/OrTabLef1.gif align=absbottom />";
          VORef.className="TabTextSel";
          VORig.innerHTML="<img src=../App_Themes/HomeCommon/Homeimages/OrTabRig1.gif align=absbottom />"; 
          GNRef.style.cursor = "Pointer";
          LORef.style.cursor = "Pointer";
          VORef.style.cursor = "text";
          ADVBck.style.cursor = "Pointer";
          GNLef.innerHTML="";
          GNRef.className="TabTextUnSel";
          GNRig.innerHTML="";
          
          LOLef.innerHTML="";
          LORef.className="TabTextUnSel";
          LORig.innerHTML="";
          
          ADVLef.innerHTML="";
          ADVBck.className="TabTextUnSel";
          ADVRig.innerHTML=""; 
        } 
         if(Opt=='Val')
        {        
          VOLef.innerHTML="";
          VORef.className="TabTextUnSel";
          VORig.innerHTML=""; 
          GNRef.style.cursor = "Pointer";
          LORef.style.cursor = "Pointer";
          VORef.style.cursor = "Pointer";
          ADVBck.style.cursor = "text";
          GNLef.innerHTML="";
          GNRef.className="TabTextUnSel";
          GNRig.innerHTML="";
          
          LOLef.innerHTML="";
          LORef.className="TabTextUnSel";
          LORig.innerHTML="";
          
          ADVLef.innerHTML="<img src=../App_Themes/HomeCommon/Homeimages/OrTabLef1.gif align=absbottom />";
          ADVBck.className="TabTextSel";
          ADVRig.innerHTML="<img src=../App_Themes/HomeCommon/Homeimages/OrTabRig1.gif align=absbottom />"; 
        } 
     document.getElementById("strDataComm").innerHTML = "<table align=center><tr><td ><img src =../App_Themes/HomeCommon/Homeimages/loader.gif /></td></tr></table>";
      CreateXmlHttpComm();
       var currentDivObj = document.getElementById("strDataComm");
        
	document.body.style.cursor = "progress";

	
	var requestUrl = "CommAjaxValueVol.aspx?typeGL="+ Opt +"&timeStamp="+new Date().getTime();
	if(XmlHttpComm!=null)	
	        {
				XmlHttpComm.onreadystatechange = function(){CommChangeControlResponse(Opt)}
				XmlHttpComm.open('GET', requestUrl,  true);
				XmlHttpComm.send(null);
			}
			 return false; 
}

function CommChangeControlResponse(Opt)
{
if(XmlHttpComm.readyState == 4)
	{
		// To make sure valid response is received from the server, 200 means response received is OK
		var td_Id = document.getElementById("strDataComm");
	   
		if(XmlHttpComm.status == 200)//
		{
			td_Id.innerHTML =  XmlHttpComm.responseText;
				
			document.body.style.cursor = "auto";		
		}
		else
		{
			td_Id.innerHTML =  "There was a problem retrieving data from the server.";
			
			document.body.style.cursor = "auto";
		}
	}
}
// Determine browser and version.

function Browser() {

  var ua, s, i;
  this.isIE    = false;
  this.isNS    = false;  
  this.version = null;
  ua = navigator.userAgent;
	s = "MSIE";
  if ((i = ua.indexOf(s)) >= 0) {
    this.isIE = true;
    this.version = parseFloat(ua.substr(i + s.length));
    return;
  }

  s = "Netscape6/";
  if ((i = ua.indexOf(s)) >= 0) {
    this.isNS = true;
    this.version = parseFloat(ua.substr(i + s.length));
    return;
  }  
  
  s="Opera";
  if ((i = ua.indexOf(s)) >= 0) {
    this.isIE = true;
    this.version = parseFloat(ua.substr(i + s.length));
    return;
  }

  // Treat any other "Gecko" browser as NS 6.1.

  s = "Gecko";
  if ((i = ua.indexOf(s)) >= 0) {
    this.isNS = true;
    this.version = 6.1;
    return;
  }
}

var browser = new Browser();

// Global object to hold drag information.

var dragObj = new Object();
dragObj.zIndex = 0;

function dragStart(event, id) {
    //alert("sdf");
  var el;
  var x, y;

  // If an element id was given, find it. Otherwise use the element being
  // clicked on.

  if (id)
    dragObj.elNode = document.getElementById(id);
  else {
    if (browser.isIE)
      dragObj.elNode = window.event.srcElement;
    if (browser.isNS)
      dragObj.elNode = event.target;

    // If this is a text node, use its parent element.

    if (dragObj.elNode.nodeType == 3)
      dragObj.elNode = dragObj.elNode.parentNode;
  }

  // Get cursor position with respect to the page.

  if (browser.isIE) {
    x = window.event.clientX + document.documentElement.scrollLeft
      + document.body.scrollLeft;
    y = window.event.clientY + document.documentElement.scrollTop
      + document.body.scrollTop;
  }
  if (browser.isNS) {
    x = event.clientX + window.scrollX;
    y = event.clientY + window.scrollY;
  }

  // Save starting positions of cursor and element.

  dragObj.cursorStartX = x;
  dragObj.cursorStartY = y;
  dragObj.elStartLeft  = parseInt(dragObj.elNode.style.left, 10);
  dragObj.elStartTop   = parseInt(dragObj.elNode.style.top,  10);

  if (isNaN(dragObj.elStartLeft)) dragObj.elStartLeft = 0;
  if (isNaN(dragObj.elStartTop))  dragObj.elStartTop  = 0;

  // Update element's z-index.

  dragObj.elNode.style.zIndex = ++dragObj.zIndex;

  // Capture mousemove and mouseup events on the page.

  if (browser.isIE) {
    document.attachEvent("onmousemove", dragGo);
    document.attachEvent("onmouseup",   dragStop);
    window.event.cancelBubble = true;
    window.event.returnValue = false;
  }
  if (browser.isNS) {
    document.addEventListener("mousemove", dragGo,   true);
    document.addEventListener("mouseup",   dragStop, true);
    event.preventDefault();
  }
}

function dragGo(event) {

  var x, y;

  // Get cursor position with respect to the page.

  if (browser.isIE) {
    x = window.event.clientX + document.documentElement.scrollLeft
      + document.body.scrollLeft;
    y = window.event.clientY + document.documentElement.scrollTop
      + document.body.scrollTop;
  }
  if (browser.isNS) {
    x = event.clientX + window.scrollX;
    y = event.clientY + window.scrollY;
  }

  // Move drag element by the same amount the cursor has moved.

  dragObj.elNode.style.left = (dragObj.elStartLeft + x - dragObj.cursorStartX) + "px";
  dragObj.elNode.style.top  = (dragObj.elStartTop  + y - dragObj.cursorStartY) + "px";

  if (browser.isIE) {
    window.event.cancelBubble = true;
    window.event.returnValue = false;
  }
  if (browser.isNS)
    event.preventDefault();
}

function dragStop(event) {

  // Stop capturing mousemove and mouseup events.

  if (browser.isIE) {
    document.detachEvent("onmousemove", dragGo);
    document.detachEvent("onmouseup",   dragStop);
  }
  if (browser.isNS) {
    document.removeEventListener("mousemove", dragGo,   true);
    document.removeEventListener("mouseup",   dragStop, true);
  }
}





function CreateXmlHttpProdDet()
	{
		//Creating object of XMLHTTP in IE
		try
		{
			XmlHttpProdDet = new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch(e)
		{
			try
			{
				XmlHttpProdDet = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch(oc)
			{
				XmlHttpProdDet = null;	
			}
		}
		//Creating object of XMLHTTP in Mozilla and Safari 
		if(!XmlHttpProdDet && typeof XMLHttpRequest != "undefined") 
		{
			XmlHttpProdDet = new XMLHttpRequest();
		}
		if (!XmlHttpProdDet && window.createRequest) 
        {
	        try 
	        {
		        XmlHttpProdDet = window.createRequest();
	        } 
	        catch (e)
	        {
		        XmlHttpProdDet=false;
	        }
        }
	}



function Fill_ProductSymbols(Exchg)
     {

 var Symbol = document.getElementById("Symbol_Prod");		
		
		CreateXmlHttpProdDet();
		document.body.style.cursor = "progress";
		var requestUrl = "Com_GetProductSymAjax.aspx?Exchg="+Exchg;
		//alert(requestUrl)
		if(XmlHttpProdDet)	{
					XmlHttpProdDet.onreadystatechange = function(){Fill_ProductSymbolsResp(Symbol)};
					XmlHttpProdDet.open("GET", requestUrl,  true);
					XmlHttpProdDet.send(null);
				}
		
 }
 
 //Called when response comes back from server Only For Symbol
function Fill_ProductSymbolsResp(ig_)
{

	// To make sure receiving response data from server is completed
	if(XmlHttpProdDet.readyState == 4)
	{

		// To make sure valid response is received from the server, 200 means response received is OK
		if(XmlHttpProdDet.status == 200)
		{		
			
			var strData = XmlHttpProdDet.responseText
	
			if(strData != "") {	
			    
				var arrSchm = strData.split("|");
				ig_.length = 0; 	
				
				for(i=0; i<arrSchm.length-1; i++) {	
								
					var strSchm = arrSchm[i];
					var arrSchmCode = strSchm.split("~");
					
					ig_.options[i] = new Option();
					
					ig_.options[i].value = arrSchmCode[0];
					ig_.options[i].text = arrSchmCode[1];
				}
				
			}
			else {
					ig_.length = 0;
					ig_.options[0] = new Option(); 
					ig_.options[0].value = "";
					ig_.options[0].text = "Symbol not available";			
			}
			document.body.style.cursor = "auto";	
		}
		else {
					ig_.length = 0;
					ig_.options[0] = new Option(); 
					ig_.options[0].value = "";
					ig_.options[0].text = "server is not ready";
					document.body.style.cursor = "auto";		
		}
	}
}
