﻿var message="";
function clickIE() 
{if (document.all)
{(message);return false;}} 
function clickNS(e) {
if
(document.layers||(document.getElementById&&!document.all))
{
if (e.which==2||e.which==3) {(message);return false;}}}
if (document.layers)
{document.captureEvents(Event.MOUSEDOWN);document.  onmousedown=clickNS;}
else
{document.onmouseup=clickNS;document.oncontextmenu  =clickIE;} 
document.oncontextmenu=new Function("return false")
function open_win(url_add,width,height)
   {
   window.open(url_add,'ENAM','width='+width+',height='+height+',menubar=no,status=no,location=no,toolbar=no,scrollbars=no');
   }

function selecttab(tabname)
   { 
   try
   {
        document.getElementById("li_home").className="";
        document.getElementById("li_aboutus").className="";
        document.getElementById("li_mutual").className="";
        document.getElementById("li_insurance").className="";
        document.getElementById("li_broking").className="";
        document.getElementById("li_primary").className="";
        document.getElementById("li_wealth").className="";
        document.getElementById("li_research").className="";
        document.getElementById("li_customer").className="";
        
        document.getElementById("u_home").style.display="none";
        document.getElementById("u_aboutus").style.display="none";
        document.getElementById("u_mutual").style.display="none";
        document.getElementById("u_insurance").style.display="none";
        document.getElementById("u_broking").style.display="none";
        document.getElementById("u_primary").style.display="none";
        document.getElementById("u_wealth").style.display="none";
        document.getElementById("u_research").style.display="none";
        document.getElementById("u_customer").style.display="none";
        if(tabname == "aboutus")
        {
            
            document.getElementById("li_aboutus").className="sel";         
            document.getElementById("u_aboutus").style.display="inline";
                     
        }
          if(tabname == "customer")
        {
            
            document.getElementById("li_customer").className="sel";         
            document.getElementById("u_customer").style.display="inline";
                     
        }
        
        if(tabname == "home")
        {
            document.getElementById("li_home").className="sel";
            document.getElementById("u_home").style.display="inline";
        }
        if (tabname == "wealth")
        {
           document.getElementById("li_wealth").className="sel";
            document.getElementById("u_wealth").style.display="inline";
        }
        if (tabname == "primary")
        {
           document.getElementById("li_primary").className="sel";
           document.getElementById("u_primary").style.display="inline";
        }
        
        if(tabname == "broking")
        {
            document.getElementById("li_broking").className="sel";
            document.getElementById("u_broking").style.display="inline";
        }
     
        
        if(tabname == "mutual")
        {
         
            document.getElementById("li_mutual").className="sel";
            //document.getElementById("sNav").style.display="inline";
            document.getElementById("u_mutual").style.display="inline";
           
        }
        
        if(tabname == "insurance")
        {
            document.getElementById("li_insurance").className="sel";
           // document.getElementById("sNav").style.display="inline";
            document.getElementById("u_insurance").style.display="inline";
        }
        
        if(tabname == "research")
        {
            document.getElementById("li_research").className="sel";
            document.getElementById("u_research").style.display="inline";
        }
        
      }
        catch(e)
        {
        }
   }
   
    function selectmenu()
    {
    var loc=window.location.href;
    if(loc.indexOf("research")!= -1)
    {selecttab('research')}
    if(loc.indexOf("customerservices")!= -1 || loc.indexOf("registered-office.aspx")!= -1)
    {selecttab('customer')}
    if(loc.indexOf("wealthmanagement")!= -1)
    {selecttab('wealth')}
    if(loc.indexOf("mutualfund")!= -1)
    {selecttab('mutual')} 
    if(loc.indexOf("insurance")!= -1 || loc.indexOf("nonlife-insurance")!= -1 || loc.indexOf("life-insurance")!= -1 )
    {selecttab('insurance')} 
     if(loc.indexOf("broking")!= -1 ||loc.indexOf("commodity")!= -1 || loc.indexOf("news")!= -1 ||loc.indexOf("currency")!= -1 || loc.indexOf("derivatives")!= -1  || loc.indexOf("markethome.aspx")!= -1 || loc.indexOf("equity-tools-planners.aspx")!= -1  || loc.indexOf("company-profile")!= -1||   loc.indexOf("market")!= -1 ||   loc.indexOf("tools")!= -1)
    {selecttab('broking')}
    if(loc.indexOf("ipo")!= -1 || loc.indexOf("primarymarket")!= -1  || loc.indexOf("debt")!= -1)
    {selecttab('primary')}
     if(loc.indexOf("aboutus")!= -1)
    {selecttab('aboutus')}
    }

 
function getheading_cookie(Name) {
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
// if cookie exists
if (offset != -1) { 
offset += search.length
// set index of beginning of value
end = document.cookie.indexOf(";", offset);
// set index of end of cookie value
if (end == -1) end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
}
}
return returnvalue;
}

function send(c,e){document.getElementById('hdnc_mypage').value=c;document.getElementById('hdne_mypage').value=e;
if(document.aspnetForm)
{
if(c!="" && e!="")
document.aspnetForm.action='https://pftracker.enamdirect.in/pms/index.aspx';
else document.aspnetForm.action='https://e-ipo.enamdirect.in/sso/ssologin.aspx';
 document.aspnetForm.submit();
 }
 else
 {
 if(c!="" && e!="")
document.form1.action='https://pftracker.enamdirect.in/pms/index.aspx';
else document.form1.action='https://e-ipo.enamdirect.in/sso/ssologin.aspx';
 document.form1.submit();
 }
 }
 
 function OpenPop(strId, strCustName)
{
    if(strId=='')
    document.location='https://e-ipo.enamdirect.in/sso/ssologin.aspx?flag=pf';
    else
    window.open('../research/redirectpf.aspx?str1=' + strId + '&str2=' + strCustName ,'','fullscreen=yes,toolbar=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=800,height=700,left=100,top=100,screenX=100,screenY=100');
}