﻿var HostAddressInJSfileForPages="http://money.livemint.com";var HostAddressInJSfileForCSS="http://money.livemint.com";function GetNewsDetailMkt(secId,SubSecId,NewsID,opt,FinCode,Section,Tsec,Tsubsec){CreateSecSubSecNameObj()
var requestUrl=HostAddressInJSfileForPages+"/LiveHome/AjaxGetSecSubSec.aspx?NewsID="+NewsID+"&Sec="+secId+"&SubSec="+SubSecId+"&Period="+opt+"&FinCode="+FinCode;if(SecSubSecNameObj){SecSubSecNameObj.onreadystatechange=function(){GetSecSubsecNameResp(secId,SubSecId,NewsID,opt,FinCode,Section,Tsec,Tsubsec)};SecSubSecNameObj.open("GET",requestUrl,true);SecSubSecNameObj.send(null);}}function CreateSecSubSecNameObj(){try{SecSubSecNameObj=new ActiveXObject("Msxml2.XMLHTTP");}catch(e){try{SecSubSecNameObj=new ActiveXObject("Microsoft.XMLHTTP");}catch(oc){SecSubSecNameObj=false;}}if(!SecSubSecNameObj&&typeof XMLHttpRequest!='undefined'){try{SecSubSecNameObj=new XMLHttpRequest();}catch(e){SecSubSecNameObj=false;}}if(!SecSubSecNameObj&&window.createRequest){try{SecSubSecNameObj=window.createRequest();}catch(e){SecSubSecNameObj=false;}}}function GetSecSubsecNameResp(secId,SubSecId,NewsID,opt,FinCode,Section,Tsec,Tsubsec){if(SecSubSecNameObj.readyState==4){if(SecSubSecNameObj.status==200){var strGlData=SecSubSecNameObj.responseText;var strGlDataTmp=strGlData.split("|");while(strGlDataTmp[0].indexOf(' ')!=-1){strGlDataTmp[0]=strGlDataTmp[0].replace(' ','-');}while(strGlDataTmp[0].indexOf('&')!=-1){strGlDataTmp[0]=strGlDataTmp[0].replace('&','And');}while(strGlDataTmp[1].indexOf(' ')!=-1){strGlDataTmp[1]=strGlDataTmp[1].replace(' ','-');}while(strGlDataTmp[1].indexOf('&')!=-1){strGlDataTmp[1]=strGlDataTmp[1].replace('&','And');}var requestUrl;if(secId=="B"||secId=="N"||secId=="C"||secId=="BoardMeet"||secId=="BoardMeetForth"){requestUrl=HostAddressInJSfileForPages+"/News/"+Section+"/"+FinCode+"/"+secId+"/"+SubSecId+"/"+Tsec+"/"+Tsubsec+"/"+NewsID+".aspx";}else{requestUrl=HostAddressInJSfileForPages+"/News/"+Section+"/"+strGlDataTmp[0]+"/"+strGlDataTmp[1]+"/"+NewsID+".aspx";}window.location.href=requestUrl;}}}var xmlhttpInd;function CreateXmlHttpInd(){try{xmlhttpInd=new ActiveXObject("Msxml2.XMLHTTP");}catch(e){try{xmlhttpInd=new ActiveXObject("Microsoft.XMLHTTP");}catch(oc){xmlhttpInd=null;}}if(!xmlhttpInd&&typeof XMLHttpRequest!="undefined"){xmlhttpInd=new XMLHttpRequest();}}function GetIndices(){CreateXmlHttpInd();document.body.style.cursor="progress";var requestUrl=HostAddressInJSfileForPages+"/LiveHome/AjaxIndices.aspx?timeStamp="+new Date().getTime();if(xmlhttpInd){xmlhttpInd.onreadystatechange=function(){getRespInd()};xmlhttpInd.open("GET",requestUrl,true);xmlhttpInd.send(null);}}function getRespInd(){if(xmlhttpInd.readyState==4){var	Td_HotS=document.getElementById("tdindices");if(xmlhttpInd.status==200){var data=xmlhttpInd.responseText;Td_HotS.innerHTML=data;document.body.style.cursor="auto";}else{Td_HotS.innerHTML='There was a problem retrieving data from the server.';document.body.style.cursor="auto";}}}var GlobalFinCode="";function FetchFinCode(FinCode){GlobalFinCode=FinCode;}function MostSearched(FinCode,Company,Section){}
function CallHomeTabsTop()
{

var strURL = window.location.href;
strURL = strURL.toUpperCase();

if(strURL.indexOf("/IPO/")>=0 || strURL.indexOf("/News/IPO/IPO/NEWS/")>= 0 || strURL.indexOf("IPO.ASPX")>=0)
{
  
   document.getElementById("MNIPO").className="current";
}
else if(strURL.indexOf("/COMMODITY/")>=0 || strURL.indexOf("/NEWS/COMMODITY/")>=0)
{
   document.getElementById("MNCommodities").className="current";
   GetTopQuotes('C');
   document.getElementById("hdntab").value="C";
}
else if (strURL.indexOf("/LIVEHOME/")>= 0 || strURL.indexOf("/NEWS/HOME/")>= 0 ) 
{
document.getElementById("MNHome").className="current";
document.getElementById("hdntab").value="H";
}
else if (strURL.indexOf("/LIVEMARKET/")>= 0|| strURL.indexOf("/OTHERMARKET/")>= 0 || strURL.indexOf("/COMPANYPROFILE/")>= 0|| strURL.indexOf("EQUITY.ASPX")>= 0 || strURL.indexOf("COMPANY.ASPX")>= 0|| strURL.indexOf("/NEWS/MARKET/EQUITY/")>= 0  || strURL.indexOf("/CORPORATEACTION/")>= 0 ) 
{
document.getElementById("MNMarkets").className="current";
GetTopQuotes('E');
document.getElementById("hdntab").value="M";
}
else if (strURL.indexOf("/MUTUALFUND/")>= 0 || strURL.indexOf("/CALCULATOR/")>= 0 ||strURL.indexOf("/MF/")>= 0) 
{
document.getElementById("MNMutualFund").className="current";
GetTopQuotes('M');
document.getElementById("hdntab").value="MU";
}

}


