﻿// JScript File


var XmlHttpForex;
function CreateXmlHttpForex()
	{
		try
		{
			XmlHttpForex = new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch(e)
		{
			try
			{
				XmlHttpForex = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch(oc)
			{
				XmlHttpForex = null;
					
			}
		}
		if(!XmlHttpForex && typeof XMLHttpRequest != "undefined") 
		{
			XmlHttpForex = new XMLHttpRequest();
		}
	}
function GetDataForex()
{

	CreateXmlHttpForex();
     var currentDivObj = document.getElementById("Forexdata");
 
	currentDivObj.innerHTML ="<img src=../App_Themes/images/loader.gif>";
	document.body.style.cursor = "progress";
	var requestUrl = "../Home/AjaxForex.aspx?Exchange="+ Math.random();		
	 //alert(requestUrl) 
	if(XmlHttpForex!=null)	
	        {
				XmlHttpForex.onreadystatechange = function(){ChangeResponseForex()}
				XmlHttpForex.open('GET', requestUrl,  true);
				XmlHttpForex.send(null);
			}
			 return false; 
}	
	
function ChangeResponseForex()
{
   
	// To make sure receiving response data from server is completed
	
	if(XmlHttpForex.readyState == 4)
	{
		// To make sure valid response is received from the server, 200 means response received is OK
		
		    var td_Id = document.getElementById("Forexdata");
		
	    //alert(XmlHttp.status)
		if(XmlHttpForex.status == 200)//
		{
			td_Id.innerHTML =  XmlHttpForex.responseText;
				
			document.body.style.cursor = "auto";		
		}
		else
		{
			td_Id.innerHTML =  "There was a problem retrieving data from the server.";
			
			document.body.style.cursor = "auto";
		}
	}
}





var XmlHttpIndices;
function CreateXmlHttpIndices()
	{
		try
		{
			XmlHttpIndices = new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch(e)
		{
			try
			{
				XmlHttpIndices = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch(oc)
			{
				XmlHttpIndices = null;
					
			}
		}
		if(!XmlHttpIndices && typeof XMLHttpRequest != "undefined") 
		{
			XmlHttpIndices = new XMLHttpRequest();
		}
	}
function GetDataIndices()
{

	CreateXmlHttpIndices();
     var currentDivObj = document.getElementById("Indicesdata");
 
	currentDivObj.innerHTML ="<img src=../App_Themes/images/loader.gif>";
	document.body.style.cursor = "progress";
	var requestUrl = "../Home/AjaxIndices.aspx?Exchange="+ Math.random();		
	 //alert(requestUrl) 
	if(XmlHttpIndices!=null)	
	        {
				XmlHttpIndices.onreadystatechange = function(){ChangeResponseIndices()}
				XmlHttpIndices.open('GET', requestUrl,  true);
				XmlHttpIndices.send(null);
			}
			 return false; 
}	
	
function ChangeResponseIndices()
{
   
	// To make sure receiving response data from server is completed
	
	if(XmlHttpIndices.readyState == 4)
	{
		// To make sure valid response is received from the server, 200 means response received is OK
		
		    var td_Id = document.getElementById("Indicesdata");
		
	    //alert(XmlHttp.status)
		if(XmlHttpIndices.status == 200)//
		{
			td_Id.innerHTML =  XmlHttpIndices.responseText;
				
			document.body.style.cursor = "auto";		
		}
		else
		{
			td_Id.innerHTML =  "There was a problem retrieving data from the server.";
			
			document.body.style.cursor = "auto";
		}
	}
}



// JScript File

var XmlHttpGLVolVal;
function CreateXmlHttpGLVolVal()
{
	try
	{
		XmlHttpGLVolVal = new ActiveXObject("Msxml2.XMLHTTP");
	}
	catch(e)
	{
		try
		{
			XmlHttpGLVolVal = new ActiveXObject("Microsoft.XMLHTTP");
		}
		catch(oc)
		{
			XmlHttpGLVolVal = null;				
		}
	}
	if(!XmlHttpGLVolVal && typeof XMLHttpRequest != "undefined")
	{
		XmlHttpGLVolVal = new XMLHttpRequest();
	}
}

function ChangeControl(Opt,Exch)
{ 
Exch = GlobalvalHome;
SetOptionGLVV = Opt;
SetExchGLVV = Exch;

    CreateXmlHttpGLVolVal();
    var currentDivObj = document.getElementById("Td_Data");
    var More = document.getElementById("More") ;
       if(Opt=='GAIN')
	                {
	              
	             
    	                document.getElementById("hdnglv").value="GAIN";
    	              //  More.href="Equity/TopGainersAndLosers.aspx?Option=GAIN&EXCHG="+Exch+"&id=1&index=0";
	                        document.getElementById("tdGain1").className="selectedg";
	                    document.getElementById("tdLose").className="unselectedg";
	                    document.getElementById("tdValue").className="unselectedg";
	                    document.getElementById("tdVolume").className="unselectedg";
	                    
	                    if (document.getElementById("hdnsensex").value=="NSE")
	                    {
	                    document.getElementById("more1NSE").style.display = "inline";
	                    document.getElementById("more2NSE").style.display = "none";
	                    document.getElementById("more3NSE").style.display = "none";
	                    document.getElementById("more4NSE").style.display = "none";
	                    document.getElementById("more1BSE").style.display = "none";
	                    document.getElementById("more2BSE").style.display = "none";
	                    document.getElementById("more3BSE").style.display = "none";
	                    document.getElementById("more4BSE").style.display = "none";
	                    }
	                    else
	                    {
	                    document.getElementById("more1NSE").style.display = "none";
	                    document.getElementById("more2NSE").style.display = "none";
	                    document.getElementById("more3NSE").style.display = "none";
	                    document.getElementById("more4NSE").style.display = "none";
	                    document.getElementById("more1BSE").style.display = "inline";
	                    document.getElementById("more2BSE").style.display = "none";
	                    document.getElementById("more3BSE").style.display = "none";
	                    document.getElementById("more4BSE").style.display = "none";
	                    }
	                    
	                }
                if(Opt=='LOSE')
                    {   
                 
                 
                        document.getElementById("hdnglv").value="LOSE";
                        //More.href="Equity/TopGainersAndLosers.aspx?id=1&Option=LOSE&EXCHG="+Exch+"&Period=Daily&Group=&Indices=2&IsAll=";
                        document.getElementById("tdGain1").className="unselectedg";
                        document.getElementById("tdLose").className="selectedg";
                        document.getElementById("tdValue").className="unselectedg";
                        document.getElementById("tdVolume").className="unselectedg";
                       
                        
                           if (document.getElementById("hdnsensex").value=="NSE")
	                    {
	                    document.getElementById("more1NSE").style.display = "none";
	                    document.getElementById("more2NSE").style.display = "inline";
	                    document.getElementById("more3NSE").style.display = "none";
	                    document.getElementById("more4NSE").style.display = "none";
	                    document.getElementById("more1BSE").style.display = "none";
	                    document.getElementById("more2BSE").style.display = "none";
	                    document.getElementById("more3BSE").style.display = "none";
	                    document.getElementById("more4BSE").style.display = "none";
	                    }
	                    else
	                    {
	                    document.getElementById("more1NSE").style.display = "none";
	                    document.getElementById("more2NSE").style.display = "none";
	                    document.getElementById("more3NSE").style.display = "none";
	                    document.getElementById("more4NSE").style.display = "none";
	                    document.getElementById("more1BSE").style.display = "none";
	                    document.getElementById("more2BSE").style.display = "inline";
	                    document.getElementById("more3BSE").style.display = "none";
	                    document.getElementById("more4BSE").style.display = "none";
	                    }
                        
                    }
	             if(Opt=='Val')
	                {
	             
	                    document.getElementById("hdnglv").value="Val";
	                    //More.href="Equity/MostActive.aspx?id=8&Option=Value&EXCHG="+Exch+"&Group=&Indices=&IsAll=";
	                    document.getElementById("tdGain1").className="unselectedg";
	                    document.getElementById("tdLose").className="unselectedg";
	                    document.getElementById("tdValue").className="selectedg";
	                    document.getElementById("tdVolume").className="unselectedg";
     
	                    if (document.getElementById("hdnsensex").value=="NSE")
	                    {
	                    document.getElementById("more1NSE").style.display = "none";
	                    document.getElementById("more2NSE").style.display = "none";
	                    document.getElementById("more3NSE").style.display = "inline";
	                    document.getElementById("more4NSE").style.display = "none";
	                    document.getElementById("more1BSE").style.display = "none";
	                    document.getElementById("more2BSE").style.display = "none";
	                    document.getElementById("more3BSE").style.display = "none";
	                    document.getElementById("more4BSE").style.display = "none";
	                    }
	                    else
	                    {
	                    document.getElementById("more1NSE").style.display = "none";
	                    document.getElementById("more2NSE").style.display = "none";
	                    document.getElementById("more3NSE").style.display = "none";
	                    document.getElementById("more4NSE").style.display = "none";
	                    document.getElementById("more1BSE").style.display = "none";
	                    document.getElementById("more2BSE").style.display = "none";
	                    document.getElementById("more3BSE").style.display = "inline";
	                    document.getElementById("more4BSE").style.display = "none";
	                    }
    
	                }
	                  if(Opt=='Vol')
	                {
	             
	                    document.getElementById("hdnglv").value="Vol";
	               //More.href="Equity/MostActive.aspx?id=8&Option=Volume&EXCHG="+Exch+"&Group=&Indices=&IsAll=";
	                    document.getElementById("tdGain1").className="unselectedg";
	                    document.getElementById("tdLose").className="unselectedg";
	                    document.getElementById("tdValue").className="unselectedg";
	                    document.getElementById("tdVolume").className="selectedg";
	                    
	                    
	                     if (document.getElementById("hdnsensex").value=="NSE")
	                    {
	                    document.getElementById("more1NSE").style.display = "none";
	                    document.getElementById("more2NSE").style.display = "none";
	                    document.getElementById("more3NSE").style.display = "none";
	                    document.getElementById("more4NSE").style.display = "inline";
	                    document.getElementById("more1BSE").style.display = "none";
	                    document.getElementById("more2BSE").style.display = "none";
	                    document.getElementById("more3BSE").style.display = "none";
	                    document.getElementById("more4BSE").style.display = "none";
	                    }
	                    else
	                    {
	                    document.getElementById("more1NSE").style.display = "none";
	                    document.getElementById("more2NSE").style.display = "none";
	                    document.getElementById("more3NSE").style.display = "none";
	                    document.getElementById("more4NSE").style.display = "none";
	                    document.getElementById("more1BSE").style.display = "none";
	                    document.getElementById("more2BSE").style.display = "none";
	                    document.getElementById("more3BSE").style.display = "none";
	                    document.getElementById("more4BSE").style.display = "inline";
	                    }
	                    
	                }
    
    
   
	document.body.style.cursor = "progress";
	var requestUrl = "../Home/AjaxDataGLVV.aspx?Option="+ Opt +"&Exchange="+ Exch + "&timeStamp="+new Date().getTime();
   //alert(requestUrl);
	if(XmlHttpGLVolVal!=null)	
	{
	    XmlHttpGLVolVal.onreadystatechange = function(){ChangeControlResponse(Opt,Exch)}
		XmlHttpGLVolVal.open('GET', requestUrl,  true);
		XmlHttpGLVolVal.send(null);
	}
	return false; 
}	
	
function ChangeControlResponse(Opt,Exch)
{
    var Head_td =document.getElementById("Heading");
    var More=document.getElementById("More");
    var BSE_td =document.getElementById("Td_BSE");
    var NSE_td =document.getElementById("Td_NSE");
	
	if(XmlHttpGLVolVal.readyState == 4)
	{
		var td_Id = document.getElementById("Td_Data");
		if(XmlHttpGLVolVal.status == 200)//
		{
			td_Id.innerHTML =  XmlHttpGLVolVal.responseText;
			document.body.style.cursor = "auto";	
		}
		else
		{
			td_Id.innerHTML =  "There was a problem retrieving data from the server.";
			document.body.style.cursor = "auto";
		}
	}
}

function ShowOnlineTradingdata(id)
{
    //alert(id);
     for(j=1;j<=4;j++)
     {
            if(id==j)
            {
                     if(eval(document.getElementById(j+'OTData')).style.display=='none')
                     {
                     eval(document.getElementById(j+'OTData')).style.display='inline';                   
                     eval(document.getElementById(j+'OT')).className="selectedg";
                    

                     }
                    else
                     {
                     eval(document.getElementById(j+'OTData')).style.display='none';                    
                     eval(document.getElementById(j+'OT')).className="unselectedg";
                    
                     }
                     }
             else
             {
               //alert('hi');
             eval(document.getElementById(j+'OTData')).style.display='none';
          //   eval(document.getElementById(j+'OTRig')).src='../App_Themes/Common/images/TabOffRig.gif';
            // eval(document.getElementById(j+'OTLef')).src='../App_Themes/Common/images/TabOffLef.gif';
             eval(document.getElementById(j+'OT')).className="unselectedg";
            // eval(document.getElementById(j+'OTAH')).className="unselectedg";

             }
    }
    //alert(id);
    if(id =="2")
    {
    //alert(hi);
        SwitchCommoditySymbol("GOLD","MCX");
        ChangeControlCommEx("G","MCX","GOLD");
        ChangeControlComm("G","MCX");
    }
   if(id == "3")
    {
      GetIssues("O");
    }
   if(id == "4")
    {
       LoadNFOUpdate("OpenFunds","ENFO")
    }

}

function BseDatadisplay()
{
   CreateXmlMarketBSE();
    var currentDivObj = document.getElementById("BSEMarketGlanceCtrl");
	document.body.style.cursor = "progress";
  //alert("BseDatadisplay");
	//var requestUrl = "../AjaxMarketGlanceCtrl.aspx?Exchange=BSE&timeStamp="+new Date().getTime();
    var requestUrl;
//	if(XmlMarketBSE!=null)	
//	{
//	    XmlMarketBSE.onreadystatechange = function(){ChangeXmlMarketBSE()}
//		XmlMarketBSE.open('GET', requestUrl,  true);
//		XmlMarketBSE.send(null);
//	}
	LoadMarketBSE();
	
}
	
	function NseDatadisplay()
	{

	CreateXmlMarketNSE();
	var currentDivObj = document.getElementById("NSEMarketGlanceCtrl");
	document.body.style.cursor = "progress";
  //alert("NseDatadisplay");
	//var requestUrl = "../AjaxMarketGlanceCtrl.aspx?Exchange=NSE&timeStamp="+new Date().getTime();
	var requestUrl;
//	if(XmlMarketNSE!=null)	
//	{
//	    XmlMarketNSE.onreadystatechange = function(){ChangeXmlMarketNSE()}
//		XmlMarketNSE.open('GET', requestUrl,  true);
//		XmlMarketNSE.send(null);
//	}
	LoadMarketNSE();
	
}

function ChangeXmlMarketBSE()
{
   	if(XmlMarketBSE.readyState == 4)
	{
		var Td_DataDeriFii = document.getElementById("BSEMarketGlanceCtrl");
		
		if(XmlMarketBSE.status == 200)//
		{
			Td_DataDeriFii.innerHTML =  XmlMarketBSE.responseText;
			document.body.style.cursor = "auto";
			//alert(XmlMarketBSE.responseText);		
		}
		else
		{
			Td_DataDeriFii.innerHTML =  "There was a problem retrieving data from the server.";
			document.body.style.cursor = "auto";
		}
	}
}

function ChangeXmlMarketNSE()
{
   	if(XmlMarketNSE.readyState == 4)
	{
		var Td_DataDeriFii = document.getElementById("NSEMarketGlanceCtrl");
		
		if(XmlMarketNSE.status == 200)//
		{
			Td_DataDeriFii.innerHTML =  XmlMarketNSE.responseText;
			document.body.style.cursor = "auto";	
			//alert(XmlMarketBSE.responseText);	
		}
		else
		{
			Td_DataDeriFii.innerHTML =  "There was a problem retrieving data from the server.";
			document.body.style.cursor = "auto";
		}
	}
}
var Globalid="";
var PeriodChart="";
function SelectDate(id)
{
if(id=="Today")
{
Globalid="Today";
PeriodChart =" ";
document.getElementById("Today").className="MarMoverSelText";
document.getElementById("1Week").className="MarMoverUnSelText";
document.getElementById("1Month").className="MarMoverUnSelText";
document.getElementById("1Year").className="MarMoverUnSelText";

}
if(id=="1Week")
{
Globalid="1Week";
PeriodChart ="1Week";
document.getElementById("Today").className="MarMoverUnSelText";
document.getElementById("1Week").className="MarMoverSelText";
document.getElementById("1Month").className="MarMoverUnSelText";
document.getElementById("1Year").className="MarMoverUnSelText";
}
if(id=="1Month")
{
Globalid="1Month";
PeriodChart ="1Month";
document.getElementById("Today").className="MarMoverUnSelText";
document.getElementById("1Week").className="MarMoverUnSelText";
document.getElementById("1Month").className="MarMoverSelText";
document.getElementById("1Year").className="MarMoverUnSelText";
}
if(id=="1Year")
{
Globalid="1Year";
PeriodChart ="1Year";
document.getElementById("Today").className="MarMoverUnSelText";
document.getElementById("1Week").className="MarMoverUnSelText";
document.getElementById("1Month").className="MarMoverUnSelText";
document.getElementById("1Year").className="MarMoverSelText";
}
sensexvalue(Globalid,SelectedTabsensex)
}

var SelectedTabsensex = "BSE";

function sensexvalueAutoData()
{     
    LoadMarketGlanceData() ;
}

var XmlMarketNSE;
function CreateXmlMarketNSE()
	{
		//Creating object of XmlHttp in IE
		try
		{
			XmlMarketNSE = new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch(e)
		{
			try
			{  
				XmlMarketNSE = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch(oc)
			{
				XmlMarketNSE = false;	
			}
		}
		//Creating object of XmlHttp in Mozilla and Safari 
		if (!XmlMarketNSE && typeof XMLHttpRequest!='undefined') 
		{
	        try 
	        {
		        XmlMarketNSE = new XMLHttpRequest();
	        } 
	        catch (e) 
	        {
		        XmlMarketNSE=false;
	        }
        }
        if (!XmlMarketNSE && window.createRequest) 
        {
	        try 
	        {
		        XmlMarketNSE = window.createRequest();
	        } 
	        catch (e)
	        {
		        XmlMarketNSE=false;
	        }
        }
	
	}
	
var XmlMarketBSE;
function CreateXmlMarketBSE()
	{
		//Creating object of XmlHttp in IE
		try
		{
			XmlMarketBSE = new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch(e)
		{
			try
			{  
				XmlMarketBSE = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch(oc)
			{
				XmlMarketBSE = false;	
			}
		}
		//Creating object of XmlHttp in Mozilla and Safari 
		if (!XmlMarketBSE && typeof XMLHttpRequest!='undefined') 
		{
	        try 
	        {
		        XmlMarketBSE = new XMLHttpRequest();
	        } 
	        catch (e) 
	        {
		        XmlMarketBSE=false;
	        }
        }
        if (!XmlMarketBSE && window.createRequest) 
        {
	        try 
	        {
		        XmlMarketBSE = window.createRequest();
	        } 
	        catch (e)
	        {
		        XmlMarketBSE=false;
	        }
        }
	
	}
	
	function CreateXmlHttpChart()
{
    try
	{
		XmlHttpChart = new ActiveXObject("Msxml2.XMLHTTP");
	}
	catch(e)
	{
		try
		{
			XmlHttpChart = new ActiveXObject("Microsoft.XMLHTTP");
		} 
		catch(oc)
		{
			XmlHttpChart = null;
		}
	}
	if(!XmlHttpChart && typeof XMLHttpRequest != "undefined") 
	{
		XmlHttpChart = new XMLHttpRequest();
	}
}
		
	var SelectedTabsensex = "BSE";
var GlobalvalHome;
function sensexvalue(id,val)
{
        id=Globalid;
        
        
          if(val=='BSE')
         {
            document.getElementById("Middleleft_MarketMovers1_updtimeBSEHM").style.display="inline";
            document.getElementById("Middleleft_MarketMovers1_updtimeNSEHM").style.display="none";
         }else
         {
          document.getElementById("Middleleft_MarketMovers1_updtimeBSEHM").style.display="none";
          document.getElementById("Middleleft_MarketMovers1_updtimeNSEHM").style.display="inline";
         }

        GlobalvalHome=val;
         CreateXmlHttpChart();
        if(val=='BSE')
        {
       SelectedTabsensex = "BSE";
        document.getElementById("BSE").className="BSENSEOnTab";
       document.getElementById("NSE").className="BSENSEOffTab";
        document.getElementById("hdnsensex").value ='BSE';
        document.getElementById("SensexNiftytext11").style.display="inline";
        document.getElementById("SensexNiftytext12").style.display="none";
        document.getElementById("SensexNiftytext21").style.display="none";
        document.getElementById("SensexNiftytext22").style.display="inline";

        if(document.getElementById("hdnglv")!=null)
        {
        ChangeControl(document.getElementById("hdnglv").value, document.getElementById("hdnsensex").value);
        }

        
    }
    else
    {
        SelectedTabsensex = "NSE";
       document.getElementById("BSE").className="BSENSEOffTab";
       document.getElementById("NSE").className="BSENSEOnTab";
        document.getElementById("SensexNiftytext11").style.display="none";
        document.getElementById("SensexNiftytext12").style.display="inline";
        document.getElementById("SensexNiftytext21").style.display="inline";
        document.getElementById("SensexNiftytext22").style.display="none";
        document.getElementById("hdnsensex").value='NSE'; 
         if(document.getElementById("hdnglv")!=null)
        {
        ChangeControl(document.getElementById("hdnglv").value, document.getElementById("hdnsensex").value);
        }
    }
        var FinCode = "";
        var RequestUrl = "../Home/BSENSEchartAjax.aspx?Exchg="+SelectedTabsensex+"&FinCode="+FinCode+"&Comp2=0&Period="+PeriodChart;
       // alert(RequestUrl);
	    //alert(requestUrl);
	    var so = new SWFObject("../amline/amline.swf", "BSENSEline", "196", "94", "8", "#FFFFFF");
	    so.addVariable("path", "../amline/"); 
	    if(id=="Today")
	    {
	    so.addVariable("settings_file", encodeURIComponent("../Home/BSENSEline_settingsToday.xml"));
	    }
	    else
	    {
	    so.addVariable("settings_file", encodeURIComponent("../Home/BSENSEline_settings.xml"));
	    }
 
	    so.addVariable("data_file", encodeURIComponent(RequestUrl + "&TimeStamp="+new Date().getTime()));
	    so.addParam("wmode","opaque");
	    so.write("CompanyChart"); 
      return false;
 
    	var requestUrl = "../AjaxExchgData.aspx?EXCHG="+ val+"&timeStamp="+new Date().getTime();
    	//alert(requestUrl);
	    if(XmlHttpChart)
	    {
	    XmlHttpChart.onreadystatechange = function(){sensexvalueResponse()}
	    XmlHttpChart.open("GET", requestUrl,  true);
	    XmlHttpChart.send(null);
	    }
	       return true;
}	


function sensexvalueResponse()
{
	if(XmlHttpChart.readyState == 4)
	{
	    var td_Id = document.getElementById("updtime");
		if(XmlHttpChart.status == 200)//
		{
			td_Id.innerHTML =  XmlHttpChart.responseText;
			document.body.style.cursor = "auto";		
		}
		else
		{
		    td_Id.innerHTML =  "There was a problem retrieving data from the server.";
			document.body.style.cursor = "auto";
		}
	}
}



var XmlHttpGLVolValComm;
function CreateXmlHttpGLVolValComm()
{
//alert();
	try
	{
		XmlHttpGLVolValComm = new ActiveXObject("Msxml2.XMLHTTP");
	}
	catch(e)
	{
		try
		{
			XmlHttpGLVolValComm = new ActiveXObject("Microsoft.XMLHTTP");
		}
		catch(oc)
		{
			XmlHttpGLVolValComm = null;				
		}
	}
	if(!XmlHttpGLVolValComm && typeof XMLHttpRequest != "undefined")
	{
		XmlHttpGLVolValComm = new XMLHttpRequest();
	}
}

var GlobalExchComm;
var GlobalParGoldsilcrudesugar;
function ChangeControlCommEx(Opt,Exch,ParGoldsilcrudesugar)
{

    CreateXmlHttpGLVolValComm();
    var currentDivObj = document.getElementById("Td_DataComm");
	document.body.style.cursor = "progress";
	GlobalExchComm=Exch;
    ParGoldsilcrudesugar=GlobalParGoldsilcrudesugar;
	if(Exch == "MCX")
	{
	    document.getElementById("tdMCX").className = "selectedg";
	    document.getElementById("tdNCDEX").className = "BSENSEOffTab";
	}
	else
	{
	    document.getElementById("tdMCX").className = "BSENSEOffTab";
	    document.getElementById("tdNCDEX").className = "BSENSEOnTab";
	}
	var requestUrl = "../Home/AjaxDataGLVVComm.aspx?Option="+ Opt +"&Exchange="+ Exch+"&timeStamp="+new Date().getTime();
	//alert(requestUrl);
	SwitchCommoditySymbol(ParGoldsilcrudesugar,Exch);
	if(XmlHttpGLVolValComm!=null)	
	{
	    XmlHttpGLVolValComm.onreadystatechange = function(){ChangeControlResponseComm(Opt,Exch)}
		XmlHttpGLVolValComm.open('GET', requestUrl,  true);
		XmlHttpGLVolValComm.send(null);
	}
	return false; 
}

function ChangeControlComm(Opt,Exch)
{
	Exch=GlobalExchComm;

    CreateXmlHttpGLVolValComm();
    var currentDivObj = document.getElementById("Td_DataComm");
	document.body.style.cursor = "progress";
	
    if(Opt=="G")
	{
	    document.getElementById("GainersComm").className="selectedg";
        document.getElementById("LosersComm").className="unselectedg";
        document.getElementById("ValueComm").className="unselectedg";
        document.getElementById("VolumeComm").className="unselectedg";
	
	}
	if(Opt=="L")
	{
	
	    document.getElementById("GainersComm").className="unselectedg";
        document.getElementById("LosersComm").className="selectedg";
        document.getElementById("ValueComm").className="unselectedg";
        document.getElementById("VolumeComm").className="unselectedg";
	
	}
	if(Opt=="Value")
	{
	    document.getElementById("GainersComm").className="unselectedg";
        document.getElementById("LosersComm").className="unselectedg";
        document.getElementById("ValueComm").className="selectedg";
        document.getElementById("VolumeComm").className="unselectedg";
	
	}
		if(Opt=="Volume")
	{
	    document.getElementById("GainersComm").className="unselectedg";
        document.getElementById("LosersComm").className="unselectedg";
        document.getElementById("ValueComm").className="unselectedg";
        document.getElementById("VolumeComm").className="selectedg";
	
	}
	var requestUrl = "../Home/AjaxDataGLVVComm.aspx?Option="+ Opt +"&Exchange="+ Exch+"&timeStamp="+new Date().getTime();
	//alert(requestUrl);
	if(XmlHttpGLVolValComm!=null)	
	{
	    XmlHttpGLVolValComm.onreadystatechange = function(){ChangeControlResponseComm(Opt,Exch)}
		XmlHttpGLVolValComm.open('GET', requestUrl,  true);
		XmlHttpGLVolValComm.send(null);
	}
	return false; 
}	

	
function ChangeControlResponseComm(Opt,Exch)
{	
	if(XmlHttpGLVolValComm.readyState == 4)
	{
		var td_IdComm = document.getElementById("Td_DataComm");
		
		if(XmlHttpGLVolValComm.status == 200)//
		{
			td_IdComm.innerHTML =  XmlHttpGLVolValComm.responseText;
			document.body.style.cursor = "auto";		
		}
		else
		{
			td_IdComm.innerHTML =  "There was a problem retrieving data from the server.";
			document.body.style.cursor = "auto";
		}
	}
}

function CommodityPriceCreateXmlHttp()
	{
		//Creating object of XmlHttp in IE
		try
		{
			CommodityPriceXmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch(e)
		{
			try
			{  
				CommodityPriceXmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch(oc)
			{
				CommodityPriceXmlHttp = false;	
			}
		}
		//Creating object of XmlHttp in Mozilla and Safari 
		if (!CommodityPriceXmlHttp && typeof XMLHttpRequest!='undefined') 
		{
	        try 
	        {
		        CommodityPriceXmlHttp = new XMLHttpRequest();
	        } 
	        catch (e) 
	        {
		        CommodityPriceXmlHttp=false;
	        }
        }
        if (!CommodityPriceXmlHttp && window.createRequest) 
        {
	        try 
	        {
		        CommodityPriceXmlHttp = window.createRequest();
	        } 
	        catch (e)
	        {
		        CommodityPriceXmlHttp=false;
	        }
        }
	
	}

function CommodityPriceAjaxCall(Commodity)
	{		
		CommodityPriceCreateXmlHttp();
		document.body.style.cursor = "progress";
		
		var requestUrl = "../Home/AjaxCommodityPrice.aspx?Symbol="+Commodity+"&Exchange=MCX&timeStamp="+new Date().getTime();
		
		if(CommodityPriceXmlHttp)	
			{
					//alert("hi");
					CommodityPriceXmlHttp.onreadystatechange = function(){CommodityPriceHandleResponse();}; 
					CommodityPriceXmlHttp.open("GET", requestUrl,  true);
					CommodityPriceXmlHttp.send(null);
			}
			
	}	
	
	
	function CommodityPriceHandleResponse()
{

	// To make sure receiving response data from server is completed
	if(CommodityPriceXmlHttp.readyState == 4)
	{
	    	
		// To make sure valid response is received from the server, 200 means response received is OK
		if(CommodityPriceXmlHttp.status == 200)
		{	
		
		  var ArrResponse = CommodityPriceXmlHttp.responseText.split("|");
		  
		   document.getElementById("TdCommodityName").innerHTML = ArrResponse[0];
		  document.getElementById("TdCommoditPrice").innerHTML = ArrResponse[1];
		  document.getElementById("TdCommodityChg").innerHTML = ArrResponse[2];
		  document.getElementById("TdCommodityPerChg").innerHTML = ArrResponse[3];
		  
			document.body.style.cursor = "auto";	
		}
		else
		{
			//ContentTD.innerHTML = "There was a problem retrieving data from the server.";
			
		}
	}
	
}	

function CreateXmlHttpMF()
	{
		//Creating object of XmlHttp in IE
		try
		{
			XmlHttpMF = new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch(e)
		{
			try
			{  
				XmlHttpMF = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch(oc)
			{
				XmlHttpMF = false;	
			}
		}
		//Creating object of XmlHttp in Mozilla and Safari 
		if (!XmlHttpMF && typeof XMLHttpRequest!='undefined') 
		{
	        try 
	        {
		        XmlHttpMF = new XMLHttpRequest();
	        } 
	        catch (e) 
	        {
		        XmlHttpMF=false;
	        }
        }
        if (!XmlHttpMF && window.createRequest) 
        {
	        try 
	        {
		        XmlHttpMF = window.createRequest();
	        } 
	        catch (e)
	        {
		        XmlHttpMF=false;
	        }
        }
	
	}

function loadGLData(id,TopBottom)
{

   if(id=="GainersMF")
  { 
    document.getElementById("OpenFundsMF").className="BSENSEOffTab";
    document.getElementById("ForthcomingMF").className="BSENSEOffTab";
    document.getElementById("GainersMF").className="BSENSEOnTab";
    document.getElementById("LosersMF").className="BSENSEOffTab";
  }
   if(id=="LosersMF")
  { 
    document.getElementById("OpenFundsMF").className="BSENSEOffTab";
    document.getElementById("ForthcomingMF").className="BSENSEOffTab";
    document.getElementById("GainersMF").className="BSENSEOffTab";
    document.getElementById("LosersMF").className="BSENSEOnTab";
  }
	CreateXmlHttpMF()
	document.body.style.cursor = "progress";
	var requestUrl = "../Home/AjaxFundData.aspx?TopBottom="+ TopBottom+"&timeStamp="+new Date().getTime();
	//alert(requestUrl);
	if(XmlHttpMF)	{
				XmlHttpMF.onreadystatechange = function(){GLResponse()}
				XmlHttpMF.open("GET", requestUrl,  true);
				XmlHttpMF.send(null);
			}
}	
	
	function GLResponse()
{
    var FundPerformance = document.getElementById("NFOId");
	// To make sure receiving response data from server is completed
	if(XmlHttpMF.readyState == 4)
	{
		if(XmlHttpMF.status == 200)
		{	
			var strGlData = XmlHttpMF.responseText
            FundPerformance.innerHTML = strGlData;	
			document.body.style.cursor = "auto";		
		}
		else
		{	
		    FundPerformance.innerHTML = "There was a problem retrieving data from the server.";
			document.body.style.cursor = "auto";
		}
	}
}

var XmlHttpIndCtrl;
function CreateXmlHttpIndCtrl()
{
	try
	{
		XmlHttpIndCtrl = new ActiveXObject("Msxml2.XMLHTTP");
	}
	catch(e)
	{
		try
		{
			XmlHttpIndCtrl = new ActiveXObject("Microsoft.XMLHTTP");
		} 
		catch(oc)
		{
			XmlHttpIndCtrl = null;
				
		}
	}
	if(!XmlHttpIndCtrl && typeof XMLHttpRequest != "undefined") 
	{
		XmlHttpIndCtrl = new XMLHttpRequest();
	}
}

function GetIssues(val)
{
//alert(val);
  if(val=="O")
  { 
    document.getElementById("OpenData").className="selectedg";
    document.getElementById("ForthcomingData").className="unselectedg";
    document.getElementById("ClosedData").className="unselectedg";
  }
    if(val=="F")
  {
   document.getElementById("OpenData").className="unselectedg";
    document.getElementById("ForthcomingData").className="selectedg";
    document.getElementById("ClosedData").className="unselectedg";
  }  
  if(val=="C")
  {
   document.getElementById("OpenData").className="unselectedg";
    document.getElementById("ForthcomingData").className="unselectedg";
    document.getElementById("ClosedData").className="selectedg";
  }
 
   CreateXmlHttpIndCtrl();
   
   document.getElementById("IssueDetails").innerHTML ="<table align=center><tr><td><img src =../App_Themes/Common/images/loader.gif /></td></tr></table>";
   document.body.style.cursor = "progress";
   var requestUrl = "../Home/AjaxIssues.aspx?IPOType="+ val+"&timeStamp="+new Date().getTime();	
	//alert(requestUrl);
		if(XmlHttpIndCtrl){
			XmlHttpIndCtrl.onreadystatechange = function(){getDataResponseIndCtrl();};
			XmlHttpIndCtrl.open("GET", requestUrl,  true);
			XmlHttpIndCtrl.send(null);
		}
		return false;
		
}
function getDataResponseIndCtrl()
    {
 
	if(XmlHttpIndCtrl.readyState == 4)
	{	
		if(XmlHttpIndCtrl.status == 200)
		{				
			var NewTd = document.getElementById("IssueDetails");
			var NewData = XmlHttpIndCtrl.responseText;

			if(NewData != "")
		    {
				NewTd.innerHTML = NewData;				
			}
				document.body.style.cursor = "auto";
				
		}
		
	}
}

function showsnapchart()
    {
   // alert("hi");
 //alert("../Home/NavDetailschartMFAjax.aspx?TimeStamp="+new Date().getTime());
    var so = new SWFObject("../amcolumn/amcolumn.swf", "Fundcolumn", "196", "140", "8", "#FFFFFF");
    so.addVariable("path", "../amcolumn/");
    so.addVariable("settings_file", encodeURIComponent("../Home/NavDetailslinechart.xml"));
    so.addVariable("data_file", encodeURIComponent("../Home/NavDetailschartMFAjax.aspx?TimeStamp="+new Date().getTime()));
    so.addParam("wmode","opaque");
    so.write("NavDetailsflashcontent");
  
    }
    
function CreateXmlHttpNFO()
{
	try
	{
		XmlHttpNFO = new ActiveXObject("Msxml2.XMLHTTP");
	}
	catch(e)
	{
		try
		{
			XmlHttpNFO = new ActiveXObject("Microsoft.XMLHTTP");
		}
		catch(oc)
		{
			XmlHttpNFO = null;				
		}
	}
	if(!XmlHttpNFO && typeof XMLHttpRequest != "undefined")
	{
		XmlHttpNFO = new XMLHttpRequest();
	}
}
    
    function LoadNFOUpdate(id,Option)
	{		
	
  if(id=="OpenFunds")
  { 
    document.getElementById("OpenFundsMF").className="BSENSEOnTab";
    document.getElementById("ForthcomingMF").className="BSENSEOffTab";
    document.getElementById("GainersMF").className="BSENSEOffTab";
    document.getElementById("LosersMF").className="BSENSEOffTab";
  }
   if(id=="ForthcomingMF")
  { 
    document.getElementById("OpenFundsMF").className="BSENSEOffTab";
    document.getElementById("ForthcomingMF").className="BSENSEOnTab";
    document.getElementById("GainersMF").className="BSENSEOffTab";
    document.getElementById("LosersMF").className="BSENSEOffTab";
  }

		CreateXmlHttpNFO();
		document.body.style.cursor = "progress";
		
		var requestUrl = "../Home/AjaxNFOUpdateData.aspx?&Option="+Option;
		//alert(requestUrl);
		if(XmlHttpNFO)	
			{
					
					XmlHttpNFO.onreadystatechange = function(){NFOUpdateResponse();}; 
					XmlHttpNFO.open("GET", requestUrl,  true);
					XmlHttpNFO.send(null);
			}
	}
	
	
	function NFOUpdateResponse()
{

	// To make sure receiving response data from server is completed
	if(XmlHttpNFO.readyState == 4)
	{
		// To make sure valid response is received from the server, 200 means response received is OK
		if(XmlHttpNFO.status == 200)
		{	
		//alert("in respnse OK")	;	
			var NFOId   = document.getElementById("NFOId");
			
			var strData = XmlHttpNFO.responseText;
			//alert(strData);
			if(strData != "")
			{
			
				NFOId.innerHTML   = strData;
				

			}
			document.body.style.cursor = "auto";	
		}
		else
		{
			NFOId.innerHTML = "There was a problem retrieving data from the server.";
			document.body.style.cursor = "auto";
		}
	}
}


var XmlHttpCompTicker="";
 function CreateXmlHttpCompTicker()
{
	try
	{
		XmlHttpCompTicker = new ActiveXObject("Msxml2.XMLHTTP");
	}
	catch(e)
	{
		try
		{
			XmlHttpCompTicker = new ActiveXObject("Microsoft.XMLHTTP");
		}
		catch(oc)
		{
			XmlHttpCompTicker = null;				
		}
	}
	if(!XmlHttpCompTicker && typeof XMLHttpRequest != "undefined")
	{
		XmlHttpCompTicker = new XMLHttpRequest();
	}
}
function getTickerDataCom(Exchg)
{	
    CreateXmlHttpCompTicker();
	
	
		var Direc;
		
		if (Exchg=="BSE")
		{
		
		   Direc = "left";
		}
		else if (Exchg=="NSE")
		{
		  
		    Direc = "left";
		}
		
		
		
	var requestUrl = "../Home/AjaxTickerData.aspx?Exchange="+ Exchg +"&timeStamp="+new Date().getTime();
	//alert(requestUrl);
	if(XmlHttpCompTicker)
	{
		XmlHttpCompTicker.onreadystatechange = function(){getDataResponseComp(Exchg,Direc);};
		XmlHttpCompTicker.open("GET", requestUrl,  true);
		XmlHttpCompTicker.send(null);
	}
}  

function getDataResponseComp(Exchg,Direc)
{
//alert(XmlHttpCompTicker.responseText);
    if(XmlHttpCompTicker.readyState == 4)
	{	
	    if(XmlHttpCompTicker.status == 200)
		{	

		    var arrCol,Time,Code,CompName,ClPrice,DiffVal,DiffImg;
			var ExchgDet="",stkDet="";
			var MarqueeId = document.getElementById("MarqueeId");
			var TickerData = XmlHttpCompTicker.responseText;
						
			if(TickerData != "")
			var arrRow = TickerData.split("|");
				
			for(i=0; i<arrRow.length-1; i++)
			{
			    arrCol = arrRow[i].split("~");
				CompName = arrCol[1];
				ClPrice  = arrCol[2];
				DiffVal  = arrCol[3];
				
				if(DiffVal>0) 
				{
					clss = "<span class='Green'>" ;
					DiffVal="+"+DiffVal;
				}
				else if(DiffVal<0) 
				{							
					clss = "<span class='Red'>" ;
				}
				else if(DiffVal==0) 
				{
					clss = "<span class='Blue'>"	;				
				} 
				
				if(i==0)
//			   ExchgDet = "<span class='TickerText'>" + arrCol[0] +" &nbsp; "+ CompName +": "+"<span  class=TickerText>" + ClPrice+"&nbsp;"+" :"+ clss + DiffVal+ "%</span>"+" </span>&nbsp;&nbsp;&nbsp;";else stkDet += "<span >" + "<a target='_parent' class='LinkNew' href='"+HostUrlForPages+"/CompanyProfile/QuoteFinder.aspx?FinCode="+arrCol[0]+"&Mode=S&id=65'><span  class=TickerText>" + CompName +"</span></a>: " + "<span  class=TickerText>" + ClPrice +"&nbsp;"+" :"+ clss  + DiffVal+ "%</span>"+"  &nbsp;</span>&nbsp;";																			
ExchgDet = "<span class='TickerText'>" + arrCol[0] +" &nbsp; "+ CompName +": "+"<span  class=TickerText>" + ClPrice+"&nbsp;"+" :"+ clss + DiffVal+ "%</span>"+" </span>&nbsp;&nbsp;&nbsp;";else stkDet += "<span >" + "<a target='_parent' class='LinkNew' style='text-decoration:none' href='../CompanyProfile/QuoteFinder.aspx?FinCode="+arrCol[0]+"&Mode=S&id=65''><span  class=TickerText>" + CompName +"</span></a>: " + "<span  class=TickerText>" + ClPrice +"&nbsp;"+" :"+ clss  + DiffVal+ "%</span>"+"  &nbsp;</span>&nbsp;";																							
			
			
			}
			
			MarqueeId.innerHTML = "<marquee id='MarqueeIdTD' style='vertical-align:middle;text-decoration:none;' onmouseover='this.stop();' onmouseout='this.start();' trueSpeed scrollAmount='1' scrollDelay='30' direction='"+Direc+"' loop='repeat' width='100%'>" + ExchgDet + stkDet + "</marquee>";
			document.getElementById("MarqueeIdTD").start();
			document.body.style.cursor = "auto";
		}
	}
}
function startstopNSE(id)
{
	var imgNseId=document.getElementById("StopImgNSE");
	if (imgNseId.src.indexOf("TickPus.gif")!=-1)
	{
		if (imgNseId.alt == "Play")
		{
		document.getElementById("MarqueeIdTD").start();
		imgNseId.alt = "Stop";
		}
		else
		{
		document.getElementById("MarqueeIdTD").stop();
		imgNseId.alt = "Play";
		}
	}
	else
	{
		document.getElementById("MarqueeIdTD").start();
		imgNseId.alt = "Stop";
		
	}
}


function ChooseNewsHome(NewsTxt)
{

NewsTxt = NewsTxt.toUpperCase();
   if(NewsTxt =="MF NEWS")
    {
        GetNewsHotGlobalHome('2','3');
        
    }
  if(NewsTxt =="COMMODITY NEWS")
    {
        GetNewsHotGlobalHome('3','5,7,31,37');
       
    }

 if(NewsTxt =="DERIVATIVE NEWS")
    {
        GetNewsHotGlobalHome('4','47');
    }
   if(NewsTxt =="IPO NEWS")
    {
        GetNewsHotGlobalHome('1','2');
    }
    if(NewsTxt =="HOT STOCKS")
    {
        GetNewsHotGlobalHome('4','38');
    }
    if(NewsTxt =="OTHER MARKET")
    {
        GetNewsHotGlobalHome('6','12,13,14,45');
    }
    if(NewsTxt =="MARKET PULSE")
    {
        GetNewsHotGlobalHome('5','56');
    }
    if(NewsTxt =="ECONOMY")
    { 
        GetNewsHotGlobalHome('5','23,24,25,26,36,43,44,49');
    }

   if(NewsTxt =="MKT.COMMENTARY")
    {
        GetNewsHotGlobalHome('4','40,41,42');
    }

    if(NewsTxt=="CORPORATE NEWS")
    {
        GetNewsHotGlobalHome('7','15');
    }
   
  
    if(NewsTxt =="FII POSITION")
    {
        GetNewsHotGlobalHome('9','22');
    }
    
    if(NewsTxt =="OPENING BELL")
    {
        GetNewsHotGlobalHome('4','40');
    }

    if(NewsTxt=="CLOSING BELL")
    {
        GetNewsHotGlobalHome('4','42');
    }
   
  
    if(NewsTxt =="MIDDAY REVIEW")
    {
        GetNewsHotGlobalHome('4','41');
    }
    
    
       if(NewsTxt =="STOCK ALERTS")
    {
        GetNewsHotGlobalHome('4','46');
    }

    if(NewsTxt =="POLITICAL NEWS")
    {
        GetNewsHotGlobalHome('5','11');
    }

     if(NewsTxt =="FOREIGN MARKETS")
    {
        GetNewsHotGlobalHome('4','27');
    }

     if(NewsTxt =="F&O UPDATE")
    {
        GetNewsHotGlobalHome('4','47');
    }
         if(NewsTxt =="COMMODITIES NEWS")
    {
        GetNewsHotGlobalHome('3','5,7,31,37');
    }
         if(NewsTxt =="IPOS NEWS")
    {
        GetNewsHotGlobalHome('1','2');
    }
         if(NewsTxt =="MUTUAL FUNDS NEWS")
    {
        GetNewsHotGlobalHome('2','3,58');
    }

}


function GetNewsHotGlobalHome(SecID,SubSec)
{	

    CreateXmlHttpNewsHome();
	document.body.style.cursor = "progress";
	document.getElementById("NewsTdGlobal").innerHTML="<table align=center><tr><td><img src =../App_Themes/Common/images/loader.gif /></td></tr></table>";
	var requestUrl = "../Home/HomenewsAjaxHome.aspx?Sec="+ SecID +"&SubSec="+SubSec+"&IpTrack="+ window.location.hostname +"&timeStamp="+new Date().getTime();
	//alert(requestUrl);
	if(XmlHttpNewsHome)
	{
	    XmlHttpNewsHome.onreadystatechange = function(){getDataResponseHotHome();};
		XmlHttpNewsHome.open("GET", requestUrl,  true);
		XmlHttpNewsHome.send(null);
	}
	
}

function getDataResponseHotHome()
{
    if(XmlHttpNewsHome.readyState == 4)
	{	
	    if(XmlHttpNewsHome.status == 200)
		{				
		    var NewTd = document.getElementById("NewsTdGlobal");
			var NewData = XmlHttpNewsHome.responseText;
			if(NewData != "")
				NewTd.innerHTML = NewData;				
			document.body.style.cursor = "auto";
			
		}
	}
}


function CreateXmlHttpNewsHome()
{
	try
	{
		XmlHttpNewsHome = new ActiveXObject("Msxml2.XMLHTTP");
	}
	catch(e)
	{
		try
		{
			XmlHttpNewsHome = new ActiveXObject("Microsoft.XMLHTTP");
		}
		catch(oc)
		{
			XmlHttpNewsHome = null;				
		}
	}
	if(!XmlHttpNewsHome && typeof XMLHttpRequest != "undefined")
	{
		XmlHttpNewsHome = new XMLHttpRequest();
	}
}


  function OpenNewsGlobalHome(NewsID,SecID,SubSecID,FinCode,Opt)
    {
		//var RUrl = "../Home/NewsPopUpWindow.aspx?timeStamp="+ new Date().getTime() +"&NewsID="+NewsID +"&SecID="+SecID +"&SubSecID="+SubSecID +"&FinCode="+FinCode;	  
		  //window.open(RUrl,'NewToInsv','dependent=yes,toolbar=no,menubar=no,location=no,directories=no,scrollbars=yes,height=450,width=460,alwaysRaised=yes,resizable=no,top=0');
		  var requestUrl ="../PopupNewsData.aspx?timeStamp="+ new Date().getTime() +"&SecId="+SecID+"&SubSecID="+SubSecID+"&NewsID="+NewsID;
            document.getElementById("divNews").style.display="inline";
		  ajaxpage(1,requestUrl,'TdNews');  
    }
    
    
//    function getTickerData(Exchg,ss)
//{	
//// alert(Exchg);
//// alert(ss);
//    CreateXmlHttpCompTicker();
//	document.body.style.cursor = "progress";
//		
//		var BSETickerTab = document.getElementById("BSETickerTab");
//	
//		var NSETickerTab = document.getElementById("NSETickerTab");
//	
//		
//		if (Exchg=="BSE")
//		{
//		
//		    BSETickerTab.className="TickerTabSelHM"; 
//		    NSETickerTab.className="TickerTabUnSelHM"; 
//		    NCDEXTickerTab.className="TickerTabUnSelHM"; 
//		    MCXTickerTab.className="TickerTabUnSelHM"; 
//		}
//		else if (Exchg=="NSE")
//		{
//		   
//	    	NSETickerTab.className="TickerTabSelHM"; 
//		    BSETickerTab.className="TickerTabUnSelHM"; 
//		    NCDEXTickerTab.className="TickerTabUnSelHM"; 
//		    MCXTickerTab.className="TickerTabUnSelHM"; 
//		}
//		else if (Exchg=="NCDEX")
//		{
//		   
//	    	NSETickerTab.className="TickerTabUnSelHM"; 
//		    BSETickerTab.className="TickerTabUnSelHM"; 
//		    NCDEXTickerTab.className="TickerTabSelHM"; 
//		    MCXTickerTab.className="TickerTabUnSelHM"; 
//		}
//			else if (Exchg=="MCX")
//		{
//		   
//	    	NSETickerTab.className="TickerTabUnSelHM"; 
//		    BSETickerTab.className="TickerTabUnSelHM"; 
//		    NCDEXTickerTab.className="TickerTabUnSelHM"; 
//		    MCXTickerTab.className="TickerTabSelHM"; 
//		}   
//		   
//		
//		
//		
//	var requestUrl = "../Home/AjaxTickerData.aspx?Exchange="+ Exchg +"&status="+ ss +"&timeStamp="+new Date().getTime();
//	//alert(requestUrl);
//	
//	if(XmlHttpCompTicker)
//	{
//		XmlHttpCompTicker.onreadystatechange = function(){getDataResponseComp(Exchg);};
//		XmlHttpCompTicker.open("GET", requestUrl,  true);
//		XmlHttpCompTicker.send(null);
//	}
//}
//	 function CreateXmlHttpCompTicker()
//{
//	try
//	{
//		XmlHttpCompTicker = new ActiveXObject("Msxml2.XMLHTTP");
//	}
//	catch(e)
//	{
//		try
//		{
//			XmlHttpCompTicker = new ActiveXObject("Microsoft.XMLHTTP");
//		}
//		catch(oc)
//		{
//			XmlHttpCompTicker = null;				
//		}
//	}
//	if(!XmlHttpCompTicker && typeof XMLHttpRequest != "undefined")
//	{
//		XmlHttpCompTicker = new XMLHttpRequest();
//	}
//}

//function getDataResponseComp(Exchg)
//{

//    if(XmlHttpCompTicker.readyState == 4)
//	{	
//	    if(XmlHttpCompTicker.status == 200)
//		{	0

//		    var arrCol,Time,Code,CompName,ClPrice,DiffVal,DiffImg;
//			var ExchgDet="",stkDet="";
//			var MarqueeId = document.getElementById("MarqueeId");
//			var TickerData = XmlHttpCompTicker.responseText;
//						
//			if(TickerData != "")
//			var arrRow = TickerData.split("|");
//				
//				
//				
//				
//					var BSENSEFIN;
//				
//				
//				if (Exchg=='BSE')
//				{
//				BSENSEFIN = "218474";
//				}
//				
//				if (Exchg=='NSE')
//				{
//				BSENSEFIN = "217829";
//				}
//				
//				
//				
//			for(i=0; i<arrRow.length-1; i++)
//			{
//			    arrCol = arrRow[i].split("~");
//				CompName = arrCol[1];
//				ClPrice  = arrCol[2];
//				DiffVal  = arrCol[3];
//				
//				if(DiffVal>0) 
//				{
//					clss = "<span class='Green'>" ;
//				}
//				else if(DiffVal<0) 
//				{							
//					clss = "<span class='Red'>" ;
//				}
//				else if(DiffVal==0) 
//				{
//					clss = "<span class='Blue'>"	;				
//				}
//				
//				if(i==0)ExchgDet = "<span class='TickerText' >" + arrCol[0] +"</span> &nbsp; <a style='text-decoration:none; border:none' href='CompanyProfile/QuoteFinder.aspx?id=65&FinCode="+BSENSEFIN+"&Mode=S' class=TickerText>"+ CompName +": "+"</span></a><span  style='text-decoration:none; border:none' class=TickerText>" + ClPrice+"&nbsp;"+" ["+ clss   +"<b>"+ DiffVal+ "%</b></span>"+"] </span>&nbsp;&nbsp;&nbsp;";else stkDet += "<span class='TickerLink'>" + "<a  style='text-decoration:none; border:none' href='CompanyProfile/QuoteFinder.aspx?id=38&FinCode="+arrCol[0]+"&Mode=S'><span  class=TickerText>" + CompName +"</span></a>: " + "<span  class=TickerText>" + ClPrice +"&nbsp;"+" ["+ clss  +"<b>"+ DiffVal+ "%</b></span>"+"]  &nbsp;</span>&nbsp;";						
//			}
//			MarqueeId.innerHTML = "<marquee id='MarqueeIdTD'  valign='middle' style='vertical-align:bottom;display:block' onmouseover='this.stop();' onmouseout='this.start();' trueSpeed scrollAmount='1' scrollDelay='30' direction='left' loop='repeat' width='100%'>" + ExchgDet + stkDet + "</marquee>";
//				
//			document.getElementById("MarqueeIdTD").start();
//			document.body.style.cursor = "auto";
//		}
//	}
//}





