﻿// JScript File

var HostAddressInJSfileForPages = "http://www.smctradeonline.com";
//var HostAddressInJSfileForPages = "http://localhost:3854/SMCServer";



function _trim(ig_)
{
    return ig_.replace(/^\s*|\s*$/g,"")
}	

function CallIframeHt(SecType)
{



    var ig_a=document.location.search.substring(1);		
    
    var ig_b=ig_a.split("&");	
    var ig_f="";
     for(var ig_c=0;ig_c<ig_b.length;ig_c++)
    {
    var ig_d=ig_b[ig_c].indexOf("IFID=");
    if(ig_d==-1)continue;
    ig_f=ig_b[ig_c].substring(5);
    ig_f=_trim(ig_f);	
     }
     
     

     
     if (ig_f=="")
     {
     
     
     var ig_f = GetIDfrompagename(SecType);
     }     
  


document.getElementById("iframe_SMC").height="1050px";

if (ig_f=="")
{
SetHomePgHt(SecType);
}

if (ig_f!="")
{
SetInnerPgHt(SecType,ig_f);
}

ShowLeftAndSiteMap(ig_f,SecType);
}

function SetHomePgHt(SecType)
{
var FrameHt;
if (SecType=='EQUITY')
{
FrameHt="500px";
}
if (SecType=='IPO')
{
FrameHt="500px";
}
if (SecType=='MF')
{
FrameHt="500px";
}
if (SecType=='COMMODITY')
{
FrameHt="480px";
}
if (SecType=='CURRENCY')
{
FrameHt="500px";
}
if (SecType=='DERIVATIVES')
{
FrameHt="500px";
}
 document.getElementById("iframe_SMC").height=FrameHt;
}

function SetInnerPgHt(SecType,ID)
{
if (SecType=='EQUITY')
{
SetInnerPgHtEquity(ID);
}

if (SecType=='COMMODITY')
{
SetInnerPgHtCommodity(ID);
}

if (SecType=='MF')
{
SetInnerPgHtMutualFund(ID);
}


if (SecType=='DERIVATIVES')
{
SetInnerPgHtDerivatives(ID);
}
if (SecType=='IPO')
{
SetInnerPgHtIPO(ID);
}


}


function SetInnerPgHtDerivatives(ID)
{
    if (ID=='5')
    {
    document.getElementById("iframe_SMC").height="3000px";
    }
    if (ID=='8')
    {
    document.getElementById("iframe_SMC").height="2000px";
    }
    
    if (ID=='13')
    {
    document.getElementById("iframe_SMC").height="2000px";
    }
     if (ID=='14')
    {
    document.getElementById("iframe_SMC").height="2000px";
    }
    
    if (ID=='16')
    {
    document.getElementById("iframe_SMC").height="2000px";
    }
}

function SetInnerPgHtIPO(ID)
{
    if (ID=='12')
    {
       document.getElementById("iframe_SMC").height="1700px";
    }    
}





function SetInnerPgHtEquity(ID)
{
if (ID=='94')
{
document.getElementById("iframe_SMC").height="3500px";
}
if (ID=='65')
{
document.getElementById("iframe_SMC").height="4000px";
}
if (ID=='15')
{
document.getElementById("iframe_SMC").height="1500px";
}
if (ID=='71')
{
document.getElementById("iframe_SMC").height="1500px";
}
if (ID=='72')
{
document.getElementById("iframe_SMC").height="1500px";
}
if (ID=='77')
{
document.getElementById("iframe_SMC").height="1800px";
}

if (ID=='23')
{
document.getElementById("iframe_SMC").height="1300px";
}
if (ID=='36')
{
document.getElementById("iframe_SMC").height="1300px";
}
if (ID=='79')
{
document.getElementById("iframe_SMC").height="1300px";
}
if (ID=='80')
{
document.getElementById("iframe_SMC").height="1300px";
}

if (ID=='81')
{
document.getElementById("iframe_SMC").height="1700px";
}
if (ID=='82')
{
document.getElementById("iframe_SMC").height="1200px";
}
}



function SetInnerPgHtCommodity(ID)
{
if (ID=='33')
{
document.getElementById("iframe_SMC").height="1700px";
}

if (ID=='1')
{
document.getElementById("iframe_SMC").height="2300px";
}
if (ID=='12')
{
document.getElementById("iframe_SMC").height="2000px";
}

}