var xmlhttpSession;

   function CreateXmlHttpSession()
	{
		//Creating object of XMLHTTP in IE
		try
		{
			xmlhttpSession = new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch(e)
		{
			try
			{
				xmlhttpSession = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch(oc)
			{
				xmlhttpSession = null;	
			}
		}
		//Creating object of XMLHTTP in Mozilla and Safari 
		if(!xmlhttpSession && typeof XMLHttpRequest != "undefined") 
		{
			xmlhttpSession = new XMLHttpRequest();
		}
	}



function checkSession()
{
  CreateXmlHttpSession();
 // alert("JJ");
  
   var requestUrl = HostAddressInJSfileForPages+"/Common/AjaxChecksession.aspx?timeStamp="+ new Date().getTime();

		if(xmlhttpSession)	{
				xmlhttpSession.onreadystatechange = function(){getRespSession()};
				xmlhttpSession.open("GET", requestUrl,  true);
				xmlhttpSession.send(null);
			}
			
			 setTimeout("checkSession()",600000);
    }
    
    function getRespSession()
{

	if(xmlhttpSession.readyState == 4)
	{
	
	
	
		
		if(xmlhttpSession.status == 200)//
		{
		   var data=xmlhttpSession.responseText;
		   if(data=="1")
		   {
		      window.location.href=HostAddressInJSfileForPages+"/index.aspx?id=SO";
		   }
          	
		}
	
	}
}



function HideTDGetquote()
{
  var strURL = window.location.href;
strURL = strURL.toUpperCase();

if(strURL.indexOf("/COMPANY")>=0 )
 {
    if(strURL.indexOf("/QUOTESHOME")>=0)
     {
      document.getElementById("tddropdown").style.display="none";
     }
     else
     {
         document.getElementById("tddropdown").style.display="";
     }
  }
}





function RedirectCompanyUrl(PageID,fincode)
{
  var PageUrl;
     switch (PageID)
                {

                    case "42":
                      
                        PageUrl = HostAddressInJSfileForPages + "/IID42/F"+fincode+"/QuickQuote/Company.aspx";
                            
                          

                        break;
                    case "43":
                     
                        PageUrl = HostAddressInJSfileForPages + "/IID43/F"+fincode+"/DetailedQuote/Company.aspx";
                          
                        break;
                    case "44":
                   
                        PageUrl = HostAddressInJSfileForPages + "/IID44/F"+fincode+"/Historical/Company.aspx";
                          
                        break;
                    case "45":
                    
                        PageUrl = HostAddressInJSfileForPages + "/IID45/F"+fincode+"/Charting/Company.aspx";
                       
                        break;
                    case "46":
                   

                        PageUrl = HostAddressInJSfileForPages + "/IID46/F"+fincode+"/Snapshot/Company.aspx";
                          

                        break;
                    case "47":
                     
                        PageUrl = HostAddressInJSfileForPages + "/IID47/F"+fincode+"/Background/Company.aspx";
                        
                        break;
                    case "48":
                       
                        PageUrl = HostAddressInJSfileForPages + "/IID48/F"+fincode+"/News/Company.aspx";
                         
                        break;
                    case "49":
                       
                        PageUrl = HostAddressInJSfileForPages + "/IID49/F"+fincode+"/BoardDirectors/Company.aspx";
                           
                        break;
                    case "50":
                       
                        PageUrl = HostAddressInJSfileForPages + "/IID50/F"+fincode+"/ShareHolding/Company.aspx";
                         
                        break;
                    case "51":
                   
                        PageUrl = HostAddressInJSfileForPages + "/IID51/F"+fincode+"/DividendHistory/Company.aspx";
                           
                        break;
                    case "52":
                       
                        PageUrl = HostAddressInJSfileForPages + "/IID52/F"+fincode+"/BonusHistory/Company.aspx";
                        
                        break;
                    case "53":
                       
                        PageUrl = HostAddressInJSfileForPages + "/IID53/F"+fincode+"/Peer/Company.aspx";
                       
                        break;
                    case "54":
                       
                        PageUrl = HostAddressInJSfileForPages + "/IID54/F"+fincode+"/MFHoldings/Company.aspx";
                           
                        break;
                    case "55":
                       
                        PageUrl = HostAddressInJSfileForPages + "/IID55/F"+fincode+"/BoardMeet/Company.aspx";
                       
                        break;
                    case "56":
                     
                        PageUrl = HostAddressInJSfileForPages + "/IID56/F"+fincode+"/Closure/Company.aspx";
                           
                        break;
                    case "57":
                      
                        PageUrl = HostAddressInJSfileForPages + "/IID57/F"+fincode+"/BRD/Company.aspx";
                         
                        break;
                    case "58":
                      
                        PageUrl = HostAddressInJSfileForPages + "/IID58/F"+fincode+"/Delisting/Company.aspx";
                         
                        break;
                    case "59":
                   
                        PageUrl = HostAddressInJSfileForPages + "/IID59/F"+fincode+"/ChangeInName/Company.aspx";
                       
                        break;
                    case "60":
                     
                        PageUrl = HostAddressInJSfileForPages + "/IID60/F"+fincode+"/BalSheet/Company.aspx";
                          
                        break;
                    case "61":
                    
                        PageUrl = HostAddressInJSfileForPages + "/IID61/F"+fincode+"/PLAccount/Company.aspx";
                          
                        break;
                    case "62":
                    
                        PageUrl = HostAddressInJSfileForPages + "/IID62/F"+fincode+"/CashFlow/Company.aspx";
                         
                        break;
                    case "63":
                     
                        PageUrl = HostAddressInJSfileForPages + "/IID63/F"+fincode+"/Valuation/Ratios/Company.aspx";
                           
                        break;
                    case "64":
                   
                        PageUrl = HostAddressInJSfileForPages + "/IID64/F"+fincode+"/Financial/Ratios/Company.aspx";
                          
                        break;
                    case "65":
                   
                        PageUrl = HostAddressInJSfileForPages + "/IID65/F"+fincode+"/Latest/Results/Company.aspx";
                         
                        break;
                    case "66":
                     
                        PageUrl = HostAddressInJSfileForPages + "/IID66/F"+fincode+"/Quarterly/Results/Company.aspx";
                         
                        break;
                    case "67":
                    
                        PageUrl = HostAddressInJSfileForPages + "/IID67/F"+fincode+"/HalfYearly/Results/Company.aspx";
                          
                        break;
                    case "91":
                       
                        PageUrl = HostAddressInJSfileForPages + "/IID91/F"+fincode+"/DirectorsReport/Company.aspx";
                     
                        break;
                    case "92":
                 
                        PageUrl = HostAddressInJSfileForPages + "/IID92/F"+fincode+"/NotesToAccount/Company.aspx";
                      
                        break;
                    case "93":
                    
                        PageUrl = HostAddressInJSfileForPages + "/IID93/F"+fincode+"/AccountingPolicies/Company.aspx";
                       
                        break;
                    case "94":
                   
                        PageUrl = HostAddressInJSfileForPages + "/IID94/F"+fincode+"/RawMaterial/Company.aspx";
                       
                        break;
                }

  window.location.href=PageUrl;
}
