//Google Analytics 23 Aug 2010
  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-4311385-1']);
  _gaq.push(['_setDomainName', '.equitymaster.com']);
  _gaq.push(['_trackPageview']);
  _gaq.push(['_trackPageLoadTime']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();
//Google Analytics 23 Aug 2010

///ANY CHANGE IN GOOGLE ANALYTICS CODE, ALSO CHANGE PTOCT09.JS AND PTOCT09MIN.JS AND HOMEJS.JS

function MenuBuild(section,displayText,linkUrl)
{
	this.section = section;
	this.displayText = displayText;
	this.linkUrl = linkUrl;
}

var mainMenu = new Array(10);
var subMenu = new Array();

mainMenu[0] = new MenuBuild("Home","Home","/");
mainMenu[1] = new MenuBuild("Markets","Today\'s&nbsp;Market","/tm");
mainMenu[2] = new MenuBuild("Premium","Premium&nbsp;Services","/ptmail");
mainMenu[3] = new MenuBuild("Learning","Learning","http://learning.equitymaster.com/");
mainMenu[4] = new MenuBuild("Researchit","Research&nbsp;it","/research-it/");
mainMenu[5] = new MenuBuild("Outlook","Outlook&nbsp;Arena","/outlook/index.asp");
mainMenu[6] = new MenuBuild("Portfolio","Portfolio&nbsp;Tracker","/portfolio/");
mainMenu[7] = new MenuBuild("Video","Video","/websummit/register.asp?wsid=16&aff=Menu");
mainMenu[8] = new MenuBuild("Mobile","Mobile","/mobile");
mainMenu[9] = new MenuBuild("Help","Help","/help/sitemap.html");


function menuBuild1(section,displayText,linkUrl)
{
	this.section = section;
	this.displayText = displayText;
	this.linkUrl = linkUrl;
}


subMenu[0] = new menuBuild1("Home","LARGE CAP","/qv")
subMenu[1] = new menuBuild1("Home","MID CAP","/mc")
subMenu[2] = new menuBuild1("Home","SMALL CAP","/htr")
subMenu[3] = new menuBuild1("Home","RESEARCHPRO","/research-it/rr")
subMenu[4] = new menuBuild1("Home","WEALTH ALLIANCE","/pwa")
subMenu[5] = new menuBuild1("Home","VALUEPRO","/ValuePro")
subMenu[6] = new menuBuild1("Home","MUTUAL FUNDS","/outsideview/strategic-fund")
subMenu[7] = new menuBuild1("Home","DERIVATIVES","/outsideview/lucrative-derivatives/")
subMenu[8] = new menuBuild1("Home","IPOs","/research-it/ipo")
subMenu[9] = new menuBuild1("Home","<img src='http://www.eqimg.com/images/white_space.gif' border='0' align='absmiddle' height='11' width='11' style='width:11px;height:11px;background-image:url(http://www.eqimg.com/images/homesp.png);background-position:-10px -81px;background-repeat:no-repeat no-repeat;'> FEATURES","/subsearch.asp")
subMenu[10] = new menuBuild1("Markets","ADRs","/stockquotes/adr.asp")
subMenu[11] = new menuBuild1("Markets","BSE REPLICA","/india-markets/bse-replica.asp")
subMenu[12] = new menuBuild1("Markets","NSE REPLICA","/india-markets/nse-replica.asp")
subMenu[13] = new menuBuild1("Markets","FII INFO","/india-markets/fiis/index.asp")
subMenu[14] = new menuBuild1("Markets","BUY BACKS / OPEN OFFERS","/stockquotes/mkt-stats/openoffer.asp")
subMenu[15] = new menuBuild1("Markets","MARKET STATS","/stockquotes/mkt-stats/")
subMenu[16] = new menuBuild1("Markets","INDICES","/stockquotes/indices/")
subMenu[17] = new menuBuild1("Researchit","COMPANY INFO","/research-it/")
subMenu[18] = new menuBuild1("Researchit","COMPARE COMPANY","/research-it/compare")
subMenu[19] = new menuBuild1("Researchit","SECTOR INFO","/research-it/sector-info/")
subMenu[20] = new menuBuild1("Researchit","ECONOMY","/research-it/india-economy/")
subMenu[21] = new menuBuild1("Portfolio","REGISTER","/portfolio/register.html")
subMenu[22] = new menuBuild1("Portfolio","DEMO","/portfolio/sample.html")
subMenu[23] = new menuBuild1("Portfolio","PORTFOLIO","/portfolio/index.asp")
//subMenu[21] = new menuBuild1("Portfolio","WATCHLIST","http://www.personalfn.com/research-it/mutual-funds/watchlist/")
subMenu[24] = new menuBuild1("Portfolio","HELP","/portfolio/startup.html")
subMenu[25] = new menuBuild1("Portfolio","TERMS OF USE","/portfolio/legal.html")
subMenu[26] = new menuBuild1("Outlook","VIEWS ON NEWS","/outlook/weekly.asp")
//subMenu[26] = new menuBuild1("Outlook","SPECIAL REPORT","/outlook/Archives.ASP?h_Type=7&start=1")
//subMenu[27] = new menuBuild1("Outlook","FACE TO FACE","/outlook/Archives.ASP?h_Type=8&start=1")
subMenu[27] = new menuBuild1("Outlook","THE OUTSIDE VIEW","/OutsideView/moreview.asp")
subMenu[28] = new menuBuild1("Outlook","THE HONEST TRUTH","/ht")
subMenu[29] = new menuBuild1("Outlook","STRAIGHT FROM THE HIP","/sfth")
subMenu[30] = new menuBuild1("Outlook","THE 5 MINUTE WRAPUP","/5MinWrapUp") 
subMenu[31] = new menuBuild1("Outlook","THE DAILY RECKONING","/DailyReckoning") 
subMenu[32] = new menuBuild1("Help","SITEMAP","/help/sitemap.html")
subMenu[33] = new menuBuild1("Help","HOW TO REACH US","/help/writetous.html")
subMenu[34] = new menuBuild1("Help","ADVERTISING INFO","/help/advertise.html")
subMenu[35] = new menuBuild1("Help","LEGAL","/help/legal.html")
subMenu[36] = new menuBuild1("Help","ABOUT US","/help/aboutus.html")
subMenu[37] = new menuBuild1("Video","REGISTER","/websummit/register.asp?wsid=16&aff=Menu")
subMenu[38] = new menuBuild1("Video","ARCHIVES","/websummit/websummit-archives-2011.html")
subMenu[39] = new menuBuild1("Mobile","MORE INFO","/mobile")
subMenu[40] = new menuBuild1("Learning","HOME","http://learning.equitymaster.com");
subMenu[41] = new menuBuild1("Learning","DERIVANTAGE","http://learning.equitymaster.com/derivantage");
subMenu[42] = new menuBuild1("Learning","LEARNING FORUM","http://learning.equitymaster.com/forum");

function dispMainMenu(sectionName)
{
    objXmlHttpMenu = null;
    objXmlHttpMenu = GetXmlHttpObj(null);
    objXmlHttpMenu.open("GET", "/newmenu.asp", false);
    objXmlHttpMenu.send(null);
    var sText = objXmlHttpMenu.responseText;
    if(sText.replace(" ","")=="")
    {
        displayNewMainMenu(sectionName, "", "", "", "", "")
    }
    else
    {
        var sTextArr = sText.split('~');
        displayNewMainMenu(sectionName, sTextArr[0], sTextArr[1], sTextArr[2], sTextArr[3], sTextArr[4])
    }
}

///initailises the Xml Http object as per the user's browser
function GetXmlHttpObj(handler)
{
	var objXHttp=null;

	if (navigator.userAgent.indexOf("MSIE")>=0 || navigator.userAgent.indexOf("Opera")>=0)
	{
	    if (window.XMLHttpRequest)
        {
            // code for all new browsers
            objXHttp=new XMLHttpRequest();
            if(handler!=null)
                objXHttp.onreadystatechange=handler;
            return objXHttp;
        }
        else if (window.ActiveXObject)
        {
            // code for IE5 and IE6
            objXHttp=new ActiveXObject("Microsoft.XMLHTTP");
            if(handler!=null)
                objXHttp.onreadystatechange=handler;
            return objXHttp;
        }

        if(objXHttp==null)
        {
	        var strName="Msxml2.XMLHTTP";
	        if (navigator.appVersion.indexOf("MSIE 5.5")>=0)
	        {
	            strName="Microsoft.XMLHTTP";
	        }
	        try
	        {
	            objXHttp=new ActiveXObject(strName);
	            if(handler!=null)
                    objXHttp.onreadystatechange=handler;
	            return objXHttp;
	        }
	        catch(e)
	        {
	            alert("Error. Scripting for ActiveX might be disabled");
	            return;
	        }
	    }
	}
	if (navigator.userAgent.indexOf("Mozilla")>=0)
	{
	    objXHttp=new XMLHttpRequest();
	    if(handler!=null)
	    {
            objXHttp.onload=handler;
	        objXHttp.onerror=handler;
	    }
	    return objXHttp;
	}
}//end of function GetXmlHttpObj(handler)

function displayNewMainMenu(sectionName, sName, sProducts, sLinks, sUserName, sPass)
{   
    document.write("<table cellspacing='0' cellpadding='0' border='0' width='100%'><tr><td style='width: 100%'><div id='outer'><ul id='nav'>")
	for(i=0; i < mainMenu.length; i++)
	{
		className = "";
			    
		if(mainMenu[i].section == sectionName)
			className = "current";

		var sMenuColor="";
        if(mainMenu[i].section=="Video")
            sMenuColor = " style='background-color:#cc0000'";

        document.write("<li class='" + className + "'" + sMenuColor + "><a href='" + mainMenu[i].linkUrl + "'>" + mainMenu[i].displayText + "</a>"+
                        "<ul style='width: 950px'>");
        
        if(mainMenu[i].section=="Premium")
            displayNewSubMenu("Home");
        else
            displayNewSubMenu(mainMenu[i].section);
                    
        document.write("</ul>"+
                    "</li>");
        if(i!=mainMenu.length - 1) //last menu
            document.write("<li><img src='http://www.eqimg.com/images/dividermenu.jpg' alt='' width='1' height='27' /></li>");
	}
	//document.write("<li class='nohover'>&nbsp;</li><li class='nohover' style='float:right;width:85px;padding-top:2px'></li>");
	document.write("<li class='nohover'>&nbsp;</li><li class='nohover' style='float:right;width:85px;padding-top:2px'><iframe allowtransparency='true' frameborder='0' scrolling='no' src='http://platform.twitter.com/widgets/follow_button.html?screen_name=Equitymaster&button=grey&link_color=ffffff&text_color=ffffff&show_count=false' style='width:60px; height:20px;'></iframe></li>");
	document.write("</ul><div id='subnavbg'></div></div></td></tr>")
	
	document.write("<tr style='height: 2px'><td></td></tr>");
	newMarketBand(sName, sProducts, sLinks, sUserName, sPass);
	document.write("</table>");
	//Code to track event in google analytics
    FB.Event.subscribe('edge.create', function(targetUrl) {
    _gaq.push(['_trackSocial', 'facebook', 'like', targetUrl]);
    });

    FB.Event.subscribe('edge.remove', function(targetUrl) {
    _gaq.push(['_trackSocial', 'facebook', 'unlike', targetUrl]);
    });
    //Code to track event in google analytics
}

function displayNewSubMenu(sectionName1)
{
    counter = ret(sectionName1)
    var k = 0;
    for(t=0; t<subMenu.length; t++)
    {
        if(subMenu[t].section == sectionName1)
        {
            var sClass="";
            if(k==counter - 1)   //last sub menu
                sClass = " class='final'";

            document.write("<li><a" + sClass + " href='" + subMenu[t].linkUrl + "'>" + subMenu[t].displayText + "</a></li>");
            if(k<counter - 1)    //not last sub menu
                document.write("<li style='color:#797979; font-size: 12px; padding-left: 3px; padding-right: 3px; padding-top: 1px;'>|</li>");
            
            k++;
        }
    }
}

function newMarketBand(sName, sProducts, sLinks, sUserName, sPass)
{
	document.write("<tr>"+
	                "<td class='menudown'>"+
	                    "<table cellpadding='0' cellspacing='0' width='100%'>"+
	                        "<tr valign='middle'>"+
	                        "   <form method='get' action='/getaquote.asp' name='Topquote'>"+
                	        "   <td style='width: 4px'>&nbsp;</td>"+
                            "   <td><input type='text' name='company' onfocus='javascript:this.form.company.value=\"\"' onblur=\"javascript:if(this.value=='')this.value='Quote';\" value='Quote' class='quoteinput' /></td>"+
                            "   <td style='width: 3px'></td>"+
                            "   <td style='display: none'>"+
                    	    "       <select name='Type' class='stockinput'>"+
                        	"           <option value='stock' selected='selected'>Stock</option>"+
                        	"           <option value='fund'>NAV</option>"+
                            "       </select>"+
                            "   </td>"+
                            "   <td style='width: 3px; display: none'>&nbsp;</td>"+
                            "   <td style='background-image:url(http://www.eqimg.com/images/homesp.png);background-position:-10px -133px;background-repeat:no-repeat no-repeat;'><a href='#' onclick='javascript:goTopQuote(document.Topquote)'><img src='http://www.eqimg.com/images/white_space.gif' alt='' border='0' height='20' width='23' /></a></td>"+
                            "   <td style='width: 9px'>&nbsp;</td>"+
                            "   </form>"+
                            "   <form method='get' action='/stockquotes/sector.asp' name='sector'>"+
                            "   <td>"+
                    	    "       <select name='sector' class='keystockinput' onchange='javascript:go1(this.form)'>"+
                        	"           <option value='0' selected>Key Sector Stocks</option>"+
							"           <option value='Gold'>Gold ETF</option>"+
	                        "           <option value='BSNX'>BSE Sensex</option>"+
	                        "           <option value='NIFTY'>NSE Nifty</option>"+
	                        "           <option value='-1'>Options Shortlist</option>"+
	                        "           <option value='Air'>Airlines</option>"+
	                        "           <option value='Aluminium'>Aluminium</option>"+
	                        "           <option value='Auto'>Automobiles</option>"+
	                        "           <option value='Autoc'>Auto Ancillaries</option>"+
	                        "           <option value='0,BANKPVT'>Banks (Private)</option>"+
	                        "           <option value='0,BANKPSU'>Banks (PSU)</option>"+
	                        "           <option value='Cement'>Cement</option>"+
	                        //"           <option value='Chemicals'>Chemicals</option>"+
	                        "           <option value='engg'>Engineering</option>"+
	                        "           <option value='energy'>Energy Sources</option>"+
	                        "           <option value='Fertilizer'>Fertilizer</option>"+
	                        "           <option value='Consprds'>FMCG</option>"+
	                        "           <option value='Food'>Food</option>"+
	                        "           <option value='Hotels'>Hotels</option>"+
	                        "           <option value='Finance'>Inv. &amp; Finance</option>"+
	                        //"           <option value='Logistics'>Logistics</option>"+
	                        "           <option value='Media'>Media</option>"+
	                        "           <option value='Mining'>Mining</option>"+
	                        "           <option value='0,MNC'>MNC</option>"+
	                        "           <option value='0,IPHARMA'>Indian Pharma</option>"+
	                        "           <option value='0,MPHARMA'>MNC Pharma</option>"+
	                        "           <option value='0,PSU'>PSU</option>"+
	                        "           <option value='Paint'>Paints</option>"+
	                        "           <option value='Paper'>Paper</option>"+	                        
	                        "           <option value='Power'>Power</option>"+
	                        "           <option value='construction'>Real Estate</option>"+
	                        "           <option value='retail'>Retailing</option>"+
	                        "           <option value='Ship'>Shipping</option>"+
	                        "           <option value='0,SOFTL'>Software (Large)</option>"+
	                        "           <option value='0,SOFTO'>Software (Others)</option>"+
	                        "           <option value='Steel'>Steel</option>"+
	                        "           <option value='Sugar'>Sugar</option>"+
	                        "           <option value='Telecom'>Telecom</option>"+
	                        "           <option value='Textiles'>Textiles</option>"+
	                        //"           <option value='Tyres'>Tyres</option>"+
	                        "           <option value='0,RBAJAJ'>Rahul Bajaj</option>"+	                        
	                        "           <option value='0,BIRLA'>A V Birla</option>"+
	                        "           <option value='0,AMBANI'>Mukesh Ambani</option>"+
	                        "           <option value='0,ADAE'>Anil Ambani</option>"+
	                        "           <option value='0,TATA'>Tata</option>"+
	                        //"           <option value='0,GODREJ'>Godrej</option>"+
	                        //"           <option value='0,SUNDARAM'>Sundaram</option>"+
	                        //"           <option value='0,MURUGAPPA'>Murugappa</option>"+
                            "       </select>"+
                            "   </td>"+
                            "   </form>"+
                            "   <td style='width: 8px'>&nbsp;</td>"+
                            "   <form action='http://www.equitymaster.com/search.html' name='csesearchbox' id='cse-search-box'>"+
                            "   <td>"+
                            "       <input type='hidden' name='cx' value='partner-pub-2960491319221583:qz2ueq-fcn2' />"+
	                        "       <input type='hidden' name='cof' value='FORID:9' /> "+
	                        "       <input type='hidden' name='ie' value='ISO-8859-1' />"+
                            "       <input type='text' name='q' value='' style='background-image:url(http://www.eqimg.com/images/homesp.png);background-position:-10px -10px;background-repeat:no-repeat no-repeat;' onfocus=\"javascript:this.style.backgroundImage='';\" onblur=\"javascript:if(this.value=='')this.style.backgroundImage='url(http://www.eqimg.com/images/homesp.png)';\" class='searchinput' />"+
                            "   </td>"+
                            "   <td style='width: 4px'>&nbsp;</td>"+
                            "   <td style='background-image:url(http://www.eqimg.com/images/homesp.png);background-position:-10px -133px;background-repeat:no-repeat no-repeat;'><a href='#' onclick='javascript:csesearchbox.submit();'><img src='http://www.eqimg.com/images/white_space.gif' alt='' border='0' height='20' width='23' /></a></td>"+
                            "   </form>"+
                            "   <td style='width: 10px'>&nbsp;</td>"+
                            "   <td class='textstock'><a href='/stockquotes/mystocks.asp'>MyStocks</a></td>"+
                            "   <td style='width: 64px'></td>");
    if(sName=="" || sName==null)
    {
        document.write("        <td class='memberslogin' style='width: 420px' align='right'><a href='#' onclick='javascript:showHomeLogin();return false;' style='color: #cc0000'>MEMBER'S LOGIN</a>&nbsp;&nbsp;"+
                            "       <div id='divLogin' style='position:relative; top:0; right:0; width: 240px; visibility: hidden; z-index: 1000'>"+
                            "           <div style='position: absolute; top: 10px; right: 0px; width: 100%; z-index: 1001; background-color: #e6e6e6'>"+
                            "               <table cellpadding='2' cellspacing='0' width='100%' style='border: solid 1px black'>"+
                            "                   <tr>"+
                            "                       <td></td>"+
                            "                       <td colspan='2' style='background-color: black; width: 96%'>"+
                            "                           <table cellspacing='0' cellpadding='0' border='0' width='100%'>"+
                            "                               <tr>"+
                            "                                   <td align='left' style='width: 80%; color: white; font-family: Arial; font-size: 14px'>MEMBER'S ARENA</td>"+
                            "                                   <td align='right' style='width: 20%; font-family: Arial; font-size: 14px; font-weight: bold'><a href='#' style='color: white; text-decoration: none' title='Close' onclick=\"javascript:showHomeLogin();return false;\">X</a>&nbsp;</td>"+
                            "                               </tr>"+
                            "                           </table>"+
                            "                       </td>"+
                            "                       <td></td>"+
                            "                   </tr>"+
                            "                    <tr>"+
                            "                       <td style='width: 2%'></td>"+
                            "                       <td align='left' style='font-size: 9pt; font-family: Arial; font-weight: bold; width: 48%'>&nbsp;&nbsp;Username</td>"+
                            "                       <td align='left' style='font-size: 9pt; font-family: Arial; font-weight: bold; width: 48%'>&nbsp;&nbsp;Password</td>"+
                            "                       <td style='width: 2%'></td>"+
                            "                   <tr>"+
                            "                       <td></td>"+
                            "                        <td align='left' style='font-size: 9pt; font-family: Arial; font-weight: bold'><input type='text' id='txtUsername' name='txtUsername' size='11' style='font-family: arial; font-size: 13px; color: Black;' />"+
                            "                       <td align='left' style='font-size: 9pt; font-family: Arial; font-weight: bold'><input type='password' id='txtPassword' name='txtPassword' size='11' style='font-family: arial; font-size: 13px; color: Black;' /></td>"+
                            "                       <td></td>"+
                            "                   </tr>"+
                            "                   <tr valign='bottom'>"+
                            "                       <td></td>"+                            
                            "                       <td colspan='2' align='left' style='font-size: 9pt; font-family: Arial;'>"+
                            "                           <input type='checkbox' name='chkRemberUsr' id='chkRemberUsr' />Remember Username"+
                            "                       </td>"+
                            "                       <td></td>"+                            
                            "                   </tr>"+                            
                            "                   <tr>"+
                            "                       <td></td>"+
                            "                       <td colspan='2' align='left'>"+
	                        "                            <select id='selType' name='selType' style='font-family: arial; font-size: 13px; color: Black; width: 168px'>"+
	                        "                               <option value='SelectOptional' selected='selected'>Select (Optional)</option>"+
	                        "                               <option value='htr'>Hidden Treasure</option>"+
	                        "                               <option value='tldr'>Lucrative Derivatives</option>"+
							"                               <option value='mc'>MidcapSelect</option>"+
				            "                               <option value='portfolio'>Portfolio Tracker</option>"+
				            "                               <option value='research-it'>ResearchPro</option>"+
	                        "                               <option value='qv'>StockSelect</option>"+
	                        "                               <option value='sfr'>Strategic Fund Report</option>"+
				            "                               <option value='valuepro'>ValuePro</option>"+
				            "                               <option value='pwa'>Wealth Alliance</option>"+				            
	                        "                               <option value='derivantage'>DeriVantage</option>"+
				            "                               <option value='forum'>Learning Forum</option>"+
	                        "                            </select>"+
	                        "                           <input type='button' value='Go' style='font-family: arial; font-size: 13px; color: Black; width: 38px' onclick='javascript:menuLoginAction(document.loginMenu);' />"+
                            "                       </td>"+
                            "                       <td></td>"+
                            "                   </tr>"+
                            "                   <tr>"+
                            "                       <td colspan='4' align='center' style='font-size: 9pt; font-family: Arial'><a href='/ptmail' style='color: #cc0000'>Sign Up</a> | <a href='/ptmail/for.asp?prd=PT' style='color: Black'>Forgot Password?</a>"+
                            "                       <form name='loginMenu' method='post' action='/Subscription/authenticate.aspx' style='display: none'>"+
                            "                            <input type='hidden' value='' name='username' />"+
                            "                           <input type='hidden' value='' name='password' />"+
                            "                           <input type='hidden' value='' name='Type' />"+
                            "                           <!-- myPlanner -->"+
                            "                           <input type='hidden' name='user name' />"+
                            "                           <!-- StockSelect / Research Reports -->"+
                            "                           <input type='hidden' name='user' />"+
                            "                           <input type='hidden' name='pass' />"+
                            "                           <input type='hidden' name='hdnURLTop' />"+
                            "                           <input type='hidden' id='rememberme' name='rememberme' />"+                            
                            "                        </form>"+
                            "                       </td>"+
                            "                   </tr>"+
                            "               </table>"+
                            "           </div>"+
                            "       </div>"+
                            "   </td>");
                            
                            //Birendra | 14-Sep-2010 | checking username cookie
                            c_name = "EQUSRNAME";
                            c_start=document.cookie.indexOf(c_name + "=");
                                 
                            if(c_start != -1)
                            {
                                c_start=c_start + c_name.length+1;
                                c_end=document.cookie.indexOf(";",c_start);
                                if (c_end==-1) c_end=document.cookie.length;
                                
                                document.getElementById('txtUsername').value = unescape(document.cookie.substring(c_start,c_end));
                                document.getElementById('chkRemberUsr').checked = true;
                            }                            
    }
    else
    {
        var sProds = sProducts.split(",");
        document.write("        <td class='memberslogin' style='width: 420px' align='right'>"+
                            "       <table cellspacing='0' cellpadding='0' border='0' width='100%'>"+
                            "           <tr>"+
                            "               <td align='right' style='width: 210px'>Welcome,&nbsp;<span style='font-weight: normal; font-style: italic'>" + sName + "</span>&nbsp;&nbsp;&nbsp;</td>"+
                          //"               <td align='left' style='width: 155px'><a href='#' onMouseOver=\"javascript:document.getElementById('divMySubs').style.display='';\" onMouseOut=\"javascript:document.getElementById('divMySubs').style.display='none';\" style='text-decoration: underline'>My Subscriptions</a>&nbsp;|&nbsp;<a href='logout.asp' style='color: black; text-decoration: underline'>Logout</a>&nbsp;&nbsp;"+
                            "               <td align='left' style='width: 210px'><a href='#' onMouseOver=\"javascript:document.getElementById('divMySubs').style.display='';\" onMouseOut=\"javascript:document.getElementById('divMySubs').style.display='none';\" style='text-decoration: underline'>My Subscriptions</a>&nbsp;|&nbsp;<a href='#' onMouseOver=\"javascript:document.getElementById('divManage').style.display='';\" onMouseOut=\"javascript:document.getElementById('divManage').style.display='none';\" style='text-decoration: underline'>Manage</a>&nbsp;|&nbsp;<a href='logout.asp' style='color: black; text-decoration: underline'>Logout</a>&nbsp;&nbsp;"+
					        "                   <div id='divMySubs' style='position:relative; top:0; right:0; width: 180px; z-index: 1000; display: none' onMouseOver=\"javascript:document.getElementById('divMySubs').style.display='';\" onMouseOut=\"javascript:document.getElementById('divMySubs').style.display='none';\">"+
                            "                       <div style='position: absolute; top: 0px; right: 0px; width: 100%; z-index: 1001; background-color: #eeeeee'>"+
                            "                           <table cellpadding='0' cellspacing='0' width='100%' height='5px'>"+
                            "                           </table>"+
                            "                           <table cellpadding='2' cellspacing='0' width='100%' style='border: solid 1px black'>");
       for(j=0; j<sProds.length; j++)
       {
            document.write("                                <tr>"+
                            "                                   <td style='color: black; border-bottom: 1px solid #b8b8b8; font-size: 8pt;font-family: arial; cursor: pointer' align='left' onMouseOver=\"javascript:this.style.color='white'; this.style.backgroundColor='#032949';\" onMouseOut=\"javascript:this.style.color='black'; this.style.backgroundColor='';\" onclick=\"javascript:GoToService('" + sLinks.split(",")[j] + "');\">" + sProds[j] + "</td>"+
                            "                               </tr>");
       }
       document.write("                                 </table>"+
                            "                       </div>"+
                            "                   </div>"+
                            "                   <form name='frmLogin' method='post' style='display: none'>"+
                            "                       <input type='hidden' name='username' value='" + sUserName + "' />"+
                            "                       <input type='hidden' name='user' value='" + sUserName + "' />"+
                            "                       <input type='hidden' name='password' value='" + sPass + "' />"+
                            "                   </form>"+
                            "                   <div id='divManage' style='position:relative; top:0; right:0; width: 100px; z-index: 1002; display: none' onMouseOver=\"javascript:document.getElementById('divManage').style.display='';\" onMouseOut=\"javascript:document.getElementById('divManage').style.display='none';\">"+
                            "                       <div style='position: absolute; top: 0px; right: 0px; left: 105px; width: 100%; z-index: 1003; background-color: #eeeeee'>"+
                            "                           <table cellpadding='0' cellspacing='0' width='100%' height='5px'>"+
                            "                           </table>"+
                            "                           <table cellpadding='2' cellspacing='0' width='100%' style='border: solid 1px black'>"+
                            "                               <tr>"+
                            "                                   <td style='color: black; border-bottom: 1px solid #b8b8b8; font-size: 8pt;font-family: arial; cursor: pointer' align='left' onMouseOver=\"javascript:this.style.color='white'; this.style.backgroundColor='#032949';\" onMouseOut=\"javascript:this.style.color='black'; this.style.backgroundColor='';\" onclick=\"javascript:window.location.href='/subscription/changepassword.asp';\">Password</td>"+
                            "                               </tr>"+
                            "                               <tr>"+
                            "                                   <td style='color: black; border-bottom: 1px solid #b8b8b8; font-size: 8pt;font-family: arial; cursor: pointer' align='left' onMouseOver=\"javascript:this.style.color='white'; this.style.backgroundColor='#032949';\" onMouseOut=\"javascript:this.style.color='black'; this.style.backgroundColor='';\" onclick=\"javascript:window.location.href='/subscription/updateprofile.asp';\">Profile</td>"+
                            "                               </tr>"+
                            "                               <tr>"+
                            "                                   <td style='color: black; border-bottom: 1px solid #b8b8b8; font-size: 8pt;font-family: arial; cursor: pointer' align='left' onMouseOver=\"javascript:this.style.color='white'; this.style.backgroundColor='#032949';\" onMouseOut=\"javascript:this.style.color='black'; this.style.backgroundColor='';\" onclick=\"javascript:window.location.href='/Subscription/manage.asp';\">Subscriptions</td>"+
                            "                               </tr>"+
                            "                               <tr>"+
                            "                                   <td style='color: black; border-bottom: 1px solid #b8b8b8; font-size: 8pt;font-family: arial; cursor: pointer' align='left' onMouseOver=\"javascript:this.style.color='white'; this.style.backgroundColor='#032949';\" onMouseOut=\"javascript:this.style.color='black'; this.style.backgroundColor='';\" onclick=\"javascript:window.location.href='/write_to_us.asp';\">Write To Us</td>"+
                            "                               </tr>"+
                            "                           </table>"+
                            "                       </div>"+
                            "                   </div>"+
                            "               </td>"+
                            "           </tr>"+
                            "       </table>"+
                            "   </td>");
    }
                            
    document.write("        </tr>"+
                        "</table>"+
                    "</td>"+
                   "</tr>");
}

function GoToService(sLink)
{
    window.location.href = sLink;
}

function showHomeLogin()
{
    var objDiv = document.getElementById('divLogin');
    if(objDiv.style.visibility=='hidden')
    {
        objDiv.style.visibility='visible';
    }
    else
    {
        objDiv.style.visibility='hidden';
    }
}

function menuLoginAction(form)
{
    form.username.value = document.getElementById('txtUsername').value;
	form.password.value = document.getElementById('txtPassword').value;
	form.Type.value = document.getElementById('selType').value;
	form["user name"].value = form.username.value;
	form.user.value = form.username.value;
	form.pass.value = form.password.value;
	
	if(!isBlank(form.username.value) && !isBlank(form.password.value))
	{
		if(document.getElementById('chkRemberUsr').checked)
		    document.getElementById('rememberme').value = 'Y';
		else
		    document.getElementById('rememberme').value = 'N';

        if(document.getElementById('selType').value=="derivantage"){form.action="http://learning.equitymaster.com/authenticatenew.aspx";form.hdnURLTop.value="/derivantage/list.aspx";}
        else if(document.getElementById('selType').value=="forum"){form.action="http://learning.equitymaster.com/authenticatenew.aspx";form.hdnURLTop.value="/forum";}
		form.submit();
	}
	else
	{
		alert("Please enter both username and password!")
		document.getElementById('txtUsername').focus();
	}
}

function ret(sec)
{
	counter = 0;
	for(j=0; j < subMenu.length; j++)
	{
		if(subMenu[j].section == sec)
			counter++;
	}
	return counter;
}

//Birendra | 13-03-2009 | New image for Back & Home button | Start-Code-->
function bottomline_new()
{
	  document.write("</td></tr></table><p align=center><a href='javascript:window.history.back()'><img src='/icons/New_back.gif' border=0></a>&nbsp;&nbsp;<a href='/'><img src='/icons/New_home.gif' border=0></a><br><font face='arial' size=2><img src='/blips/copyright.gif' width='10' height='10'>&nbsp;Equitymaster Agora Research Private Limited</font><font face='arial' size=1><br><a href='/help/legal.html'>Terms</a> | <a href='/help/privacy.html' style='color: Black'>Privacy</a> | <a href='/help/writetous.html'>Contact</a> | <a href='/help/sitemap.html'>Sitemap</a> | <a href='/help/aboutus.html'>About</a> | <A href='/rss' target='_new'><img src='/rss/rss.gif' border=0 align=absmiddle></a> <A href='/rss' target='_new'>RSS FEEDS</A></p><iframe name='session' WIDTH='0' HEIGHT='0' SRC='/session.asp' scrolling='no' frameborder='0'></iframe>");
}
//Birendra | 13-03-2009 | New image for Back & Home button | End-Code-->

function bottomLinepf()
{
	document.write("</td></tr></table><p align=center><font face='arial' size=2><img src='/blips/copyright.gif' width='10' height='10'>&nbsp;Equitymaster Agora Research Private Limited");
}

//any change in this function please also change js/PtOct09Min.js
function bottomLine()
{
	bottomLineNew("Y");
}

function bottomLineNew(sCloseTbl)
{
	var sWidth = "";
    var myBody = document.getElementsByTagName('body')[0];
	var objTable = myBody.getElementsByTagName("table")[0];
	sWidth=objTable.width;

    if(sCloseTbl)
    {
	    document.write("</td></tr></table>");
	}
document.write("<table cellspacing='0' cellpadding='0' border='0' width='"+sWidth+"' align='center'>"+
"<tr style='height: 5px'><td></td></tr>"+
"<tr><td style=\"background-image: url('http://www.eqimg.com/images/bordertabfot.gif'); background-repeat: repeat-x; height: 2px;\"></td></tr>"+
"<tr>"+
"<td>"+
"<table border=0 cellpadding=0 cellspacing=0 width=100%>"+
"<tr>"+
"    <td style='font-size: 8pt; font-family: arial;padding-top: 10px' align='center'>"+
"        <span style='background-image:url(http://www.eqimg.com/images/homesp.png);background-position:-10px -51px;background-repeat:no-repeat no-repeat;vertical-align:bottom'><img src='http://www.eqimg.com/images/white_space.gif' alt='' height='10' width='10' /></span><span style='font-weight: bold'>&nbsp;Equitymaster Agora Research Private Limited.</span>"+
"   </td>"+
"	 <td align=right rowspan='2'>"+
"		<!-- START SCANALERT CODE -->"+
"		<a target='_blank' href='https://www.mcafeesecure.com/RatingVerify?ref=www.equitymaster.com'>"+
"		<img width='115' height='32' border='0' src='//images.scanalert.com/meter/www.equitymaster.com/22.gif' alt='McAfee Secure sites help keep you safe from identity theft, credit card fraud, spyware, spam, viruses and online scams' oncontextmenu=\"alert('Copying Prohibited by Law - McAfee Secure is a Trademark of McAfee, Inc.'); return false;\"></a>"+
"		<!-- END SCANALERT CODE -->"+
"			    </td>"+
"</tr><tr style='height:16px;vertical-align:top'><td style='padding-bottom:10px;' align='center'>"+
"        <table width='550px' cellpadding='0' cellspacing='0' border='0'><tr style='vertical-align:top'><td align='right' style='font-size:8pt;font-family:arial;'><a href='/whitelist.html' style='color: Black'>"+
"                    Whitelist</a> | <a href='#' onclick=\"javascript:recommend('Equitymaster.com');return false;\""+
"                        style='color: Black'>Refer</a> | <a href='/help/legal.html' style='color: Black'>"+
"                            Terms</a> | <a href='/help/privacy.html' style='color: Black'>Privacy</a> | <a href='/help/writetous.html' style='color: Black'>Contact</a>"+
"        | <a href='/help/advertise.html' style='color: Black'>Advertise</a>"+
"        | <a href='/help/aboutus.html' style='color: Black'>About</a> | <a href='/help/sitemap.html'"+
"            style='color: Black'>Sitemap</a>&nbsp;|&nbsp;</td><td style='height:16px;width:20px;background-image:url(http://www.eqimg.com/images/homesp.png);background-position:-10px -829px;background-repeat:no-repeat no-repeat;'><a href='/rss' target='_new'>"+
"<img alt='RSS' src='http://www.eqimg.com/images/white_space.gif' border='0' align='absmiddle' width='16' height='16' /></a>&nbsp;</td><td style='height:16px;width:20px;background-image:url(http://www.eqimg.com/images/homesp.png);background-position:-10px -197px;background-repeat:no-repeat no-repeat;'><a href='http://www.facebook.com/Eqtmonline' target='_new'>"+
"<img alt='Follow Equitymaster on Facebook' src='http://www.eqimg.com/images/white_space.gif' border='0' align='absmiddle' width='16' height='16' /></a>&nbsp;</td><td style='height:16px;width:20px;background-image:url(http://www.eqimg.com/images/homesp.png);background-position:-10px -313px;background-repeat:no-repeat no-repeat;'><a href='http://www.twitter.com/equitymaster' target='_new'>"+
"<img alt='Follow Equitymaster on Twitter' src='http://www.eqimg.com/images/white_space.gif' border='0' align='absmiddle' width='16' height='16' /></a>&nbsp;</td><td align='left' style='height:16px;width:20px;'><a href='https://plus.google.com/b/116621930507245638619/?prsrc=3' style='text-decoration: none;' target='_new'><img src='https://ssl.gstatic.com/images/icons/gplus-16.png' width='16' height='16' align='absmiddle' style='border: 0;'/></a></td><td width='52'></td></tr></table>"+
"    </td>"+
"		    </tr>"+
"		</table>"+
"	</td></tr></table>");
}

function bottomLineHTSFTH()
{
	var sWidth = "";
    var myBody = document.getElementsByTagName('body')[0];
	var objTable = myBody.getElementsByTagName("table")[0];
	sWidth=objTable.width;

	document.write("</td></tr></table><table cellspacing='0' cellpadding='0' border='0' width='" + sWidth + "' align='center'>"+
	"<tr style='height: 5px'><td colspan='2'></td></tr>"+
	"<!--tr>"+
	"    <td style=\"background-image: url('/images/bordertabfot.gif'); background-repeat: repeat-x; height: 2px;\"></td>"+
	"</tr-->"+
	"<tr>"+
	"    <td style='font-size: 8pt; font-family: arial; padding-bottom: 10px; padding-top: 10px; color: white' align='center'>"+
	"        <span style='font-weight: bold'><img src='/blips/copyright.gif' width='10' height='10'>&nbsp;Equitymaster Agora Research Private Limited.</span><br />"+
	"        <!--a href='#' onclick=\"this.style.behavior = 'url(#default#homepage)'; this.setHomePage('http://www.equitymaster.com/');return false;\""+
	"            style='color: white'>Homepage</a> | <a href='#' onclick=\"javascript:window.external.AddFavorite('http://www.equitymaster.com','Equitymaster.com - The investors best friend!');return false;\""+
	"                style='color: white'>Bookmark</a> | --><a href='/whitelist.html' style='color: white'>"+
	"                    Whitelist</a> | <a href='#' onclick=\"javascript:recommend('Equitymaster.com');return false;\""+
	"                        style='color: white'>Refer</a> | <a href='/help/legal.html' style='color: white'>"+
	"                            Terms</a> | <a href='/help/privacy.html' style='color: white'>Privacy</a> | <a href='/help/writetous.html' style='color: white'>Contact</a>"+
	"        | <a href='/help/advertise.html' style='color: White'>Advertise</a>"+
	"        | <a href='/help/aboutus.html' style='color: white'>About</a> | <a href='/help/sitemap.html'"+
	"            style='color: White'>Sitemap</a> |&nbsp;<a href='/rss' target='_new'><img alt='RSS' src='/rss/rss.png' border='0' align='absmiddle' width='16' height='16' /></a>&nbsp;<a href='http://www.facebook.com/Eqtmonline' target='_new'>" +
	                "<img alt='Follow Equitymaster on Facebook' src='/images/facebook.png' border='0' align='absmiddle' width='16' height='16' /></a>&nbsp;<a href='http://www.twitter.com/equitymaster' target='_new'>" +
                    "<img alt='Follow Equitymaster on Twitter' src='/images/twitter.png' border='0' align='absmiddle' width='16' height='16' /></a>&nbsp;<a href='https://plus.google.com/b/116621930507245638619/?prsrc=3' style='text-decoration: none;' target='_new'><img src='https://ssl.gstatic.com/images/icons/gplus-16.png' width='16' height='16' align='absmiddle' style='border: 0;'/></a>" +
	"    </td>"+
	"	 <td align=right>" +
	"		<!-- START SCANALERT CODE -->"+
	"		<a target='_blank' href='https://www.mcafeesecure.com/RatingVerify?ref=www.equitymaster.com'>"+
	"		<img width='115' height='32' border='0' src='//images.scanalert.com/meter/www.equitymaster.com/22.gif' alt='McAfee Secure sites help keep you safe from identity theft, credit card fraud, spyware, spam, viruses and online scams' oncontextmenu=\"alert('Copying Prohibited by Law - McAfee Secure is a Trademark of McAfee, Inc.'); return false;\"></a>"+
	"		<!-- END SCANALERT CODE -->" + 
	"	</td>"+
	"</tr>"+
	"</table>");
}

function bottomLineHTTPS()
{
	var sWidth = "";
    var myBody = document.getElementsByTagName('body')[0];
	var objTable = myBody.getElementsByTagName("table")[0];
	sWidth=objTable.width;

	document.write("</td></tr></table><table cellspacing='0' cellpadding='0' border='0' width='" + sWidth + "' align='center'>"+
	"<tr style='height: 5px'><td colspan='2'></td></tr>"+
	"<tr>"+
	"    <td style=\"background-image: url('/images/bordertabfot.gif'); background-repeat: repeat-x; height: 2px;\"></td>"+
	"</tr>"+
	"<tr>"+
	"<td>"+
	"<table border=0 cellpadding=0 cellspacing=0 width=100%>"+
	"<tr>"+
	"    <td style='font-size: 8pt; font-family: arial; padding-bottom: 10px; padding-top: 10px' align='center'>"+
	"        <span style='font-weight: bold'><img src='/blips/copyright.gif' width='10' height='10'>&nbsp;Equitymaster Agora Research Private Limited.</span><br />"+
	"        <!--a href='#' onclick=\"this.style.behavior = 'url(#default#homepage)'; this.setHomePage('http://www.equitymaster.com/');return false;\""+
	"            style='color: Black'>Homepage</a> | <a href='#' onclick=\"javascript:window.external.AddFavorite('http://www.equitymaster.com','Equitymaster.com - The investors best friend!');return false;\""+
	"                style='color: Black'>Bookmark</a> | --><a href='http://www.equitymaster.com/whitelist.html' style='color: Black'>"+
	"                    Whitelist</a> | <a href='#' onclick=\"javascript:recommendHTTPS('Equitymaster.com');return false;\""+
	"                        style='color: Black'>Refer</a> | <a href='http://www.equitymaster.com/help/legal.html' style='color: Black'>"+
	"                            Terms</a> | <a href='http://www.equitymaster.com/help/privacy.html' style='color: Black'>Privacy</a> | <a href='http://www.equitymaster.com/help/writetous.html' style='color: Black'>Contact Us</a>"+
	"        | <a href='http://www.equitymaster.com/help/advertise.html' style='color: Black'>Advertise</a>"+
	"        | <a href='http://www.equitymaster.com/help/aboutus.html' style='color: Black'>About</a> | <a href='http://www.equitymaster.com/help/sitemap.html'"+
	"            style='color: Black'>Sitemap</a> | <a href='http://www.equitymaster.com/rss' target='_new'>"+
	"                <img alt='RSS' src='/rss/rss.png' border='0' align='absmiddle' width='16' height='16' /></a>&nbsp;<a href='http://www.facebook.com/Eqtmonline' target='_new'>" +
	                "<img alt='Follow Equitymaster on Facebook' src='/images/facebook.png' border='0' align='absmiddle' width='16' height='16' /></a>&nbsp;<a href='http://www.twitter.com/equitymaster' target='_new'>" +
                    "<img alt='Follow Equitymaster on Twitter' src='/images/twitter.png' border='0' align='absmiddle' width='16' height='16' /></a>&nbsp;<a href='https://plus.google.com/b/116621930507245638619/?prsrc=3' style='text-decoration: none;' target='_new'><img src='https://ssl.gstatic.com/images/icons/gplus-16.png' width='16' height='16' align='absmiddle' style='border: 0;'/></a>" +
	"    </td>"+
	"	 <td align=right>" +
	"		            <!-- START SCANALERT CODE -->"+
	"			        <a target='_blank' href='https://www.mcafeesecure.com/RatingVerify?ref=www.equitymaster.com'>"+
	"		            <img width='115' height='32' border='0' src='//images.scanalert.com/meter/www.equitymaster.com/22.gif' alt='McAfee Secure sites help keep you safe from identity theft, credit card fraud, spyware, spam, viruses and online scams' oncontextmenu=\"alert('Copying Prohibited by Law - McAfee Secure is a Trademark of McAfee, Inc.'); return false;\"></a>"+
	"			        <!-- END SCANALERT CODE -->" + 
	"			    </td>"+
    "		    </tr>"+
	"		</table>"+
	"	</td>"+
	"</tr>"+
	"</table>");
}

function recommend(title)
{
	url = window.location.href;
	var recommend = window.open("/recommend/recommend.asp?title=" + title + "&url=" + url ,"recommend","height=230,width=400,toolbars=false");

}

function recommendHTTPS(title)
{
	url = window.location.href;
	var recommend = window.open("http://www.equitymaster.com/recommend/recommend.asp?title=" + title + "&url=" + url ,"recommend","height=230,width=400,toolbars=false");

}

function launchticker()
{
	var tickerWindow;
	var url = "/nseticker.html"
	tickerWindow = window.open(url,"tickerWindow","height=20, width=775")
	tickerWindow.focus();
}

function isBlank(s)
	{
	  var len,k,flg;
	  flg=true;
	  if(s!=null)
	  {
		len=s.length;
		for(k=0;k<len;k++)
		 {
		  if(s.substring(k,k+1)!=" ")
				flg=false;
		 }
	  }
	 return flg;
	}

function goTopQuote(form)
{
	var a;
	a = true;
	var f = form


	if(f.company.value == null || f.company.value == "" || isBlank(f.company.value) || f.company.value == "Quote")
	{
		alert("Please enter a valid symbol/company name.");
		a = false;
	}
	if(a == true)
	{
		form.submit();
	}
}

function go1(form)
{
	if(form.sector.options[form.sector.selectedIndex].value == -1)
		window.location.href = "/stockquotes/options.asp";
	else if(form.sector.options[form.sector.selectedIndex].value != 0)
		form.submit();
	else
		alert("Please select a sector.");
}

function displayMainMenu(sectionName)
{
    document.write("<link href='/css/dropdown.css' rel='stylesheet' type='text/css' />");
        
    objXmlHttpMenu1 = null;
    objXmlHttpMenu1 = GetXmlHttpObj(null);
    objXmlHttpMenu1.open("GET", "/newmenu.asp", false);
    objXmlHttpMenu1.send(null);
    var sText = objXmlHttpMenu1.responseText;

    if(sText.replace(" ","")=="")
    {
        displayNewMainMenuInner(sectionName, "", "", "", "", "")
    }
    else
    {
        var sTextArr = sText.split('~');
        displayNewMainMenuInner(sectionName, sTextArr[0], sTextArr[1], sTextArr[2], sTextArr[3], sTextArr[4])
    }
}

function displayNewMainMenuInner(sectionName, sName, sProducts, sLinks, sUserName, sPass)
{   
    var iWidth = 0;
    var sWidth = "";
    if (typeof window.innerWidth != 'undefined')
    {
        sWidth = "100%";
    }
    // IE6 in standards compliant mode (i.e. with a valid doctype as the first line in the document)
    else if (typeof document.documentElement != 'undefined' && typeof document.documentElement.clientWidth != 'undefined' && document.documentElement.clientWidth != 0)
    {
		iWidth = document.documentElement.clientWidth;
        iWidth = iWidth - 4;
        sWidth = iWidth.toString() + "px";

		var myBody = document.getElementsByTagName('body')[0];
		var objTable = myBody.getElementsByTagName("table")[0];
		if(objTable.width!="100%")
			sWidth=objTable.width;
    }
    // older versions of IE
    else
    {
		iWidth = document.getElementsByTagName('body')[0].clientWidth;
        iWidth = iWidth - 4;
        sWidth = iWidth.toString() + "px";

		var myBody = document.getElementsByTagName('body')[0];
		var objTable = myBody.getElementsByTagName("table")[0];
		if(objTable.width!="100%")
			sWidth=objTable.width;
    }
    
    document.write("<table cellspacing='0' cellpadding='0' border='0' width='100%' style='margin: 0px;padding: 0px;font-family: Arial, Helvetica, sans-serif;'>")

    if(sectionName != "BUDGET")
    { 
        document.write("<tr><td style='width: 100%'><div id='outer'><ul id='nav'>")
	    for(i=0; i < mainMenu.length; i++)
	    {
		    className = "";
    			    
		    if(mainMenu[i].section == sectionName)
			    className = "current";

			var sMenuColor="";
			if(mainMenu[i].section=="Video")
				sMenuColor = " style='background-color:#cc0000'";

            document.write("<li class='" + className + "' onmouseover=\"javascript:this.className+=' over';\" onmouseout=\"javascript:this.className=this.className.replace(' over', '');\""+sMenuColor+"><a href='" + mainMenu[i].linkUrl + "'>" + mainMenu[i].displayText + "</a>"+
                            "<ul style='width: " + sWidth + "'>");
            
            if(mainMenu[i].section=="Premium")
                displayNewSubMenu("Home");
            else
                displayNewSubMenu(mainMenu[i].section);
                        
            document.write("</ul>"+
                        "</li>");
            if(i!=mainMenu.length - 1) //last menu
                document.write("<li><img src='http://www.eqimg.com/images/dividermenu.jpg' alt='' width='1' height='27' /></li>");
	    }
	    //document.write("<li class='nohover'>&nbsp;</li><li class='nohover' style='float:right;width:85px;padding-top:2px'></li>");
	    document.write("<li class='nohover' style='float:right;width:70px;padding-top:2px'><iframe allowtransparency='true' frameborder='0' scrolling='no' src='http://platform.twitter.com/widgets/follow_button.html?screen_name=Equitymaster&button=grey&link_color=ffffff&text_color=ffffff&show_count=false' style='width:60px; height:20px;'></iframe></li>");
	    document.write("</ul><div id='subnavbg'></div></div></td></tr>")    	
	    document.write("<tr style='height: 2px'><td></td></tr>");
	}
	newMarketBandInner(sName, sProducts, sLinks, sUserName, sPass);
	document.write("<tr style='height: 2px'><td></td></tr>");
	document.write("</table>");
}

function newMarketBandInner(sName, sProducts, sLinks, sUserName, sPass)
{
	document.write("<tr>"+
	                "<td style='height: 29px; background-color: #eeeeee;'>"+
	                    "<table cellpadding='0' cellspacing='0' width='100%'>"+
	                        "<tr valign='middle'>"+
	                        "   <form method='get' action='/getaquote.asp' name='Topquote'>"+
                	        "   <td style='width: 4px'>&nbsp;</td>"+
                            "   <td style='width: 82px'><input type='text' name='company' onfocus='javascript:this.form.company.value=\"\"' onblur=\"javascript:if(this.value=='')this.value='Quote';\" value='Quote' style='width: 82px; height: 22px; border: 1px solid #cacaca; color: black; font-size: 12px; padding-left: 5px; padding-right: 5px; text-align: left; font-family: Arial, Helvetica, sans-serif;' /></td>"+
                            "   <td style='width: 3px'></td>"+
                            "   <td style='width: 56px; display: none'>"+
                    	    "       <select name='Type' style='font-family: Arial, Helvetica, sans-serif; height: 22px; width: 56px; border: 1px solid #cacaca; color: black; font-size: 12px;'>"+
                        	"           <option value='stock' selected='selected'>Stock</option>"+
                        	"           <option value='fund'>NAV</option>"+
                            "       </select>"+
                            "   </td>"+
                            "   <td style='width: 3px; display: none'>&nbsp;</td>"+
                            "   <td style='background-image:url(http://www.eqimg.com/images/homesp.png);background-position:-10px -133px;background-repeat:no-repeat no-repeat;width: 23px'><a href='#' onclick='javascript:goTopQuote(document.Topquote)'><img src='http://www.eqimg.com/images/white_space.gif' alt='' border='0' height='20' width='23' /></a></td>"+
                            "   <td style='width: 9px'>&nbsp;</td>"+
                            "   </form>"+
                            "   <form method='get' action='/stockquotes/sector.asp' name='sector'>"+
                            "   <td style='width: 128px'>"+
                    	    "       <select name='sector' style='font-family: Arial, Helvetica, sans-serif; height: 22px; width: 128px; border: 1px solid #cacaca; color: black; font-size: 12px;' onchange='javascript:go1(this.form)'>"+
                        	"           <option value='0' selected>Key Sector Stocks</option>"+
							"           <option value='Gold'>Gold ETF</option>"+
	                        "           <option value='BSNX'>BSE Sensex</option>"+
	                        "           <option value='NIFTY'>NSE Nifty</option>"+
	                        "           <option value='-1'>Options Shortlist</option>"+
	                        "           <option value='Air'>Airlines</option>"+
	                        "           <option value='Aluminium'>Aluminium</option>"+
	                        "           <option value='Auto'>Automobiles</option>"+
	                        "           <option value='Autoc'>Auto Ancillaries</option>"+
	                        "           <option value='0,BANKPVT'>Banks (Private)</option>"+
	                        "           <option value='0,BANKPSU'>Banks (PSU)</option>"+
	                        "           <option value='Cement'>Cement</option>"+
	                        //"           <option value='Chemicals'>Chemicals</option>"+
	                        "           <option value='engg'>Engineering</option>"+
	                        "           <option value='energy'>Energy Sources</option>"+
	                        "           <option value='Fertilizer'>Fertilizer</option>"+
	                        "           <option value='Consprds'>FMCG</option>"+
	                        "           <option value='Food'>Food</option>"+
	                        "           <option value='Hotels'>Hotels</option>"+
	                        "           <option value='Finance'>Inv. &amp; Finance</option>"+
	                        //"           <option value='Logistics'>Logistics</option>"+
	                        "           <option value='Media'>Media</option>"+
	                        "           <option value='Mining'>Mining</option>"+
	                        "           <option value='0,MNC'>MNC</option>"+
	                        "           <option value='0,IPHARMA'>Indian Pharma</option>"+
	                        "           <option value='0,MPHARMA'>MNC Pharma</option>"+
	                        "           <option value='0,PSU'>PSU</option>"+
	                        "           <option value='Paint'>Paints</option>"+
	                        "           <option value='Paper'>Paper</option>"+	                        
	                        "           <option value='Power'>Power</option>"+
	                        "           <option value='construction'>Real Estate</option>"+
	                        "           <option value='retail'>Retailing</option>"+
	                        "           <option value='Ship'>Shipping</option>"+
	                        "           <option value='0,SOFTL'>Software (Large)</option>"+
	                        "           <option value='0,SOFTO'>Software (Others)</option>"+
	                        "           <option value='Steel'>Steel</option>"+
	                        "           <option value='Sugar'>Sugar</option>"+
	                        "           <option value='Telecom'>Telecom</option>"+
	                        "           <option value='Textiles'>Textiles</option>"+
	                        //"           <option value='Tyres'>Tyres</option>"+
	                        "           <option value='0,RBAJAJ'>Rahul Bajaj</option>"+	                        
	                        "           <option value='0,BIRLA'>A V Birla</option>"+
	                        "           <option value='0,AMBANI'>Mukesh Ambani</option>"+
	                        "           <option value='0,ADAE'>Anil Ambani</option>"+
	                        "           <option value='0,TATA'>Tata</option>"+
	                        //"           <option value='0,GODREJ'>Godrej</option>"+
	                        //"           <option value='0,SUNDARAM'>Sundaram</option>"+
	                        //"           <option value='0,MURUGAPPA'>Murugappa</option>"+
                            "       </select>"+
                            "   </td>"+
                            "   </form>"+
                            "   <td style='width: 8px'>&nbsp;</td>"+
                            "   <form action='http://www.equitymaster.com/search.html' name='csesearchbox' id='cse-search-box'>"+
                            "   <td style='width: 128px'>"+
                            "       <input type='hidden' name='cx' value='partner-pub-2960491319221583:qz2ueq-fcn2' />"+
	                        "       <input type='hidden' name='cof' value='FORID:9' /> "+
	                        "       <input type='hidden' name='ie' value='ISO-8859-1' />"+
                            "       <input type='text' name='q' value='' style='background-image:url(http://www.eqimg.com/images/homesp.png);background-position:-10px -10px;background-repeat:no-repeat no-repeat;' onfocus=\"javascript:this.style.backgroundImage='';\" onblur=\"javascript:if(this.value=='')this.style.backgroundImage='url(http://www.eqimg.com/images/homesp.png)';\" class='searchinput' />"+
                            "   </td>"+
                            "   <td style='width: 4px'>&nbsp;</td>"+
                            "   <td style='background-image:url(http://www.eqimg.com/images/homesp.png);background-position:-10px -133px;background-repeat:no-repeat no-repeat;width: 23px'><a href='#' onclick='javascript:csesearchbox.submit();'><img src='http://www.eqimg.com/images/white_space.gif' alt='' border='0' height='20' width='23' /></a></td>"+
                            "   </form>"+
                            "   <td style='width: 10px'>&nbsp;</td>"+
                            "   <td style='font-size: 12px; color: black;'><a href='/stockquotes/mystocks.asp' style='font-size: 12px; color: black; text-decoration: underline;'>MyStocks</a></td>"+
                            "   <td style='width: 64px'></td>");
    if(sName=="" || sName==null)
    {
        document.write("        <td style='width: 420px; font-family: arial; font-size: 12px; color: black; font-weight: bold; text-decoration: none;' align='right'><a href='#' onclick='javascript:showHomeLogin();return false;' style='color: #cc0000; font-family: arial; font-size: 12px; font-weight: bold; text-decoration: underline;'>MEMBER'S LOGIN</a>&nbsp;&nbsp;"+
                            "       <div id='divLogin' style='position:relative; top:0; right:0; width: 240px; visibility: hidden; z-index: 1000'>"+
                            "           <div style='position: absolute; top: 10px; right: 0px; width: 100%; z-index: 1001; background-color: #e6e6e6'>"+
                            "               <table cellpadding='2' cellspacing='0' width='100%' style='border: solid 1px black'>"+
                            "                   <tr>"+
                            "                       <td></td>"+
                            "                       <td colspan='2' style='background-color: black; width: 96%'>"+
                            "                           <table cellspacing='0' cellpadding='0' border='0' width='100%'>"+
                            "                               <tr>"+
                            "                                   <td align='left' style='width: 80%; color: white; font-family: Arial; font-size: 14px; font-weight: bold'>MEMBER'S ARENA</td>"+
                            "                                   <td align='right' style='width: 20%; font-family: Arial; font-size: 14px; font-weight: bold'><a href='#' style='color: white; text-decoration: none' title='Close' onclick=\"javascript:showHomeLogin();return false;\">X</a>&nbsp;</td>"+
                            "                               </tr>"+
                            "                           </table>"+
                            "                       </td>"+
                            "                       <td></td>"+
                            "                   </tr>"+
                            "                    <tr>"+
                            "                       <td style='width: 2%'></td>"+
                            "                       <td align='left' style='font-size: 9pt; font-family: Arial; font-weight: bold; width: 48%'>&nbsp;&nbsp;Username</td>"+
                            "                       <td align='left' style='font-size: 9pt; font-family: Arial; font-weight: bold; width: 48%'>&nbsp;&nbsp;Password</td>"+
                            "                       <td style='width: 2%'></td>"+
                            "                   <tr>"+
                            "                       <td></td>"+
                            "                        <td align='left' style='font-size: 9pt; font-family: Arial; font-weight: bold'><input type='text' id='txtUsername' name='txtUsername' size='11' style='font-family: arial; font-size: 13px; color: Black;' />"+
                            "                       <td align='left' style='font-size: 9pt; font-family: Arial; font-weight: bold'><input type='password' id='txtPassword' name='txtPassword' size='11' style='font-family: arial; font-size: 13px; color: Black;' /></td>"+
                            "                       <td></td>"+
                            "                   </tr>"+
                            "                   <tr valign='bottom'>"+
                            "                       <td></td>"+                            
                            "                       <td colspan='2' align='left' style='font-size: 9pt; font-family: Arial; font-weight : bold'>"+
                            "                           <input type='checkbox' name='chkRemberUsr' id='chkRemberUsr' />Remember Username"+
                            "                       </td>"+
                            "                       <td></td>"+                            
                            "                   </tr>"+                            
                            "                   <tr>"+
                            "                       <td></td>"+
                            "                       <td colspan='2' align='left'>"+
	                        "                            <select id='selType' name='selType' style='font-family: arial; font-size: 13px; color: Black; width: 168px'>"+
	                        "                               <option value='SelectOptional' selected='selected'>Select (Optional)</option>"+
	                        "                               <option value='htr'>Hidden Treasure</option>"+
                            "                               <option value='tldr'>Lucrative Derivatives</option>"+
							"                               <option value='mc'>MidcapSelect</option>"+
				            "                               <option value='portfolio'>Portfolio Tracker</option>"+
				            "                               <option value='research-it'>ResearchPro</option>"+
	                        "                               <option value='qv'>StockSelect</option>"+
	                        "                               <option value='sfr'>Strategic Fund Report</option>"+
				            "                               <option value='valuepro'>ValuePro</option>"+
				            "                               <option value='pwa'>Wealth Alliance</option>"+				            
	                        "                               <option value='derivantage'>DeriVantage</option>"+
				            "                               <option value='forum'>Learning Forum</option>"+
	                        "                            </select>"+
	                        "                           <input type='button' value='Go' style='font-family: arial; font-size: 13px; color: Black; width: 38px' onclick='javascript:menuLoginAction(document.loginMenu);' />"+
                            "                       </td>"+
                            "                       <td></td>"+
                            "                   </tr>"+
                            "                   <tr>"+
                            "                       <td colspan='4' align='center' style='font-size: 9pt; font-family: Arial; font-weight: bold'><a href='/ptmail' style='color: #cc0000'>Sign Up</a> | <a href='/ptmail/for.asp?prd=PT' style='color: Black'>Forgot Password?</a>"+
                            "                       <form name='loginMenu' method='post' action='/Subscription/authenticate.aspx' style='display: none'>"+
                            "                            <input type='hidden' value='' name='username' />"+
                            "                           <input type='hidden' value='' name='password' />"+
                            "                           <input type='hidden' value='' name='Type' />"+
                            "                           <!-- myPlanner -->"+
                            "                           <input type='hidden' name='user name' />"+
                            "                           <!-- StockSelect / Research Reports -->"+
                            "                           <input type='hidden' name='user' />"+
                            "                           <input type='hidden' name='pass' />"+
                            "                           <input type='hidden' name='hdnURLTop' />"+
                            "                           <input type='hidden' id='rememberme' name='rememberme' />"+                            
                            "                        </form>"+
                            "                       </td>"+
                            "                   </tr>"+
                            "               </table>"+
                            "           </div>"+
                            "       </div>"+
                            "   </td>");
                            
                            //Birendra | 14-Sep-2010 | checking username cookie
                            c_name = "EQUSRNAME";
                            c_start=document.cookie.indexOf(c_name + "=");
                                 
                            if(c_start != -1)
                            {
                                c_start=c_start + c_name.length+1;
                                c_end=document.cookie.indexOf(";",c_start);
                                if (c_end==-1) c_end=document.cookie.length;
                                
                                document.getElementById('txtUsername').value = unescape(document.cookie.substring(c_start,c_end));
                                document.getElementById('chkRemberUsr').checked = true;
                            }                            
    }
    else
    {
        var sProds = sProducts.split(",");
        document.write("        <td style='width: 420px; font-family: arial; font-size: 12px; color: black; font-weight: bold; text-decoration: none;' align='right'>"+
                            "       <table cellspacing='0' cellpadding='0' border='0' width='100%' style='font-family: arial; font-size: 12px; color: black; font-weight: bold; text-decoration: none;'>"+
                            "           <tr>"+
                            "               <td align='right' style='width: 210px;'>Welcome,&nbsp;<span style='font-weight: normal; font-style: italic'>" + sName + "</span>&nbsp;&nbsp;&nbsp;</td>"+
                            "               <td align='left' style='width: 210px'><a href='#' onMouseOver=\"javascript:document.getElementById('divMySubs').style.display='';\" onMouseOut=\"javascript:document.getElementById('divMySubs').style.display='none';\" style='text-decoration: underline; color: black'>My Subscriptions</a>&nbsp;|&nbsp;<a href='#' onMouseOver=\"javascript:document.getElementById('divManage').style.display='';\" onMouseOut=\"javascript:document.getElementById('divManage').style.display='none';\" style='text-decoration: underline; color: black'>Manage</a>&nbsp;|&nbsp;<a href='/logout.asp' style='color: black; text-decoration: underline'>Logout</a>&nbsp;&nbsp;"+
                            "                   <div id='divMySubs' style='position:relative; top:0; right:0; width: 155px; z-index: 1000; display: none' onMouseOver=\"javascript:document.getElementById('divMySubs').style.display='';\" onMouseOut=\"javascript:document.getElementById('divMySubs').style.display='none';\">"+
                            "                       <div style='position: absolute; top: 0px; right: 0px; width: 100%; z-index: 1001; background-color: #eeeeee'>"+
                            "                           <table cellpadding='0' cellspacing='0' width='100%' height='5px'>"+
							"								<tr style='height: 5px'>"+
							"									<td></td>"+
							"								</tr>"+
                            "                           </table>"+
                            "                           <table cellpadding='2' cellspacing='0' width='100%' style='border: solid 1px black'>");
       for(j=0; j<sProds.length; j++)
       {
            document.write("                                <tr>"+
                            "                                   <td style='font-weight: bold; color: black; border-bottom: 1px solid #b8b8b8; font-size: 8pt;font-family: arial; cursor: pointer' align='left' onMouseOver=\"javascript:this.style.color='white'; this.style.backgroundColor='#032949';\" onMouseOut=\"javascript:this.style.color='black'; this.style.backgroundColor='';\" onclick=\"javascript:GoToService('" + sLinks.split(",")[j] + "');\">" + sProds[j] + "</td>"+
                            "                               </tr>");
       }
       document.write("                                 </table>"+
                            "                       </div>"+
                            "                   </div>"+
                            "                   <form name='frmLogin' method='post' style='display: none'>"+
                            "                       <input type='hidden' name='username' value='" + sUserName + "' />"+
                            "                       <input type='hidden' name='user' value='" + sUserName + "' />"+
                            "                       <input type='hidden' name='password' value='" + sPass + "' />"+
                            "                   </form>"+
                            "                   <div id='divManage' style='position:relative; top:0; right:0; width: 100px; z-index: 1002; display: none' onMouseOver=\"javascript:document.getElementById('divManage').style.display='';\" onMouseOut=\"javascript:document.getElementById('divManage').style.display='none';\">"+
                            "                       <div style='position: absolute; top: 0px; right: 0px; left: 105px; width: 100%; z-index: 1003; background-color: #eeeeee'>"+
                            "                           <table cellpadding='0' cellspacing='0' width='100%' height='5px'>"+
                            "                               <tr style='height: 5px'>"+
							"									<td></td>"+
							"								</tr>"+
                            "                           </table>"+
                            "                           <table cellpadding='2' cellspacing='0' width='100%' style='border: solid 1px black'>"+
                            "                               <tr>"+
                            "                                   <td style='font-weight: bold; color: black; border-bottom: 1px solid #b8b8b8; font-size: 8pt;font-family: arial; cursor: pointer' align='left' onMouseOver=\"javascript:document.getElementById('aPassword').style.color='white'; this.style.backgroundColor='#032949';\" onMouseOut=\"javascript:document.getElementById('aPassword').style.color='black'; this.style.backgroundColor='';\"><a id='aPassword' href='/subscription/changepassword.asp' style='text-decoration: none; color: black'>Password</a></td>"+
                            "                               </tr>"+
                            "                               <tr>"+
                            "                                   <td style='font-weight: bold; color: black; border-bottom: 1px solid #b8b8b8; font-size: 8pt;font-family: arial; cursor: pointer' onMouseOver=\"javascript:document.getElementById('aProfile').style.color='white'; this.style.backgroundColor='#032949';\" onMouseOut=\"javascript:document.getElementById('aProfile').style.color='black'; this.style.backgroundColor='';\"><a id='aProfile' href='/subscription/updateprofile.asp' style='text-decoration: none; color: black'>Profile</a></td>"+
                            "                               </tr>"+
                            "                               <tr>"+
                            "                                   <td style='font-weight: bold; color: black; border-bottom: 1px solid #b8b8b8; font-size: 8pt;font-family: arial; cursor: pointer' align='left' onMouseOver=\"javascript:this.style.color='white'; this.style.backgroundColor='#032949';\" onMouseOut=\"javascript:this.style.color='black'; this.style.backgroundColor='';\" onclick=\"javascript:window.location.href='/Subscription/manage.asp';\">Subscriptions</td>"+
                            "                               </tr>"+
                            "                               <tr>"+
                            "                                   <td style='font-weight: bold; color: black; border-bottom: 1px solid #b8b8b8; font-size: 8pt;font-family: arial; cursor: pointer' align='left' onMouseOver=\"javascript:this.style.color='white'; this.style.backgroundColor='#032949';\" onMouseOut=\"javascript:this.style.color='black'; this.style.backgroundColor='';\" onclick=\"javascript:window.location.href='/write_to_us.asp';\">Write To Us</td>"+
                            "                               </tr>"+
                            "                           </table>"+
                            "                       </div>"+
                            "                   </div>"+
                            "               </td>"+
                            "           </tr>"+
                            "       </table>"+
                            "   </td>");
    }
                            
    document.write("        </tr>"+
                        "</table>"+
                    "</td>"+
                   "</tr>");
}

function displaySubMenu(sectionName1){ }

function newMarketBandInner_rr(sName, sProducts, sLinks, sUserName, sPass)
{
	document.write("<tr>"+
	                "<td style='height: 29px; background-color: #eeeeee;'>"+
	                    "<table cellpadding='0' cellspacing='0' width='100%'>"+
	                        "<tr valign='middle'>");
    if(sName=="" || sName==null)
    {
        document.write("        <td style='width: 100%; font-family: arial; font-size: 12px; color: black; font-weight: bold; text-decoration: none;' align='right'><a href='#' onclick='javascript:showHomeLogin();return false;' style='color: #cc0000; font-family: arial; font-size: 12px; font-weight: bold; text-decoration: underline; text-align: right'>MEMBER'S LOGIN</a>&nbsp;&nbsp;"+
                            "       <div id='divLogin' style='position:relative; top:0; right:0; width: 240px; visibility: hidden; z-index: 1000'>"+
                            "           <div style='position: absolute; top: 10px; right: 0px; width: 100%; z-index: 1001; background-color: #e6e6e6'>"+
                            "               <table cellpadding='2' cellspacing='0' width='100%' style='border: solid 1px black'>"+
                            "                   <tr>"+
                            "                       <td></td>"+
                            "                       <td colspan='2' style='background-color: black; width: 96%'>"+
                            "                           <table cellspacing='0' cellpadding='0' border='0' width='100%'>"+
                            "                               <tr>"+
                            "                                   <td align='left' style='width: 80%; color: white; font-family: Arial; font-size: 14px; font-weight: bold'>MEMBER'S ARENA</td>"+
                            "                                   <td align='right' style='width: 20%; font-family: Arial; font-size: 14px; font-weight: bold'><a href='#' style='color: white; text-decoration: none' title='Close' onclick=\"javascript:showHomeLogin();return false;\">X</a>&nbsp;</td>"+
                            "                               </tr>"+
                            "                           </table>"+
                            "                       </td>"+
                            "                       <td></td>"+
                            "                   </tr>"+
                            "                    <tr>"+
                            "                       <td style='width: 2%'></td>"+
                            "                       <td align='left' style='font-size: 8pt; font-family: Arial; font-weight: bold; width: 48%'>&nbsp;&nbsp;USERNAME</td>"+
                            "                       <td align='left' style='font-size: 8pt; font-family: Arial; font-weight: bold; width: 48%'>&nbsp;&nbsp;PASSWORD</td>"+
                            "                       <td style='width: 2%'></td>"+
                            "                   <tr>"+
                            "                       <td></td>"+
                            "                        <td align='left' style='font-size: 8pt; font-family: Arial; font-weight: bold'><input type='text' id='txtUsername' name='txtUsername' size='11' style='font-family: arial; font-size: 13px; color: Black;' />"+
                            "                       <td align='left' style='font-size: 8pt; font-family: Arial; font-weight: bold'><input type='password' id='txtPassword' name='txtPassword' size='11' style='font-family: arial; font-size: 13px; color: Black;' /></td>"+
                            "                       <td></td>"+
                            "                   </tr>"+
                            "                   <tr>"+
                            "                       <td></td>"+
                            "                       <td colspan='2' align='left'>"+
	                        "                            <select id='selType' name='selType' style='font-family: arial; font-size: 13px; color: Black; width: 168px'>"+
	                        "                               <option value='SelectOptional' selected='selected'>Select (Optional)</option>"+
	                        "                               <option value='htr'>Hidden Treasure</option>"+
	                        "                               <option value='tldr'>Lucrative Derivatives</option>"+
							"                               <option value='mc'>MidcapSelect</option>"+
				            "                               <option value='portfolio'>Portfolio Tracker</option>"+
				            "                               <option value='research-it'>ResearchPro</option>"+
	                        "                               <option value='qv'>StockSelect</option>"+
	                        "                               <option value='sfr'>Strategic Fund Report</option>"+
				            "                               <option value='valuepro'>ValuePro</option>"+
				            "                               <option value='pwa'>Wealth Alliance</option>"+
	                        "                               <option value='derivantage'>DeriVantage</option>"+
				            "                               <option value='forum'>Learning Forum</option>"+
	                        "                            </select>"+
	                        "                           <input type='button' value='Go' style='font-family: arial; font-size: 13px; color: Black; width: 38px' onclick='javascript:menuLoginAction(document.loginMenu);' />"+
                            "                       </td>"+
                            "                       <td></td>"+
                            "                   </tr>"+
                            "                   <tr>"+
                            "                       <td colspan='4' align='center' style='font-size: 8pt; font-family: Arial; font-weight: bold'><a href='/ptmail' style='color: #cc0000'>Sign Up</a> | <a href='/ptmail/for.asp?prd=PT' style='color: Black'>Forgot Password?</a>"+
                            "                       <form name='loginMenu' method='post' action='/Subscription/authenticate.aspx' style='display: none'>"+
                            "                            <input type='hidden' value='' name='username' />"+
                            "                           <input type='hidden' value='' name='password' />"+
                            "                           <input type='hidden' value='' name='Type' />"+
                            "                           <!-- myPlanner -->"+
                            "                           <input type='hidden' name='user name' />"+
                            "                           <!-- StockSelect / Research Reports -->"+
                            "                           <input type='hidden' name='user' />"+
                            "                           <input type='hidden' name='pass' />"+
                            "                           <input type='hidden' name='hdnURLTop' />"+
                            "                        </form>"+
                            "                       </td>"+
                            "                   </tr>"+
                            "               </table>"+
                            "           </div>"+
                            "       </div>"+
                            "   </td>");
    }
    else
    {
        var sProds = sProducts.split(",");
        document.write("        <td style='width: 100%; font-family: arial; font-size: 12px; color: black; font-weight: bold; text-decoration: none;' align='right'>"+
                            "       <table cellspacing='0' cellpadding='0' border='0' width='100%' style='font-family: arial; font-size: 12px; color: black; font-weight: bold; text-decoration: none;'>"+
                            "           <tr>"+
                            "               <td align='right' style='width: auto;'>Welcome,&nbsp;<span style='font-weight: normal; font-style: italic'>" + sName + "</span>&nbsp;&nbsp;&nbsp;</td>"+
                            "               <td align='left' style='width: 210px'><a href='#' onMouseOver=\"javascript:document.getElementById('divMySubs').style.display='';\" onMouseOut=\"javascript:document.getElementById('divMySubs').style.display='none';\" style='text-decoration: underline; color: black'>My Subscriptions</a>&nbsp;|&nbsp;<a href='#' onMouseOver=\"javascript:document.getElementById('divManage').style.display='';\" onMouseOut=\"javascript:document.getElementById('divManage').style.display='none';\" style='text-decoration: underline; color: black'>Manage</a>&nbsp;|&nbsp;<a href='/logout.asp' style='color: black; text-decoration: underline'>Logout</a>&nbsp;&nbsp;"+
                            "                   <div id='divMySubs' style='position:relative; top:0; right:0; width: 155px; z-index: 1000; display: none' onMouseOver=\"javascript:document.getElementById('divMySubs').style.display='';\" onMouseOut=\"javascript:document.getElementById('divMySubs').style.display='none';\">"+
                            "                       <div style='position: absolute; top: 0px; right: 0px; width: 100%; z-index: 1001; background-color: #eeeeee'>"+
                            "                           <table cellpadding='0' cellspacing='0' width='100%' height='5px'>"+
							"								<tr style='height: 5px'>"+
							"									<td></td>"+
							"								</tr>"+
                            "                           </table>"+
                            "                           <table cellpadding='2' cellspacing='0' width='100%' style='border: solid 1px black'>");
       for(j=0; j<sProds.length; j++)
       {
            document.write("                                <tr>"+
                            "                                   <td style='font-weight: bold; color: black; border-bottom: 1px solid #b8b8b8; font-size: 8pt;font-family: arial; cursor: pointer' align='left' onMouseOver=\"javascript:this.style.color='white'; this.style.backgroundColor='#032949';\" onMouseOut=\"javascript:this.style.color='black'; this.style.backgroundColor='';\" onclick=\"javascript:GoToService('" + sLinks.split(",")[j] + "');\">" + sProds[j] + "</td>"+
                            "                               </tr>");
       }
       document.write("                                 </table>"+
                            "                       </div>"+
                            "                   </div>"+
                            "                   <form name='frmLogin' method='post' style='display: none'>"+
                            "                       <input type='hidden' name='username' value='" + sUserName + "' />"+
                            "                       <input type='hidden' name='user' value='" + sUserName + "' />"+
                            "                       <input type='hidden' name='password' value='" + sPass + "' />"+
                            "                   </form>"+
                            "                   <div id='divManage' style='position:relative; top:0; right:0; width: 100px; z-index: 1002; display: none' onMouseOver=\"javascript:document.getElementById('divManage').style.display='';\" onMouseOut=\"javascript:document.getElementById('divManage').style.display='none';\">"+
                            "                       <div style='position: absolute; top: 0px; right: 0px; left: 105px; width: 100%; z-index: 1003; background-color: #eeeeee'>"+
                            "                           <table cellpadding='0' cellspacing='0' width='100%' height='5px'>"+
                            "                               <tr style='height: 5px'>"+
							"									<td></td>"+
							"								</tr>"+
                            "                           </table>"+
                            "                           <table cellpadding='2' cellspacing='0' width='100%' style='border: solid 1px black'>"+
                            "                               <tr>"+
                            "                                   <td style='font-weight: bold; color: black; border-bottom: 1px solid #b8b8b8; font-size: 8pt;font-family: arial; cursor: pointer' align='left' onMouseOver=\"javascript:document.getElementById('aPassword').style.color='white'; this.style.backgroundColor='#032949';\" onMouseOut=\"javascript:document.getElementById('aPassword').style.color='black'; this.style.backgroundColor='';\"><a id='aPassword' href='/subscription/changepassword.asp' style='text-decoration: none; color: black'>Password</a></td>"+
                            "                               </tr>"+
                            "                               <tr>"+
                            "                                   <td style='font-weight: bold; color: black; border-bottom: 1px solid #b8b8b8; font-size: 8pt;font-family: arial; cursor: pointer' onMouseOver=\"javascript:document.getElementById('aProfile').style.color='white'; this.style.backgroundColor='#032949';\" onMouseOut=\"javascript:document.getElementById('aProfile').style.color='black'; this.style.backgroundColor='';\"><a id='aProfile' href='/subscription/updateprofile.asp' style='text-decoration: none; color: black'>Profile</a></td>"+
                            "                               </tr>"+
                            "                               <tr>"+
                            "                                   <td style='font-weight: bold; color: black; border-bottom: 1px solid #b8b8b8; font-size: 8pt;font-family: arial; cursor: pointer' align='left' onMouseOver=\"javascript:this.style.color='white'; this.style.backgroundColor='#032949';\" onMouseOut=\"javascript:this.style.color='black'; this.style.backgroundColor='';\" onclick=\"javascript:window.location.href='/Subscription/manage.asp';\">Subscriptions</td>"+
                            "                               </tr>"+
                            "                               <tr>"+
                            "                                   <td style='font-weight: bold; color: black; border-bottom: 1px solid #b8b8b8; font-size: 8pt;font-family: arial; cursor: pointer' align='left' onMouseOver=\"javascript:this.style.color='white'; this.style.backgroundColor='#032949';\" onMouseOut=\"javascript:this.style.color='black'; this.style.backgroundColor='';\" onclick=\"javascript:window.location.href='/write_to_us.asp';\">Write To Us</td>"+
                            "                               </tr>"+
                            "                           </table>"+
                            "                       </div>"+
                            "                   </div>"+
                            "               </td>"+
                            "           </tr>"+
                            "       </table>"+
                            "   </td>");
    }
                            
    document.write("        </tr>"+
                        "</table>"+
                    "</td>"+
                   "</tr>");
}

function displayMainMenu_rr()
{
    document.write("<link href='/css/dropdown.css' rel='stylesheet' type='text/css' />");        
    objXmlHttpMenu1 = null;
    objXmlHttpMenu1 = GetXmlHttpObj(null);
    objXmlHttpMenu1.open("GET", "/newmenu.asp", false);
    objXmlHttpMenu1.send(null);
    var sText = objXmlHttpMenu1.responseText;
	document.write("<table cellspacing='0' cellpadding='0' border='0' width='100%' style='margin: 0px;padding: 0px;font-family: Arial, Helvetica, sans-serif;'>");
	if(sText.replace(" ","")=="")
    {
		
        newMarketBandInner_rr("", "", "", "", "")
    }
    else
    {
        var sTextArr = sText.split('~');
        newMarketBandInner_rr(sTextArr[0], sTextArr[1], sTextArr[2], sTextArr[3], sTextArr[4])
    }
	document.write("</table>");
}

function PrdInnerBand(sName,sProducts,sLinks)
{
    var sProds = sProducts.split(",");
    var sLnks = sLinks.split(",");
    document.write("<table cellspacing='0' cellpadding='0' border='0' width='100%' style='font-family: arial; font-size: 12px; color: black; font-weight: bold; text-decoration: none;'>"+
                        "           <tr>"+
                        "               <td align='right' style='width: auto;'>Welcome,&nbsp;<span style='font-weight: normal; font-style: italic'>" + sName + "</span>&nbsp;&nbsp;&nbsp;</td>"+
                        "               <td align='left' style='width: 210px'><a href='#' onMouseOver=\"javascript:document.getElementById('divMySubs').style.display='';\" onMouseOut=\"javascript:document.getElementById('divMySubs').style.display='none';\" style='text-decoration: underline; color: black'>My Subscriptions</a>&nbsp;|&nbsp;<a href='#' onMouseOver=\"javascript:document.getElementById('divManage').style.display='';\" onMouseOut=\"javascript:document.getElementById('divManage').style.display='none';\" style='text-decoration: underline; color: black'>Manage</a>&nbsp;|&nbsp;<a href='/logout.asp' style='color: black; text-decoration: underline'>Logout</a>&nbsp;&nbsp;"+
                        "                   <div id='divMySubs' style='position:relative; top:0; right:0; width: 155px; z-index: 1000; display: none' onMouseOver=\"javascript:document.getElementById('divMySubs').style.display='';\" onMouseOut=\"javascript:document.getElementById('divMySubs').style.display='none';\">"+
                        "                       <div style='position: absolute; top: 0px; right: 0px; width: 100%; z-index: 1001;'>"+
                        "                           <table cellpadding='0' cellspacing='0' width='100%' height='5px'>"+
						"								<tr style='height:5px;background-color:white'>"+
						"									<td></td>"+
						"								</tr>"+
                        "                           </table>"+
                        "                           <table cellpadding='2' cellspacing='0' width='100%' style='border: solid 1px black;background-color:#eeeeee'>");
   for(j=0; j<sProds.length; j++)
   {
        document.write("                                <tr>"+
                        "                                   <td style='font-weight: bold; color: black; border-bottom: 1px solid #b8b8b8; font-size: 8pt;font-family: arial; cursor: pointer' align='left' onMouseOver=\"javascript:this.style.color='white'; this.style.backgroundColor='#032949';\" onMouseOut=\"javascript:this.style.color='black'; this.style.backgroundColor='';\" onclick=\"javascript:GoToService('" + sLnks[j] + "');\">" + sProds[j] + "</td>"+
                        "                               </tr>");
   }
   document.write("                                 </table>"+
                        "                       </div>"+
                        "                   </div>"+
                        "                   <div id='divManage' style='position:relative; top:0; right:0; width: 100px; z-index: 1002; display: none' onMouseOver=\"javascript:document.getElementById('divManage').style.display='';\" onMouseOut=\"javascript:document.getElementById('divManage').style.display='none';\">"+
                        "                       <div style='position: absolute; top: 0px; right: 0px; left: 105px; width: 100%; z-index: 1003;'>"+
                        "                           <table cellpadding='0' cellspacing='0' width='100%' height='5px'>"+
                        "                               <tr style='height:5px;background-color:white'>"+
						"									<td></td>"+
						"								</tr>"+
                        "                           </table>"+
                        "                           <table cellpadding='2' cellspacing='0' width='100%' style='border: solid 1px black;background-color:#eeeeee'>"+
                        "                               <tr>"+
                        "                                   <td style='font-weight: bold; color: black; border-bottom: 1px solid #b8b8b8; font-size: 8pt;font-family: arial; cursor: pointer' align='left' onMouseOver=\"javascript:document.getElementById('aPassword').style.color='white'; this.style.backgroundColor='#032949';\" onMouseOut=\"javascript:document.getElementById('aPassword').style.color='black'; this.style.backgroundColor='';\"><a id='aPassword' href='/subscription/changepassword.asp' style='text-decoration: none; color: black'>Password</a></td>"+
                        "                               </tr>"+
                        "                               <tr>"+
                        "                                   <td style='font-weight: bold; color: black; border-bottom: 1px solid #b8b8b8; font-size: 8pt;font-family: arial; cursor: pointer' onMouseOver=\"javascript:document.getElementById('aProfile').style.color='white'; this.style.backgroundColor='#032949';\" onMouseOut=\"javascript:document.getElementById('aProfile').style.color='black'; this.style.backgroundColor='';\"><a id='aProfile' href='/subscription/updateprofile.asp' style='text-decoration: none; color: black'>Profile</a></td>"+
                        "                               </tr>"+
                        "                               <tr>"+
                        "                                   <td style='font-weight: bold; color: black; border-bottom: 1px solid #b8b8b8; font-size: 8pt;font-family: arial; cursor: pointer' align='left' onMouseOver=\"javascript:this.style.color='white'; this.style.backgroundColor='#032949';\" onMouseOut=\"javascript:this.style.color='black'; this.style.backgroundColor='';\" onclick=\"javascript:window.location.href='/Subscription/manage.asp';\">Subscriptions</td>"+
                        "                               </tr>"+
                        "                               <tr>"+
                        "                                   <td style='color: black; border-bottom: 1px solid #b8b8b8; font-size: 8pt;font-family: arial; cursor: pointer' align='left' onMouseOver=\"javascript:this.style.color='white'; this.style.backgroundColor='#032949';\" onMouseOut=\"javascript:this.style.color='black'; this.style.backgroundColor='';\" onclick=\"javascript:window.location.href='/write_to_us.asp';\">Write To Us</td>"+
                        "                               </tr>"+
                        "                           </table>"+
                        "                       </div>"+
                        "                   </div>"+
                        "               </td>"+
                        "           </tr>"+
                        "       </table>");
}

function displayMainMenu_Prd()
{
    document.write("<link href='/css/dropdown.css' rel='stylesheet' type='text/css' />");        
    objXmlHttpMenu1 = null;
    objXmlHttpMenu1 = GetXmlHttpObj(null);
    objXmlHttpMenu1.open("GET", "/newmenu.asp", false);
    objXmlHttpMenu1.send(null);
    var sText = objXmlHttpMenu1.responseText;
	if(sText.replace(" ","")!="")
    {
        var sTextArr = sText.split('~');
        PrdInnerBand(sTextArr[0], sTextArr[1], sTextArr[2])
    }
}
  function openWindow(reqUrl){
	//window.open(reqUrl,'mywindow','width=600,height=300,resizable=yes,scrollbars=yes,toolbar=yes,directories=yes,status=yes,menubar=yes,copyhistory=yes');
	window.open(reqUrl,'_blank');  
	return false;
  }

function getCookie(objUserName, objCheck)
{

    //Birendra | 14-Sep-2010 | checking username cookie
    c_name = "EQUSRNAME";
    c_start=document.cookie.indexOf(c_name + "=");

    if(c_start != -1)
    {
        c_start=c_start + c_name.length+1;
        c_end=document.cookie.indexOf(";",c_start);
        if (c_end==-1) c_end=document.cookie.length;

        document.getElementById(objUserName).value = unescape(document.cookie.substring(c_start,c_end));
        document.getElementById(objCheck).checked = true;
    }
}

function getNLLine(strNL,strType,strUserName,strEncoded)
{getNLLineColor(strNL,strType,strUserName,strEncoded,'#000000');}
function getNLLineColor(strNL,strType,strUserName,strEncoded,strColor)
{
    var strDispName = "";
    var strWriteTo = "US";
    if(strNL == "5MinWrapup")
        strDispName = "THE 5 MINUTE WRAPUP";
    else if(strNL == "dailyreckoning")
        strDispName = "THE DAILY RECKONING";
    else if(strNL == "ht")
    {
        strDispName = "THE HONEST TRUTH";
        strWriteTo = "AJIT";
    }
    else if(strNL == "sfth")
    {
        strDispName = "STRAIGHT FROM THE HIP";
        strWriteTo = "JAWAHIR";
    }

    var strLine = "";
    
    if(strType == "Archives" || strType == "Details")
        strLine = "<a href='/" + strNL + "/popular.asp' style='color:" + strColor + "'>MOST POPULAR</a>&nbsp;|&nbsp;";
    if(strType == "Popular" || strType == "Details")
        strLine += "<a href='/" + strNL + "/archives.asp' style='color:" + strColor + "'>ARCHIVES</a>&nbsp;|&nbsp;";
        
    strLine += "<a href=\"javascript:recommend('" + strEncoded + "')\" style='color:" + strColor + "'>TELL YOUR FRIENDS ABOUT " + strDispName + "</a>&nbsp;|&nbsp;";
    if(strType == "Details")
        strLine += "<a href='/write_to_us.asp?pg_title=" + strEncoded + "&username=" + strUserName + "'";
    else
        strLine += "<a href='/feedback.asp?Hsector=" + strEncoded + "&Htitle=" + strType + "&username=" + strUserName + "'";
    strLine += " style='color:" + strColor + "'>WRITE TO " + strWriteTo + "</a>";
    
    document.write("<table width='100%' cellspacing='0' cellpadding='0' style='border-top: solid 1px #e0e7f1; border-bottom: solid 1px #e0e7f1'>"+
        "<tr>"+
        "    <td align='left' style='padding:4px 0px 4px 0px;font-family:arial, serif;font-size:8pt;line-height: 1.5'>" + strLine + "</td>"+
        "    <td align='right' style='padding:4px 0px 4px 0px;font-family:arial, serif;font-size:8pt;line-height: 1.5;'>"+
        "        <!-- AddThis Button BEGIN -->"+
        "        <div class=\"addthis_toolbox addthis_default_style\" style='float: right'>"+
        "        <a href=\"http://www.addthis.com/bookmark.php?v=250&amp;username=equitymaster\" class=\"addthis_button_compact\">Share</a>"+
        "        <span class=\"addthis_separator\">|</span>"+
        "        <a class=\"addthis_button_preferred_1\"></a>"+
        "        <a class=\"addthis_button_preferred_2\"></a>"+
        "        <a class=\"addthis_button_preferred_3\"></a>"+
        "        <a class=\"addthis_button_preferred_4\"></a>"+
        "        <a href='/rss'><img src='/rss/rss.gif' border='0' /></a>"+
        "        </div>"+
        "        <script type=\"text/javascript\">var addthis_config = {\"data_track_clickback\":true};</script>"+
        "        <script type=\"text/javascript\" src=\"http://s7.addthis.com/js/250/addthis_widget.js#username=equitymaster\"></script>"+
        "        <!-- AddThis Button END -->"+
        "    </td>"+
        "</tr>"+
    "</table>");
}
var sURLCurr = unescape(document.location.href).toLowerCase();
var iChgURL = 0;
if (sURLCurr.indexOf("invest.equitymaster") >= 0)
{
    iChgURL = 1;
    sURLCurr = sURLCurr.replace("invest.equitymaster","www.equitymaster");
}
else if (sURLCurr.indexOf("chalomumbai.equitymaster") >= 0)
{
    iChgURL = 1;
    sURLCurr = sURLCurr.replace("chalomumbai.equitymaster","www.equitymaster");
}
if(sURLCurr.indexOf("https:") >= 0 && sURLCurr.indexOf("subscription") < 0)
{
    iChgURL = 1;
    sURLCurr = sURLCurr.replace("https:","http:");
}
if(iChgURL == 1)
{
	window.location.href=sURLCurr;
}
function fnPostIt()
{
    document.write("<script language='javascript' src='http://www.adimpact.com/cgi-bin/webapp/dsp.cgi?id=5143924003'></script><noscript><a href='http://www.adimpact.com/'>Email Marketing</a></noscript>");  
}
function GoogPages() // For Google Pages Badge in the head tag
{document.write("<link href='https://plus.google.com/b/116621930507245638619/' rel='publisher' />");}
GoogPages();
function fnAdvtAsyncServ()
{
    if(iGetAsyncServices == 1)
    {
        objXmlHttpMenu = null;
        objXmlHttpMenu = GetXmlHttpObj(fnAdvtAsyncSucc);
        objXmlHttpMenu.open("POST", "/subscription/AsyncHit.aspx", true);
        objXmlHttpMenu.send(null);
    }
}
function fnAdvtAsyncSucc()
{

}
//Calling Async page to get services from advantage
fnAdvtAsyncServ();
