// JavaScript Document
/*To load page inside iFrame: start here*/
function loadURL(pageURL){
document.location.href = pageURL;
}
/*To load page inside iFrame: end here*/

/*Function to show-hide Stock chart on Home Page: starts here*/
function stockChart(sId1, sId2,linkId1,linkId2,spanId1,spanId2){
	document.getElementById(sId1).style.display='inline';
	document.getElementById(sId2).style.display='none';	
	document.getElementById(spanId1).className='redtxt';
	document.getElementById(spanId2).className='bluetxt';		
	document.getElementById(linkId1).className='mbgon';
	document.getElementById(linkId2).className='mbgof';	
}
/*Function to show-hide Stock chart on Home Page: ends here*/

/* To search topnav.jsp: start here */
function ScripNameOnFocus()
{	
	var txtScripName = document.getElementById("Top1_TxtQuotes");
		
	if(txtScripName.value=='Scrip Name')
	{
		txtScripName.value="";
		return true;
	}	
	return false;
}
function ScripNameOnBlur()
{	
	var txtScripName = document.getElementById("Top1_TxtQuotes");	
		
	if(TrimSpaces(txtScripName.value)=='')
	{
		txtScripName.value="Scrip Name";
		return true;
	}	
	return false;
}










function ScripNameOnFocus1()
{	
	var txtScripName = document.getElementById("searchCriteria");
		
	if(txtScripName.value=='Search')
	{
		txtScripName.value="";
		return true;
	}	
	return false;
}



function ScripNameOnBlur1()
{	
	var txtScripName = document.getElementById("searchCriteria");		
	if(TrimSpaces(txtScripName.value)=='')
	{
		txtScripName.value="Search";
		return true;
	}	
	return false;
}

/*To search topnav.jsp:: end here*/
/*Function to display content on Glossary Page and Comodity Glossary Page: starts here*/

function showAlphaContent(cId,conLength,classnm1,classnm2){         
            for(i=0;i<conLength;i++){
                        if(cId == i){
                        document.getElementById('alphacon'+cId).className="show-content";
                        document.getElementById('alpha'+cId).className=classnm1;
                        }else{
                        document.getElementById('alphacon'+i).className="hide-content";
                        document.getElementById('alpha'+i).className=classnm2;
                        }
            }
}
/*Function to display content on Glossary Page: ends here*/



/*Fucntion for popup window: start here*/

function NewWindow(mypage, myname, w, h, scroll)
{
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	wint = wint - 100;
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable'
	winprops = winprops + ',hotkeys=yes'
	mypage = mypage
	win = window.open(mypage, myname, winprops)
}
function sub()
{
window.open();
}
/*Fucntion for popup window: end here*/

/*Function to display the tab content on 'Our Vision & Mission' page under Home - About Us: starts here*/ 
function DisplaySpan(spanToDiplay, spanToHide1, spanToHide2, tab1, tab2, tab3)
	{	
		document.getElementById(spanToDiplay).style.display="inline";
		document.getElementById(spanToHide1).style.display="none";
		document.getElementById(spanToHide2).style.display="none";
		document.images['img_vision'].src = '../../images/vm_button_'+tab1+'.gif';
		document.images['img_corporate'].src = '../../images/vm_button_'+tab2+'.gif';
		document.images['img_mission'].src = '../../images/vm_button_'+tab3+'.gif';		
		return true;
	}
/*Function to display the tab content on 'Our Vision & Mission' page under Home - About Us: ends here*/

/*Functions for Current Openings section: starts here*/
function check(){	
	win=window.open('C-submitResumeNew.jsp','win','status=no,menubar=no,toolbar=no,resizable=0,width=650,height=300');
	win.moveTo(window.outerWidth/10,window.outerHeight/4);
	return true;
}

function mailpage(){
	mail_str = "mailto:?subject=Welcome to HSBC InvestDirect (India)" ;//+ document.title;
	mail_str += "&body=You can view the Current Openings of HSBC InvestDirect (India) at " + location.href;
	location.href = mail_str;
}

function getElementbyClass(classname){
	var t_array=new Array()
	var alltags=document.all? document.all : document.getElementsByTagName("*")
	var inc=0
	for (i=0; i<alltags.length; i++ ) {
	if (alltags[i].className == classname )
	t_array[inc++]=alltags[i];
	}
	return t_array
}

function expcol(pid,img1,src1,src2){
	dontHideThis(pid,img1,src1,src2)
	document.getElementById(pid).style.display=(document.getElementById(pid).style.display!="none")? "none" : ""
	document.getElementById(img1).src=(document.getElementById(pid).style.display!="none")? src2 : src1
	//parent.document.all.frame1.style.height  = document.body.scrollHeight;
}

function hideIt(){
	var i=0
	var elem=new Array()
	var imag=new Array()
	elem = getElementbyClass("switchcontent")
	imag = getElementbyClass("switchimage")
	for(i=0;i<elem.length;i++){
	elem[i].style.display="none"
}
}

function dontHideThis(pid,img1,src1,src2){
	var i=0
	img1.src=src2
	var elem=new Array()
	var imag=new Array()
	elem = getElementbyClass("switchcontent")
	imag = getElementbyClass("switchimage")
	for(i=0;i<elem.length;i++){
	if(document.getElementById(pid)!=elem[i])
		elem[i].style.display="none"	
	}
	for(i=0;i<imag.length;i++){
	if(document.getElementById(img1)!=imag[i])
		imag[i].src="../../images/Toggle_Right.gif"	
	}
}
/*Functions for Current Openings section: ends here*/

/*Functions for Write to HR section: starts here*/
function sendmail(){
	alert ("Sending E-mail.");
	return true;
}
/*Functions for Write to HR section: ends here*/

/* Function to be used in the file 'BoardOfDirectors.htm' to show the messages: start here */
function ShowDetails(value1, value2)
	{
		/* Function Usage :*/	
	
		var PreviousStyle;
		var counter;				
		for (counter=1; counter<=value2; counter++)
		{
			PreviousStyle=document.getElementById("span" + counter ).style.display;					
			if (counter==value1 && PreviousStyle != "inline" )
			{						
				document.getElementById("span" + "" + counter ).style.display="inline";
				document.getElementById("span" + "" + counter + "" + counter + "_").className="OrangeHead";
				document.getElementById("span" + "" + counter + "" + counter + "" + counter).className="txtBlackbold";						
				//document.getElementById("image" + "" + counter ).src="../imagess/Toggle_Down.gif";	
				document.getElementById("image" + "" + counter ).src="../../images/Toggle_down.gif";	
			}
			else
			{
				document.getElementById("span" + "" + counter ).style.display="none";
				document.getElementById("span" + "" + counter + "" + counter + "_").className="bluetxt";
				document.getElementById("span" + "" + counter + "" + counter + "" + counter).className="text";
				//document.getElementById("image" + "" + counter ).src="../imagess/Toggle_Right.gif";					
								document.getElementById("image" + "" + counter ).src="../../images/Toggle_Right.gif";					
			}					 																										
		}	
		//calcHeight();
		function calcHeight()
		{
			
			if(top.document.getElementById && !(top.document.all)) {
				h = top.document.getElementById('frame1').contentDocument.body.scrollHeight;
				top.document.getElementById('frame1').style.height = h;
			}
			else if(document.all) {
				h = top.document.frames('frame1').document.body.scrollHeight;
				top.document.all.frame1.style.height = h;
			}								
		}			
	}