function SetInnerPgHtMutualFund(ID)
{
if (ID=='23')
{
document.getElementById("iframe_SMC").height="1700px";
}
if (ID=='24')
{
document.getElementById("iframe_SMC").height="1400px";
}
if (ID=='29')
{
document.getElementById("iframe_SMC").height="4500px";
}
if (ID=='13')
{
document.getElementById("iframe_SMC").height="15500px";
}

if (ID=='8')
{
document.getElementById("iframe_SMC").height="1200px";
}

if (ID=='15')
{
document.getElementById("iframe_SMC").height="4000px";
}
if (ID=='37')
{
document.getElementById("iframe_SMC").height="1600px";
}
if (ID=='1')
{
document.getElementById("iframe_SMC").height="1200px";
}

if (ID=='30')
{
document.getElementById("iframe_SMC").height="2000px";
}

}


function CheckZoomFeature()
{

var strURL = window.location.href;
strURL = strURL.toUpperCase();

if ((strURL.indexOf("/NRI/TRADINGPLATFORMMAIN.ASPX")>= 0)||(strURL.indexOf("/ONLINETRADE/TRADINGPLATFORMMAIN.ASPX")>= 0)||(strURL.indexOf("/PNBNK/TRADINGPLATFORMMAIN.ASPX")>= 0)) 
{
setupZoom();
}

if ((strURL.indexOf("/NRI-ONLINE-TRADING.ASPX")>= 0)||(strURL.indexOf("/ONLINE-TRADING-PLATFORMS.ASPX")>= 0)||(strURL.indexOf("/PNB-TRADING-PLATFORM.ASPX")>= 0)) 
{
setupZoom();
}




}



function ShowAdd(flash1,x,y)
{
    document.getElementById("AddOn").style.visibility = "visible";
	var xp, yp, op
	    xp = document.getElementById(flash1).offsetLeft;	// Element's offset x in pixels
	    yp = document.getElementById(flash1).offsetTop;
	    dname=document.getElementById(flash1);
	   
        while (dname.offsetParent) 
        {
		    op = dname.offsetParent;	// Get container parent
		    xp = xp + op.offsetLeft;	// Add this element's offset x in pixels
		    yp = yp + op.offsetTop;		// Add this element's offset y in pixels
		    dname = dname.offsetParent;	// Update current container
	    }
            document.getElementById('AddOn').style.left=xp - x + "px";
            document.getElementById('AddOn').style.top=yp + y + "px";
            document.getElementById('AddOn').style.display='block';
} 



