
function getTicker(Exchg)
{
     var TdBSE = document.getElementById("tdBse");
     var TdNSE = document.getElementById("tdNse");
	if (Exchg =='BSE')
	{
		TdBSE.className = "TickerBSEOn";
		TdNSE.className = "TickerBSEOff";
	}
	else
	{	
	    TdBSE.className = "TickerBSEOff";
	    TdNSE.className = "TickerBSEOn";
	}
   // alert(Exchg);
    var tcr = "../Market/GetTickerData.aspx?Exchg="+ Exchg;
    //document.getElementById("TDTicker").innerHTML="<table cellpadding='0' cellspacing='0' width='100%'><tr><td align='center'><img src='../images/loading1.gif'></td></tr></table>";
    var ajax = new Ajax.Updater('TDTicker',tcr,{evalScripts: true});
}
/* For News */

function GetNewsDetail(SrNo,secId,SubSecId,type)
{	
    
	document.getElementById("cm_window").style.display='inline';
	//alert(document.getElementById("cm_window"));	
	var NewsUrl = "../News/NewsDetails.aspx?SecId="+ secId +"&SubSecId="+ SubSecId+"&SNo="+ SrNo +"&type="+type;
	document.getElementById("NewsId").innerHTML="<table cellpadding='0' cellspacing='0' width='100%'><tr><td align='center'><img src='../images/loading1.gif'></td></tr></table>";
	var ajax = new Ajax.Updater('NewsId',NewsUrl);
    //var ajax = new Ajax.Updater('NewsId',"index.aspx");
}


/*  News  Ens */ 
/*Company Profile */


function SearchText(txtCNameId,ddlPageId)
{
    
    
    var strCompany= document.getElementById(txtCNameId);
    var iPageFilter= document.getElementById(ddlPageId).value;

//    var txtcname = document.getElementById("ctl00_ContentPlaceHolder1_txtcname");
//	var filter = document.getElementById("ctl00_ContentPlaceHolder1_Drp_select").value;
	if ((strCompany.value == "")||(strCompany.value=="Enter Company Name"))
		{
		alert("Enter few characters to search");
		strCompany.value = "";
		
		strCompany.focus();
		return false;
		}	
	else
	{
	
		var StrUrl = "../CP/CompanySearch.aspx?schtxt="+strCompany.value+"&id="+iPageFilter+"&filter="+iPageFilter;
        document.location =StrUrl;
	}
	return true;
    
}
//function GetTips()
//{	
//    
//	document.getElementById("Tip_window").style.display='inline';
//	//alert(document.getElementById("Tip_window"));	
//	var NewsUrl = "../ClientPopup/SubBroker.aspx";
//	
//	document.getElementById("TipsId").innerHTML="<table cellpadding='0' cellspacing='0' width='100%'><tr><td align='center'><img src='../images/loading1.gif'></td></tr></table>";
//	var ajax = new Ajax.Updater('TipsId',NewsUrl);
//    
//}

	VideoClip(srno)
	{
				
		var Url = "VideoCilp.aspx?SrNo="+srno;
	   alert(Url);
	    document.getElementById("TdVideoCilp").innerHTML="<table cellpadding='0' cellspacing='0' width='100%'><tr><td height='90px' align='center'><img src='../images/loading1.gif'></td></tr></table>";
	    var ajax = new Ajax.Updater('TdVideoCilp',Url);	
	}


function chngindex(opt)
{
   var id="";
   if(opt=="IND")
   {
      id="1";      
      document.getElementById("hdpageid").value=id;
      document.getElementById("imgindia").src="../images/india_on.gif";
      document.getElementById("imgglobal").src="../images/global.gif";     
      document.getElementById("imgcurrencies").src="../images/currencies.gif";
      document.getElementById("tdIND").className="seltab"; 
      document.getElementById("tdGLOB").className="unseltab"; 
      document.getElementById("tdCUR").className="unseltab"; 
      showchart('NIFTY','IND');
   }
   else if(opt=="GLOB")
   {
      id="2";
      document.getElementById("hdpageid").value=id;
      document.getElementById("imgindia").src="../images/india.gif";
      document.getElementById("imgglobal").src="../images/Global_on.gif";
      document.getElementById("imgcurrencies").src="../images/currencies.gif";
      document.getElementById("tdIND").className="unseltab"; 
      document.getElementById("tdGLOB").className="seltab"; 
      document.getElementById("tdCUR").className="unseltab";
      showchart('DJIA','GLOB'); 
   }
   else
   {
      id="3";
       document.getElementById("hdpageid").value=id;
      document.getElementById("imgindia").src="../images/india.gif";
      document.getElementById("imgglobal").src="../images/global.gif";
      document.getElementById("imgcurrencies").src="../images/Currencies_on.gif";
      document.getElementById("tdIND").className="unseltab"; 
      document.getElementById("tdGLOB").className="unseltab"; 
      document.getElementById("tdCUR").className="seltab"; 
      showchart('BSE','CUR'); 
   }
   url="../HomeInner.aspx?id="+id;
   document.getElementById("tdindices").innerHTML="<table cellpadding='0' cellspacing='0' width='201px' border='0'><tr><td align='center' height='145px'><img src='../images/loading1.gif'></td></tr></table>";
   var ajax = new Ajax.Updater('tdindices',url);
}

function showchart(Exchg,opt)
{    
    //alert(Exchg);
    var url="";
    if(opt=="CUR")
    {
       url="../currecydata.aspx";
    }
    else if(opt=="GLOB")
    {
       url="../HomeTeechart.aspx?Exchg="+Exchg;
    }
    else
    {
       if(Exchg=="Bank Nifty" || Exchg=="10 Yr GSe")
       {          
          url="../HomeTeechart.aspx?Exchg="+Exchg;
       }       
       else
       {
           if(Exchg=="NIFTY")
              Exchg="NSE";
           else if(Exchg=="SENSEX")
              Exchg="BSE";
           url="../Homechart.aspx?Exchg="+Exchg;
       }
    }
    document.getElementById("tdchart").innerHTML="<table cellpadding='0' cellspacing='0' width='165px' border='0'><tr><td align='center' height='144px'><img src='../images/loading1.gif'></td></tr></table>";
    var ajax = new Ajax.Updater('tdchart',url);
}


function chngpage()
{
   var id=document.getElementById("hdpageid").value;
   document.location="../OtherMarket/InnerPage.aspx?id="+id;
}