﻿function ClickFalse()
{
 return false;
}
function SpeedTicker(opt,bsemarq)
 {
    if(opt=='PLUS')	
	    document.getElementById(bsemarq).scrollAmount = parseInt(document.getElementById(bsemarq).scrollAmount)+1;
		
    if(opt=='STOP')
    {
	    if(document.getElementById(bsemarq).scrollAmount==0)
	    {
		    document.getElementById(bsemarq).scrollAmount=1;
		    document.getElementById("stop").src = "../images/stop.gif";
		    document.getElementById("stop").title = "stop";
		    }
	    else 
	    {
		    document.getElementById(bsemarq).scrollAmount=0;
		    document.getElementById("stop").src = "../images/PLAY.gif";
		    document.getElementById("stop").title = "play";
	    }
    }	
    if(opt=='MINUS')
    {
	    if(document.getElementById(bsemarq).scrollAmount>1)
	    {
		    document.getElementById(bsemarq).scrollAmount = parseInt(document.getElementById(bsemarq).scrollAmount)-1; 
	    }
    }
    
}

function ShowSelectedLink()
{
  var SelectedLink = document.getElementById("Drp_Links").value;
  if(SelectedLink == "NSE")
   {
      window.open('http://www.nseindia.com/');
   }
   else if(SelectedLink == "BSE")
   {
    window.open('http://www.bseindia.com/');
   }
   else if(SelectedLink == "CDSL")
   {
   window.open('http://www.cdslindia.com/');
   }
   else if(SelectedLink == "NSDL")
   {
   window.open('https://nsdl.co.in/');
   }
   else if(SelectedLink == "MCX")
   {
   window.open('http://mcxindia.com/');
   }
   else if(SelectedLink == "NCDEX")
   {
   window.open('http://ncdex.com/');
   }
   else if(SelectedLink == "RBI")
   {
   window.open('http://www.rbi.org.in/home.aspx');
   }
   else if(SelectedLink == "SEBI")
   {
   window.open('http://www.sebi.gov.in/');
   }
   
}
function CloseMe(ID)
   {        
     document.getElementById(ID).style.display="none";
   }
   function ShowMe(ID)
   {
     document.getElementById(ID).style.display="inline";                 
   }
   var XmlHttp;
    function CreateXmlHttp()
    {
        try
        {
	        XmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
        }
        catch(e)
        {
	        try
	        {
		        XmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
	        } 
	        catch(oc)
	        {
		        XmlHttp = null;
    				
	        }
        }
        if(!XmlHttp && typeof XMLHttpRequest != "undefined") 
        {
	        XmlHttp = new XMLHttpRequest();
        }
    }
    
   function LoadNews(sno,sec,subsec,cocode,opt)
   {        
        document.getElementById("NewsDetails").innerHTML = "<table width='100%' border='0' cellspacing='0' cellpadding='0'><tr><td align='center'><img src='../innerimages/70.gif'></td></tr></table>"; 
        var D = Date();        
        CreateXmlHttp();	   
        var  LBUrl= "../News/NewsDetails.aspx?Date="+ D +"&sno="+ sno +"&secid="+ sec +"&subsecid="+subsec+"&opt="+opt+"&cocode="+cocode;
       //alert(LBUrl);
        if(XmlHttp)	
        {		
          XmlHttp.onreadystatechange = function(){GetData();};
          XmlHttp.open("GET", LBUrl,true);
          XmlHttp.send(null);
        }
   }
       
   function GetData()
    {   
        if(XmlHttp.readyState == 4)	
        {   
	        if(XmlHttp.status == 200 )
	        { 
              var response = XmlHttp.responseText;   
              document.getElementById("NewsDetails").innerHTML = response; 
            } 
            else
            {
               alert("Internal Server Error.Please Try after some time");
            }
        }	
       
    }
    
 function proddetails(Exchng,comcode)
   {        
        document.getElementById("CommDetails").innerHTML = "<table width='100%' border='0' cellspacing='0' cellpadding='0'><tr><td align='center'><img src='../innerimages/70.gif'></td></tr></table>"; 
        var D = Date();        
        CreateXmlHttp();	   
        var  LBUrl= "../Commodity/ProductDetData.aspx?Exchng="+ Exchng +"&comcode="+ comcode; 
       //alert(LBUrl);
        if(XmlHttp)	
        {		
          XmlHttp.onreadystatechange = function(){GetCommData();};
          XmlHttp.open("GET", LBUrl,true);
          XmlHttp.send(null);
        }
   }
   function GetCommData()
    {   
        if(XmlHttp.readyState == 4)	
        {  
	        if(XmlHttp.status == 200 )
	        { 
              var response = XmlHttp.responseText;   
              document.getElementById("CommDetails").innerHTML = response; 
            } 
            else
            {
               alert("Internal Server Error.Please Try after some time");
            }
        }	
       
    }
    
    function showPortfilo(fundname,portcode)
    {
      var portUrl = "../Insurance/PortfolioDetails.aspx?fundname="+ fundname +"&portcode="+ portcode;
      document.getElementById("tdPortfolio").style.display="none";
      document.getElementById("prenext").style.display="none";
	  document.getElementById("tdPortfolioDetails").style.display="inline";
       CreateXmlHttp();	
      if(XmlHttp)	
        {		
          XmlHttp.onreadystatechange = function(){GetPortfolioData();};
          XmlHttp.open("GET", portUrl,true);
          XmlHttp.send(null);
        }
    }
    function GetPortfolioData()
    { 
     if(XmlHttp.readyState == 4)	
        {  
	        if(XmlHttp.status == 200 )
	        { 
              var response = XmlHttp.responseText;
              document.getElementById("tdPortfolioDetails").innerHTML = response; 
            } 
            else
            {
               alert("Internal Server Error.Please Try after some time");
            }
        }	
    }