function CreateXmlHttpInvestGrev()
	{
		//Creating object of XMLHTTP in IE
		try
		{
			XmlHttpInvestGrev = new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch(e)
		{
			try
			{  
				XmlHttpInvestGrev = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch(oc)
			{
				XmlHttpInvestGrev = false;	
			}
		}
		//Creating object of XmlHttp in Mozilla and Safari 
		if (!XmlHttpInvestGrev && typeof XMLHttpRequest!='undefined') 
		{
	        try 
	        {
		        XmlHttpInvestGrev = new XMLHttpRequest();
	        } 
	        catch (e) 
	        {
		        XmlHttpInvestGrev=false;
	        }
        }
        if (!XmlHttpInvestGrev && window.createRequest) 
        {
	        try 
	        {
		        XmlHttpInvestGrev = window.createRequest();
	        } 
	        catch (e)
	        {
		        XmlHttpInvestGrev=false;
	        }
        }
	}
	
    function OpenInvestGrev()
    {
        CreateXmlHttpInvestGrev();
        document.getElementById("InvestGrev").style.display = "inline";
     
        var xp = document.getElementById("BottomTDCtl").offsetLeft;	// Element's offset x in pixels
	    var yp = document.getElementById("BottomTDCtl").offsetTop;
	  
	   
         document.getElementById('InvestGrev').style.left=xp + 400 + "px";
         document.getElementById('InvestGrev').style.top=yp - 250 + "px";
            
     
      	var requestUrl = HostAddressInJSfileForPages+"/CommonControl/InvestorGrievence.aspx?timeStamp="+ new Date().getTime() ;
		if(XmlHttpInvestGrev)	{
					XmlHttpInvestGrev.onreadystatechange = function(){getNewsInvestGrev()};
					XmlHttpInvestGrev.open("GET", requestUrl,  true);
					XmlHttpInvestGrev.send(null);
				}
    }
    
    function getNewsInvestGrev()
{



	if(XmlHttpInvestGrev.readyState == 4)
	{
		// To make sure valid response is received from the server, 200 means response received is OK
		
		
		
		if(XmlHttpInvestGrev.status == 200)//
		{
		
		
			  var Data = XmlHttpInvestGrev.responseText;
		      var StartIndex = Data.indexOf('<div>');
		      var LastIndex = Data.lastIndexOf("</form>");
             var MainData =  Data.substring(StartIndex,LastIndex);
			if(MainData != "")
			{
			document.getElementById("InvestGrevTxt").innerHTML=MainData;
		    document.body.style.cursor = "auto";		
		}
		
		document.getElementById("InvestGrevTxt").innerHTML=MainData;
		document.body.style.cursor = "auto";		
		}
		else
		{
			document.getElementById("InvestGrevTxt").innerHTML =  "There was a problem retrieving data from the server.";
			document.body.style.cursor = "auto";
		}
		
	}
}







function ShowBADiv(RefImg,x,y,Opt)
{
    document.getElementById("BussAssociate").style.display = "inline";
	var xp, yp, op
	    xp = document.getElementById("BottomTDCtl").offsetLeft;	// Element's offset x in pixels
	    yp = document.getElementById("BottomTDCtl").offsetTop;
	    dname=document.getElementById("BottomTDCtl");
	   
        while (dname.offsetParent) 
        {
		    op = dname.offsetParent;	// Get container parent
		    xp = xp + op.offsetLeft;	// Add this element's offset x in pixels
		    yp = yp + op.offsetTop;		// Add this element's offset y in pixels
		    dname = dname.offsetParent;	// Update current container
	    }
	    
	    if (Opt=='INSURANCE')
	    {
            document.getElementById('BussAssociate').style.left=xp + 276 + "px";
            document.getElementById('BussAssociate').style.top=yp - 681  + "px";
        }
        else
        {
           document.getElementById('BussAssociate').style.left=xp + 276 + "px";
          // document.getElementById('BussAssociate').style.top=yp - 581  + "px";
          document.getElementById('BussAssociate').style.top=yp - 753  + "px";
        }
            
} 



function FAQDataDisp(Opt)
{

if(document.getElementById("FAQQuest"+Opt).style.display=="inline")
{
  document.getElementById("FAQQuest"+Opt).style.display="none";
  document.getElementById(Opt).src=HostAddressInJSfileForPages+"/App_Themes/Common/images/PlusHome.gif";
}
else
{
  CloseAllFAQDataDisp();
  document.getElementById("FAQQuest"+Opt).style.display="inline";
  document.getElementById(Opt).src=HostAddressInJSfileForPages+"/App_Themes/Common/images/MinusHome.gif";
}
}
function CloseAllFAQDataDisp()
{
 for(var i=1;i<=60;i++)
    {
    
    if (document.getElementById("FAQQuest"+i))
    {
    document.getElementById("FAQQuest"+i).style.display="none";
    document.getElementById(i).src=HostAddressInJSfileForPages+"/App_Themes/Common/images/PlusHome.gif";
    }
    }
}



function SetMarqueeSpeed(UpDown,MarqueeID,PlusImgID,MinusImgID,Opt)
{
if ((UpDown=="UP") && (document.getElementById(MarqueeID).scrollAmount<10))
{
document.getElementById(MarqueeID).scrollAmount = document.getElementById(MarqueeID).scrollAmount + 1;
}
if ((UpDown=="DOWN") && (document.getElementById(MarqueeID).scrollAmount>1))
{
document.getElementById(MarqueeID).scrollAmount = document.getElementById(MarqueeID).scrollAmount - 1;
}

document.getElementById(PlusImgID).alt=' «« +'+ document.getElementById(MarqueeID).scrollAmount;
document.getElementById(MinusImgID).alt=' «« -'+ document.getElementById(MarqueeID).scrollAmount;

}


function OpenCloseCommonGlobalTab(TabName,Opt)
{
if(document.getElementById(TabName).style.display=="inline")
{
  document.getElementById(TabName).style.display="none";
}
else
{
  document.getElementById(TabName).style.display="inline";
}
}





function GetIDfrompagename(SecType)
{

 var ig_a=document.location.href;	
   ig_a= ig_a.toUpperCase(); 	
     ig_a= ig_a.replace('?','/'); 	
    
    var ig_b=ig_a.split("/");	
    var ig_f="";
     for(var ig_c=0;ig_c<ig_b.length;ig_c++)
    {
    var ig_d=ig_b[ig_c].indexOf(".ASPX");
    if(ig_d==-1)continue;
    ig_f=ig_b[ig_c];
    ig_f=_trim(ig_f);	
     }


  SecType= SecType.toUpperCase(); 


     var  StrID="";
  switch(SecType)
         {
       
         case "EQUITY": 
         StrID=GetEQUITYPageID(ig_f);
         break;
         case "DERIVATIVES": 
         StrID=GetDERIVATIVESPageID(ig_f);
         break;
         case "MF": 
         StrID=GetMFPageID(ig_f);
         break;
         case "COMMODITY": 
         StrID=GetCOMMODITYPageID(ig_f);
         break;
         case "IPO": 
         StrID=GetIPOPageID(ig_f);
         break;
         case "CUSTCARE": 
         StrID=GetCCIDfrompagename();
         break;
         case "INSURANCE": 
         StrID=GetInsuranceIDfrompagename();
         break;
         case "RESEARCH": 
         StrID=GetResearchIDfrompagename();
         break;
          case "CURRENCY": 
         StrID=GetCurrencyIDfrompagename();
         break;



         default: 
         StrID="";

         }
         
         return StrID;
}


function GetIPOPageID(ig_f)
{
        var  PageName = new Array();
        var IFID="";
          
        PageName[1] = "initial-public-offering.aspx";
        PageName[2] = "ipo-open-issues.aspx";
        PageName[3] = "closed-ipo.aspx";
        PageName[4] = "ipo-stock.aspx";
        PageName[5] = "ipo-listing.aspx";
        PageName[6] = "ipo-withdrawal.aspx";
        PageName[7] = "ipo-review.aspx";
        PageName[8] = "ipo-top-losers.aspx";
        PageName[9] = "ipo-days-movement.aspx";
        PageName[10] = "ipo-market.aspx";
        PageName[11] = "ipo-average-price.aspx";
        PageName[12] = "best-ipo.aspx";
        PageName[13] = "ipo-analysis.aspx";
        PageName[14] = "ipos-calendar.aspx"; 
        PageName[15] = "ipo-news.aspx";
        PageName[16] = "ipo-allotment.aspx";
        PageName[17] = "ipo-draft-prospectus.aspx";
        PageName[18] = "top-value-ipo.aspx";
        PageName[19] = "top-volume-ipo.aspx";
        PageName[21] = "ipo-glossary.aspx";
        PageName[22] = "ipo-faqs.aspx";
      
        for (var i=1;i<=30;i++)
        {
             if (((PageName[i]!=null) && (PageName[i]!=""))&& (PageName[i].toUpperCase()==ig_f))
           {
             IFID = i;
            }
        }

       return IFID;
}




function GetEQUITYPageID(ig_f)
{
        var  PageName = new Array();
        var IFID="";
          
       PageName[1] = "gainers-losers.aspx";
        PageName[2] = "real-time-quotes.aspx";
        PageName[3] = "buy-sell-shares.aspx";
        PageName[4] = "circuit-breakers.aspx";
        PageName[5] = "market-value-toppers.aspx";
        PageName[6] = "new-high-low.aspx";
        PageName[7] = "company-historical-prices.aspx";
        PageName[8] = "lifetime-high-low.aspx";
        PageName[9] = "high-low.aspx";
        PageName[10] = "exchange-turnover.aspx";
        PageName[11] = "volume-toppers.aspx";
        PageName[12] = "highest-lowest-delivery.aspx";
        PageName[13] = "unusual-delivery.aspx";
        PageName[14] = "unusual-volume.aspx";
        PageName[15] = "bulk-block-deals.aspx";
        PageName[16] = "exchange-volume.aspx";
        PageName[17] = "stock-market-analysis.aspx";
        PageName[18] = "nifty-sensex.aspx";
        PageName[19] = "index-weightage-analysis.aspx";
        PageName[20] = "indian-indices.aspx";
        PageName[21] = "stock-profit-report.aspx";
        PageName[22] = "stock-income-report.aspx";
        PageName[23] = "fii-activities.aspx";
        PageName[24] = "mutual-fund-activities.aspx";
        PageName[25] = "adr-prices.aspx";
        PageName[26] = "gdr-prices.aspx";
        PageName[27] = "forex-trading.aspx";
        PageName[28] = "bullion-rates.aspx";
        PageName[29] = "crude-oil-prices.aspx";
        PageName[30] = "world-indices.aspx";
        PageName[31] = "bse-nse-corporate-action.aspx";
        PageName[32] = "corporate-book-closures.aspx";
        PageName[33] = "corporate-board-meetings.aspx";
        PageName[34] = "bonus-issue.aspx";
        PageName[35] = "dividend-details.aspx";
        PageName[36] = "corporate-right-issues.aspx";
        PageName[37] = "corporate-results.aspx";
        PageName[39] = "company-delisted-shares.aspx";
        PageName[40] = "split-face-value.aspx";
        PageName[41] = "change-of-name.aspx";
        PageName[42] = "corporate-mergers.aspx";
        PageName[43] = "corporate-demergers.aspx";
        PageName[44] = "exchange-holidays.aspx";
        PageName[45] = "online-stock-market.aspx";
        PageName[46] = "stock-market-news.aspx";
        PageName[48] = "hot-stock-quote.aspx";
        PageName[49] = "stock-exchange-alerts.aspx";
        PageName[50] = "fii-position-news.aspx";
        PageName[51] = "economy-news.aspx";
        PageName[52] = "corporate-news.aspx";
        PageName[53] = "corporate-results-news.aspx";
        PageName[55] = "political-news.aspx";
        PageName[57] = "foreign-market-news.aspx";
        PageName[58] = "f-o-trading-news.aspx";
        PageName[59] = "commodity-news.aspx";
        PageName[61] = "ipo-market-news.aspx";
        PageName[62] = "mutual-funds-news.aspx";
        PageName[95] = "other-market-news.aspx";
        PageName[64] = "get-quote.aspx";
        PageName[65] = "stock-quotes.aspx";
        PageName[66] = "company-background.aspx";
        PageName[67] = "company-board-members.aspx";
        PageName[69] = "company-locations.aspx";
        PageName[70] = "company-capital-structure.aspx";
        PageName[71] = "company-products.aspx";
        PageName[72] = "company-raw-materials.aspx";
        PageName[73] = "company-bankers-auditors.aspx";
        PageName[93] = "mf-holdings-shares.aspx";
        PageName[47] = "company-news.aspx";
        PageName[63] = "peer-companies-news.aspx";
        PageName[74] = "profit-and-loss.aspx";
        PageName[75] = "financial-balance-sheet.aspx";
        PageName[76] = "cash-flow.aspx";
        PageName[77] = "financial-ratios.aspx";
        PageName[78] = "share-holdings-pattern.aspx";
        PageName[79] = "company-results.aspx";
        PageName[80] = "half-yearly-result.aspx ";
        PageName[81] = "nine-months-result.aspx ";
        PageName[82] = "annual-result.aspx";
        PageName[83] = "quick-review.aspx";
        PageName[84] = "equity-directors-report.aspx";
        PageName[85] = "company-auditor-report.aspx";
        PageName[86] = "notes-to-account.aspx";
        PageName[87] = "company-accounting-policies.aspx";
        
        PageName[88] = "equity-glossary.aspx";
        PageName[89] = "equity-faqs.aspx";
        
        PageName[94] = "equity-sector-watch.aspx";
        PageName[96] = "technical-trading-analysis.aspx";

        PageName[101] = "bse-nse-announcements.aspx";	
        PageName[102] = "company-book-closures.aspx";	
        PageName[103] = "company-board-meetings.aspx";	
        PageName[104] = "bonus-issues.aspx";		
        PageName[105] = "company-dividend-details.aspx";
        PageName[106] = "company-right-issues.aspx";
        PageName[107] = "company-name-change.aspx";	
					

      
        for (var i=1;i<=110;i++)
        {
             if (((PageName[i]!=null) && (PageName[i]!=""))&& (PageName[i].toUpperCase()==ig_f))
           {
             IFID = i;
            }
        }
        
        
               if ((ig_f=="NSE-BSE-GAINERS-LOSERS.ASPX") ||(ig_f=="BSE-NSE-GAINERS-LOSERS.ASPX"))
             {
             IFID = "1";
             }
             
               if ((ig_f=="NSE-BSE-MARKET-VALUE-TOPPERS.ASPX") ||(ig_f=="BSE-NSE-MARKET-VALUE-TOPPERS.ASPX"))
             {
             IFID = "5";
             }
             
                   if ((ig_f=="NSE-BSE-VOLUME-TOPPERS.ASPX") ||(ig_f=="BSE-NSE-VOLUME-TOPPERS.ASPX"))
             {
             IFID = "11";
             }
             
             

       return IFID;
}


function GetDERIVATIVESPageID(ig_f)
{
        var  PageName = new Array();
        var IFID="";
          
   PageName[1] = "derivatives-quotes.aspx";
        PageName[2] = "nifty-futures-trading.aspx";
        PageName[3] = "fii-statistics-india.aspx";
        PageName[4] = "put-call-ratio.aspx";
        PageName[5] = "most-active-calls.aspx";
        PageName[6] = "most-active-puts.aspx";
        PageName[7] = "derivative-underlying.aspx";
        PageName[8] = "daily-settlement-price.aspx";
        PageName[9] = "derivative-summary.aspx";
        PageName[10] = "derivatives-news.aspx";
        PageName[11] = "derivatives-top-gainers.aspx";
        PageName[12] = "derivatives-top-losers.aspx";
        PageName[13] = "derivatives-top-value.aspx";
        PageName[14] = "derivatives-top-volume.aspx";
        PageName[15] = "market-futures.aspx";
        PageName[16] = "derivatives-futures-contracts.aspx";
        PageName[18] = "derivatives-overview.aspx";
        PageName[19] = "pl-and-oi-overview.aspx";
        PageName[20] = "open-interest.aspx";
        PageName[21] = "derivative-future-overview.aspx";
        PageName[22] = "derivatives-glossary.aspx";
        PageName[23] = "derivatives-basics.aspx";

      
        for (var i=1;i<=30;i++)
        {
             if (((PageName[i]!=null) && (PageName[i]!=""))&& (PageName[i].toUpperCase()==ig_f))
           {
             IFID = i;
            }
        }

       return IFID;
}



function GetMFPageID(ig_f)
{
        var  PageName = new Array();
        var IFID="";
          
   PageName[1] = "mutual-fund-nav.aspx";
        PageName[2] = "mutual-fund-nav-history.aspx";
        PageName[3] = "mutual-fund-nfo.aspx";
        PageName[4] = "forthcoming-mutual-funds.aspx";
        PageName[5] = "best-funds.aspx";
        PageName[6] = "top-fund.aspx";
        PageName[7] = "mutual-funds-activity.aspx";
        PageName[8] = "mutual-fund-dividends.aspx";
        PageName[9] = "mutual-fund-dividend-history.aspx";
        PageName[10] = "bonus-declaration.aspx";
        PageName[12] = "fund-performance.aspx";
        PageName[13] = "mutual-fund-performance.aspx";
        PageName[14] = "compare-mutual-funds.aspx";
        PageName[15] = "compare-funds.aspx";
        PageName[16] = "fund-ranking.aspx";
        PageName[18] = "funds-performance.aspx";
        PageName[19] = "returns-calculator.aspx";
        PageName[20] = "fund-ranking-calculator.aspx";
        PageName[21] = "mf-sip-calculator.aspx";
        PageName[22] = "company-tracker.aspx";
        PageName[23] = "mutual-fund-information.aspx";
        PageName[24] = "mutual-funds-aum.aspx";
        PageName[26] = "aum.aspx";
        PageName[27] = "top-funds.aspx";
        PageName[28] = "fund-scheme-information.aspx";
        PageName[29] = "mutual-funds-scheme.aspx";
        PageName[30] = "mutual-fund-portfolio.aspx";
        PageName[31] = "mf-portfolio-composition.aspx";
        PageName[34] = "mf-rolling-return-chart.aspx";
        PageName[35] = "buy-sell-mutualfunds.aspx";
        PageName[36] = "mf-least-volatile-schemes.aspx";
        PageName[37] = "best-mutual-funds.aspx";
        PageName[38] = "fund-news.aspx";                    
        
        PageName[39] = "mutual-fund-glossary.aspx";  
        PageName[40] = "mutual-funds-basics.aspx";  
        PageName[41] = "mutual-funds-tax-implications.aspx";  
        PageName[42] = "pan-kyc-circulation.aspx";  

        for (var i=1;i<=50;i++)
        {
             if (((PageName[i]!=null) && (PageName[i]!=""))&& (PageName[i].toUpperCase()==ig_f))
           {
             IFID = i;
            }
        }

       return IFID;
}



function GetCOMMODITYPageID(ig_f)
{
        var  PageName = new Array();
        var IFID="";
          
  PageName[1] = "commodities-today.aspx";
        PageName[2] = "commodities-top-gainers.aspx";
        PageName[3] = "commodities-top-losers.aspx";
        PageName[4] = "commodities-top-volume.aspx";
        PageName[5] = "commodities-top-value.aspx";
        PageName[6] = "commodity-market-trading.aspx";
        PageName[7] = "commodities-prices.aspx";
        PageName[8] = "commodities-index-watch.aspx";
        PageName[9] = "commodities-charts.aspx";
        PageName[10] = "commodities-information.aspx";
        PageName[11] = "commodities-product-info.aspx";
        PageName[12] = "commodities-product-notes.aspx";
        PageName[17] = "commodities-statistics.aspx";
        PageName[20] = "commodities-exchange-turnover.aspx";
        PageName[21] = "commodity-open-interest.aspx";
        PageName[23] = "commodities-closing-prices.aspx";
        PageName[24] = "commodities-spot-prices.aspx";
        PageName[28] = "commodities-news.aspx";
       
        PageName[32] = "commodities-glossary.aspx";
        PageName[33] = "commodity-trading-basics.aspx";   

        for (var i=1;i<=100;i++)
        {
             if (((PageName[i]!=null) && (PageName[i]!=""))&& (PageName[i].toUpperCase()==ig_f))
           {
             IFID = i;
            }
        }

       return IFID;
}



function GetInsuranceIDfrompagename()
{
      
      
      
 var ig_a=document.location.href;	
   ig_a= ig_a.toUpperCase(); 	
     ig_a= ig_a.replace('?','/'); 	
    
    var ig_b=ig_a.split("/");	
    var ig_f="";
     for(var ig_c=0;ig_c<ig_b.length;ig_c++)
    {
    var ig_d=ig_b[ig_c].indexOf(".ASPX");
    if(ig_d==-1)continue;
    ig_f=ig_b[ig_c];
    ig_f=_trim(ig_f);	
     }
      
      
        var  PageName = new Array();
        var IFID="";
          
        PageName[1] = "life-insurance-investment.aspx" ;             
		PageName[2] = "life-insurance-charges.aspx"     ;            
		PageName[3] = "life-insurance-premium.aspx"      ;           
		PageName[4] = "life-insurance-riders.aspx"        ;          
		PageName[5] = "insurance-premium-underwritten.aspx";         
		PageName[6] = "insurance-general-exclusion.aspx"    ;        
		PageName[7] = "life-insurance-latest-nav.aspx"       ;       
		PageName[8] = "insurance-historical-nav.aspx"         ;      
		PageName[9] = "life-insurance-portfolio.aspx"          ;     
		PageName[10] = "compare-insurance-policy.aspx"           ;    
		PageName[11] = "compare-policy-return.aspx"               ;   
		PageName[12] = "insurance-policy-return.aspx"              ;  
		PageName[13] = "ulip-performance.aspx"                      ; 
		PageName[14] = "insurance-snapshot.aspx"                     ;
		PageName[15] = "insurance-company-profile.aspx"              ;
		PageName[16] = "insurance-company-address.aspx"              ;
		PageName[21] = "general-insurance-features.aspx"             ;
		PageName[23] = "general-insurance-advantages.aspx"           ;
		PageName[24] = "general-insurance-coverage.aspx"             ;
		PageName[25] = "insurance-claim-services.aspx"               ;
		PageName[26] = "general-insurance-policy-extension.aspx"     ;
		PageName[27] = "general-insurance-exclusion.aspx"            ;
		PageName[28] = "general-insurance-other-features.aspx"       ;

    

        for (var i=1;i<=50;i++)
        {
             if (((PageName[i]!=null) && (PageName[i]!=""))&& (PageName[i].toUpperCase()==ig_f))
           {
             IFID = i;
            }
        }

       return IFID;
}


function GetResearchIDfrompagename()
{
      
 var ig_a=document.location.href;	
   ig_a= ig_a.toUpperCase(); 	
     ig_a= ig_a.replace('?','/'); 	
    
    var ig_b=ig_a.split("/");	
    var ig_f="";
     for(var ig_c=0;ig_c<ig_b.length;ig_c++)
    {
    var ig_d=ig_b[ig_c].indexOf(".ASPX");
    if(ig_d==-1)continue;
    ig_f=ig_b[ig_c];
    ig_f=_trim(ig_f);	
     }
      
      
        var  PageName = new Array();
        var IFID="";
          
PageName[1]="equity-analysis.aspx";
PageName[2]="online-equity-research.aspx";
PageName[3]="equity-stock-report.aspx";
PageName[4]="sector-analysis-report.aspx";
PageName[5]="derivatives-daily.aspx";
PageName[6]="commodity-analysis.aspx";
PageName[7]="commodities-morning-mantra.aspx";
PageName[8]="commodities-afternoon-mantra.aspx";
PageName[9]="commodities-evening-mantra.aspx";
PageName[10]="commodities-updates.aspx";
PageName[11]="trading-opportunity-report.aspx";
PageName[12]="dgcx-daily-report.aspx";
PageName[13]="currency-analysis.aspx";
PageName[14]="currency-analysis-report.aspx";
PageName[15]="ipo-research.aspx";
PageName[16]="mutual-fund-analysis.aspx";
PageName[17]="mutual-fund-tracker.aspx";
PageName[18]="mutual-fund-updates.aspx";
PageName[19]="stock-portfolio-monitor.aspx";
PageName[20]="debt-market-overview.aspx";
PageName[21]="special-reports.aspx";
PageName[22]="pre-budget-analysis.aspx";
PageName[23]="post-budget-analysis.aspx";
PageName[24]="research-newsletter.aspx";
PageName[25]="fund-research-report.aspx";



       
    

        for (var i=1;i<=50;i++)
        {
             if (((PageName[i]!=null) && (PageName[i]!=""))&& (PageName[i].toUpperCase()==ig_f))
           {
             IFID = i;
            }
        }

       return IFID;
}



function GetCurrencyIDfrompagename()
{
var ig_a=document.location.href;	
   ig_a= ig_a.toUpperCase(); 	
     ig_a= ig_a.replace('?','/'); 	
    
    var ig_b=ig_a.split("/");	
    var ig_f="";
     for(var ig_c=0;ig_c<ig_b.length;ig_c++)
    {
    var ig_d=ig_b[ig_c].indexOf(".ASPX");
    if(ig_d==-1)continue;
    ig_f=ig_b[ig_c];
    ig_f=_trim(ig_f);	
     }
      
      
        var  PageName = new Array();
        var IFID="";
          
        PageName[51] = "nse-currency-futures.aspx";
        PageName[52] = "currency-futures-quotes.aspx";
        PageName[53] = "currency-top-volume.aspx";
        PageName[54] = "currency-top-value.aspx";
        PageName[55] = "currency-open-interest.aspx";
        PageName[56] = "currency-chart.aspx";
        PageName[57] = "currency-spot-chart.aspx";
        PageName[58] = "mcx-currency-futures.aspx";
        PageName[59] = "currencies-top-volume.aspx";
        PageName[60] = "currencies-open-interest.aspx"; 
        PageName[61] = "Spot-Prices.aspx";   
        PageName[62] = "Product-Specifications.aspx";  
        for (var i=51;i<=62;i++)
        {
             if (((PageName[i]!=null) && (PageName[i]!=""))&& (PageName[i].toUpperCase()==ig_f))
           { 
             IFID = i;
            }
        }

       return IFID;
}