/* Function to be used in the file 'BoardOfDirectors.htm' to show the messages: end here */
		
/* functions to show hide earlier reports table in case of retail Offerings->commodity ->Research : starts here*/
  function setearlier()
	  {			  
	  		document.getElementById("ReportFrm:earlier_binding").value="earlier"			       
	  }
  function showhidetable()
	  {		
		  if(document.getElementById("ReportFrm:earlier").value == "earlier")
		  {
		  	document.getElementById("table1").style.display='none';
		  	document.getElementById("table2").style.display='';
		  }
	  }
/*  functions to show hide earlier reports table in case of retail Offerings->commodity ->Research : ends here */


/*
  Markets->Company InformationPage:  Below function is to populate appropriate pages values in pages dropdown as value is selected in section dropdown used in QuoteFinder.jsp
*/
function ChangePgDropDownQF()
	{
		var arr_0 = new Array("Smart Quotes");
		var arr_1 = new Array("Company Background","Company Snapshot","Company History","Company News");	
		var arr_2 = new Array("Smart Quotes","Historical Prices","Charting");
		var arr_3 = new Array("Board Of Directors","Share Holding","Branches","Products","Compare company","Peer Group");
		var arr_4 = new Array("Results","PL Account","Balance Sheet","Cash Flows","Research Reports" );
		var arr_5 = new Array("Valuation Ratio","Financial Ratios","Scoreboard","Earnings");
		var arr_6 = new Array("Dividend History","Chairmans Speech","Directors Report","Fo.Board Meeting");
		var arr_7 =  new Array("Announcements","Book Closure","Bonus - Rights","De-listed Shares","Market Turnover","Change of Name");
		var arr_8 = new Array("Latest Equity","Equity History","Bonus History","MF Holdings");
		
		var arraytoCopy  = eval('arr_' + document.getElementById("DD_Quotes").value)
	
	
		var selectOption = document.getElementById("selectOption");
		if(selectOption ==null )
		{
			var selectOptionArr = document.getElementsByName("selectOption");
			selectOption = selectOptionArr[0];
		}	
		
		selectOption.options.length = arraytoCopy.length;
	
		var setPage1 = document.getElementById("DD_Quotes").value ;
		
		var setPage= setPage1 - 1 ;
		
		document.getElementById("pageId").value = setPage ;
		for(i = 0; i<arraytoCopy.length;i++)
		{
			selectOption.options[i].text = arraytoCopy[i];
			selectOption.options[i].value = arraytoCopy[i];
		}	
	}
	/* Market -> CompanyInfo below function is called on click of submit button on QuoteFinder used in QuoteFinder.jsp*/
	function SearchQuote()
	{	
if (document.getElementById("coName").value.indexOf("'")!=-1)
{
	alert("invalid");
	return false;
}
		var srchComp = document.getElementById("coName");
		if(srchComp ==null )
		{
			var srchCompArr = document.getElementsByName("coName");
			srchComp = srchCompArr[0];
		}	
		
		var selectOption = document.getElementById("selectOption");
		if(selectOption ==null )
		{
			var selectOptionArr = document.getElementsByName("selectOption");
			selectOption = selectOptionArr[0];
		}	
		
		var PageId = document.getElementById("pageId").value;
		
		var SrchComp1=srchComp.value;				
		var bFind=false;
		var iIndex=-1;
	
		while(!bFind)
		{
			// Replace & characher with "%26"
			SrchComp1=SrchComp1.replace(/&/,"%26");
			// Replace single quotes (''') characher with "" (empty)
			SrchComp1=SrchComp1.replace(/'/,"");
			// Replace double quotes (") characher with "" (empty)
			SrchComp1=SrchComp1.replace(/"/,"");
			
			iIndex=SrchComp1.lastIndexOf("&");			
			if (iIndex==-1)
			{
				iIndex=SrchComp1.lastIndexOf("'");
				if (iIndex==-1)
				{
					iIndex=SrchComp1.lastIndexOf('"');
					if (iIndex==-1)
					{
						bFind=true;
					}
				}
			}
		}
		
		if(TrimSpaces(SrchComp1)=="")
		{
			alert("Please enter company Name ..!!!");
			actVar  ="../../Markets/CompanyInfo/GenInformation.do?reqCode=generalInfo&page="+PageId;		
			document.forms[0].action=actVar
			document.forms[0].submit();
			return;			
		}
		else
		{	
		actVar  ="../../Markets/CompanyInfo/GenInformation.do?reqCode=generalInfo&page="+PageId;		
		document.forms[0].action=actVar				
		document.forms[0].submit();	
		}
	}
	/**/
	/* Below is utility function used to trim the space in String */
	function TrimSpaces(checkString)
	{
	    newString = "";    // REVISED/CORRECTED STRING
	    for (i = 0; i < checkString.length; i++) 
	    {
	        ch = checkString.substring(i, i+1);
	        if (ch != " " ) 
	        {
	            newString += ch;
	        }
	    }
	        return newString;
	}
	 /*  */
	/* below function redirects to the jsp selected in combo. used in MarketQuotes.jsp*/
	function ChangePgDropDown1()
	{
	var field=document.getElementById("quotes").value;
	
	if (field=="Select")
		{
			alert("Please Select any link..!!");
		}
		else
		{
			window.location.href=field;
		}	
	}
	/* Below function is to set the dispalyed Page Name in the Quick Links DropDown */
	function setCombo1()
		{
	
		var jspName = location.href;
			chk_Q = jspName.indexOf("?");			
			/*This code is to detect '?' sign in URL - starts here*/
			if(chk_Q == -1){
			jspName = location.href;
			}else{
			jspName = jspName.substring(0,chk_Q);
			}
			
			sperator = '/'
			var jspNameArray = jspName.split(sperator);
			jspnameVar = jspNameArray[jspNameArray.length-1];
			
			document.getElementById("quotes").value = jspnameVar
			
		}
		
		/* Below function is to set the dispalyed Page Name in the Quick Links DropDown */
	function setCombo()
		{
	
		var jspName = location.href;
			chk_Q = jspName.indexOf("=");			
			/*This code is to detect '?' sign in URL - starts here*/
			if(chk_Q == -1){
			jspName = location.href;
			}else{
			jspName = jspName.substring(chk_Q+1,jspName.length);
			}
		
			var arrayCode = new Array("liveIndices","sensexMovers","niftyMovers","marketFIIActivity","marketMFActivity","exchangeHolidays","gainersLosers",
"advancesDeclines","volumeToppers","instiVolume","highsLows","sectorUpdate","volumeToppers","getIndexWeightage","gainersLoosers","compareIndustry","limeLight","turnOver","circuitBreakers",
"newListings","bulkDeals","forexMarket","callMoney","bullionMarket","ADRPrices","worldIndices","foreignMarketCommentry","preSession","midSession",
"endSession","quickReview","economyWatch","marketSummary","hotPursuit","sectorNews","marketBeat","economy","stockAlert","corporateNews",
"equityMarkets","debtMarkets","generalMarkets","economicMarkets","ipoMarkets","bseAnnouncement","nseAnnouncement","announcement",
"resultsAnnounced","boardMeetEvent","AGMeetEvent","bookClosureEvent","bonusIssuesEvent","rightIssuesEvent","splitFVEvent","resultCalendar","nameChange","delistedShares");
			// sperator = '/'
			//var jspNameArray = jspName.split(sperator);
			//jspnameVar = jspNameArray[jspNameArray.length-1];
			
			var temp=new Array();
			if(jspName.indexOf('&')!=-1){
			temp=jspName.split('&');
			jspName=temp[0];
			
			}
			
			for(i=0;i<arrayCode.length;i++)
			{
				if(jspName==arrayCode[i])
				{
				
				document.getElementById('quotes').value =i;
				//break;
				}
			}
			
		
			
		}
		
	/* below function prints A to Z alphabets on page used in MiscnameChg.jsp, DeListedShares.jsp*/
	function ShowA2Z(redUrl_){
		var A2ZIndexId = document.getElementById("A2Z");
		if(A2ZIndexId.innerHTML==""){
			var A2Z="";
				for(i=65; i<=90; i++)
					A2Z += "<a href='"+ redUrl_ +"?var="+ String.fromCharCode(i) +"'"+"class = 'BlueLinkCons'"+">"+ String.fromCharCode(i) +"</a> <span class='Divider'> | </span>";
					A2Z = A2Z.substring(0,A2Z.length -32)
					A2ZIndexId.innerHTML = A2Z;
		}
		else
			A2ZIndexId.innerHTML = "";			
	}

	/* Below function switchs Nifty / Sensex on click of radio used in MarketLive.jsp */
	function ShowSubOptions(opt) 
	{
	
	option = opt	
		var optlen = 1;	
		for( icount = 0;icount<=optlen;icount++)	
		{		
			if(icount == option)	
			{		
				document.getElementById("ShowM" + option).style.display = 'block';						
			}
			else{
			document.getElementById("ShowM" + icount).style.display = 'none';
			}
		}
		if (option==0)
		{
				document.getElementById("bse").style.display='none';
				document.getElementById("nse").style.display='';	
				document.getElementById("market:mktNSE").style.display='inline';				
				document.getElementById("market:mktBSE").style.display='none';	
				document.getElementById("radio_0").className="textblack";
				document.getElementById("radio_1").className="textblackN";
		}
		if (option==1)
		{
				document.getElementById("nse").style.display='none';
				document.getElementById("bse").style.display='';
				document.getElementById("market:mktNSE").style.display='none';
				document.getElementById("market:mktBSE").style.display='inline';
				document.getElementById("radio_1").className="textblack";
				document.getElementById("radio_0").className="textblackN";				
		}		
	}


/* below function prints page numbers on the jsp page used in CorpEvtAGMAnalyst.jsp*/
function ShowPages(redUrl_,appendStr,container,countCont,current)
{
count = document.getElementById(countCont).value
	var PageIndexId = document.getElementById(container);
	if(PageIndexId.innerHTML==""){
		var dispayPages="";
			for(i=1; i<=count; i++)
			{
				if(current == i )
				{
				dispayPages +="<span class='BlueLinkCons' style='font-size:11px'>"+i+"&nbsp;</span>"
				}
				else
				{
					dispayPages += "<a href='"+ redUrl_ +"&"+appendStr+"="+ i +"'"+"class = 'BlueLinkCons'"+">"+ i +"</a> ";			
				}
			}
				PageIndexId.innerHTML = dispayPages;
	}
	else
		PageIndexId.innerHTML = "";			
}

// Below function is to show/hide the table on click of plus/minus image
// tbleOn:Table id to be shown,tbleOff:-table id to be hidden,imgOn:-image id to be shown,
// imgOff:-Image Id to be hidden used in CorpEvtAGMAnalyst.jsp, CorpEvtBookClosure.jsp
// Also used in LLBulkdeals.jsp,LLNewlistings.jsp,LLturnover,jsp

function showTble( tbleOn,imgOn,imgOff)
{
	var onMT = document.getElementById(tbleOn);
	
	var Img_RawOff = document.getElementById(imgOn);
	var Img_RawOn = document.getElementById(imgOff);
	
	if(onMT.style.display == 'none')
	{
		onMT.style.display = "inline";  
	}else
	{
		onMT.style.display = "none";
	}
	
	Img_RawOff.style.display = "none";  
	Img_RawOn.style.display = "inline"; 	
}

// used in Corporate Events AGM tab
function showTble1( tbleOn,tbleOn1,imgOn,imgOff)
{
	var onMT = document.getElementById(tbleOn);
	var onMT1 = document.getElementById(tbleOn1);
	
	var Img_RawOff = document.getElementById(imgOn);
	var Img_RawOn = document.getElementById(imgOff);
	
	if(onMT.style.display == 'none')
	{
		onMT.style.display = "inline";  
	}else
	{
		onMT.style.display = "none";
	}
	if(onMT1.style.display == 'none')
	{
		onMT1.style.display = "inline";  
	}else
	{
		onMT1.style.display = "none";
	}
	
	Img_RawOff.style.display = "none";  
	Img_RawOn.style.display = "inline"; 	
}
//-------------------------- added by Rachit------------------------------

function showTble2( tbleOn,tbleOn1,imgOn,imgOff)
{
	var onMT = document.getElementById(tbleOn);
	var onMT1 = document.getElementById(tbleOn1);
	//alert("onMT::"+onMT);
	//alert("onMT1::"+onMT1);
	
	var Img_RawOff = document.getElementById(imgOn);
	var Img_RawOn = document.getElementById(imgOff);
	
	
	
	
	
	if(onMT!= null)
	{
	
	if(onMT.style.display == 'none')
	{
		onMT.style.display = "inline";  
	}else
	{
		onMT.style.display = "none";
	}
	if(onMT1!= null)
	{
	if(onMT1.style.display == 'none')
	{
		onMT1.style.display = "inline";  
	}else
	{
		onMT1.style.display = "none";
	}
	}
	}
	
	Img_RawOff.style.display = "none";  
	//alert(Img_RawOff.style.display);
	Img_RawOn.style.display = "inline"; 	
	//alert(Img_RawOn.style.display);
}



//-------------------------- added by Rachit------------------------------
function winpopup(strUrl)
{	
	 var strUrl;
	 var newWin=window.open(strUrl,'MyWindow2','x=0,y=0,toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=no,copyhistory=no,width=580,height=350,screenX=0,screenY=0,left=210,top=200');	
	 newWin.focus();
}

function fillSymbol(which)
{
	if(which =="NCDEX")
	{
	document.getElementById("NCDEX").style.display = "inline";
	document.getElementById("MCX").style.display = "none";
	}
	else
	{
	document.getElementById("MCX").style.display = "inline";
	document.getElementById("NCDEX").style.display = "none";
	}
}

/* Function used LookUp dropDown in Commodity.jsp */
function LookUpPage(which)
{
	var valSel = document.getElementById("DD_LookUp").value; 
	var selExchange = document.getElementById("Ech");
		 if(selExchange ==null )
			{
				var selectExchgArr = document.getElementsByName("Ech");
				selExchange = selectExchgArr[0];
			}			
			exchange = selExchange.value ; 
		var arrAction = new Array('',
		'../../Markets/Commodity/MarketMovers.do?reqCode=gainersLosers',
		'../../Markets/Commodity/MarketMovers.do?reqCode=advDec',
		'../../Markets/Commodity/MarketMovers.do?reqCode=highLow',
		'../../Markets/Commodity/MarketMovers.do?reqCode=closingPrice',
		'../../Markets/Commodity/TradeInfo.do?reqCode=volumeToppers',
		'../../Markets/Commodity/TradeInfo.do?reqCode=valueToppers');
		if(valSel !=null && valSel.length > 0)
		{
			location.href = arrAction[valSel]+"&Exchg="+exchange+"&Symbol=ALL";		
		}
}

/* Commodity Section -Closing price submit action */
function sumbitClosingPrice()
{
		
		var exchange = document.getElementById("exchange").value;
		var totRec = document.getElementById("totRec").value;
		
		document.forms[1].action = "../../Markets/Commodity/MarketMovers.do?reqCode=closingPrice&Exchg="+exchange+"&TOTREC="+totRec;
		document.forms[1].submit();
}

/* Commodity Section -ADVANCES & DECLINES submit action */
function advDecSubmit()
{
		document.forms[1].action = "../../Markets/Commodity/MarketMovers.do?reqCode=advDec";
		document.forms[1].submit();
}

/* Commodity Section -Highs & Lows submit action */
function highLowsSumbit()
	{
		var exchange = document.getElementById("exchange").value;
		var totRec = document.getElementById("pageName").value;
		var expDate=document.getElementById("expDate").value;
		document.forms[1].action = "../../Markets/Commodity/MarketMovers.do?reqCode=highLow&Exchg="+exchange+"&TOTREC="+totRec+"&EXPDATE="+expDate;
		document.forms[1].submit();
	}
	
/* Commodity Section -Gainers & Losers submit action */
function gainersLosersSumbit()
	{
		var exchange = document.getElementById("exchange").value;
		var totRec = document.getElementById("pageName").value;
		document.forms[1].action = "../../Markets/Commodity/MarketMovers.do?reqCode=gainersLosers&Exchg="+exchange+"&TOTREC="+totRec;
		document.forms[1].submit();
	}

/* Commodity Section -Value Toppers submit action */
function valueTopperssumbit()
	{
		var exchange = document.getElementById("exchange").value;
		var totRec = document.getElementById("totRec").value;
		document.forms[1].action = "../../Markets/Commodity/TradeInfo.do?reqCode=valueToppers&Exchg="+exchange+"&TOTREC="+totRec;
		document.forms[1].submit();
	}
	/* Commodity Section -Volume Toppers submit action */
function volumeTopperssumbit()
	{
		var exchange = document.getElementById("exchange").value;
		var totRec = document.getElementById("totRec").value;
		document.forms[1].action = "../../Markets/Commodity/TradeInfo.do?reqCode=volumeToppers&Exchg="+exchange+"&TOTREC="+totRec;
		document.forms[1].submit();
	}
////////////////////////////////////////////////////////////////////////
/* functions for commodity Quick Links starts here */
	function checkLink()
	{
		var valSel = document.getElementById("DD_QuickLinks").value; 
		
		if(valSel == 0)
		{
		alert("Please select any link");
		return ;
		}
		var arrAction = new Array('',
									'../../Markets/Commodity/PerformanceReview.jsp',
									'../../Markets/Commodity/Charting.jsp',
									'../../Markets/Commodity/MarketMovers.do?reqCode=gainersLosers',
									'../../Markets/Commodity/MarketMovers.do?reqCode=advDec&Exchg=',
									'../../Markets/Commodity/MarketMovers.do?reqCode=highLow',
									'../../Markets/Commodity/MarketMovers.do?reqCode=closingPrice',
									'../../Markets/Commodity/TradeInfo.do?reqCode=volumeToppers',
									'../../Markets/Commodity/TradeInfo.do?reqCode=valueToppers',
									'../../Markets/Commodity/NewsCommentry.do?reqCode=generalNews',
									'../../Markets/Commodity/NewsCommentry.do?reqCode=morningBuzz',
									'../../Markets/Commodity/NewsCommentry.do?reqCode=middayReview',
									'../../Markets/Commodity/NewsCommentry.do?reqCode=closingSession',
									'../../Markets/Commodity/ProductInfo.do?reqCode=productDetails',
									'../../Markets/Commodity/ProductInfo.do?reqCode=productNotes');

		if(valSel !=null && valSel.length > 0)
		{
		document.forms[0].action = arrAction[valSel];
		document.forms[0].submit();
		}		
	}
	
	function setLink(which)
	{
		if(which == 'null')
		{		
		which = fileNameArray[fileNameArray.length-1]	
		}
		if(which != null)
		{
			var optSel = document.getElementById("DD_QuickLinks");			
			var arrSel = new Array('',
								'PerformanceReview.jsp',
								'Charting.jsp',
								'gainersLosers',
								'advDec',
								'highLow',
								'closingPrice',
								'volumeToppers',
								'valuToppers',
								'generalNews',
								'morningBuzz',
								'middayReview',
								'closingSession',
								'productDetails',
								'productNotes');
								
			var selIndex = 0;
			for(i=0;i<arrSel.length;i++)
			{
				if(which ==arrSel[i] )
				{
				selIndex = i;
				break;
				}
			}
			optSel.options[selIndex].selected = true;
		}
	}
	
/* function for commodity Quick Links Ends here */

/*  funcrions for commodity Product Details Starts here */
function submitThis()
	{
		var selExchange = document.getElementById("exchange");
		 if(selExchange ==null )
			{
				var selectExchgArr = document.getElementsByName("exchange");
				selExchange = selectExchgArr[0];
			}			
			exchange = selExchange.value ;
		var selCategory = document.getElementById("category");	
		 if(selCategory == null )
			{
				var selectcategoryArr = document.getElementsByName("category");
				selCategory = selectcategoryArr[0];
			}				
		var	category1 = selCategory.value ;
		
		if(category1 == 0)
		{
		alert("Please Select Category")
		return false ;
		}	
	
		
		document.forms[1].action = "../../Markets/Commodity/ProductInfo.do?reqCode=showProduct&Symbol="+category1 + "&Exchg="+exchange;
		document.forms[1].submit();
	}
/* fucntions for commodity Products Details ENds here */

/* functions for Commodity Landing Page Starts here */
function goToProdDetails()
	{
	var selExchange = document.getElementById("exchange");
		 if(selExchange ==null )
			{
				var selectExchgArr = document.getElementsByName("exchange");
				selExchange = selectExchgArr[0];
			}			
			exchange = selExchange.value ;
			
	var selCategory = document.getElementById("category");	
	 if(selCategory == null )
		{
			var selectcategoryArr = document.getElementsByName("category");
			selCategory = selectcategoryArr[0];
		}				
	var	category1 = selCategory.value ;		
		if(category1 == 0)
		{
		alert("Please Select Category")
		return false ;
		}
	
	document.forms[2].action ="../../Markets/Commodity/ProductInfo.do?reqCode=showProduct&Symbol="+category1 + "&Exchg="+exchange;
	
	document.forms[2].submit();
	}
	
	function goToQuotesDetails()
	{
	 var selExchange = document.getElementById("exchange");
	 if(selExchange ==null )
		{
			var selectExchgArr = document.getElementsByName("exchange");
			selExchange = selectExchgArr[0];
		}			
		exchange = selExchange.value ;
		if(exchange == 0)
		{
		alert("Please Select Exchnage")
		return false ;
		}
 	 var selCompName = document.getElementById("compName");
 	 if(selCompName ==null )
		{
			var compNameArr = document.getElementsByName("compName");
			selCompName = compNameArr[0];
		}			
 	 compName = selCompName.value;
 	 if(compName == 0)
		{
		alert("Please Select Symbol")
		return false ;
		}
	 var expDateMcx = document.getElementById("expDate");
 	 if(expDateMcx ==null )
		{
			var expDateMcxArr = document.getElementsByName("expDate");
			expDateMcx = expDateMcxArr[0];
		}			
 	 expDateMcxVal = expDateMcx.value;
 	
 	 if(expDateMcxVal == "0" || (expDateMcxVal.length==0) )
		{
		alert("Please Select Expiry Date")
		return false ;
		}
	 document.forms[3].action ="../../Markets/Commodity/QuotesHome.do?reqCode=performanceReviewDetails"+"&Exchg="+exchange+"&CompName="+compName;
	 document.forms[3].submit();
	}
/* functions for commodities Landing Page Ends here */
/* functions for commodities Perfomarmance Details Starts HEre */
	function submitDate()
	{
	
	 	var selectExchg = document.getElementById("exchange");
			if(selectExchg ==null )
			{
				var selectExchgArr = document.getElementsByName("exchange");
				selectExchg = selectExchgArr[0];
			}	
			exchange = selectExchg.value;
			
			if(exchange == 0)
			{
			alert("Please Select Exchange")
			return false ;
			}
			
	 	 var selCompName = document.getElementById("compName");	  
	 	 	
			if(selCompName ==null )
			{
				var selCompNameArr = document.getElementsByName("compName");
				selCompName = selCompNameArr[0];
			}	
			
	 	// compName = selCompName.value
	 	compName = document.getElementById("tempCompName").value; 	
	 	 if(compName == 0)
			{
			alert("Please Select Symbol")
			return false ;
			}
			
			
			var expDateMcx = document.getElementById("expDate");
	 	 if(expDateMcx ==null )
			{
				var expDateMcxArr = document.getElementsByName("expDate");
				expDateMcx = expDateMcxArr[0];
			}			
	 	 expDateMcxVal = expDateMcx.value;
	 	 if(expDateMcxVal == "0" || (expDateMcxVal.length==0) )
			{
			alert("Please Select Expiry Date")
			return false ;
			}
	 	
		 document.forms[2].action ="../../Markets/Commodity/QuotesHome.do?reqCode=performanceReviewDetails"+"&Exchg="+exchange+"&CompName="+compName;
		document.forms[2].submit();
	}


	function showSymbol(which)
	{
		if(which!='0')
		{
			document.getElementById("noOne").style.display = "none";
			if(which == "MCX")
			{				
				document.getElementById("mcx").style.display = "inline";	
				document.getElementById("ncdex").style.display = "none";			
			}
			else
			{
				document.getElementById("mcx").style.display = "none";	
				document.getElementById("ncdex").style.display = "inline";	
			}
			document.getElementById("compName").value=0;
		}
	}
/* Functions for Commodities Perfomarmance Details Ends here */

/*************** starts  markets - companyInfo - ComapnyNews.jsp  *************/
function setStartRow()
{
	if(document.forms[2].startRow!=null)
	{
		if (document.forms[2].startRow.value == '')
			document.forms[2].startRow.value = '0';
	}		
}
/***************   ends  markets - companyInfo - ComapnyNews.jsp    ***********/
/*************** starts  markets - companyInfo - GenInformation.jsp  *************/
function showDetailGenInfo(coName)
{
//alert(coName);
	document.forms[0].coName.value=coName;
	
	//alert(document.forms[0].coName.value);
	document.forms[0].selectOption.value=document.forms[1].selectOption.value;
	//alert(document.forms[1].selectOption.value);
	javascript:submitForm('');
}
/*************** ends  markets - companyInfo - GenInformation.jsp   *************/

/*************** starts  markets - companyInfo -Includes - IndexSearchLookUp.jsp   *************/
function submitForm(Symbolform)
{
	
	if (Symbolform == 'LeftNavCompanySnapshot')
	{
		Symbolform = 'Company Snapshot';;
	}
	if (Symbolform == 'LeftNavSmartQuotes')
	{
		Symbolform = 'Smart Quotes';
	}	
	if (Symbolform == 'LeftNavBoardOfDirectors')
	{
		Symbolform = 'Board Of Directors';
	}	
	if (Symbolform == 'LeftNavResults')
	{
		Symbolform = 'Results';
	}	
	if (Symbolform == 'LeftNavValuationRatio')
	{
		Symbolform = 'Valuation Ratio';
	}	
	if (Symbolform == 'LeftNavDividendHistory')
	{
		Symbolform = 'Dividend History';
	}	
	if (Symbolform == 'LeftNavAnnouncements')
	{
		Symbolform = 'Announcements';
	}	
	if (Symbolform == 'LeftNavLatestEquity')
	{
		Symbolform = 'Latest Equity';
	}	
	
	
	if(Symbolform != '')
	{
		which = Symbolform;
		document.forms[0].selectOption.value = Symbolform;
	}
	else
	{
		which = document.forms[0].selectOption.value;
	}
	actVar  ="../../Markets/CompanyInfo/GenInformation.do?reqCode=generalInfo";

	if(which == 'Company Background' || which=='Company Snapshot'|| which=='Company History'|| which=='Company News')
	{
		actVar  = actVar + "&page=0";
	}	
	else if(which == 'Detailed Quote' || which=='Smart Quotes'|| which=='Historical Prices'|| which=='Charting')
	{
		actVar  = actVar + "&page=1";
	}	
	else if(which == 'Announcements' || which == 'Book Closure' || which == 'Bonus - Rights' || which == 'De-listed Shares' || which == 'Market Turnover' || which == 'Change of Name')
	{
		actVar  = actVar + "&page=6";
	}
	else if(which == "Dividend History" || which == "Chairmans Speech" || which == "Directors Report" || which == "Fo.Board Meeting")
	{
		actVar  = actVar + "&page=5";
	}
	else if(which == "Board Of Directors" || which == "Share Holding" || which == "Branches" || which == "Products" || which == "Compare company" || which == "Peer Group")
	{
		actVar  = actVar + "&page=2";

	}
	else if(which == "Results" || which == "PL Account" || which == "Balance Sheet" || which == "Cash Flows" || which == "Research Reports" )
	{
		actVar  = actVar + "&page=3";
	}

	else if(which == "Valuation Ratio" || which == "Financial Ratios" || which == "Scoreboard" || which == "Earnings" )
	{
	actVar  = actVar + "&page=4";
	}

    else if(which == "Latest Equity" || which == "Equity History" || which == "Bonus History" || which == "MF Holdings" )
	{
		actVar  = actVar + "&page=7";
	}

 
	
	if(which == 'prev')
	{
		actVar  ="../../Markets/CompanyInfo/GenInformation.do?reqCode=generalInfo&page=0&navigation=prev";
		document.forms[2].action=actVar				
		document.forms[2].selectOption.value = document.forms[0].selectOption.value;
		document.forms[2].coName.value = document.forms[0].coName.value;
		document.forms[2].submit();	
		return;
	}
	if(which == 'next')
	{
		actVar  ="../../Markets/CompanyInfo/GenInformation.do?reqCode=generalInfo&page=0&navigation=next";
		document.forms[2].action=actVar				
		document.forms[2].selectOption.value = document.forms[0].selectOption.value;
		document.forms[2].coName.value = document.forms[0].coName.value;
		document.forms[2].submit();	
		return;
	}
	
	if(which == 'ResultsQuaters')
	{
		actVar  ="../../Markets/CompanyInfo/GenInformation.do?reqCode=generalInfo&page=3";
		document.forms[2].action=actVar				
		document.forms[2].selectOption.value = "ResultsQuaters";
		document.forms[2].coName.value = document.forms[0].coName.value;
		document.forms[2].submit();	
		return;
	}
	

	if(which == 'BranchesDetail')
	{
		actVar  ="../../Markets/CompanyInfo/GenInformation.do?reqCode=generalInfo";
		document.forms[2].action=actVar				
		document.forms[2].selectOption.value = "BranchesDetail";
		document.forms[2].coName.value = document.forms[0].coName.value;
		document.forms[2].submit();	
		return;
	}

	if(which == 'History')
	{
		document.forms[2].submit();	
		return;
	}	
	
	document.forms[0].action=actVar		
	document.forms[0].submit();
 
}

function checkKey(e)
{
	if(e.keyCode==13)
	{
		submitFormISL('');
	}
}
/*************** ends  markets - companyInfo -Includes - IndexSearchLookUp.jsp   *************/
/*************** starts  markets - companyInfo -Includes - NseBseCompanyData.jsp   *************/

/*************** ends  markets - companyInfo -Includes - NseBseCompanyData.jsp   *************/
function showTbleIndices( tbleOn,exchg,tbleOff)
		{						
	
			var onMT = document.getElementById(tbleOn);
			var onMT1 = document.getElementById(tbleOff);					
			
			onMT.style.display = "inline";  
			onMT1.style.display = "none";				
						
			var Img_BSEOff = document.getElementById("BSEOff");
			var Img_BSEOn = document.getElementById("BSEOn");
			var Img_NSEOff = document.getElementById("NSEOff");
			var Img_NSEOn = document.getElementById("NSEOn");
			
			if(exchg=='NSE')
			{
			
				Img_BSEOff.style.display = "inline";
				Img_NSEOff.style.display = "none";
				Img_BSEOn.style.display = "none";
				Img_NSEOn.style.display = "inline";
			}
			else
			{
			
				Img_BSEOff.style.display = "none";
				Img_NSEOff.style.display = "inline";
				Img_BSEOn.style.display = "inline";
				Img_NSEOn.style.display = "none";
			}
					
		}
					
function ShowSnap()
{
	var DG_RawMT = document.getElementById("SnapTable");
	var Img_RawOff = document.getElementById("RawOff");
	var Img_RawOn = document.getElementById("RawOn");
	
	DG_RawMT.style.display = "none";  
	Img_RawOff.style.display = "inline";  
	Img_RawOn.style.display = "none";  
	
}

function HideSnap()
{
	var DG_RawMT = document.getElementById("SnapTable");
	var Img_RawOff = document.getElementById("RawOff");
	var Img_RawOn = document.getElementById("RawOn");
	DG_RawMT.style.display = "inline";  
	Img_RawOff.style.display = "none";  
	Img_RawOn.style.display = "inline"  
	
}
/*************** starts  markets - commodity - PerformanceReview.jsp  *************/
	function myAlertPR()
{
	var selExchange = document.getElementById("exchange");
	 if(selExchange ==null )
		{
			var selectExchgArr = document.getElementsByName("exchange");
			selExchange = selectExchgArr[0];
		}			
		exchange = selExchange.value ;
		if(exchange == 0)
		{
			alert("Please Select Exchange")
			return false ;
		}
 	 var selCompName = document.getElementById("compName");
 	 if(selCompName ==null )
		{
			var compNameArr = document.getElementsByName("compName");
			selCompName = compNameArr[0];
		}			
 	 compName = selCompName.value;
 	 if(compName == 0)
		{
			alert("Please Select Symbol")
			return false ;
		}
		
		 var expDateMcx = document.getElementById("expDate");
 	 if(expDateMcx ==null )
		{
			var expDateMcxArr = document.getElementsByName("expDate");
			expDateMcx = expDateMcxArr[0];
		}			
 	 expDateMcxVal = expDateMcx.value;
 	 if(expDateMcxVal == "0" || (expDateMcxVal.length==0) )
		{
			alert("Please Select Expiry Date")
			return false ;
		}		
		
	document.forms[1].reqCode.value="performanceReviewDetails"
	document.forms[1].submit();
}

function submitSymbolPR()
{
	var expDateMcx = document.getElementById("expDate");
 	 if(expDateMcx ==null )
		{
			var expDateMcxArr = document.getElementsByName("expDate");
			expDateMcx = expDateMcxArr[0];
		}			
 	 expDateMcx.value =0;
 	 
		//document.getElementById("expDate").value=0;
		document.forms[1].reqCode.value="displayQuotes"
		document.forms[1].submit()
}
function submitExchgPR()
{
	 var selCompName = document.getElementById("compName");
 	 if(selCompName ==null )
		{
			var compNameArr = document.getElementsByName("compName");
			selCompName = compNameArr[0];
		}	
	selCompName.value=0;
	
	document.forms[1].reqCode.value="displayQuotes"
	document.forms[1].submit()
}
/*************** ends  markets - comodity - PerformanceReview.jsp  *************/
/*************** starts  markets - comodity - PerformanceReviewCharting.jsp  *************/
	function submitDatePRC()
	{ 	
		var selchartType = document.getElementById("chartType");
		if(selchartType ==null )
			{
				var chartTypeArr = document.getElementsByName("chartType");
				selchartType = chartTypeArr[0];
			}	
			chartType = selchartType.value;
			
			if(chartType =="0")
			{
				alert("Please Select ChartType")
				return false ;
			}	
		
			var selperiod = document.getElementById("period");
			
			if(selperiod ==null )
			{
				var selperiodArr = document.getElementsByName("period");
				selperiod = selperiod[0];
			}	
			period = selperiod.value;
			
			if(period =="0")
			{
				alert("Please Select Period")
				return false ;
			}
			
		var selectExchg = document.getElementById("exchange");
			if(selectExchg ==null )
			{
				var selectExchgArr = document.getElementsByName("exchange");
				selectExchg = selectExchgArr[0];
			}	
			exchange = selectExchg.value;
			
			if(exchange ==0)
			{
				alert("Please Select Exchange")
				return false ;
			}
			
	 	 var selCompName = document.getElementById("compName");	  
	 	 	
			if(selCompName ==null )
			{
				var selCompNameArr = document.getElementsByName("compName");
				selCompName = selCompNameArr[0];
			}	
			
	 	// compName = selCompName.value
	 	compName = document.getElementById("tempCompName").value; 	
	 	 if(compName ==0)
			{
				alert("Please Select Symbol")
				return false ;
			}		
			
			var expDateMcx = document.getElementById("expDate");
	 	 if(expDateMcx ==null )
			{
				var expDateMcxArr = document.getElementsByName("expDate");
				expDateMcx = expDateMcxArr[0];
			}	
					
	 	 expDateMcxVal = expDateMcx.value;
	 	 if(expDateMcxVal == "0" || (expDateMcxVal.length==0) )
			{
			alert("Please Select Expiry Date")
			return false ;
			}
			document.forms[2].action ="../../Markets/Commodity/QuotesHome.do?reqCode=getChartData"+"&Exchg="+exchange+"&CompName="+compName+"&chartType="+chartType+"&period="+period;
			document.forms[2].submit();	
		
	}
	function showSymbolPRC(which)
	{
		if(which!='0')
		{
			document.getElementById("noOne").style.display = "none";
			if(which == "MCX")
			{				
				document.getElementById("mcx").style.display = "inline";	
				document.getElementById("ncdex").style.display = "none";			
			}
			else
			{
				document.getElementById("mcx").style.display = "none";	
				document.getElementById("ncdex").style.display = "inline";	
			}
		}
	}
/*************** ends  markets - comodity - PerformanceReviewCharting.jsp  *************/
/*************** starts  markets - comodity - ProductNotes.jsp  *************/
function submitThisPN()
{
	document.forms[1].action = "../../Markets/Commodity/ProductInfo.do?reqCode=showProductNotes";
	document.forms[1].submit();
}
	
function openPDF_PN(path)
{
	pdfPath = 'http://www.cmlinks.com/pub/commodity/ProductNotes/' + path; 
	window.open(pdfPath)
}
/*************** ends  markets - comodity - ProductNotes.jsp  *************/
/***************************** starts  markets - comodity -Includes - CommoditySearch.jsp ************************************/
function submitFormCS(Symbolform)
{
	if(Symbolform != '')
	{
		which = Symbolform;
		document.forms[0].selectOption.value = Symbolform;
	}
	else
	{
		which = document.forms[0].selectOption.value;
	}	
	
	
	if(which == "General News" || which == "Morning Buzz" || which == "Mid-Day Review" || which == "Closing Session")
	{
	actVar  ="../../Markets/Commodity/NewsCommentry.do?reqCode=newsCommentry";
	}
	else if(which == "Gainers & Losers" || which == "Advances & Declines" || which == "Highs & Lows" || which == "Closing Price")
	{
	actVar  ="../../Markets/Commodity/MarketMovers.do?reqCode=marketMovers";
	}

	document.forms[0].action=actVar				
	document.forms[0].submit();
}
/******************************ends   markets - comodity - Includes - CommoditySearch.jsp ***********************************/

/************************* starts   markets - IPO - IPOUpdate.jsp *****************************/
function ShowSubOptionsIPO(opt) 
	{
		var optlen = 5;	
		for( icount = 1;icount<=optlen;icount++)	
		{
		
			if(icount == opt)	
				{			
				document.getElementById("ShowM" + opt).style.display = 'block';			
				document.getElementById("SpanM" + opt).className="redtxt";			
				document.getElementById("m" + opt).className="mbgon";			
				//document.getElementById("m" + opt).setAttribute("width","34%")			
			}
			else{
			
			document.getElementById("ShowM" + icount).style.display = 'none';		
			document.getElementById("SpanM" + icount).className="bluetxt"; 		
			document.getElementById("m" + icount).className="mbgof";		
			//document.getElementById("m" + icount).setAttribute("width","22%")		
			}
		}
	}
/************************ ENDS  markets - IPO - IPOUpdate.jsp ******************************/
/********************starts   markets - MarketInfo - CompareIndustry.jsp ***************************/
function showIndustry()
{
	industry = window.document.getElementById("Industry");
	
	if (industry.value == 0)
	{
		window.document.getElementById("errorTab").style.display = "inline";
		return false;
	}
	window.location = "sectorWatchAction.do?reqCode=getIndustry&industry=" + industry.value ;
}
/********************** markets - MarketInfo - CompareIndustry.jsp ****************************/
/*************** starts   markets - MarketInfo - LLCircuitbreakers.jsp ***************/
function changeGroup()
{

	var exchange  = document.getElementById('upperlower:exchange');
	var nseGroup  = document.getElementById('upperlower:nseGroup');
	var bseGroup  = document.getElementById('upperlower:bseGroup');
	
	if(exchange.value=="BSE")
	{
	 nseGroup.style.display = "none";
	 bseGroup.style.display = "inline";
	}
	 else if(exchange.value=="NSE")
	{
	 nseGroup.style.display = "inline";
	 bseGroup.style.display = "none";
	}
 		
}
function showTablesLLCB()
{

	var option = document.getElementById('upperlower:hiddenOption');
	var upper = document.getElementById('upperstab');
	var lower = document.getElementById('lowerstab');
	
	if (option.value == "Top 10")
	{
		upper.style.display = "inline";
		lower.style.display = "inline";
	}
	else if (option.value == "Upper Breakers")
	{
		upper.style.display = "inline";
		lower.style.display = "none";
	}
	else if (option.value == "Lowers Breakers")
	{
		upper.style.display = "none";
		lower.style.display = "inline";
	}	
	changeGroup();		
}

function HideResultLLCB()
{
	var OptionId1  = document.getElementById('upperlower:option1');
	var OptionId2  = document.getElementById('option2');
	if(OptionId1.value=="10")
	 OptionId2.style.display = "none";
	 else
	 OptionId2.style.display = "inline"; 		
}
/*************** ends   markets - MarketInfo - LLCircuitbreakers.jsp ***************/
/*************** starts   markets - MarketInfo - SectorUpdate.jsp ***************/
function showSector(sector)
	{
				window.location = "sectorWatchAction.do?reqCode=getSectorUpdateData&sector=" + sector.value + "&showOption=inline";
	}
/*************** ends   markets - MarketInfo - SectorUpdate.jsp *****************/
/*************** starts   markets - MarketInfo - SectorWatch.jsp ***************/
function showSectorSW(sector)
	{

		window.location = "sectorWatchAction.do?reqCode=getSectorUpdateData&sector=" + sector.value + "&showOption=inline";
	}
/*************** ends   markets - MarketInfo - SectorWatch.jsp *****************/
/*************** starts   markets - MarketInfo - VolumeToppers.jsp ***************/

/*************** ends   markets - MarketInfo - VolumeToppers.jsp *****************/
/*************** starts   markets - MarketInfo - VolumeToppersMAnalysis.jsp,Analysis.jsp ***************/
function changeValueAnalysis()
{
	var exchange = document.getElementById("marketform:exchange");
	var bse = document.getElementById("bseanalysis");
	var nse = document.getElementById("nseanalysis");
	var group = document.getElementById("marketform:group")
	if(exchange.value=="NSE")
	{
	 bse.style.display = "none";
	 nse.style.display = "inline";
 	 group.value = document.getElementById("marketform:nseoption").value;
	} 
	else
	{
	 bse.style.display = "inline";
	 nse.style.display = "none";
  	 group.value = document.getElementById("marketform:bseoption").value;
	}
}




/*************** ends   markets - MarketInfo - VolumeToppersMAnalysis.jsp *****************/

function submitAction(symbol)
{

if(symbol == 'BSEAnnouncement')
	{
		var actVar  ="../../Markets/MarketInfo/Announcements.do?reqCode=bseAnnouncement";
		document.forms("latestAnnouncement").action=actVar;				
		document.forms("latestAnnouncement").submit();	
		return;
	}

else if(symbol == 'NSEAnnouncement')
	{
		var actVar  ="../../Markets/MarketInfo/Announcements.do?reqCode=nseAnnouncement";
		document.forms("latestAnnouncement").action=actVar;				
		document.forms("latestAnnouncement").submit();	
		return;
	}

else if(symbol == 'Announcement')
	{
		var actVar  ="../../Markets/MarketInfo/Announcements.do?reqCode=announcement";
		document.forms("latestAnnouncement").action=actVar;				
		document.forms("latestAnnouncement").submit();	
		return;
	}

else if(symbol == 'ResultsAnnounced')
	{
		var actVar  ="../../Markets/MarketInfo/Announcements.do?reqCode=resultsAnnounced";
		document.forms("latestAnnouncement").action=actVar;				
		document.forms("latestAnnouncement").submit();	
		return;
	}
	
	
	else if(symbol == 'EconomyWatch')
	{
		var actVar  ="../../Markets/MarketInfo/MarketNews.do?reqCode=economyWatch";
		document.forms("marketNews").action=actVar;				
		document.forms("marketNews").submit();	
		return;
	}
	
	else if(symbol == 'MarketSummary')
	{
		var actVar  ="../../Markets/MarketInfo/MarketNews.do?reqCode=marketSummary";
		document.forms("marketNews").action=actVar;				
		document.forms("marketNews").submit();	
		return;
	}
	
	else if(symbol == 'HotPursuit')
	{
		var actVar  ="../../Markets/MarketInfo/MarketNews.do?reqCode=hotPursuit";
		document.forms("marketNews").action=actVar;				
		document.forms("marketNews").submit();	
		return;
	}
	
	else if(symbol == 'SectorNews')
	{
		var actVar  ="../../Markets/MarketInfo/MarketNews.do?reqCode=sectorNews";
		document.forms("marketNews").action=actVar;				
		document.forms("marketNews").submit();	
		return;
	}
		else if(symbol == 'MarketBeat')
	{
		var actVar  ="../../Markets/MarketInfo/MarketNews.do?reqCode=marketBeat";
		document.forms("marketNews").action=actVar;				
		document.forms("marketNews").submit();	
		return;
	}
	else if(symbol == 'SectorNewsDetails')
	{
	
if (document.forms[0].selectedSectorid.value=="")
return false;

		var actVar  ="../../Markets/MarketInfo/MarketNews.do?reqCode=sectorNewsDetails";
		document.forms("marketSector").action=actVar;				
		document.forms("marketSector").submit();	
		return;
	}
	
	
}


function next(){
document.forms("latestAnnouncement").noOfRecords.value="8";
var actVar  ="../../Markets/MarketInfo/Announcements.do?reqCode=announcement";
		document.forms("latestAnnouncement").action=actVar;				
		document.forms("latestAnnouncement").submit();	
		return;
}

function previous(){
document.forms("latestAnnouncement").noOfRecords.value="-8";
var actVar  ="../../Markets/MarketInfo/Announcements.do?reqCode=announcement";
		document.forms("latestAnnouncement").action=actVar;				
		document.forms("latestAnnouncement").submit();	
		return;
}

function nextBSE(){
document.forms("latestAnnouncement").noOfRecords.value="8";
var actVar  ="../../Markets/MarketInfo/Announcements.do?reqCode=bseAnnouncement";
		document.forms("latestAnnouncement").action=actVar;				
		//document.forms[2].selectOption.value = "Latest Announcement";
		//document.forms[2].coName.value = document.forms[0].coName.value;
		document.forms("latestAnnouncement").submit();	
		return;
}

function previousBSE(){
document.forms("latestAnnouncement").noOfRecords.value="-8";
var actVar  ="../../Markets/MarketInfo/Announcements.do?reqCode=bseAnnouncement";
		document.forms("latestAnnouncement").action=actVar;				
		//document.forms[2].selectOption.value = "Latest Announcement";
		//document.forms[2].coName.value = document.forms[0].coName.value;
		document.forms("latestAnnouncement").submit();	
		return;
}


function nextNSE(){
document.forms("latestAnnouncement").noOfRecords.value="8";
var actVar  ="../../Markets/MarketInfo/Announcements.do?reqCode=nseAnnouncement";
		document.forms("latestAnnouncement").action=actVar;				
		//document.forms[2].selectOption.value = "Latest Announcement";
		//document.forms[2].coName.value = document.forms[0].coName.value;
		document.forms("latestAnnouncement").submit();	
		return;
}

function previousNSE(){
document.forms("latestAnnouncement").noOfRecords.value="-8";
var actVar  ="../../Markets/MarketInfo/Announcements.do?reqCode=nseAnnouncement";
		document.forms("latestAnnouncement").action=actVar;				
		//document.forms[2].selectOption.value = "Latest Announcement";
		//document.forms[2].coName.value = document.forms[0].coName.value;
		document.forms("latestAnnouncement").submit();	
		return;
}

function submitCompany(rowId)
{
document.forms("latestAnnouncement").rowId.value=rowId;
var actVar  ="../../Markets/MarketInfo/Announcements.do?reqCode=resultsAnnouncedDetails";
document.forms("latestAnnouncement").action=actVar;
document.forms("latestAnnouncement").submit();	
return;
}

function Show(Tab1,Tab2,Tab3,Tab4)
{
var GTableId = document.getElementById(Tab1);
var LTableId = document.getElementById(Tab2);
var Tab1 = document.getElementById(Tab3);
var Tab2 = document.getElementById(Tab4);

GTableId.style.display = 'inline';
LTableId.style.display = 'none';
Tab1.className = 'mbgon';
Tab2.className = 'mbgof';

/*ShowColumn('NseGainTable','NseLoseTable','P','G1','G2')
ShowColumn('NseATable','NseDTable','P','g3','g4')
ShowColumn('NseHTable','NseLowTable','P','g5','g6')*/
}





