function browserVersion()
{
      if(navigator.userAgent.indexOf('Chrome')!=-1)
     {
         //alert("You are using Google Chrome.");   
		 browserpopup();
     }
}
function browserpopup()
	 {
		var wind_new;
		wind_new=window.open("Browserpopup.htm", "win2", 'x=0,y=0,toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=no,copyhistory=no,width=495,height=305,screenX=0,screenY=0,left=0,top=0')					
		wind_new.focus();
	 }
	 
function downpdf(FileName)
	{
		window.open("../Mutual/PdfDownloads/"+FileName,'win','','');
	}
	
/*IPO section Function*/
function Reckoner(url)
{
	window.open(url,"","status =no, height =180, width =530px, resizable = 0,scrollbars=1,left=200,top=200" )
}

function ChangeIPOPage(ipoUrl) 
{
	document.getElementById("IPOInner").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
	var ajax = new Ajax.Updater('IPOInner',ipoUrl);
}

 function fundetails(sno)
 {
	document.getElementById("cm_window").style.display='inline';
	var newsurl="fund_newsdetails.asp?sno="+sno;    
	  
    document.getElementById("NewsId").innerHTML="<table cellpadding='0' cellspacing='0' width='100%'><tr><td align='center'><img src='../images/loading.gif'></td></tr></table>";
    var ajax = new Ajax.Updater('NewsId',newsurl);	
 }
function IPOpageData(code,type)
{
	if (type=="BandF")
		{
			var StrUrl= "../IPO/BandF.asp?code="+code;
		}
	else
		{
			var StrUrl= "../IPO/Issue.asp?code="+code;
		}
	document.getElementById("IPOInner").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
	var ajax = new Ajax.Updater('IPOInner',StrUrl);
}

function draftpageData(OptPg)
{
	var StrUrl= "../IPO/draft.asp?OptPg="+OptPg;
	//alert(StrUrl);
	document.getElementById("IPOInner").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
	var ajax = new Ajax.Updater('IPOInner',StrUrl);
}


/*Commodity section function*/
function Commadvdec(exchg,opt)
{	
	var Url="advdec.asp?Exchg="+exchg+"&Opt="+opt
	document.getElementById("CommodityInner").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
	var ajax = new Ajax.Updater('CommodityInner',Url);	
}

function ChangePageCommTab(comPageUrl) /// PriceAnalysis Left Menu Function
{
	//alert(comPageUrl);
	document.getElementById("CommodityInner").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
	var ajax = new Ajax.Updater('CommodityInner',comPageUrl);
}

function changePeriodcom(Period)
{
	//alert(Period)
	if(Period=="pre")
	{
		document.getElementById("trPre").style.display="inline";
		document.getElementById("trMid").style.display="none";
		document.getElementById("trEnd").style.display="none";
	}
	else if(Period=="mid")
	{
		document.getElementById("trPre").style.display="none";
		document.getElementById("trMid").style.display="inline";
		document.getElementById("trEnd").style.display="none";
	}	
	else if(Period=="end")
	{
		document.getElementById("trPre").style.display="none";
		document.getElementById("trMid").style.display="none";
		document.getElementById("trEnd").style.display="inline";
	}	

	comPageUrl="Commentary.asp?Pageid=9&page=NEWS&Period="+Period;
	document.getElementById("CommodityInner").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
	var ajax = new Ajax.Updater('CommodityInner',comPageUrl);

}

function onChangeComm(mno)/// Call GetQuotes Page in Commodities
{	
	var Exchng=document.getElementById("Exchng").value;		
	var Symbol=document.getElementById("Symbol").value;	
	 if(mno == 1)
		{
		 var HomPageUrl="../commodity/CommCharts.asp?Exchng="+Exchng; 
		 
		}
	  else if(mno ==2)
		{
		 var HomPageUrl="../commodity/CommCharts.asp?Exchng="+Exchng+"&Symbol="+Symbol; 
		}
		document.getElementById("CommodityInner").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
		var ajax = new Ajax.Updater('CommodityInner',HomPageUrl);
}

function CommValidate1(Submit)/// Call Chart Page in Commodities
{
	var Exchng =  document.getElementById("Exchng").options[document.getElementById("Exchng").selectedIndex].value
	var Symbol =  document.getElementById("Symbol").options[document.getElementById("Symbol").selectedIndex].value
	var ExpDate =  document.getElementById("ExpDate").options[ document.getElementById("ExpDate").selectedIndex].value
	var ChartType =  document.getElementById("ChartType").options[ document.getElementById("ChartType").selectedIndex].value
	var Period =  document.getElementById("SPeriod").options[ document.getElementById("SPeriod").selectedIndex].value
	
	if(Exchng=="")
	{
		alert("Select an Exchange");
		document.getElementById("Exchng").focus();		
	}	
	else if(Symbol=="")
	{
		alert("Select a Symbol");
		document.getElementById("Symbol").focus();		
	}	
	else if(ExpDate=="")
	{
		alert("Select an Expiry Date");
		document.getElementById("ExpDate").focus();		
	}	
	else 
	{		
	 var HomPageUrl="../Commodity/CommCharts.asp?Exchng="+Exchng+"&Symbol="+Symbol+"&Submit="+Submit+"&ChartType="+ChartType+"&SPeriod="+Period+"&ExpDate="+ExpDate;	
	 document.getElementById("CommodityInner").innerHTML="<table cellpadding='0' cellspacing='0' width='100%'><tr><td height='260px' align='center'><img src='../images/loading.gif'></td></tr></table>";
	 var ajax = new Ajax.Updater('CommodityInner',HomPageUrl);
	}
		
}

/* tushar */
function CallGetQuotes(Exchng,Symbol,ExpDate)/// Call GetQuotes Page in Commodities
{
	if(Exchng=="")
	{
		alert("Select an Exchange");
		document.getElementById("Exchng").focus();		
	}	
	else if(Symbol=="")
	{
		alert("Select a Symbol");
		document.getElementById("Symbol").focus();		
	}	
	else if(ExpDate=="")
	{
		alert("Select an Expiry Date");
		document.getElementById("ExpDate").focus();		
	}	
	else 
	{
	var pgName="../Commodity/CommGetQuotes.asp?Exchng="+Exchng+"&Symbol="+Symbol+"&ExpDate="+ExpDate;		
    document.getElementById("CommodityInner").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
	var ajax = new Ajax.Updater('CommodityInner',pgName);
	}
}

function onChange(mno)/// Call GetQuotes Page in Commodities
{	
	var Exchng=document.getElementById("Exchng").value;		
	var Symbol=document.getElementById("Symbol").value;	
	 if(mno == 1)
		{
		 var HomPageUrl="../commodity/GetQuotes.asp?Exchng="+Exchng; 
		}
	  else if(mno ==2)
		{
		 var HomPageUrl="../commodity/GetQuotes.asp?Exchng="+Exchng+"&Symbol="+Symbol; 
		}
		document.getElementById("CommodityInner").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
		var ajax = new Ajax.Updater('CommodityInner',HomPageUrl);
}


function showData(mno)/// Call highLow Page in Commodities
{
	if (comcat == "")
	{
		var comcat="all";
	}
	else
	{
		var comcat=document.getElementById("comcat").value;
	}
	if (PageName == "")
	{
		var PageName="WHI";
	}
	else
	{
		var PageName=document.getElementById("PageName").value;
	}
	
	var Exchg=document.getElementById("Exchg").value;		
	var Symbol=document.getElementById("Symbol").value;	
	var category=document.getElementById("comcat").value;	
	var ExpDate=document.getElementById("ExpDate").value;

	if(mno == 6)
		{	pgName="HighLow.asp?Exchg="+Exchg+"&category="+comcat+"&Symbol="+Symbol+"&ExpDate="+ExpDate+"&PageName="+PageName; }
	//alert(pgName);
	document.getElementById("CommodityInner").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
 	var ajax = new Ajax.Updater('CommodityInner',pgName);
}

function showDataGL(mno)/// Call highLow Page in Commodities
{
	if (comcat == "")
	{
		var comcat="all";
	}
	else
	{
		var comcat=document.getElementById("comcat").value;
	}
	if (opt == "")
	{
		var opt="topg";
	}
	else
	{
		var opt=document.getElementById("opt").value;
	}
	
	var Exchg=document.getElementById("Exchg").value;		
	var Symbol=document.getElementById("Symbol").value;	
	var category=document.getElementById("comcat").value;	
	var ExpDate=document.getElementById("ExpDate").value;
	var opt=document.getElementById("opt").value;

	if(mno == 2)
		{	pgName="TopGL.asp?Exchg="+Exchg+"&category="+comcat+"&Symbol="+Symbol+"&ExpDate="+ExpDate+"&opt="+opt; }
	//alert(pgName);
	document.getElementById("CommodityInner").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
 	var ajax = new Ajax.Updater('CommodityInner',pgName);
}

function showDataval()/// Call highLow Page in Commodities
{
	if (comcat == "")
	{
		var comcat="all";
	}
	else
	{
		var comcat=document.getElementById("comcat").value;
	}
	if (opt == "")
	{
		var opt="TOPV";
	}
	else
	{
		var opt=document.getElementById("opt").value;
	}
	
	var Exchg=document.getElementById("Exchg").value;		
	var Symbol=document.getElementById("Symbol").value;	
	var category=document.getElementById("comcat").value;	
	var ExpDate=document.getElementById("ExpDate").value;
	var opt=document.getElementById("opt").value;

	pgName="TopTradval.asp?Exchg="+Exchg+"&category="+comcat+"&Symbol="+Symbol+"&ExpDate="+ExpDate+"&opt="+opt; 
	//alert(pgName);
	document.getElementById("CommodityInner").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
 	var ajax = new Ajax.Updater('CommodityInner',pgName);
}
function showDatacprice()/// Call highLow Page in Commodities
{
	if (comcat == "")
	{
		var comcat="all";
	}
	else
	{
		var comcat=document.getElementById("comcat").value;
	}
	if (opt == "")
	{
		var opt="CLOSEP";
	}
	else
	{
		var opt=document.getElementById("opt").value;
	}
	
	var Exchg=document.getElementById("Exchg").value;		
	var Symbol=document.getElementById("Symbol").value;	
	var category=document.getElementById("comcat").value;	
	var ExpDate=document.getElementById("ExpDate").value;
	var opt=document.getElementById("opt").value;

	pgName="Closeprice.asp?Exchg="+Exchg+"&category="+comcat+"&Symbol="+Symbol+"&ExpDate="+ExpDate+"&opt="+opt; 
	//alert(pgName);
	document.getElementById("CommodityInner").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
 	var ajax = new Ajax.Updater('CommodityInner',pgName);
}



function CommGainerlosers(exchg,opt)
{	
	var Symbol=document.getElementById("Symbol").value;	
	var category=document.getElementById("comcat").value;	
	var ExpDate=document.getElementById("ExpDate").value;
	
	var Url="topgl.asp?Exchg="+exchg+"&Opt="+opt; 
	document.getElementById("CommodityInner").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
	var ajax = new Ajax.Updater('CommodityInner',Url);	
}


/*Other Fuction*/
function discHome()
{
var newWin=window.open("disclaimer.asp", "gop", "status = 1, height = 420, width =500, resizable = 0,scrollbars=1,left=220,top=150" )
newWin.focus();
}

function disc()
{
var newWin=window.open("disclaimer.asp", "gop", "status = 1, height = 420, width =530, resizable = 0,scrollbars=1,left=220,top=150" )
newWin.focus();
}

function privacy()
{
var newWin=window.open("privacy.asp", "gop", "status = 1, height = 300, width =530, resizable = 0,scrollbars=1,left=220,top=150" )
newWin.focus();
}

function empty()
{
if (document.frmQuotes.txtQuotes.value=="enter company name")
{
  document.frmQuotes.txtQuotes.value="";
 }
}

function fill()
{
var getquote=document.frmQuotes.txtQuotes.value;
if (getquote=="")
{
	document.frmQuotes.txtQuotes.value="enter company name";
}
}

function emptyL()
{
	if (document.getElementById("userName").value=="UserName")
	{
	  document.getElementById("userName").value="";
	 }
}

function fillL()
{
	var getquote=document.getElementById("userName").value;
	if (getquote=="")
	{
		document.getElementById("userName").value="UserName";
	}
}
function emptyP()
{
	if (document.getElementById("userPassword").value=="*******")
	{
	  document.getElementById("userPassword").value="";
	 }
}

function fillP()
{
	var getquote=document.getElementById("userPassword").value;
	if (getquote=="")
	{
		document.getElementById("userPassword").value="*******";
	}
}

function CheckQuote()
{
	var getquote=document.frmQuotes.txtQuotes.value;
	if (getquote=="" || getquote=="enter company name")
	{
		alert('Please enter few Characters')
		document.frmQuotes.txtQuotes.focus();
		window.status='Please enter first few Characters of a company';
		return false;
	}
	else
	{
	opt = document.getElementById("cmbPageType").value;
	if (opt == 1)
	{//quotes
		url = "../profiles/companylist.asp?PageOpt=0&txtQuotes="+document.getElementById("txtQuotes").value;
	}	
	if (opt == 2)
	{//finacials
		url = "../profiles/companylist.asp?PageOpt=6&txtQuotes="+document.getElementById("txtQuotes").value;
	}
	if (opt == 3)
	{//charts
		url = "../profiles/companylist.asp?PageOpt=8&txtQuotes="+document.getElementById("txtQuotes").value;
	}
	document.frmQuotes.action = url
	document.frmQuotes.submit();
		return true;
	}
}

function chkGQuote()
{
if (document.form2.txtQuotes.value=="")
	{
		alert("Enter Script Name or Code !");
		document.form2.txtQuotes.focus();
		return false;
	} 
}

function ChangeExchg(option)
{
	var NB=option	
			
		if (NB=='N')
		{
			document.getElementById("nseflash").style.display="inline";
			document.getElementById("bseflash").style.display="none";			
		}					
		else					
		{
			document.getElementById("nseflash").style.display="none";
			document.getElementById("bseflash").style.display="inline";
		}
}

function setTicker(option)
{
	var NB=option
	var nseimg = document.getElementById("nseimg")
	var bseimg = document.getElementById("bseimg")
					
		if (NB=='N')
		{
		 //nseticker.style.visibility="visible";
			//	bseticker.style.visibility="Hidden";
			nseimg.src="images/TockerNSE.GIF";
			bseimg.src="images/TockerBSE.GIF";
			document.getElementById("nse").style.display="inline";
			document.getElementById("bse").style.display="none";				
			//nsemarquee.stop();
			//bsemarquee.start();
		}
		else
		{
			//nseticker.style.visibility="Hidden";
			//bseticker.style.visibility="visible";
			 nseimg.src="images/TockerNSEoff.GIF";
		     bseimg.src="images/TickerBseOn.GIF";
			 document.getElementById("bse").style.display="inline";
		     document.getElementById("nse").style.display="none";					
			//nsemarquee.start();						
			//bsemarquee.stop();
		}
}


function ShowBTOPGL(id)
{
	if(id=="BG")
	{
		document.getElementById("BG").style.display = "inline";
		document.getElementById("BL").style.display = "none";
		document.getElementById("NG").style.display = "none";
		document.getElementById("NL").style.display = "none";
		document.getElementById("BTopG").style.display = "inline";
		document.getElementById("BTopL").style.display = "none";
	}
	if(id=="BL")
	{
		document.getElementById("BG").style.display = "none";
		document.getElementById("BL").style.display = "inline";
		document.getElementById("NG").style.display = "none";
		document.getElementById("NL").style.display = "none";
		document.getElementById("BTopG").style.display = "none";
		document.getElementById("BTopL").style.display = "inline";
	}
	
}

function ShowNTOPGL(id)
{
	if(id=="NG")
	{
		document.getElementById("BG").style.display = "none";
		document.getElementById("BL").style.display = "none";
		document.getElementById("NG").style.display = "inline";
		document.getElementById("NL").style.display = "none";
		document.getElementById("NTopG").style.display = "inline";
		document.getElementById("NTopL").style.display = "none";
	}
	if(id=="NL")
	{
		document.getElementById("BG").style.display = "none";
		document.getElementById("BL").style.display = "none";
		document.getElementById("NG").style.display = "none";
		document.getElementById("NL").style.display = "inline";
		document.getElementById("NTopG").style.display = "none";
		document.getElementById("NTopL").style.display = "inline";
	}	
}

function ShowGraph(id)
{
	if(id=="B")
	{
		document.getElementById("BSE").style.display = "inline";
		document.getElementById("BseTxt").style.display = "inline";
		document.getElementById("NseTxt").style.display = "none";
		document.getElementById("NSE").style.display = "none";
		document.getElementById("BtBse").style.display = "inline";
		document.getElementById("BtNse").style.display = "none";
		document.getElementById("ImgB").style.display = "inline";
		document.getElementById("ImgN").style.display = "none";
		document.getElementById("BTopG").style.display = "inline";
		document.getElementById("BTopL").style.display = "none";
		document.getElementById("NTopG").style.display = "none";
		document.getElementById("NTopL").style.display = "none";
		document.getElementById("BG").style.display = "inline";
		document.getElementById("BL").style.display = "none";
		document.getElementById("NG").style.display = "none";
		document.getElementById("NL").style.display = "none";
	}
	if(id=="N")
	{
		document.getElementById("BSE").style.display = "none";
		document.getElementById("BseTxt").style.display = "none";
		document.getElementById("NseTxt").style.display = "inline";
		document.getElementById("NSE").style.display = "inline";
		document.getElementById("BtBse").style.display = "none";
		document.getElementById("BtNse").style.display = "inline";
		document.getElementById("ImgB").style.display = "none";
		document.getElementById("ImgN").style.display = "inline";
		document.getElementById("BTopG").style.display = "none";
		document.getElementById("BTopL").style.display = "none";
		document.getElementById("NTopG").style.display = "inline";
		document.getElementById("NTopL").style.display = "none";
		document.getElementById("NG").style.display = "inline";
		document.getElementById("NL").style.display = "none";
		document.getElementById("BG").style.display = "none";
		document.getElementById("BL").style.display = "none";
	}

}

function ShowNews(id)
{
	if(id=="C"){
		document.getElementById("news1").style.display = "inline";
		document.getElementById("news2").style.display = "none";
		document.getElementById("news3").style.display = "none";
		document.getElementById("news4").style.display = "none";
		
		document.getElementById("Company1").style.display = "inline";
		document.getElementById("Company2").style.display = "none";
		document.getElementById("Industry1").style.display = "none";
		document.getElementById("Industry2").style.display = "inline";
		document.getElementById("Economy1").style.display = "none";
		document.getElementById("Economy2").style.display = "inline";
		document.getElementById("Market1").style.display = "none";
		document.getElementById("Market2").style.display = "inline";
	}
	if(id=="R"){
		document.getElementById("news1").style.display = "none";
		document.getElementById("news2").style.display = "inline";
		document.getElementById("news3").style.display = "none";
		document.getElementById("news4").style.display = "none";
		
		document.getElementById("Company1").style.display = "none";
		document.getElementById("Company2").style.display = "inline";
		document.getElementById("Industry1").style.display = "inline";
		document.getElementById("Industry2").style.display = "none";
		document.getElementById("Economy1").style.display = "none";
		document.getElementById("Economy2").style.display = "inline";
		document.getElementById("Market1").style.display = "none";
		document.getElementById("Market2").style.display = "inline";
	}
	if(id=="E"){
		document.getElementById("news1").style.display = "none";
		document.getElementById("news2").style.display = "none";
		document.getElementById("news3").style.display = "inline";
		document.getElementById("news4").style.display = "none";
		
		document.getElementById("Company1").style.display = "none";
		document.getElementById("Company2").style.display = "inline";
		document.getElementById("Industry1").style.display = "none";
		document.getElementById("Industry2").style.display = "inline";
		document.getElementById("Economy1").style.display = "inline";
		document.getElementById("Economy2").style.display = "none";
		document.getElementById("Market1").style.display = "none";
		document.getElementById("Market2").style.display = "inline";
	}
	if(id=="M"){
		document.getElementById("news1").style.display = "none";
		document.getElementById("news2").style.display = "none";
		document.getElementById("news3").style.display = "none";
		document.getElementById("news4").style.display = "inline";
		
		document.getElementById("Company1").style.display = "none";
		document.getElementById("Company2").style.display = "inline";
		document.getElementById("Industry1").style.display = "none";
		document.getElementById("Industry2").style.display = "inline";
		document.getElementById("Economy1").style.display = "none";
		document.getElementById("Economy2").style.display = "inline";
		document.getElementById("Market1").style.display = "inline";
		document.getElementById("Market2").style.display = "none";
		
	}
}

 function details(sno,secid,subsecid,view)
 {
	document.getElementById("cm_window").style.display='inline';
	var newsurl="Newsdetails.asp?view="+view+"&type=2&sno="+sno+"&secid="+secid+"&subsecid="+subsecid;    
    document.getElementById("NewsId").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
    var ajax = new Ajax.Updater('NewsId',newsurl);	
 }

function Story(type,sno,secid,subsecid)
{	
	fileName = "NewsDetails.asp?type="+ type+"&sno="+ sno+"&secid="+ secid+"&subsecid="+ subsecid;
  	var w1=screen.width;
 	 w1-=300;
 	 var h1=screen.height;
 	 h1-=200;
	 var newWin=window.open(fileName,'win1','x=0,y=0,toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,copyhistory=no,width=640,height=360,screenX=0,screenY=0,left=300,top=237');	
	newWin.focus();	 
}

function StoryAnnounce(code)
{	
	fileName = "AnnonceDetails.asp?code="+ code;
   	var w1=screen.width;
 	 w1-=300;
 	 var h1=screen.height;
 	 h1-=200;
	 var newWin=window.open(fileName,'gopi','x=0,y=0,toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=1,copyhistory=no,width=580,height=350,screenX=0,screenY=0,left=210,top=200');	
	 newWin.focus();	 
}

function shownews(srno)
 {
	window.open("MF_news.asp?srno="+srno+"","gop", 'x=0,y=0,toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,copyhistory=no,width=580,height=360,screenX=0,screenY=0,left=300,top=237');
 }

function chkUserBlank()
{
	var getuser=document.getElementById("userName").value;
	var getpwd=document.getElementById("userPassword").value;	
	if (getuser=="")
	{
		alert('Please Enter User Id')
		document.frm.userName.focus();		
		return false;
	}
	if (getpwd=="")
	{
		alert('Please Enter User Password')
		document.getElementById("userPassword").focus();		
		return false;
	}
	else{
	document.frm.submit();
	return true;
	}
}

function backlogin()
{
	fileName = "Backofficelogin.asp"
	var newWin=window.open(fileName,'win2','x=0,y=0,toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,copyhistory=no,width=580,height=360,screenX=0,screenY=0,left=300,top=237');	
	newWin.focus();	 

}

function BSE52HighLow(){
option=document.frmPriceAnal.Opt.value;
switch (option){ 
	case 'A' : 
		document.location= "Bse52HighLow.asp?MNU=1&SubMNU=1&sel=1&Fld=A&FldG=R&id=18&Exchg=BSE&mnuOpt=3&tmnu=3"
				break; 
	case 'B1' : 
	//alert('b1')
		document.location="Bse52HighLow.asp?MNU=1&SubMNU=1&sel=1&Fld=B1&FldG=R&id=18&Exchg=BSE&mnuOpt=3&tmnu=3"
	break; 
	case 'B2' : 
		document.location= "Bse52HighLow.asp?MNU=1&SubMNU=1&sel=1&Fld=B2&FldG=R&id=18&Exchg=BSE&mnuOpt=3&tmnu=3"
	break; 
	case 'T' : 
		document.location= "Bse52HighLow.asp?MNU=1&SubMNU=1&sel=1&Fld=T&FldG=R&id=18&Exchg=BSE&mnuOpt=3&tmnu=3"
	break; 
	case 'Z' : 
		document.location= "Bse52HighLow.asp?MNU=1&SubMNU=1&sel=1&Fld=Z&FldG=R&id=18&Exchg=BSE&mnuOpt=3&tmnu=3"
	break; 
	case 'ALL' : 
		document.location= "Bse52HighLow.asp?MNU=1&SubMNU=1&sel=1&Fld=ALL&FldG=R&id=18&Exchg=BSE&mnuOpt=3&tmnu=3"
	break;
} 
}

function Nse52HighLow(){
option=document.frmPriceAnal.Opt.value;
switch (option){ 
	case 'NI' : 
		document.location= "Nse52HighLow.asp?MNU=1&SubMNU=1&sel=1&FLd=NI&id=18&Exchg=NSE&mnuOpt=3&tmnu=3"
	break; 
	case 'NJ' : 
		document.location= "Nse52HighLow.asp?MNU=1&SubMNU=1&sel=1&FLd=NJ&id=18&Exchg=NSE&mnuOpt=3&tmnu=3"
	break; 
	case 'OT' : 
		document.location= "Nse52HighLow.asp?MNU=1&SubMNU=1&sel=1&FLd=OT&id=18&Exchg=NSE&mnuOpt=3&tmnu=3"
	break; 
	case 'AL' : 
		document.location= "Nse52HighLow.asp?MNU=1&SubMNU=1&sel=1&FLd=AL&id=18&Exchg=NSE&mnuOpt=3&tmnu=3"
	break; 
} 
}

	function Fun_tab(Ctype)
	{
	//  alert(Ctype)
	  if (Ctype =='B')
		{	
		document.getElementById("sensexdata1").style.display="inline";
		document.getElementById("niftydata1").style.display="none";	
		document.getElementById("bsesector1").className="tabpaneltd03";
		document.getElementById("nsesector1").className="tabpaneltd02";
		}
		else
		{	
		document.getElementById("sensexdata1").style.display="none";
		document.getElementById("niftydata1").style.display="inline";
		document.getElementById("nsesector1").className="tabpaneltd03";
		document.getElementById("bsesector1").className="tabpaneltd02";
		
		}		
	}


function changetab(tabid)
{
	//alert(tabid);
	if (tabid==1) 
	{
		document.getElementById("tab1").className="text1Atabalt"
		document.getElementById("tab2").className="text1Atab"
		document.getElementById("tab3").className="text1Atab"
		document.getElementById("tab4").className="text1Atab"
	}
	else if (tabid==2) 
	{	
		document.getElementById("tab2").className="text1Atabalt"
		document.getElementById("tab1").className="text1Atab"
		document.getElementById("tab3").className="text1Atab"
		document.getElementById("tab4").className="text1Atab"
	}
	else if (tabid==3) 
	{	
		document.getElementById("tab3").className="text1Atabalt"
		document.getElementById("tab1").className="text1Atab"
		document.getElementById("tab2").className="text1Atab"
		document.getElementById("tab4").className="text1Atab"
	}
	else if (tabid==4)
	{	
		document.getElementById("tab4").className="text1Atabalt"
		document.getElementById("tab1").className="text1Atab"
		document.getElementById("tab2").className="text1Atab"
		document.getElementById("tab3").className="text1Atab"
	}
}

function changeStyle(URl,exch)
{
	window.location=URl;
}

function CompInfoEnterPressed(e,cmpalpha)
 {
	var characterCode
	if(e && e.which)
	{ // NN4 specific code
		e = e
		characterCode = e.which
	}
	else 
	{
		e = event
		characterCode = e.keyCode // IE specific code
	}
	if (characterCode == 13) 
	{
	  checkquote('companylist.asp'); 
	    return true 		
	}
	// Enter key is 13
	else
	{
	 return false
	 }	
}


function SelQuarter(pageurl) //for Change of Quarters in Quarterly Results
{
	var url = pageurl;
	document.getElementById("EQinnerPage").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
	var ajax = new Ajax.Updater('EQinnerPage',url);
//document.submit();
}

function ProfileFirstPage(mno,txtQuote,code) /// Profile -comapny information for Qet Quotes
{
//alert(mno)
	document.getElementById("profhr"+mno).className="MenuSubLink1";
	document.getElementById("profimg"+mno).src="../images/Arw3.gif";
	document.getElementById("profsid"+mno).className="lmenuselect";

	for(var i=1; i<=20; i++)
	{	
		if (i!=mno)
		{
			document.getElementById("profhr"+i).className="MenuSubLink";
			document.getElementById("profimg"+i).src="../images/Arw4.gif";
			document.getElementById("profsid"+i).className="lmenu";
		}
	}

	if (txtQuote == "" && code == "")
	{
		var HomPageUrl = "../Profile/compinfodetail.asp?finid=2&pageOpt=1";
	}
	else
	{
		var HomPageUrl = "../Profile/companylist.asp?finid=2&strSearch="+txtQuote+"&pageOpt="+mno+"&code="+code;
	}
	//alert(HomPageUrl)
	document.getElementById("EQinnerPage").innerHTML="<table cellpadding='0' cellspacing='0' width='100%'><tr><td height='260px' align='center'><img src='../images/loading.gif'></td></tr></table>";
	var ajax = new Ajax.Updater('EQinnerPage',HomPageUrl);
}

function ChangePagePriceanly(EquityPageUrl) /// PriceAnalysis Left Menu Function
{	

	document.getElementById("EQinnerPage").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
	var ajax = new Ajax.Updater('EQinnerPage',EquityPageUrl);
}

function Change(id,Exchg) ///For PriceAnalysis Exchange Holidays
{
	var Url="ExchageHOLIDAY.ASP?id=33&PageOpt=13&Exchg="+Exchg+"&BYear="+id
	document.getElementById("EQinnerPage").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
	var ajax = new Ajax.Updater('EQinnerPage',Url);	
}
function ChangeGainerlosers(exchg,fldval,gain,seccode,Period)
{	

	var Url="bsetopgl.asp?Exchg="+exchg+"&Fld="+fldval+"&Opt="+gain+"&cmbSecCode="+seccode+"&Period="+Period;
document.getElementById("EQinnerPage").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
	var ajax = new Ajax.Updater('EQinnerPage',Url);	
}
function check() // for Chart
{
if (document.getElementById("SPeriod").value == "Other Period")
{
document.getElementById("forcheck").value = "1"
}
else
{
document.getElementById("forcheck").value = ""
}
if (document.getElementById("SPeriod").value == "Intraday")
{
document.getElementById("ChartType").options.length=1
}
else
{
document.getElementById("ChartType").options.length=2
document.getElementById("ChartType").options[1].innerText='OHLC Chart';
document.getElementById("ChartType").options[1].value='3';
}
}
function Vaildate_Date(Code) //for Normal Chart
{
	
	var PlotAt =  document.getElementById("PlotAt").options[document.getElementById("PlotAt").selectedIndex].value
	//var CompWith =  document.getElementById("CompWith").options[ document.getElementById("CompWith").selectedIndex].value
	var ChartType =  document.getElementById("ChartType").options[document.getElementById("ChartType").selectedIndex].value
	var SPeriod =  document.getElementById("SPeriod").options[document.getElementById("SPeriod").selectedIndex].value
	
	if (document.getElementById("forcheck").value == "1")
	{
		
		if (validateDate('S')==false)
		{
		return false
		}
		if (validateDate('E')==false)
		{
		return false
		}
	return true
	}
	//return true
	 var HomPageUrl="../Profile/param.asp?PageOpt=17&PlotAt="+PlotAt+"&SPeriod="+SPeriod+"&ChartType="+ChartType+"&code="+Code;
	document.getElementById("EQinnerPage").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
	var ajax = new Ajax.Updater('EQinnerPage',HomPageUrl);
}
function validateDate(dateOpt) //for validation of date for Chart
{
var dateOpt;
var bvalid1 ;
bvalid1=true
a2=0; b2=0; c2=0;
if (dateOpt == 'S')
{
a1 = eval("document.Chartsentext.SyearOfDate")
b1 = eval("document.Chartsentext.SmonthOfDate")
c1 = eval("document.Chartsentext.SdayOfDate")
a2 = eval("document.Chartsentext.SyearOfDate.options[document.Chartsentext.SyearOfDate.selectedIndex].value")
b2 = eval("document.Chartsentext.SmonthOfDate.options[document.Chartsentext.SmonthOfDate.selectedIndex].value")
c2 = eval("document.Chartsentext.SdayOfDate.options[document.Chartsentext.SdayOfDate.selectedIndex].value")
}
else
{
a1 = eval("document.Chartsentext.EyearOfDate")
b1 = eval("document.Chartsentext.EmonthOfDate")
c1 = eval("document.Chartsentext.EdayOfDate")
a2=eval("document.Chartsentext.EyearOfDate.options[document.Chartsentext.EyearOfDate.selectedIndex].value")
b2=eval("document.Chartsentext.EmonthOfDate.options[document.Chartsentext.EmonthOfDate.selectedIndex].value")
c2=eval("document.Chartsentext.EdayOfDate.options[document.Chartsentext.EdayOfDate.selectedIndex].value")
}
if (a2 == 0 && b2 == 0 && c2 == 0)
{
alert ("Invalid date format")
c1.focus();
bvalid1 = false;
}
else
{
if (a2 == 0 || b2 == 0 || c2 == 0)
{
alert ("Invalid date format")
c1.focus();
bvalid1 = false;
}
}
switch(eval(b2))
{
case 4: 
if (c2 > 30)
{
alert("Invalid date format")
c1.focus();
bvalid1 = false;
}
break;
case 6: 
if (c2 > 30)
{
alert("Invalid  date format")
c1.focus();
bvalid1 = false; 
}
break;
case 9:
if (c2 > 30)
{
alert("Invalid  date format")
c1.focus();
bvalid1 = false; 
}
break;
case 11:        
if (c2 > 30)
{
alert("Invalid  date format")
c1.focus();
bvalid1 = false; 
}
break;
case 2: 
if(((a2 % 4 == 0) && (a2 %100 != 0 || a2 % 400 == 0)))
{
if (c2 > 29)
{ 	
alert("Invalid  date format");
c1.focus();
bvalid1 = false;
}	
}
else
{
if (c2 > 28) 
{
alert("Invalid  date format");
c1.focus();
bvalid1 = false;
}	
}
break;	
}
if (bvalid1 != true) 
{
return false;
}
else
{
return true;
}
}

function Fun_chperiod(id,Exchg,code) //for Company Snapshot Chart
{
switch (id){ 
	case 'Intraday' : 
		
		document.getElementById("P_Ch").src="../profile/PeriodChart.asp?Exchange="+Exchg+"&SPeriod=Intraday&code="+code;
		 document.getElementById("t1").className="GainLoseSel";
		  document.getElementById("t2").className="GainLoseUnSel";
		   document.getElementById("t3").className="GainLoseUnSel"; 
		   document.getElementById("t4").className="GainLoseUnSel";
		    document.getElementById("t5").className="GainLoseUnSel";
			
	break; 
	case '5' : 
		document.getElementById("P_Ch").src="../profile/PeriodChart.asp?Exchange="+Exchg+"&SPeriod=-5&code="+code;
		 document.getElementById("t1").className="GainLoseUnSel";
		  document.getElementById("t2").className="GainLoseSel";
		   document.getElementById("t3").className="GainLoseUnSel"; 
		   document.getElementById("t4").className="GainLoseUnSel";
		    document.getElementById("t5").className="GainLoseUnSel";
			
	break; 
	case '90' : 
		 document.getElementById("P_Ch").src="../profile/PeriodChart.asp?Exchange="+Exchg+"&SPeriod=-90&code="+code;
		 document.getElementById("t1").className="GainLoseUnSel";
		  document.getElementById("t2").className="GainLoseUnSel";
		   document.getElementById("t3").className="GainLoseSel"; 
		   document.getElementById("t4").className="GainLoseUnSel";
		    document.getElementById("t5").className="GainLoseUnSel";
	
	break; 
	case '180' : 
		 document.getElementById("P_Ch").src="../profile/PeriodChart.asp?Exchange="+Exchg+"&SPeriod=-180&code="+code;
		 document.getElementById("t1").className="GainLoseUnSel";
		  document.getElementById("t2").className="GainLoseUnSel";
		   document.getElementById("t3").className="GainLoseUnSel"; 
		   document.getElementById("t4").className="GainLoseSel";
		    document.getElementById("t5").className="GainLoseUnSel";
			
	break; 
	case '365' : 
		document.getElementById("P_Ch").src="../profile/PeriodChart.asp?Exchange="+Exchg+"&SPeriod=-365&code="+code;
		 document.getElementById("t1").className="GainLoseUnSel";
		  document.getElementById("t2").className="GainLoseUnSel";
		   document.getElementById("t3").className="GainLoseUnSel"; 
		   document.getElementById("t4").className="GainLoseUnSel";
		    document.getElementById("t5").className="GainLoseSel";
			
	break; 
	}
}

function showContract(opt) ///show derivatives Future Option
{
if(opt!="SE"){
switch (opt){ 	
	case '1' :
		pgName="foMostActContract.asp?a=10&SortOrder=TradedQty&pageOpt=1"
		document.getElementById("DerivativesInner").innerHTML="<table cellpadding='0' cellspacing='0' width='100%'><tr><td height='260px' align='center'><img src='../images/loading.gif'></td></tr></table>";
 		var ajax = new Ajax.Updater('DerivativesInner',pgName);
	break; 
	case '2' :
		pgName="foMostActContract.asp?a=10&SortOrder=TradedQty&InstType=FUTIDX&symbol=nifty&pageOpt=2"
		document.getElementById("DerivativesInner").innerHTML="<table cellpadding='0' cellspacing='0' width='100%'><tr><td height='260px' align='center'><img src='../images/loading.gif'></td></tr></table>";
 		var ajax = new Ajax.Updater('DerivativesInner',pgName);
	break; 
	case '3' :
		pgName="foMostActContract.asp?a=10&SortOrder=TradedQty&InstType=OPTIDX&symbol=nifty&pageOpt=3"
		document.getElementById("DerivativesInner").innerHTML="<table cellpadding='0' cellspacing='0' width='100%'><tr><td height='260px' align='center'><img src='../images/loading.gif'></td></tr></table>";
 		var ajax = new Ajax.Updater('DerivativesInner',pgName);
	break; 
	case '4' :
		pgName="foMostActContract.asp?a=10&SortOrder=TradedQty&InstType=FUTIDX&symbol=CNXIT&Sym=S&pageOpt=4"
		document.getElementById("DerivativesInner").innerHTML="<table cellpadding='0' cellspacing='0' width='100%'><tr><td height='260px' align='center'><img src='../images/loading.gif'></td></tr></table>";
 		var ajax = new Ajax.Updater('DerivativesInner',pgName);
	break; 
	case '5' :
		pgName="foMostActContract.asp?a=10&SortOrder=TradedQty&InstType=OPTIDX&symbol=CNXIT&Sym=S&pageOpt=5"
		document.getElementById("DerivativesInner").innerHTML="<table cellpadding='0' cellspacing='0' width='100%'><tr><td height='260px' align='center'><img src='../images/loading.gif'></td></tr></table>";
 		var ajax = new Ajax.Updater('DerivativesInner',pgName);
	break; 
	case '6' :
		pgName="foMostActContract.asp?a=10&SortOrder=TradedQty&InstType=FUTSTK&Sym=SP&pageOpt=6"
		document.getElementById("DerivativesInner").innerHTML="<table cellpadding='0' cellspacing='0' width='100%'><tr><td height='260px' align='center'><img src='../images/loading.gif'></td></tr></table>";
 		var ajax = new Ajax.Updater('DerivativesInner',pgName);
	break; 
	case '7' :
		pgName="foMostActContract.asp?a=10&SortOrder=TradedQty&InstType=OPTSTK&Sym=SP&pageOpt=7"
		document.getElementById("DerivativesInner").innerHTML="<table cellpadding='0' cellspacing='0' width='100%'><tr><td height='260px' align='center'><img src='../images/loading.gif'></td></tr></table>";
 		var ajax = new Ajax.Updater('DerivativesInner',pgName);
	break; 
} 
}
}
function showContract1(opt,pageid) ///show derivatives Future Option
{
	if (pageid == "2" || pageid == "3" || pageid == "4" || pageid == "5")
		{
			var url="foMarketWatch.asp?a=10";
		}
	else if (pageid == "7" )
		{
			var url ="foDlySetlmntPrice.asp?a=10";
		}
	var ExpiryDate = document.getElementById("ExpiryDate").value;
	if(opt!="SE")
	{
	switch (opt)
		{ 	
		case '1' :
			pgName = url+"&SortOrder=TradedQty&pageOpt=1&pageid="+pageid+"&ExpDate="+ExpiryDate;
			//alert(pgName);
			document.getElementById("DerivativesInner").innerHTML="<table cellpadding='0' cellspacing='0' width='100%'><tr><td height='260px' align='center'><img src='../images/loading.gif'></td></tr></table>";
			var ajax = new Ajax.Updater('DerivativesInner',pgName);
		break; 
		case '2' :
			pgName = url+"&SortOrder=TradedQty&InstType=FUTIDX&symbol=nifty&pageOpt=2&pageid="+pageid+"&ExpDate="+ExpiryDate;
			document.getElementById("DerivativesInner").innerHTML="<table cellpadding='0' cellspacing='0' width='100%'><tr><td height='260px' align='center'><img src='../images/loading.gif'></td></tr></table>";
			var ajax = new Ajax.Updater('DerivativesInner',pgName);
		break; 
		case '3' :
			pgName= url+"&SortOrder=TradedQty&InstType=OPTIDX&symbol=nifty&pageOpt=3&pageid="+pageid+"&ExpDate="+ExpiryDate;
			document.getElementById("DerivativesInner").innerHTML="<table cellpadding='0' cellspacing='0' width='100%'><tr><td height='260px' align='center'><img src='../images/loading.gif'></td></tr></table>";
			var ajax = new Ajax.Updater('DerivativesInner',pgName);
		break; 
		case '4' :
			pgName= url+"&SortOrder=TradedQty&InstType=FUTIDX&symbol=CNXIT&Sym=&pageOpt=4&pageid="+pageid+"&ExpDate="+ExpiryDate;
			document.getElementById("DerivativesInner").innerHTML="<table cellpadding='0' cellspacing='0' width='100%'><tr><td height='260px' align='center'><img src='../images/loading.gif'></td></tr></table>";
			var ajax = new Ajax.Updater('DerivativesInner',pgName);
		break; 
		case '5' :
			pgName= url+"&SortOrder=TradedQty&InstType=OPTIDX&symbol=CNXIT&Sym=&pageOpt=5&pageid="+pageid+"&ExpDate="+ExpiryDate;
			document.getElementById("DerivativesInner").innerHTML="<table cellpadding='0' cellspacing='0' width='100%'><tr><td height='260px' align='center'><img src='../images/loading.gif'></td></tr></table>";
			var ajax = new Ajax.Updater('DerivativesInner',pgName);
		break; 
		case '6' :
			pgName= url+"&SortOrder=TradedQty&InstType=FUTSTK&Sym=SP&pageOpt=6&pageid="+pageid+"&ExpDate="+ExpiryDate;
			document.getElementById("DerivativesInner").innerHTML="<table cellpadding='0' cellspacing='0' width='100%'><tr><td height='260px' align='center'><img src='../images/loading.gif'></td></tr></table>";
			var ajax = new Ajax.Updater('DerivativesInner',pgName);
		break; 
		case '7' :
			pgName= url+"&SortOrder=TradedQty&InstType=OPTSTK&Sym=SP&pageOpt=7&pageid="+pageid+"&ExpDate="+ExpiryDate;
			document.getElementById("DerivativesInner").innerHTML="<table cellpadding='0' cellspacing='0' width='100%'><tr><td height='260px' align='center'><img src='../images/loading.gif'></td></tr></table>";
			var ajax = new Ajax.Updater('DerivativesInner',pgName);
		break; 
		} 
	}
}

function showSection(opt)/// DErivatives Futures & option Pages Call
{
switch (opt)
	{ 	
	case '1' :
		pgName="foMostActContract.asp?InstType=FUT&Sym=MAC&a=10"
		document.getElementById("DerivativesInner").innerHTML="<table cellpadding='0' cellspacing='0' width='100%'><tr><td height='260px' align='center'><img src='../images/loading.gif'></td></tr></table>";
 		var ajax = new Ajax.Updater('DerivativesInner',pgName);
	break; 
	case '2' :
		pgName="foAllIndex.asp?InstType=FUT&Sym=AIF&a=11"
		document.getElementById("DerivativesInner").innerHTML="<table cellpadding='0' cellspacing='0' width='100%'><tr><td height='260px' align='center'><img src='../images/loading.gif'></td></tr></table>";
 		var ajax = new Ajax.Updater('DerivativesInner',pgName);
	break; 
	case '3' :
		pgName="fomktreport.asp?InstType=FUT&Sym=G&a=12"
		document.getElementById("DerivativesInner").innerHTML="<table cellpadding='0' cellspacing='0' width='100%'><tr><td height='260px' align='center'><img src='../images/loading.gif'></td></tr></table>";
 		var ajax = new Ajax.Updater('DerivativesInner',pgName);
	break; 
	case '4' :
		pgName="fomktreport.asp?InstType=FUT&Sym=L&a=13"
		document.getElementById("DerivativesInner").innerHTML="<table cellpadding='0' cellspacing='0' width='100%'><tr><td height='260px' align='center'><img src='../images/loading.gif'></td></tr></table>";
 		var ajax = new Ajax.Updater('DerivativesInner',pgName);
	break; 
	case '5' :
		pgName="fomktreport.asp?InstType=FUT&Sym=HOI&a=14"
		document.getElementById("DerivativesInner").innerHTML="<table cellpadding='0' cellspacing='0' width='100%'><tr><td height='260px' align='center'><img src='../images/loading.gif'></td></tr></table>";
 		var ajax = new Ajax.Updater('DerivativesInner',pgName);
	break; 
	case '6' :
		pgName="fomktreport.asp?InstType=FUT&Sym=LOI&a=15"
		document.getElementById("DerivativesInner").innerHTML="<table cellpadding='0' cellspacing='0' width='100%'><tr><td height='260px' align='center'><img src='../images/loading.gif'></td></tr></table>";
 		var ajax = new Ajax.Updater('DerivativesInner',pgName);
	break; 	
	case '7' :
		pgName="fomktreport.asp?InstType=FUT&Sym=IOI&a=16"
		document.getElementById("DerivativesInner").innerHTML="<table cellpadding='0' cellspacing='0' width='100%'><tr><td height='260px' align='center'><img src='../images/loading.gif'></td></tr></table>";
 		var ajax = new Ajax.Updater('DerivativesInner',pgName);
	break; 
	case '16' :
		pgName="fomktreport.asp?InstType=FUT&Sym=DOI&a=25"
		//alert(pgName);
		document.getElementById("DerivativesInner").innerHTML="<table cellpadding='0' cellspacing='0' width='100%'><tr><td height='260px' align='center'><img src='../images/loading.gif'></td></tr></table>";
 		var ajax = new Ajax.Updater('DerivativesInner',pgName);
	break; 
	//options
	case '8' :
		pgName="fomostactcalls.asp?a=17"
		document.getElementById("DerivativesInner").innerHTML="<table cellpadding='0' cellspacing='0' width='100%'><tr><td height='260px' align='center'><img src='../images/loading.gif'></td></tr></table>";
		var ajax = new Ajax.Updater('DerivativesInner',pgName);
	break; 
	case '9' :
		pgName="fomostactputs.asp?a=18"
		document.getElementById("DerivativesInner").innerHTML="<table cellpadding='0' cellspacing='0' width='100%'><tr><td height='260px' align='center'><img src='../images/loading.gif'></td></tr></table>";
		var ajax = new Ajax.Updater('DerivativesInner',pgName);
	break; 
	case '10' :
		pgName="fomktreport.asp?InstType=OPT&Sym=G&a=19"
		document.getElementById("DerivativesInner").innerHTML="<table cellpadding='0' cellspacing='0' width='100%'><tr><td height='260px' align='center'><img src='../images/loading.gif'></td></tr></table>";
		var ajax = new Ajax.Updater('DerivativesInner',pgName);
	break; 
	case '11' :
		pgName="foMktReport.asp?InstType=OPT&Sym=L&a=20"
		document.getElementById("DerivativesInner").innerHTML="<table cellpadding='0' cellspacing='0' width='100%'><tr><td height='260px' align='center'><img src='../images/loading.gif'></td></tr></table>";
		var ajax = new Ajax.Updater('DerivativesInner',pgName);
	break; 
	
	case '12' :
		pgName="foMktReport.asp?InstType=OPT&Sym=HOI&a=21"
		document.getElementById("DerivativesInner").innerHTML="<table cellpadding='0' cellspacing='0' width='100%'><tr><td height='260px' align='center'><img src='../images/loading.gif'></td></tr></table>";
		var ajax = new Ajax.Updater('DerivativesInner',pgName);
	break; 
	case '13' :
		pgName="foMktReport.asp?InstType=OPT&Sym=LOI&a=22"
		document.getElementById("DerivativesInner").innerHTML="<table cellpadding='0' cellspacing='0' width='100%'><tr><td height='260px' align='center'><img src='../images/loading.gif'></td></tr></table>";
		var ajax = new Ajax.Updater('DerivativesInner',pgName);
	break; 
	case '14' :
		pgName="foMktReport.asp?InstType=OPT&Sym=IOI&a=23"
		document.getElementById("DerivativesInner").innerHTML="<table cellpadding='0' cellspacing='0' width='100%'><tr><td height='260px' align='center'><img src='../images/loading.gif'></td></tr></table>";
		var ajax = new Ajax.Updater('DerivativesInner',pgName);
	break; 
	case '15' :
		pgName="foMktReport.asp?InstType=OPT&Sym=DOI&a=24"
		document.getElementById("DerivativesInner").innerHTML="<table cellpadding='0' cellspacing='0' width='100%'><tr><td height='260px' align='center'><img src='../images/loading.gif'></td></tr></table>";
		var ajax = new Ajax.Updater('DerivativesInner',pgName);
	break; 
	} 
}


var InstIndex="";
var SymbIndex="";
var ExpIndex ="";
var TypeIndex="";
var StrikeIndex="";

var ExpiryDate="";
var OptionType="";
var InstrumentTypeVal="";
var SymbolVal="";
var StrikeVal="";

function validate()//derivative
 {

 //final check ..required since any change during final submission will
 // unnecessarily invoke the server side program.... only the combinations
 //available needs to be checked at the server end...
 // wrong combinations will increase unwarranted calls to controller servlet

		 //InstrumentTypeVal=document.frmGetQuotes.InstrumentType.options[document.frmGetQuotes.InstrumentType.selectedIndex].value;
		 //InstIndex=document.frmGetQuotes.InstrumentType.selectedIndex;
		InstrumentTypeVal=document.getElementById("InstrumentType").options[document.getElementById("InstrumentType").selectedIndex].value
		InstIndex=document.getElementById("InstrumentType").selectedIndex
		 
	 if(InstIndex!=0)
	 {
	     //SymbolVal=document.frmGetQuotes.Symbol.options[document.frmGetQuotes.Symbol.selectedIndex].value;
		//SymbIndex=document.frmGetQuotes.Symbol.selectedIndex;
		SymbolVal=document.getElementById("Symbol").options[document.getElementById("Symbol").selectedIndex].value
		SymbIndex=document.getElementById("Symbol").selectedIndex

		 if(SymbIndex!=0)
		 {
		    // ExpiryDate=document.frmGetQuotes.ExpiryDate.options[document.frmGetQuotes.ExpiryDate.selectedIndex].value;
			// ExpIndex =document.frmGetQuotes.ExpiryDate.selectedIndex;
			ExpiryDate=document.getElementById("ExpiryDate").options[document.getElementById("ExpiryDate").selectedIndex].value
		    ExpIndex=document.getElementById("ExpiryDate").selectedIndex

			 if(ExpIndex!=0)
			 {
			 if(InstrumentTypeVal=="FUTIDX"||InstrumentTypeVal=="FUTSTK"||InstrumentTypeVal=="FUTINT")
				 {
				 OptionType="-";
				 TypeIndex=0;
				 StrikePriceVal="-";
				 StrikeIndex=0;
	
				 if(SymbolVal.match(/&/g))
				 SymbolVal=SymbolVal.replace("&","%26");
				 unique_key=InstrumentTypeVal+SymbolVal+ExpiryDate+OptionType+StrikePriceVal;
				 urlText = "InstType="+ InstrumentTypeVal +"&symbol="+ SymbolVal +"&ExpDate="+ ExpiryDate +"&OptType=XX&StkPrice=0"
				
				 ////document.frmGetQuotes.action = "fogetquotes.asp?opt=2&"+ urlText
				var StrUrl= "fogetquotes.asp?opt=2&"+ urlText;
				//alert(StrUrl);
				var ajax = new Ajax.Updater('DerivativesInner',StrUrl);
				
				// return true; // to me made true
				 }
			 else{
			 		 //OptionType=document.frmGetQuotes.OptionType.options[document.frmGetQuotes.OptionType.selectedIndex].value;
			 		// TypeIndex=document.frmGetQuotes.OptionType.selectedIndex;
					OptionType=document.getElementById("OptionType").options[document.getElementById("OptionType").selectedIndex].value
		            TypeIndex=document.getElementById("OptionType").selectedIndex


			 		 if(TypeIndex!=0)
					{
					// StrikePriceVal=document.frmGetQuotes.StrikePrice.options[document.frmGetQuotes.StrikePrice.selectedIndex].value;
					// StrikeIndex=document.frmGetQuotes.StrikePrice.selectedIndex;
					StrikePriceVal=document.getElementById("StrikePrice").options[document.getElementById("StrikePrice").selectedIndex].value
					StrikeIndex=document.getElementById("StrikePrice").selectedIndex


					 if(StrikeIndex !=0)
					 {

					 unique_key=InstrumentTypeVal+SymbolVal+ExpiryDate+OptionType+StrikePriceVal;						 
					 if(finalcheck(unique_key))
					 {

					 if(SymbolVal.match(/&/g))
					 SymbolVal=SymbolVal.replace("&","%26");
					 urlText = "InstType="+ InstrumentTypeVal +"&symbol="+ SymbolVal +"&ExpDate="+ ExpiryDate +"&OptType="+ OptionType +"&StkPrice="+ StrikePriceVal						 
					 //document.frmGetQuotes.action = "fogetquotes.asp?opt=2&"+ urlText
					 //alert();
					 var StrUrl= "fogetquotes.asp?opt=2&"+ urlText;var ajax = new Ajax.Updater('DerivativesInner',StrUrl);
						//alert(StrUrl);
					// return true; // to return true
					 }
					 else{
					 alert("No Strike Price Is Available For The Selected Combination...Try Again");
						//return false;
						}

					 }
						 else
						 {
						 	alert("Please Select Strike Price Before You Proceed");
							document.getElementById("StrikePrice").focus();
	 	 					//return false;
						 }

			 			}
			 			else
			 			{
			 			alert("Please Select Option Type Before You Proceed");
						document.getElementById("OptionType").focus();
	 	 			//return false;

			 			}

				 }
			 }
			 else
			 {
			 alert("Please Select An Expiry Date Before You Proceed");
			 document.getElementById("ExpiryDate").focus();
	 	// return false;
			 }
		 }
		 else
		 {
		 	alert("Please Select The Symbol Before You Proceed");
			document.getElementById("Symbol").focus();
	// return false;
		 }
	 }
	 else
	 {
	 alert("Please select an Instrument Type before you proceed");
	 document.getElementById("InstrumentType").focus();	 
	//return false;
	 }
 }
 
function validateFilter(pageid)//derivative option filter
 {
//alert(pageid);
 //final check ..required since any change during final submission will
 // unnecessarily invoke the server side program.... only the combinations
 //available needs to be checked at the server end...
 // wrong combinations will increase unwarranted calls to controller servlet

		 //InstrumentTypeVal=document.frmGetQuotes.InstrumentType.options[document.frmGetQuotes.InstrumentType.selectedIndex].value;
		 //InstIndex=document.frmGetQuotes.InstrumentType.selectedIndex;
		InstrumentTypeVal=document.getElementById("InstrumentType").options[document.getElementById("InstrumentType").selectedIndex].value
		InstIndex=document.getElementById("InstrumentType").selectedIndex
		 
	 if(InstIndex!=0)
	 {
	     //SymbolVal=document.frmGetQuotes.Symbol.options[document.frmGetQuotes.Symbol.selectedIndex].value;
		//SymbIndex=document.frmGetQuotes.Symbol.selectedIndex;
		SymbolVal=document.getElementById("Symbol").options[document.getElementById("Symbol").selectedIndex].value
		SymbIndex=document.getElementById("Symbol").selectedIndex

		 if(SymbIndex!=0)
		 {
		    // ExpiryDate=document.frmGetQuotes.ExpiryDate.options[document.frmGetQuotes.ExpiryDate.selectedIndex].value;
			// ExpIndex =document.frmGetQuotes.ExpiryDate.selectedIndex;
			ExpiryDate=document.getElementById("ExpiryDate").options[document.getElementById("ExpiryDate").selectedIndex].value
		    ExpIndex=document.getElementById("ExpiryDate").selectedIndex

			//if(ExpIndex!=0)
			 {
				  {
			 		 OptionType="-";
			 		 TypeIndex=0;
			 		 StrikePriceVal="-";
			 		 StrikeIndex=0;

			 		 if(SymbolVal.match(/&/g))
			 		 SymbolVal=SymbolVal.replace("&","%26");
			 		 unique_key=InstrumentTypeVal+SymbolVal+ExpiryDate;
					 urlText = "InstType="+ InstrumentTypeVal +"&symbol="+ SymbolVal +"&ExpDate="+ ExpiryDate +""
					
					 ////document.frmGetQuotes.action = "fogetquotes.asp?opt=2&"+ urlText
					var StrUrl= "foMostActCalls.asp?a=17&opt=11&"+ urlText;
					//document.write(StrUrl);
					var ajax = new Ajax.Updater('DerivativesInner',StrUrl);
			 		
			 		// return true; // to me made true
			 	  }

			 }
			//else
			// {
			// alert("Please Select  An Expiry Date Before You Proceed");
			// document.getElementById("ExpiryDate").focus();
	 	// return false;
			// }
		 }
		 else
		 {
		 	alert("Please Select The Symbol Before You Proceed");
			document.getElementById("Symbol").focus();
	// return false;
		 }
	 }
	 else
	 {
	 alert("Please select an Instrument Type before you proceed");
	 document.getElementById("InstrumentType").focus();	 
	 //return false;
	 }
 }
function filldropderi(mno) //fill drop downs  for filtarion in derivative section
{
	var InstrumentType=document.getElementById("InstrumentType").value;
	var Symbol=document.getElementById("Symbol").value;	
	var ExpDate=document.getElementById("ExpiryDate").value;
	
	if(mno == 10)
		{	pgName="foMostActContract.asp?pageid=10&a=10&InstType="+InstrumentType+"&Symbol="+Symbol+"&ExpDate="+ExpDate; }
	if(mno == 7)
		{	pgName="foDlySetlmntPrice.asp?pageid=7&a=7&InstType="+InstrumentType+"&Symbol="+Symbol+"&ExpDate="+ExpDate; }
	if(mno == 17)
		{	pgName="fomostactcalls.asp?pageid=11&a=17&InstType="+InstrumentType+"&Symbol="+Symbol+"&ExpDate="+ExpDate; }
	if(mno == 18)
		{	pgName="fomostactPuts.asp?pageid=11&a=18&InstType="+InstrumentType+"&Symbol="+Symbol+"&ExpDate="+ExpDate; }
	//alert(pgName);
	document.getElementById("DerivativesInner").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
 	var ajax = new Ajax.Updater('DerivativesInner',pgName);
}
function filldropderiins(mno) //fill drop downs  for filtarion in derivative section
{
	var InstrumentType=document.getElementById("InstrumentType").value;
	var Symbol=document.getElementById("Symbol").value;	
	var ExpDate=document.getElementById("ExpiryDate").value;
	
	if(mno == 10)
		{	pgName="foMostActContract.asp?pageid=10&a=10&InstType="+InstrumentType; }
	if(mno == 7)
		{	pgName="foDlySetlmntPrice.asp?pageid=7&a=7&InstType="+InstrumentType; }
	if(mno == 17)
		{	pgName="fomostactcalls.asp?pageid=11&a=17&InstType="+InstrumentType; }
	if(mno == 18)
		{	pgName="fomostactPuts.asp?pageid=11&a=18&InstType="+InstrumentType; }
	//alert(pgName);
	document.getElementById("DerivativesInner").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
 	var ajax = new Ajax.Updater('DerivativesInner',pgName);
}


//-------------------------------------------------------------------------------------
	 //This function used for showing option table
function showOptTable(opt){
	if(opt=="OPTIDX" || opt=="OPTSTK")
	{
		document.getElementById("OptTable").style.display='inline';
		document.getElementById("OptTable1").style.display='inline';
	}
	else
	{
		document.getElementById("OptTable").style.display='none';
		document.getElementById("OptTable1").style.display='none';
	}
}



//-------------------------------------------------------------------------------------
// Derivatives Get Quotes Select Starts here

function dateConvert(strDate){
	//strDate = "21/01/2006"
	var strMon=0;
	monthArr = new Array("","Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")
	strMon = strDate.substring(3,5);
	if(strMon.substring(0,1)==0)strMon=strMon.substring(1,2);
	return strDate.substring(0,2) + "-" + monthArr[strMon] + "-" + strDate.substring(6) 
}

/*function dateConvert(strDate){
	alert(strDate);
	//strDate = "21/01/2006"
	monthArr = new Array("","Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")
	return strDate.substring(0,2) + "-" + monthArr[strDate.substring(4,2)] + "-" + strDate.substring(6) 
}*/

function fillSymbol(){


 if((document.getElementById("InstrumentType").options[document.getElementById("InstrumentType").selectedIndex].value)=="FUTIDX")
 {

 document.getElementById("Symbol").options.length =8;
 document.getElementById("Symbol").options[0].value ="";
 document.getElementById("Symbol").options[0].text ="Select Symbol";

 // display the first element in the select box which is SelectSymbol

 document.getElementById("Symbol").selectedIndex=0;

 document.getElementById("Symbol").options[1].value ="BANKNIFTY";
 document.getElementById("Symbol").options[1].text ="BANKNIFTY";
 
 document.getElementById("Symbol").options[2].value ="CNX100";
 document.getElementById("Symbol").options[2].text ="CNX100";
 
 document.getElementById("Symbol").options[3].value ="CNXIT";
 document.getElementById("Symbol").options[3].text ="CNXIT";
 
 document.getElementById("Symbol").options[4].value ="JUNIOR";
 document.getElementById("Symbol").options[4].text ="JUNIOR";
 
 document.getElementById("Symbol").options[5].value ="MINIFTY";
 document.getElementById("Symbol").options[5].text ="MINIFTY";
 
 document.getElementById("Symbol").options[6].value ="NFTYMCAP50";
 document.getElementById("Symbol").options[6].text ="NFTYMCAP50";

 document.getElementById("Symbol").options[7].value ="NIFTY";
 document.getElementById("Symbol").options[7].text ="NIFTY";


/* document.getElementById("ExpiryDate").options.length =4;
 document.getElementById("ExpiryDate").selectedIndex=0;

 for (i=1;i<=3;i++)
 {
   document.getElementById("ExpiryDate").options[i].value = e[i];
   document.getElementById("ExpiryDate").options[i].text = dateConvert(e[i]);
 }*/

 document.getElementById("OptionType").options.length =1;
 document.getElementById("OptionType").options[0].value ="";
 document.getElementById("OptionType").options[0].text ="Select Option Type";
 document.getElementById("OptionType").selectedIndex=0;

 document.getElementById("StrikePrice").options.length =1;
 document.getElementById("StrikePrice").options[0].value ="";
 document.getElementById("StrikePrice").options[0].text ="Select Strike Price";
 document.getElementById("StrikePrice").selectedIndex=0;

 }
 else if((document.getElementById("InstrumentType").options[document.getElementById("InstrumentType").selectedIndex].value)=="FUTSTK")
 {
  val=1;

   for (i=1;i<s.length;i++)
	 {
  	  	 	   //code to identify if symbol starts with NSE
  	    if(s[i].indexOf("NSE",0)==-1){
  	  	 	   val++;
  	  	 }

      }

  	 document.getElementById("Symbol").options.length = val;
	 document.getElementById("Symbol").options[0].value ="";
	 document.getElementById("Symbol").options[0].text ="Select Symbol";
	 document.getElementById("Symbol").selectedIndex=0;

    val=1;
     for (i=1;i<s.length;i++)
	  {
	  	 	   //code to identify if symbol starts with NSE
	  	   if(s[i].indexOf("NSE",0)==-1){
	  	   document.getElementById("Symbol").options[val].value = s[i];
	  	   document.getElementById("Symbol").options[val].text = s[i];
	  	   val++;
	  	  	 }

	   }
	   
/*	   
  	 document.getElementById("ExpiryDate").options.length =4;
	 document.getElementById("ExpiryDate").selectedIndex=0;

 for (i=1;i<=3;i++)
  {
   document.getElementById("ExpiryDate").options[i].value = e[i];
   document.getElementById("ExpiryDate").options[i].text = dateConvert(e[i]);
  }
*/
 document.getElementById("OptionType").options.length =1;
 document.getElementById("OptionType").options[0].value ="";
 document.getElementById("OptionType").options[0].text ="Select Option Type";
 document.getElementById("OptionType").selectedIndex=0;

 document.getElementById("StrikePrice").options.length =1;
 document.getElementById("StrikePrice").options[0].value ="";
 document.getElementById("StrikePrice").options[0].text ="Select Strike Price";
 document.getElementById("StrikePrice").selectedIndex=0;

 }
 else if((document.getElementById("InstrumentType").options[document.getElementById("InstrumentType").selectedIndex].value)=="FUTINT")
 {
 //length has to only symbols which belongs to FUTINT
var len =1;
  for (i=1;i<s.length;i++)
   {
  	 	   //code to identify if symbol starts with NSE
  	 if(s[i].indexOf("NSE",0)!=-1){
  	 len++;
  	 }
    }
     document.getElementById("Symbol").options.length =len;
 	 document.getElementById("Symbol").options[0].value ="";
 	 document.getElementById("Symbol").options[0].text ="Select Symbol";
 	 document.getElementById("Symbol").selectedIndex=0;

     len=1;
 	 for (i=1;i<s.length;i++)
 	 {
 	 	   //code to identify if symbol starts with NSE
 	 	if(s[i].indexOf("NSE",0)!=-1){
 	 	 document.getElementById("Symbol").options[len].value = s[i];
 	 	 document.getElementById("Symbol").options[len].text = s[i];
 	 	 len++;
 	 	 }
      }
/*
 document.getElementById("ExpiryDate").options.length =e.length;
 document.getElementById("ExpiryDate").selectedIndex=0;
//alert(document.getElementById("ExpiryDate").selectedIndex);
 for (i=1;i<e.length;i++)
  {
   document.getElementById("ExpiryDate").options[i].value = e[i];
   document.getElementById("ExpiryDate").options[i].text = dateConvert(e[i]);
  }
*/
 document.getElementById("OptionType").options.length =1;
 document.getElementById("OptionType").options[0].value ="";
 document.getElementById("OptionType").options[0].text ="Select Option Type";
 document.getElementById("OptionType").selectedIndex=0;

 document.getElementById("StrikePrice").options.length =1;
 document.getElementById("StrikePrice").options[0].value ="";
 document.getElementById("StrikePrice").options[0].text ="Select Strike Price";
 document.getElementById("StrikePrice").selectedIndex=0;

 }
 else if((document.getElementById("InstrumentType").options[document.getElementById("InstrumentType").selectedIndex].value)=="OPTIDX")
 {
 document.getElementById("Symbol").options.length =8;
 document.getElementById("Symbol").options[0].value ="";
 document.getElementById("Symbol").options[0].text ="Select Symbol";
 document.getElementById("Symbol").selectedIndex=0;

 document.getElementById("Symbol").options[1].value ="BANKNIFTY";
 document.getElementById("Symbol").options[1].text ="BANKNIFTY";

 document.getElementById("Symbol").options[2].value ="CNX100";
 document.getElementById("Symbol").options[2].text ="CNX100";

 document.getElementById("Symbol").options[3].value ="CNXIT";
 document.getElementById("Symbol").options[3].text ="CNXIT";
 
 document.getElementById("Symbol").options[4].value ="JUNIOR";
 document.getElementById("Symbol").options[4].text ="JUNIOR";
 
 document.getElementById("Symbol").options[5].value ="MINIFTY";
 document.getElementById("Symbol").options[5].text ="MINIFTY";

 document.getElementById("Symbol").options[6].value ="NFTYMCAP50";
 document.getElementById("Symbol").options[6].text ="NFTYMCAP50";
 
 document.getElementById("Symbol").options[7].value ="NIFTY";
 document.getElementById("Symbol").options[7].text ="NIFTY"; 


/*
 document.getElementById("ExpiryDate").options.length =4;
 document.getElementById("ExpiryDate").selectedIndex=0;

  for (i=1;i<=3;i++)
	{
		document.getElementById("ExpiryDate").options[i].value = e[i];
		document.getElementById("ExpiryDate").options[i].text = dateConvert(e[i]);
	}
*/
	document.getElementById("OptionType").options.length =3;
	document.getElementById("OptionType").options[0].value ="";
	document.getElementById("OptionType").options[0].text ="Select Option Type";
	document.getElementById("OptionType").options[1].value ="PE";
	document.getElementById("OptionType").options[1].text ="PE";
	document.getElementById("OptionType").options[2].value ="CE";
	document.getElementById("OptionType").options[2].text ="CE";
}
 else
{
	val=1;
	for (i=1;i<s.length;i++)
	{
		//code to identify if symbol starts with NSE
		if(s[i].indexOf("NSE",0)==-1){
		val++;
		}
	}
	document.getElementById("Symbol").options.length =val;
	document.getElementById("Symbol").options[0].value ="";
	document.getElementById("Symbol").options[0].text ="Select Symbol";
	document.getElementById("Symbol").selectedIndex=0;

   val=1;
        for (i=1;i<s.length;i++)
  	  	 	 {
  	  	 	   //code to identify if symbol starts with NSE
  	  	 	   if(s[i].indexOf("NSE",0)==-1){
  	  	 	  document.getElementById("Symbol").options[val].value = s[i];
  	  	 	 document.getElementById("Symbol").options[val].text = s[i];
  	  	 	 val++;
  	  	  	 }
	        }
/*	document.getElementById("ExpiryDate").options.length =4;
	document.getElementById("ExpiryDate").selectedIndex=0;

  for (i=1;i<=3;i++)
   {
    document.getElementById("ExpiryDate").options[i].value = e[i];
    document.getElementById("ExpiryDate").options[i].text = dateConvert(e[i]);
   }
*/

	document.getElementById("OptionType").options.length =3;
	document.getElementById("OptionType").options[0].value ="";
	document.getElementById("OptionType").options[0].text ="Select Option Type";
	document.getElementById("OptionType").options[1].value ="PA";
	document.getElementById("OptionType").options[1].text ="PA";
	document.getElementById("OptionType").options[2].value ="CA";
	document.getElementById("OptionType").options[2].text ="CA";
 }

//fillStrikePrice();
}


function fillSymbolfilter() //this function used for filration in derivatives pages
{
if((document.getElementById("InstrumentType").options[document.getElementById("InstrumentType").selectedIndex].value)=="FUTIDX")
	{
		 document.getElementById("Symbol").options.length =8;
		 document.getElementById("Symbol").options[0].value ="";
		 document.getElementById("Symbol").options[0].text ="Select Symbol";
		
		 // display the first element in the select box which is SelectSymbol
		
		 document.getElementById("Symbol").selectedIndex=0;
		
		 document.getElementById("Symbol").options[1].value ="BANKNIFTY";
		 document.getElementById("Symbol").options[1].text ="BANKNIFTY";
		 
		 document.getElementById("Symbol").options[2].value ="CNX100";
		 document.getElementById("Symbol").options[2].text ="CNX100";
		 
		 document.getElementById("Symbol").options[3].value ="CNXIT";
		 document.getElementById("Symbol").options[3].text ="CNXIT";
		 
		 document.getElementById("Symbol").options[4].value ="JUNIOR";
		 document.getElementById("Symbol").options[4].text ="JUNIOR";
		 
		 document.getElementById("Symbol").options[5].value ="MINIFTY";
		 document.getElementById("Symbol").options[5].text ="MINIFTY";
		 
		 document.getElementById("Symbol").options[6].value ="NFTYMCAP50";
		 document.getElementById("Symbol").options[6].text ="NFTYMCAP50";
		
		 document.getElementById("Symbol").options[7].value ="NIFTY";
		 document.getElementById("Symbol").options[7].text ="NIFTY";
		
/*		 document.getElementById("ExpiryDate").options.length =4;
		 document.getElementById("ExpiryDate").selectedIndex=0;

		 for (i=1;i<=3;i++)
		 {
		   document.getElementById("ExpiryDate").options[i].value = e[i];
		   document.getElementById("ExpiryDate").options[i].text = dateConvert(e[i]);
		 }*/
	}
 else if((document.getElementById("InstrumentType").options[document.getElementById("InstrumentType").selectedIndex].value)=="FUTSTK")
	 {
		  val=1;
		
		   for (i=1;i<s.length;i++)
			 {
					   //code to identify if symbol starts with NSE
				if(s[i].indexOf("NSE",0)==-1){
					   val++;
				 }
		
			  }
		
			 document.getElementById("Symbol").options.length = val;
			 document.getElementById("Symbol").options[0].value ="";
			 document.getElementById("Symbol").options[0].text ="Select Symbol";
			 document.getElementById("Symbol").selectedIndex=0;
		
			val=1;
			 for (i=1;i<s.length;i++)
			  {
					   //code to identify if symbol starts with NSE
				   if(s[i].indexOf("NSE",0)==-1){
				   document.getElementById("Symbol").options[val].value = s[i];
				   document.getElementById("Symbol").options[val].text = s[i];
				   val++;
					 }
		
			   }
/*			 document.getElementById("ExpiryDate").options.length =4;
			 document.getElementById("ExpiryDate").selectedIndex=0;
		
		 for (i=1;i<=3;i++)
		  {
		   document.getElementById("ExpiryDate").options[i].value = e[i];
		   document.getElementById("ExpiryDate").options[i].text = dateConvert(e[i]);
		  }*/

 	}
 	else if((document.getElementById("InstrumentType").options[document.getElementById("InstrumentType").selectedIndex].value)=="FUTINT")
	 {
	 //length has to only symbols which belongs to FUTINT
		var len =1;
		  for (i=1;i<s.length;i++)
		   {
				   //code to identify if symbol starts with NSE
			 if(s[i].indexOf("NSE",0)!=-1){
			 len++;
			 }
			}
			 document.getElementById("Symbol").options.length =len;
			 document.getElementById("Symbol").options[0].value ="";
			 document.getElementById("Symbol").options[0].text ="Select Symbol";
			 document.getElementById("Symbol").selectedIndex=0;
		
			 len=1;
			 for (i=1;i<s.length;i++)
			 {
				   //code to identify if symbol starts with NSE
				if(s[i].indexOf("NSE",0)!=-1){
				 document.getElementById("Symbol").options[len].value = s[i];
				 document.getElementById("Symbol").options[len].text = s[i];
				 len++;
				 }
			  }
/*		 document.getElementById("ExpiryDate").options.length =e.length;
		 document.getElementById("ExpiryDate").selectedIndex=0;
		
		 for (i=1;i<e.length;i++)
		  {
		   document.getElementById("ExpiryDate").options[i].value = e[i];
		   document.getElementById("ExpiryDate").options[i].text = dateConvert(e[i]);
		  }*/
	 }
 else if((document.getElementById("InstrumentType").options[document.getElementById("InstrumentType").selectedIndex].value)=="OPTIDX")
	 {
	 document.getElementById("Symbol").options.length =8;
	 document.getElementById("Symbol").options[0].value ="";
	 document.getElementById("Symbol").options[0].text ="Select Symbol";
	 document.getElementById("Symbol").selectedIndex=0;
	
	 document.getElementById("Symbol").options[1].value ="BANKNIFTY";
	 document.getElementById("Symbol").options[1].text ="BANKNIFTY";
	
	 document.getElementById("Symbol").options[2].value ="CNX100";
	 document.getElementById("Symbol").options[2].text ="CNX100";
	
	 document.getElementById("Symbol").options[3].value ="CNXIT";
	 document.getElementById("Symbol").options[3].text ="CNXIT";
	 
	 document.getElementById("Symbol").options[4].value ="JUNIOR";
	 document.getElementById("Symbol").options[4].text ="JUNIOR";
	 
	 document.getElementById("Symbol").options[5].value ="MINIFTY";
	 document.getElementById("Symbol").options[5].text ="MINIFTY";
	
	 document.getElementById("Symbol").options[6].value ="NFTYMCAP50";
	 document.getElementById("Symbol").options[6].text ="NFTYMCAP50";
	 
	 document.getElementById("Symbol").options[7].value ="NIFTY";
	 document.getElementById("Symbol").options[7].text ="NIFTY"; 
	
	
/*	 document.getElementById("ExpiryDate").options.length =4;
	 document.getElementById("ExpiryDate").selectedIndex=0;
	
	  for (i=1;i<=3;i++)
		{
			document.getElementById("ExpiryDate").options[i].value = e[i];
			document.getElementById("ExpiryDate").options[i].text = dateConvert(e[i]);
		}
		*/
	}
 else
{
	val=1;
	for (i=1;i<s.length;i++)
	{
		//code to identify if symbol starts with NSE
		if(s[i].indexOf("NSE",0)==-1){
		val++;
		}
	}
	document.getElementById("Symbol").options.length =val;
	document.getElementById("Symbol").options[0].value ="";
	document.getElementById("Symbol").options[0].text ="Select Symbol";
	document.getElementById("Symbol").selectedIndex=0;

   val=1;
        for (i=1;i<s.length;i++)
  	  	 	 {
  	  	 	   //code to identify if symbol starts with NSE
  	  	 	   if(s[i].indexOf("NSE",0)==-1){
  	  	 	  document.getElementById("Symbol").options[val].value = s[i];
  	  	 	 document.getElementById("Symbol").options[val].text = s[i];
  	  	 	 val++;
  	  	  	 }
	        }
/*	document.getElementById("ExpiryDate").options.length =4;
	document.getElementById("ExpiryDate").selectedIndex=0;

  for (i=1;i<=3;i++)
   {
    document.getElementById("ExpiryDate").options[i].value = e[i];
    document.getElementById("ExpiryDate").options[i].text = dateConvert(e[i]);
   }*/

 }
}

function populate()
{
// Code to dynamically populate the drop downs

 	//document.frmGetQuotes.Symbol.options.length =s.length;
	document.getElementById("Symbol").options.length =s.length;
 	//document.frmGetQuotes.ExpiryDate.options.length = e.length;
	document.getElementById("ExpiryDate").options.length = e.length;
 	//document.frmGetQuotes.StrikePrice.options.length=1;
	document.getElementById("StrikePrice").options.length=1;


  // works in browsers which support HTML 4.0
 //document.frmGetQuotes.InstrumentType.disabled=true;

 	//document.frmGetQuotes.InstrumentType.selectedIndex=0;
	document.getElementById("InstrumentType").selectedIndex=0;
 	//document.frmGetQuotes.Symbol.selectedIndex=0;
	document.getElementById("Symbol").selectedIndex=0;
 	//document.frmGetQuotes.ExpiryDate.selectedIndex=0;
	document.getElementById("ExpiryDate").selectedIndex=0;
 	//document.frmGetQuotes.OptionType.selectedIndex=0;
	 	document.getElementById("OptionType").selectedIndex=0;
 	//document.frmGetQuotes.StrikePrice.selectedIndex=0;
	 	document.getElementById("StrikePrice").selectedIndex=0;


 for (i=1;i<s.length;i++)
 {
 	//document.frmGetQuotes.Symbol.options[i].value = s[i];
	 	document.getElementById("Symbol").options[i].value = s[i];
 	//document.frmGetQuotes.Symbol.options[i].text = s[i];
	 	document.getElementById("Symbol").options[i].text = s[i];
 }

 for (i=1;i<e.length;i++)
 {
 // document.frmGetQuotes.ExpiryDate.options[i].value = e[i];
    	document.getElementById("ExpiryDate").options[i].value = e[i];
  //document.frmGetQuotes.ExpiryDate.options[i].text = dateConvert(e[i]);
    	document.getElementById("ExpiryDate").options[i].text = dateConvert(e[i]);
 }

}


function populatefilter() // thsi fuction used for filtration in derivatives pages
{
// Code to dynamically populate the drop downs

 	//document.frmGetQuotes.Symbol.options.length =s.length;
	document.getElementById("Symbol").options.length =s.length;
 	//document.frmGetQuotes.ExpiryDate.options.length = e.length;
	document.getElementById("ExpiryDate").options.length = e.length;
 	//document.frmGetQuotes.StrikePrice.options.length=1;
	document.getElementById("StrikePrice").options.length=1;


  // works in browsers which support HTML 4.0
 //document.frmGetQuotes.InstrumentType.disabled=true;

 	//document.frmGetQuotes.InstrumentType.selectedIndex=0;
	document.getElementById("InstrumentType").selectedIndex=0;
 	//document.frmGetQuotes.Symbol.selectedIndex=0;
	document.getElementById("Symbol").selectedIndex=0;
 	//document.frmGetQuotes.ExpiryDate.selectedIndex=0;
	document.getElementById("ExpiryDate").selectedIndex=0;
 	//document.frmGetQuotes.OptionType.selectedIndex=0;
	 	document.getElementById("OptionType").selectedIndex=0;
 	//document.frmGetQuotes.StrikePrice.selectedIndex=0;
	 	document.getElementById("StrikePrice").selectedIndex=0;


 for (i=1;i<s.length;i++)
 {
 	//document.frmGetQuotes.Symbol.options[i].value = s[i];
	 	document.getElementById("Symbol").options[i].value = s[i];
 	//document.frmGetQuotes.Symbol.options[i].text = s[i];
	 	document.getElementById("Symbol").options[i].text = s[i];
 }

 for (i=1;i<e.length;i++)
 {
 // document.frmGetQuotes.ExpiryDate.options[i].value = e[i];
    	document.getElementById("ExpiryDate").options[i].value = e[i];
  //document.frmGetQuotes.ExpiryDate.options[i].text = dateConvert(e[i]);
    	document.getElementById("ExpiryDate").options[i].text = dateConvert(e[i]);
 }

}

function fillStrikePrice()
{

	InstrumentTypeVal=document.getElementById("InstrumentType").options[document.getElementById("InstrumentType").selectedIndex].value;
	InstIndex=document.getElementById("InstrumentType").selectedIndex;
	SymbolVal=document.getElementById("Symbol").options[document.getElementById("Symbol").selectedIndex].value;
	SymbIndex=document.getElementById("Symbol").selectedIndex;
	ExpiryDate=document.getElementById("ExpiryDate").options[document.getElementById("ExpiryDate").selectedIndex].value;
	ExpIndex =document.getElementById("ExpiryDate").selectedIndex;

	if(InstrumentTypeVal=="FUTIDX"||InstrumentTypeVal=="FUTSTK"||InstrumentTypeVal=="FUTINT")
	{
		OptionType="-";
		TypeIndex=0;
		
		if(SymbolVal!="")
		{
					document.getElementById("ExpiryDate").options.length =4;
		 			//document.getElementById("ExpiryDate").selectedIndex=0;
		
		  for (i=1;i<=3;i++)
			{
				document.getElementById("ExpiryDate").options[i].value = e[i];
				document.getElementById("ExpiryDate").options[i].text = dateConvert(e[i]);
			}
			}
	}
	else
	{
		OptionType=document.getElementById("OptionType").options[document.getElementById("OptionType").selectedIndex].value;
		TypeIndex=document.getElementById("OptionType").selectedIndex;
		//alert(TypeIndex);
		
		if(SymbolVal!="")
		{
					document.getElementById("ExpiryDate").options.length =4;
		 	//document.getElementById("ExpiryDate").selectedIndex=0;
		
		  for (i=1;i<=3;i++)
			{
				document.getElementById("ExpiryDate").options[i].value = e[i];
				document.getElementById("ExpiryDate").options[i].text = dateConvert(e[i]);
			}
			}
	}

	if(InstIndex!=0)
	{
		if(SymbIndex!=0)
		{
			if(ExpIndex!=0)
			{
//ExpiryDate = document.getElementById("ExpiryDate").selectedIndex;
				if(TypeIndex!=0 && (InstrumentTypeVal!="FUTIDX"||InstrumentTypeVal!="FUTSTK"||InstrumentTypeVal!="FUTINT"))
				{
					unique_key=	InstrumentTypeVal+SymbolVal+ExpiryDate+OptionType
	
					if(!populateStrikePrice(unique_key))
						{
							alert("No Strike Price Is Available For The Selected Combination...Try Again");
							document.getElementById("StrikePrice").options.length =1;
							document.getElementById("StrikePrice").options[0].value ="";
							document.getElementById("StrikePrice").options[0].text ="Select Strike Price";
							document.getElementById("StrikePrice").selectedIndex=0;
						
						}
						
						
				}
			else if(TypeIndex==0 && (InstrumentTypeVal=="FUTIDX"||InstrumentTypeVal=="FUTSTK"||InstrumentTypeVal!="FUTINT"))
				{
					unique_key=InstrumentTypeVal+SymbolVal+ExpiryDate+OptionType;
				}
			}
		}
	}
}

function fillStrikePriceFilter() //function used for filteration in derivatives
{
	InstrumentTypeVal=document.getElementById("InstrumentType").options[document.getElementById("InstrumentType").selectedIndex].value;
	InstIndex=document.getElementById("InstrumentType").selectedIndex;
	SymbolVal=document.getElementById("Symbol").options[document.getElementById("Symbol").selectedIndex].value;
	SymbIndex=document.getElementById("Symbol").selectedIndex;
	ExpiryDate=document.getElementById("ExpiryDate").options[document.getElementById("ExpiryDate").selectedIndex].value;
	ExpIndex =document.getElementById("ExpiryDate").selectedIndex;

	if(InstIndex!=0)
	{
		if(SymbIndex!=0)
		{
			document.getElementById("ExpiryDate").options.length =4;
		 	document.getElementById("ExpiryDate").selectedIndex=0;
		
		  for (i=1;i<=3;i++)
			{
				document.getElementById("ExpiryDate").options[i].value = e[i];
				document.getElementById("ExpiryDate").options[i].text = dateConvert(e[i]);
			}		
		
			if(ExpIndex!=0)
			{
				if(TypeIndex!=0 && (InstrumentTypeVal!="FUTIDX"||InstrumentTypeVal!="FUTSTK"||InstrumentTypeVal!="FUTINT"))
				{
					unique_key=	InstrumentTypeVal+SymbolVal+ExpiryDate
					alert(unique_key);
	
					if(!populateStrikePrice(unique_key))
						{
							alert("No Strike Price Is Available For The Selected Combination...Try Again");
							document.getElementById("StrikePrice").options.length =1;
							document.getElementById("StrikePrice").options[0].value ="";
							document.getElementById("StrikePrice").options[0].text ="Select Strike Price";
							document.getElementById("StrikePrice").selectedIndex=0;
						
						}
							
						
				}
			else if(TypeIndex==0 && (InstrumentTypeVal=="FUTIDX"||InstrumentTypeVal=="FUTSTK"||InstrumentTypeVal!="FUTINT"))
				{
					unique_key=InstrumentTypeVal+SymbolVal+ExpiryDate+OptionType;
				}
			}
		}
	}
}

function populateStrikePrice(unique_key)
{
	avail_flag=false;
 // since zero element text is SelectStrikePrice and we need to fill from first element
 // hence counter =1
	document.getElementById("StrikePrice").options.length =1;
	document.getElementById("StrikePrice").options[0].value ="";
	document.getElementById("StrikePrice").options[0].text ="Select Strike Price";
	document.getElementById("StrikePrice").selectedIndex=0;

	counter=1;

	for (i=1;i<u.length;i++)
	 {
	 	 if(u[i].indexOf(unique_key) != -1)
	 	 {
	 	 avail_flag=true;

	 	 document.getElementById("StrikePrice").options.length = counter + 1;
 		 document.getElementById("StrikePrice").options[counter].value = u[i].substring(unique_key.length,u[i].length),u[i].substring(unique_key.length,u[i].length);
	     document.getElementById("StrikePrice").options[counter].text = u[i].substring(unique_key.length,u[i].length),u[i].substring(unique_key.length,u[i].length);
	     counter++;
	 	 }
	 }
	if(!avail_flag)
	{
	return false;
	}
	else
	{
	return true;
	}
}

function finalcheck(unique_key)
 {
 avail_flag=false;

	for (i=1;i<u.length;i++)
	 {
		 	 if(u[i].indexOf(unique_key) != -1)
		 	 {
		 	 avail_flag=true;

				 break;
		 	 }

		 }

	 if(!avail_flag)
	 {
	 return false;
	 }
	 else
	 {
	 return true;
	 }
 }
 
 function showFutures(pgName,Inst,symbol,mnOpt) ///List of Underlying Securities in derivatives
{
	if(symbol!="SE")
	{
		pgName= pgName + "?a=8&InstType="+ Inst +"&symbol="+ symbol +"&Opt="+ mnOpt
		//alert(pgName);
		document.getElementById("DerivativesInner").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
		var ajax = new Ajax.Updater('DerivativesInner',pgName);
	} 
}
function showderi(pgName) ///List of Underlying Securities in derivatives
{
		//document.write(pgName);
		document.getElementById("DerivativesInner").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
		var ajax = new Ajax.Updater('DerivativesInner',pgName);
}
 function deridetails(sno,secid,subsecid)
 {
	document.getElementById("cm_window").style.display='inline';
	var newsurl="full_newsdetails.asp?sno="+sno+"&secid="+secid+"&subsecid="+subsecid;    
	document.getElementById("deriNewsId").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
    var ajax = new Ajax.Updater('deriNewsId',newsurl);	
 }

function Deriv_Paging(mno,start,InstType,Symbol,Sym,Sc,a,pageOpt,Expdate)
{
   if(mno == 1)
	{
	   var StrUrl= "fomarketwatch.asp?start="+start+"&InstType="+InstType+"&Symbol="+Symbol+"&Sym="+Sym+"&Sc="+Sc+"&pageid="+a+"&pageOpt="+pageOpt+"&Expdate="+Expdate;
	}
	else if(mno == 2)
	{
	   var StrUrl= "foDlySetlmntPrice.asp?a="+a+"&start="+start;
	}
	document.getElementById("DerivativesInner").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
	var ajax = new Ajax.Updater('DerivativesInner',StrUrl);
}
/*All Derivatives Fuction End Here */
function ShowPage() // for Change of BSE NSE Groups
{
	var opt;
	opt=document.getElementById("Opt").value;
	document.getElementById("EQinnerPage").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
	var ajax = new Ajax.Updater('EQinnerPage',opt);

}
function ChangeBuyerSeller(exchg,Opt,fldval,seccode) //for Change of Buyer and Sellers
{	

	var Url="BuyerSeller.asp?Exchg="+exchg+"&val="+Opt+"&cmbSecCode="+seccode+"&Fld="+fldval;

	document.getElementById("EQinnerPage").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
	var ajax = new Ajax.Updater('EQinnerPage',Url);	
}
function ChangeOutUnder(exchg,Opt,fldval,Period,seccode) //for Change of Out and Underperformer
{	

	var Url="outunder.asp?Exchg="+exchg+"&val="+Opt+"&cmbSecCode="+seccode+"&Fld="+fldval+"&Period="+Period;

	document.getElementById("EQinnerPage").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
	var ajax = new Ajax.Updater('EQinnerPage',Url);	
}

function ChangeCircuit(exchg,Opt,fldval,seccode) //for Change of Buyer and Sellers
{	

	var Url="Circuitbreaker.asp?Exchg="+exchg+"&val="+Opt+"&cmbSecCode="+seccode+"&Fld="+fldval;

	document.getElementById("EQinnerPage").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
	var ajax = new Ajax.Updater('EQinnerPage',Url);	
}

function ChangeDelivery(exchg,Opt,fldval,seccode) //for Change of Buyer and Sellers
{	

	var Url="Highlowdelivery.asp?Exchg="+exchg+"&val="+Opt+"&cmbSecCode="+seccode+"&Fld="+fldval;

	document.getElementById("EQinnerPage").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
	var ajax = new Ajax.Updater('EQinnerPage',Url);	
}
function ChangeUnVolume(exchg,Opt,fldval,seccode,Period) //for Change of Buyer and Sellers
{	

	var Url="unusualvolume.asp?Exchg="+exchg+"&val="+Opt+"&cmbSecCode="+seccode+"&Fld="+fldval+"&Period="+Period;

	document.getElementById("EQinnerPage").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
	var ajax = new Ajax.Updater('EQinnerPage',Url);	
}
function Changehrlygainlose(exchg,Opt,fldval,seccode,Period) //for Change of Buyer and Sellers
{	
	var Url="hrlygainlose.asp?Exchg="+exchg+"&val="+Opt+"&cmbSecCode="+seccode+"&Fld="+fldval+"&Period="+Period;
	document.getElementById("EQinnerPage").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
	var ajax = new Ajax.Updater('EQinnerPage',Url);	
}
function ChangeRiseVolume(exchg,Opt,Prd) //for Change of Buyer and Sellers
{	

	var Url="Risedelivery.asp?Exchg="+exchg+"&val="+Opt+"&Period="+Prd;

	document.getElementById("EQinnerPage").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
	var ajax = new Ajax.Updater('EQinnerPage',Url);	
}
function Change52Week(exchg,Opt,fldval,seccode) //for Change of Buyer and Sellers
{	

	var Url="52weekhigh.asp?Exchg="+exchg+"&val="+Opt+"&cmbSecCode="+seccode+"&Fld="+fldval;

	document.getElementById("EQinnerPage").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
	var ajax = new Ajax.Updater('EQinnerPage',Url);	
}

function ShowGroupNse(index) // For NSE Equity Top volume (group and price wise )
{
	
var arrPrice		=  new Array('All Range','Rs.0-10','Rs.11-50','Rs.51-100','Rs. Above 100');
var arrPriceCode	=  new Array('All','0-10','11-50','51-100','>100');

var arrBseGroup		=	new Array('All Group','A Group','B Group','S Group','T Group','TS Group','Z Group');
var arrBseGroupCode	=	new Array('All','A','B','S','T','TS','Z');

var arrBseIndex		=	new Array('All Index','BSE','BSE 100','BSE 200','BSE 500','BSE CD','BSE CG','BSE FMCG','BSE HC','BSE IT','BSE PSU','BSE SENSEX','BSE TECK','BSE AUTO','BSE BANKEX','BSE DOLLEX','BSE METAL','BSE MID','BSE OIL','BSE SMALLCAP','BSE POWER','BSE REALTY');

var arrBseIndexCode	=  new Array('All','BSE','BSE_100','BSE_200','BSE_500','BSE_CD','BSE_CG','BSE_FMCG','BSE_HC','BSE_IT','BSE_PSU','BSE_SENSEX','BSE_TECK','BSEAUTO','BSEBANKEX','BSEDOLLEX','BSEMETAL','BSEMID','BSEOIL','BSESMALLCA','BSEPOWER','BSEREALTY');

var arrNseGroup		=	new Array('All Group','NIFTY','NIFTY JR');
var arrNseGroupCode	=	new Array('All','NIFTY','NIFTYJR');

var arrNseIndex		=  new Array('All Index','NSE','BANK NIFTY','CNX IT','CNX FMCG','CNX MNC','CNX 100','CNX 500','CNX ENERGY','CNX MIDCAP','CNX PHARMA','MIDCAP 200');
var arrNseIndexCode	=  new Array('All','NSE','BANKNIFTY','CNX_IT','CNX_FMCG','CNX_MNC','CNX100','CNX500','CNXENERGY','CNXMIDCAP','CNXPHARMA','MIDCAP200');

var arrFAO		=  new Array('ALL Contracts','ALL Futures','ALL Options','NIFTY Futures','NIFTY Options','BANKNIFTY Futures','BANKNIFTY Options','CNXIT Futures','CNXIT Options','STOCK Futures','STOCK Options');
var arrFAOCode	=  new Array('','FUT','OPT','FUTIDX|NIFTY','OPTIDX|NIFTY','FUTIDX|BANKNIFTY','OPTIDX|BANKNIFTY','FUTIDX|CNXIT','OPTIDX|CNXIT','FUTSTK','OPTSTK');	
		
	
	//alert(index);	
	if(index=='P')
	{
	array =arrPrice;
	arrayCode=arrPriceCode;
	}
	if(index=='G')
	{
	array =arrNseGroup;
	arrayCode=arrNseGroupCode;	
	}
	if(index=='I')
	{
	array =arrNseIndex;
	arrayCode=arrNseIndexCode;	
	}
	data= "<Select class=Combo name=cmbIndex id=cmbIndex>";
	for( a=0;a<array.length;a++){
		data = data+"<option value="+arrayCode[a]+">"+array[a]+"</option>";
	}
	data = data+"</Select>"
	//alert(data);
	document.getElementById("divIndexnse").innerHTML =  data;
}
function ShowPagense(Exchg)
{
	var cmbReport = document.frmPrice.cmbReport.value;
	var Fldval=document.frmPrice.cmbIndex.value;
	var volurln="../equity/nsetopvol.asp?Exchg="+Exchg+"&FldVal="+Fldval+"&cmbReport="+cmbReport;
	document.getElementById("EQinnerPage").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
	var ajax = new Ajax.Updater('EQinnerPage',volurln);	

}
function ShowGroup(index) // For Equity Top volume (group and price wise )
{

var arrPrice		=  new Array('All Range','Rs.0-10','Rs.11-50','Rs.51-100','Rs. Above 100');
var arrPriceCode	=  new Array('All','0-10','11-50','51-100','>100');

var arrBseGroup		=	new Array('All Group','A Group','B Group','S Group','T Group','TS Group','Z Group');
var arrBseGroupCode	=	new Array('All','A','B','S','T','TS','Z');

var arrBseIndex		=	new Array('All Index','BSE','BSE 100','BSE 200','BSE 500','BSE CD','BSE CG','BSE FMCG','BSE HC','BSE IT','BSE PSU','BSE SENSEX','BSE TECK','BSE AUTO','BSE BANKEX','BSE DOLLEX','BSE METAL','BSE MID','BSE OIL','BSE SMALLCAP','BSE POWER','BSE REALTY');

var arrBseIndexCode	=  new Array('All','BSE','BSE_100','BSE_200','BSE_500','BSE_CD','BSE_CG','BSE_FMCG','BSE_HC','BSE_IT','BSE_PSU','BSE_SENSEX','BSE_TECK','BSEAUTO','BSEBANKEX','BSEDOLLEX','BSEMETAL','BSEMID','BSEOIL','BSESMALLCA','BSEPOWER','BSEREALTY');

var arrNseGroup		=	new Array('All Group','NIFTY','NIFTY JR');
var arrNseGroupCode	=	new Array('All','NIFTY','NIFTYJR');

var arrNseIndex		=  new Array('All Index','NSE','BANK NIFTY','CNX IT','CNX FMCG','CNX MNC','CNX 100','CNX 500','CNX ENERGY','CNX MIDCAP','CNX PHARMA','MIDCAP 200');
var arrNseIndexCode	=  new Array('All','NSE','BANKNIFTY','CNX_IT','CNX_FMCG','CNX_MNC','CNX100','CNX500','CNXENERGY','CNXMIDCAP','CNXPHARMA','MIDCAP200');

var arrFAO		=  new Array('ALL Contracts','ALL Futures','ALL Options','NIFTY Futures','NIFTY Options','BANKNIFTY Futures','BANKNIFTY Options','CNXIT Futures','CNXIT Options','STOCK Futures','STOCK Options');
var arrFAOCode	=  new Array('','FUT','OPT','FUTIDX|NIFTY','OPTIDX|NIFTY','FUTIDX|BANKNIFTY','OPTIDX|BANKNIFTY','FUTIDX|CNXIT','OPTIDX|CNXIT','FUTSTK','OPTSTK');	
	
	
	//alert(index);
	if(index=='P')
	{
	array =arrPrice;
	arrayCode=arrPriceCode;
	}
	if(index=='G')
	{
	array =arrBseGroup;
	arrayCode=arrBseGroupCode;	
	}
	if(index=='I')
	{
	array =arrBseIndex;
	arrayCode=arrBseIndexCode;	
	}
	data= "<Select class=Combo name=cmbIndex id=cmbIndex>";
	for( a=0;a<array.length;a++){
		data = data+"<option value="+arrayCode[a]+">"+array[a]+"</option>";
	}
	data = data+"</Select>"
	document.getElementById("divIndex").innerHTML =  data;

}

function ShowPagenew(Exchg)
{
	var cmbReport = document.frmPriceAnal.cmbReport.value;
	var Fldval=document.frmPriceAnal.cmbIndex.value;
	var volurl="../equity/bsetopvol.asp?Exchg="+Exchg+"&FldVal="+Fldval+"&cmbReport="+cmbReport;
	document.getElementById("EQinnerPage").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
	var ajax = new Ajax.Updater('EQinnerPage',volurl);	

}
function ShowGroupwk(index) // For Equity Top volume (group and price wise )
{
var arrPrice		=  new Array('All Range','Rs.0-10','Rs.11-50','Rs.51-100','Rs. Above 100');
var arrPriceCode	=  new Array('All','0-10','11-50','51-100','>100');

var arrBseGroup		=	new Array('All Group','A Group','B Group','S Group','T Group','TS Group','Z Group');
var arrBseGroupCode	=	new Array('All','A','B','S','T','TS','Z');

var arrBseIndex		=	new Array('All Index','BSE','BSE 100','BSE 200','BSE 500','BSE CD','BSE CG','BSE FMCG','BSE HC','BSE IT','BSE PSU','BSE SENSEX','BSE TECK','BSE AUTO','BSE BANKEX','BSE DOLLEX','BSE METAL','BSE MID','BSE OIL','BSE SMALLCAP','BSE POWER','BSE REALTY');

var arrBseIndexCode	=  new Array('All','BSE','BSE_100','BSE_200','BSE_500','BSE_CD','BSE_CG','BSE_FMCG','BSE_HC','BSE_IT','BSE_PSU','BSE_SENSEX','BSE_TECK','BSEAUTO','BSEBANKEX','BSEDOLLEX','BSEMETAL','BSEMID','BSEOIL','BSESMALLCA','BSEPOWER','BSEREALTY');

var arrNseGroup		=	new Array('All Group','NIFTY','NIFTY JR');
var arrNseGroupCode	=	new Array('All','NIFTY','NIFTYJR');

var arrNseIndex		=  new Array('All Index','NSE','BANK NIFTY','CNX IT','CNX FMCG','CNX MNC','CNX 100','CNX 500','CNX ENERGY','CNX MIDCAP','CNX PHARMA','MIDCAP 200');
var arrNseIndexCode	=  new Array('All','NSE','BANKNIFTY','CNX_IT','CNX_FMCG','CNX_MNC','CNX100','CNX500','CNXENERGY','CNXMIDCAP','CNXPHARMA','MIDCAP200');

var arrFAO		=  new Array('ALL Contracts','ALL Futures','ALL Options','NIFTY Futures','NIFTY Options','BANKNIFTY Futures','BANKNIFTY Options','CNXIT Futures','CNXIT Options','STOCK Futures','STOCK Options');
var arrFAOCode	=  new Array('','FUT','OPT','FUTIDX|NIFTY','OPTIDX|NIFTY','FUTIDX|BANKNIFTY','OPTIDX|BANKNIFTY','FUTIDX|CNXIT','OPTIDX|CNXIT','FUTSTK','OPTSTK');	
	
	if(index=='P')
	{
	array =arrPrice;
	arrayCode=arrPriceCode;
	}
	if(index=='G')
	{
	array =arrBseGroup;
	arrayCode=arrBseGroupCode;	
	}
	if(index=='I')
	{
	array =arrBseIndex;
	arrayCode=arrBseIndexCode;	
	}
	data= "<Select class=Combo name=cmbIndex id=cmbIndex>";
	for( a=0;a<array.length;a++){
		data = data+"<option value="+arrayCode[a]+">"+array[a]+"</option>";
	}
	data = data+"</Select>"
	document.getElementById("wkdivIndex").innerHTML =  data;

}

function ShowPagewk(Exchg,Opt)
{
	var cmbSecCode = document.getElementById("cmbSecCode").value;
	var Period = document.getElementById("cmbPeriod").value;
	var Fldval=document.getElementById("cmbIndex").value;
	if (Period=="Today")
	{	
		if(Opt=="WGain") 
		{	
		var volurl="../equity/bsetopgl.asp?Exchg="+Exchg+"&Fld="+Fldval+"&Period="+Period+"&cmbSecCode="+cmbSecCode+"&Opt=Gain"
		}
		else if(Opt=="WLose")
		{	
		var volurl="../equity/bsetopgl.asp?Exchg="+Exchg+"&Fld="+Fldval+"&Period="+Period+"&cmbSecCode="+cmbSecCode+"&Opt=Lose"
		}		
		else if(Opt=="MGain")
		{
		var volurl="../equity/bsetopgl.asp?Exchg="+Exchg+"&Fld="+Fldval+"&Period="+Period+"&cmbSecCode="+cmbSecCode+"&Opt=Gain"
		}
		else if(Opt=="MLose")
		{
		var volurl="../equity/bsetopgl.asp?Exchg="+Exchg+"&Fld="+Fldval+"&Period="+Period+"&cmbSecCode="+cmbSecCode+"&Opt=Lose"
		}
		else
		{
		var volurl="../equity/bsetopgl.asp?Exchg="+Exchg+"&Fld="+Fldval+"&Period="+Period+"&cmbSecCode="+cmbSecCode+"&Opt="+Opt;					
		}

	}
	if (Period=="Weekly") 
	{
		if((Opt=="Gain") || (Opt=="Lose")) 
		{	
		var volurl="../equity/bsetopgl.asp?Exchg="+Exchg+"&Fld="+Fldval+"&Period="+Period+"&cmbSecCode="+cmbSecCode+"&Opt=W"+Opt;
		}
		else if(Opt=="MGain")
		{
		var volurl="../equity/bsetopgl.asp?Exchg="+Exchg+"&Fld="+Fldval+"&Period="+Period+"&cmbSecCode="+cmbSecCode+"&Opt=WGain"
		}
		else if(Opt=="MLose")
		{
		var volurl="../equity/bsetopgl.asp?Exchg="+Exchg+"&Fld="+Fldval+"&Period="+Period+"&cmbSecCode="+cmbSecCode+"&Opt=WLose"
		}
		else
		{
		var volurl="../equity/bsetopgl.asp?Exchg="+Exchg+"&Fld="+Fldval+"&Period="+Period+"&cmbSecCode="+cmbSecCode+"&Opt="+Opt;					
		}
	}
	if (Period=="Monthly")
	{	
		if((Opt=="Gain") || (Opt=="Lose")) 
		{	
		var volurl="../equity/bsetopgl.asp?Exchg="+Exchg+"&Fld="+Fldval+"&Period="+Period+"&cmbSecCode="+cmbSecCode+"&Opt=M"+Opt;
		}
		else if(Opt=="WGain")
		{
		var volurl="../equity/bsetopgl.asp?Exchg="+Exchg+"&Fld="+Fldval+"&Period="+Period+"&cmbSecCode="+cmbSecCode+"&Opt=MGain"
		}
		else if(Opt=="WLose")
		{
		var volurl="../equity/bsetopgl.asp?Exchg="+Exchg+"&Fld="+Fldval+"&Period="+Period+"&cmbSecCode="+cmbSecCode+"&Opt=MLose"
		}
		else
		{
		var volurl="../equity/bsetopgl.asp?Exchg="+Exchg+"&Fld="+Fldval+"&Period="+Period+"&cmbSecCode="+cmbSecCode+"&Opt="+Opt;					
		}
	}	
	document.getElementById("EQinnerPage").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
	var ajax = new Ajax.Updater('EQinnerPage',volurl);	

}
function ShowPageunVol(Exchg,val)
{

	var cmbSecCode = document.getElementById("cmbSecCode").value;
	var Period = document.getElementById("cmbPeriod").value;
	var Fldval=document.getElementById("cmbIndex").value;

	var volurl="../equity/unusualvolume.asp?Exchg="+Exchg+"&Fld="+Fldval+"&Period="+Period+"&cmbSecCode="+cmbSecCode+"&val="+val;
	//alert(volurl);
	document.getElementById("EQinnerPage").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
	var ajax = new Ajax.Updater('EQinnerPage',volurl);	

}
function ShowPagehrly(Exchg,val)
{

	var cmbSecCode = document.getElementById("cmbSecCode").value;
	var Period = document.getElementById("cmbPeriod").value;
	var Fldval=document.getElementById("cmbIndex").value;

	var volurl="../equity/hrlygainlose.asp?Exchg="+Exchg+"&Fld="+Fldval+"&Period="+Period+"&cmbSecCode="+cmbSecCode+"&val="+val;
	//alert(volurl);
	document.getElementById("EQinnerPage").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
	var ajax = new Ajax.Updater('EQinnerPage',volurl);	

}
function ShowPageHigh(Exchg)
{

	var cmbSecCode = document.getElementById("cmbSecCode").value;
	var Period = document.getElementById("cmbPeriod").value;
	var Fldval=document.getElementById("cmbIndex").value;
	
	var volurl="../equity/newhigh.asp?Exchg="+Exchg+"&Fld="+Fldval+"&Period="+Period+"&cmbSecCode="+cmbSecCode;
	//alert(volurl);
	document.getElementById("EQinnerPage").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
	var ajax = new Ajax.Updater('EQinnerPage',volurl);	

}

function ShowPagecommon(Exchg)
{
	var cmbSecCode = document.getElementById("cmbSecCode").value;
	var Fldval=document.getElementById("cmbIndex").value;
	
	var volurl="../equity/bsetopval.asp?Exchg="+Exchg+"&Fld="+Fldval+"&cmbSecCode="+cmbSecCode;
	//alert(volurl);
	document.getElementById("EQinnerPage").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
	var ajax = new Ajax.Updater('EQinnerPage',volurl);	
}
function ShowPageBuy(Exchg,val)
{
	
	var cmbSecCode = document.getElementById("cmbSecCode").value;
	var Fldval=document.getElementById("cmbIndex").value;

	var volurl="../equity/BuyerSeller.asp?Exchg="+Exchg+"&Fld="+Fldval+"&cmbSecCode="+cmbSecCode+"&val="+val;
	//alert(volurl);
	document.getElementById("EQinnerPage").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
	var ajax = new Ajax.Updater('EQinnerPage',volurl);	
}
function ShowPageDelivery(Exchg,val)
{
	
	var cmbSecCode = document.getElementById("cmbSecCode").value;
	var Fldval=document.getElementById("cmbIndex").value;

	var volurl="../equity/HighLowDelivery.asp?Exchg="+Exchg+"&Fld="+Fldval+"&cmbSecCode="+cmbSecCode+"&val="+val;
	//alert(volurl);
	document.getElementById("EQinnerPage").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
	var ajax = new Ajax.Updater('EQinnerPage',volurl);	
}
function ShowPage52Week(Exchg,val)
{
	
	var cmbSecCode = document.getElementById("cmbSecCode").value;
	var Fldval=document.getElementById("cmbIndex").value;

	var volurl="../equity/52weekhigh.asp?Exchg="+Exchg+"&Fld="+Fldval+"&cmbSecCode="+cmbSecCode+"&val="+val;
	//alert(volurl);
	document.getElementById("EQinnerPage").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
	var ajax = new Ajax.Updater('EQinnerPage',volurl);	
}
function ShowPageRecovery(Exchg)
{
	
	var cmbSecCode = document.getElementById("cmbSecCode").value;
	var Fldval=document.getElementById("cmbIndex").value;

	var volurl="../equity/Recovery.asp?Exchg="+Exchg+"&Fld="+Fldval+"&cmbSecCode="+cmbSecCode
	//alert(volurl);
	document.getElementById("EQinnerPage").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
	var ajax = new Ajax.Updater('EQinnerPage',volurl);	
}
function ShowPageFallintra(Exchg)
{
	
	var cmbSecCode = document.getElementById("cmbSecCode").value;
	var Fldval=document.getElementById("cmbIndex").value;

	var volurl="../equity/Fallintra.asp?Exchg="+Exchg+"&Fld="+Fldval+"&cmbSecCode="+cmbSecCode
	//alert(volurl);
	document.getElementById("EQinnerPage").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
	var ajax = new Ajax.Updater('EQinnerPage',volurl);	
}
function ShowPageOut(Exchg,val)
{
	
	var Period = document.getElementById("cmbPeriod").value;
	var cmbSecCode = document.getElementById("cmbSecCode").value;
	var Fldval=document.getElementById("cmbIndex").value;
	

	var volurl="../equity/Outunder.asp?Exchg="+Exchg+"&Fld="+Fldval+"&cmbSecCode="+cmbSecCode+"&val="+val+"&Period="+Period

	document.getElementById("EQinnerPage").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
	var ajax = new Ajax.Updater('EQinnerPage',volurl);	
}
function ShowPageRiseDelivery(Exchg,val)
{

	var Period = document.getElementById("cmbPeriod").value;

	var volurl="../equity/RiseDelivery.asp?Exchg="+Exchg+"&val="+val+"&Period="+Period;

	document.getElementById("EQinnerPage").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
	var ajax = new Ajax.Updater('EQinnerPage',volurl);	
}

function ShowPageCircuit(Exchg)
{
	var cmbSecCode = document.getElementById("cmbSecCode").value;
	var Fldval=document.getElementById("cmbIndex").value;

	var volurl="../equity/Circuitbreaker.asp?Exchg="+Exchg+"&Fld="+Fldval+"&cmbSecCode="+cmbSecCode+"&val=Upper"
	//alert(volurl);
	document.getElementById("EQinnerPage").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
	var ajax = new Ajax.Updater('EQinnerPage',volurl);	
}
function ShowPageVol(Exchg)
{
	var cmbSecCode = document.getElementById("cmbSecCode").value;
	var Fldval=document.getElementById("cmbIndex").value;

	var volurl="../equity/Nsetopvol.asp?Exchg="+Exchg+"&Fld="+Fldval+"&cmbSecCode="+cmbSecCode;
	//alert(volurl);
	document.getElementById("EQinnerPage").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
	var ajax = new Ajax.Updater('EQinnerPage',volurl);	

}
function ShowPageVolBSE(Exchg)
{
	var cmbSecCode = document.getElementById("cmbSecCode").value;
	var Fldval=document.getElementById("cmbIndex").value;

	var volurl="../equity/Bsetopvol.asp?Exchg="+Exchg+"&Fld="+Fldval+"&cmbSecCode="+cmbSecCode;
	//alert(volurl);
	document.getElementById("EQinnerPage").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
	var ajax = new Ajax.Updater('EQinnerPage',volurl);	

}
function ShowGroupwkNSE(index) // For Equity Top volume (group and price wise )
{

var arrPrice		=  new Array('All Range','Rs.0-10','Rs.11-50','Rs.51-100','Rs. Above 100');
var arrPriceCode	=  new Array('All','0-10','11-50','51-100','>100');

var arrBseGroup		=	new Array('All Group','A Group','B Group','S Group','T Group','TS Group','Z Group');
var arrBseGroupCode	=	new Array('All','A','B','S','T','TS','Z');

var arrBseIndex		=	new Array('All Index','BSE','BSE 100','BSE 200','BSE 500','BSE CD','BSE CG','BSE FMCG','BSE HC','BSE IT','BSE PSU','BSE SENSEX','BSE TECK','BSE AUTO','BSE BANKEX','BSE DOLLEX','BSE METAL','BSE MID','BSE OIL','BSE SMALLCAP','BSE POWER','BSE REALTY');

var arrBseIndexCode	=  new Array('All','BSE','BSE_100','BSE_200','BSE_500','BSE_CD','BSE_CG','BSE_FMCG','BSE_HC','BSE_IT','BSE_PSU','BSE_SENSEX','BSE_TECK','BSEAUTO','BSEBANKEX','BSEDOLLEX','BSEMETAL','BSEMID','BSEOIL','BSESMALLCA','BSEPOWER','BSEREALTY');

var arrNseGroup		=	new Array('All Group','NIFTY','NIFTY JR');
var arrNseGroupCode	=	new Array('All','NIFTY','NIFTYJR');

var arrNseIndex		=  new Array('All Index','NSE','BANK NIFTY','CNX IT','CNX FMCG','CNX MNC','CNX 100','CNX 500','CNX ENERGY','CNX MIDCAP','CNX PHARMA','MIDCAP 200');
var arrNseIndexCode	=  new Array('All','NSE','BANKNIFTY','CNX_IT','CNX_FMCG','CNX_MNC','CNX100','CNX500','CNXENERGY','CNXMIDCAP','CNXPHARMA','MIDCAP200');

var arrFAO		=  new Array('ALL Contracts','ALL Futures','ALL Options','NIFTY Futures','NIFTY Options','BANKNIFTY Futures','BANKNIFTY Options','CNXIT Futures','CNXIT Options','STOCK Futures','STOCK Options');
var arrFAOCode	=  new Array('','FUT','OPT','FUTIDX|NIFTY','OPTIDX|NIFTY','FUTIDX|BANKNIFTY','OPTIDX|BANKNIFTY','FUTIDX|CNXIT','OPTIDX|CNXIT','FUTSTK','OPTSTK');	
	
	
	//alert(index);
	if(index=='P')
	{
	array =arrPrice;
	arrayCode=arrPriceCode;
	}
	if(index=='G')
	{
	array =arrNseGroup;
	arrayCode=arrNseGroupCode;	
	}
	if(index=='I')
	{
	array =arrNseIndex;
	arrayCode=arrNseIndexCode;	
	}
	data= "<Select class=Combo name=cmbIndex id=cmbIndex>";
	for( a=0;a<array.length;a++){
		data = data+"<option value="+arrayCode[a]+">"+array[a]+"</option>";
	}
	data = data+"</Select>"
	//alert(data);
	document.getElementById("divNseIndex").innerHTML =  data;

}
function ShowPagewkNSE(Exchg)
{
	var cmbReport = document.getElementById("cmbReport").value;
	var Period = document.getElementById("cmbPeriod").value;
	var Fldval=document.getElementById("cmbIndex").value;
	var volurl="../equity/weeknsetopgl.asp?Exchg="+Exchg+"&FldVal="+Fldval+"&Period="+Period+"&cmbReport="+cmbReport;
	document.getElementById("EQinnerPage").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
	var ajax = new Ajax.Updater('EQinnerPage',volurl);	

}

 function ipodetails(sno,secid,subsecid)
 {
	document.getElementById("cm_window").style.display='inline';
	var newsurl="../ipo/ipo_newsdetails.asp?sno="+sno+"&secid="+secid+"&subsecid="+subsecid;    
	  
	document.getElementById("NewsIdipo").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
    var ajax = new Ajax.Updater('NewsIdipo',newsurl);	
 }
  function Commdetails(sno,secid,subsecid)
 {
	document.getElementById("cm_window").style.display='inline';
	var newsurl="../Commodity/Comm_newsdetails.asp?sno="+sno+"&secid="+secid+"&subsecid="+subsecid;    
	  
	document.getElementById("NewsIdComm").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
    var ajax = new Ajax.Updater('NewsIdComm',newsurl);	
 }

  function MUTUALdetails(sno,secid,subsecid)
 {
	document.getElementById("cm_window").style.display='inline';
	var newsurl="../MUTUAL/mutual_newsdetails.asp?sno="+sno+"&secid="+secid+"&subsecid="+subsecid;    
	  
	document.getElementById("NewsIdmutual").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
    var ajax = new Ajax.Updater('NewsIdmutual',newsurl);	
 }
 
 function interviewdetails(sno,secid,subsecid)
 {
	document.getElementById("cm_window").style.display='inline';
	var newsurl="../MUTUAL/interviewdetails.asp?sno="+sno+"&secid="+secid+"&subsecid="+subsecid;    
	  
	document.getElementById("NewsIdmutual").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
    var ajax = new Ajax.Updater('NewsIdmutual',newsurl);	
 }

 /*Start here D*/
 function Newsdetails(id,sno,secid,subsecid)
 {
	document.getElementById("cm_window1").style.display='inline';
	var newsurl="../News/NewsDetails.asp?id="+ id+"&sno="+ sno+"&secid="+ secid+"&subsecid="+ subsecid;   
	  
	document.getElementById("NewsIdAll").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
    var ajax = new Ajax.Updater('NewsIdAll',newsurl);	
 }
 /*End Here D*/
 function pagecall(pgname)
 {
	document.getElementById("cm_windowcall").style.display='inline';
    document.getElementById("CallID").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='200' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
    var ajax = new Ajax.Updater('CallID',pgname);	
 }
function popnews(period,sno) //for Company News pop up
 {
	document.getElementById("cm_window2").style.display='inline';
	var newsurl="../profile/compnewsdetails.asp?secid=comp&period="+period+"&sno="+sno;    
	  
    document.getElementById("cmnewsAll").innerHTML="<table cellpadding='0' cellspacing='0' width='100%'><tr><td align='center'><img src='../images/loading.gif'></td></tr></table>";
    var ajax = new Ajax.Updater('cmnewsAll',newsurl);	
 }
 function FundNewsdetails(sno) //for Live fundamental News pop up
 {
	document.getElementById("cm_window1").style.display='inline';
	var newsurl="../News/LiveNewsDetails.asp?sno="+ sno;   
	  
    document.getElementById("NewsIdAll").innerHTML="<table cellpadding='0' cellspacing='0' width='100%'><tr><td align='center'><img src='../images/loading.gif'></td></tr></table>";
    var ajax = new Ajax.Updater('NewsIdAll',newsurl);	
 }
 
  function SpFundNewsdetails(sno) //for Live fundamental News pop up
 {
	document.getElementById("cm_window1").style.display='inline';
	var newsurl="../News/spLiveNewsDetails.asp?sno="+ sno;   
	  
    document.getElementById("spNewsIdAll").innerHTML="<table cellpadding='0' cellspacing='0' width='100%'><tr><td align='center'><img src='../images/loading.gif'></td></tr></table>";
    var ajax = new Ajax.Updater('spNewsIdAll',newsurl);	
 }
 /* functions for  Mutual fund Section */
 function ChangeFund(opt)
{
	if (document.checking.Equity[0].checked == true)
	{	
		PageUrl = "download.asp?opt="+opt+"&id=26"
		document.getElementById("MutualInner").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
		var ajax = new Ajax.Updater('MutualInner',PageUrl);

	}
	if (document.checking.Equity[1].checked == true)
	{	
		PageUrl = "download.asp?opt="+opt+"&id=26"
		document.getElementById("MutualInner").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
		var ajax = new Ajax.Updater('MutualInner',PageUrl);
	}		
	if (document.checking.Equity[2].checked == true)
	{	
		PageUrl = "download.asp?opt="+opt+"&id=26"
		document.getElementById("MutualInner").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
		var ajax = new Ajax.Updater('MutualInner',PageUrl);
	}	
	if (document.checking.Equity[3].checked == true)
	{	
		PageUrl = "download.asp?opt="+opt+"&id=26"
		document.getElementById("MutualInner").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
		var ajax = new Ajax.Updater('MutualInner',PageUrl);
	}					
}
/*For mutual D*/
function FundPerform(page)
{
   if(page=="")
    page="Performance"

 var FType = document.getElementById("FType").value;
 var Cat1 = document.getElementById("CategoryDropListT").value;
var schtype = document.getElementById("schtype").value;

 		PageUrl="mf_Performance.asp?page="+page+"&PageOpt=1&schtype="+schtype+"&FType="+FType+"&Cat1="+Cat1;
 		document.getElementById("MutualInner").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
		var ajax = new Ajax.Updater('MutualInner',PageUrl);

}
function submitMe()
{  

 var FType = document.getElementById("FType").value;
 var Cat1 = document.getElementById("CategoryDropListT").value;
var schtype = document.getElementById("schtype").value;


  var page = document.getElementById("CmbPageSelect").value;  
  PageUrl="mf_Performance.asp?page="+page+"&PageOpt=1&schtype="+schtype+"&FType="+FType+"&Cat1="+Cat1;
  document.getElementById("MutualInner").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
		var ajax = new Ajax.Updater('MutualInner',PageUrl);

}

function chkasc(col,ord,sch,f_type)
{
var ord1=ord
cat1=document.getElementById("cat").value;

MutualPageUrl="../mutual/mf_Performance.asp?page=Performance&PageOpt=1&schtype="+sch+"&FType="+f_type+"&Cat1="+cat1+"&col="+col+"&ret="+ord1+""
	document.getElementById("MutualInner").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
	var ajax = new Ajax.Updater('MutualInner',MutualPageUrl);

}
function ChangePageMutuals(MutualPageUrl) /// PriceAnalysis Left Menu Function
{	
	//alert(MutualPageUrl);
	document.getElementById("MutualInner").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
	var ajax = new Ajax.Updater('MutualInner',MutualPageUrl);
}
function changeScheme()
{

//document.location="Histnav.asp?id=4&Compcode="+document.getElementById('Compname').value+"&SType="+ document.getElementById('drp_stype').value;
MutualPageUrl="Histnav.asp?id=4&Compcode="+document.getElementById('Compname').value+"&SType="+ document.getElementById('drp_stype').value;
document.getElementById("MutualInner").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
	var ajax = new Ajax.Updater('MutualInner',MutualPageUrl);
}
function ChangeCat()
{

//document.location="Histnav.asp?id=4&Compcode="+document.getElementById('Compname').value+"&SType="+ document.getElementById('drp_stype').value;
MutualPageUrl="Histnav.asp?id=4&Compcode="+document.getElementById('Compname').value+"&SType="+ document.getElementById('drp_stype').value;
document.getElementById("MutualInner").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
	var ajax = new Ajax.Updater('MutualInner',MutualPageUrl);
}
function ChangePage()
	{

		if (document.getElementById('drp_scheme').value == "")
			{
				alert("Select a Scheme ");
			}
			else
			{
				//document.location="Histnav.asp?id=4&show=1&schcode=" + document.getElementById('drp_scheme').value +"&SType="+ document.getElementById('drp_stype').value+"&Compcode="+document.getElementById('Compname').value+"&Period="+document.getElementById('drp_Period').value;
				MutualPageUrl="Histnav.asp?id=4&show=1&schcode=" + document.getElementById('drp_scheme').value +"&SType="+ document.getElementById('drp_stype').value+"&Compcode="+document.getElementById('Compname').value+"&Period="+document.getElementById('drp_Period').value;
				document.getElementById("MutualInner").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
				var ajax = new Ajax.Updater('MutualInner',MutualPageUrl);
			}
		
}

function DivSub()
{
	if ((document.getElementById("DivMth").selectedIndex ==0) && (document.getElementById("Fund").selectedIndex ==0) && (document.getElementById("Cat").selectedIndex ==0)) 
	{
		alert('Select a Criteria')
		return false
	}
	else
	{
		var Category=document.getElementById("Cat").options[document.getElementById("Cat").selectedIndex].value;
		var FundNm=document.getElementById("Fund").options[document.getElementById("Fund").selectedIndex].value;
		var MonName=document.getElementById("DivMth").options[document.getElementById("DivMth").selectedIndex].value;
		
		var MutualPageUrl ="mf_dividents.asp?Cat="+Category+"&Fund="+FundNm+"&DivMth="+MonName+"&a=10&opt=Y";

		document.getElementById("MutualInner").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
				var ajax = new Ajax.Updater('MutualInner',MutualPageUrl);
	}
}
function ChangeMonth()
{
	document.getElementById('DivMth').value="";
}

function ChangePeriod()
{ 
	document.getElementById('drp_Period').value="";
}

function SubmitAlpha4()
	{
		//alert("SubmitAlpha4");
		PageUrl="whtinout.asp?id=4&pageid=19&mutcode="+ document.mutual1.mutcode.options[document.mutual1.mutcode.selectedIndex].value+"&Modopt=MF"
		//alert(PageUrl);
		document.getElementById("MutualInner").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
		var ajax = new Ajax.Updater('MutualInner',PageUrl);
	}
	
function SubmitAlpha1()
	{
		//alert("SubmitAlpha1");
		PageUrl = "whtinout.asp?id=4&pageid=19&mutcode="+ document.mutual1.mutcode.options[document.mutual1.mutcode.selectedIndex].value+"&class="+ document.mutual1.classes.options[document.mutual1.classes.selectedIndex].value+"&Modopt=MF"
		//alert(PageUrl);
		document.getElementById("MutualInner").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
		var ajax = new Ajax.Updater('MutualInner',PageUrl);
	}


function SubmitAlpha2()
	{
		//alert("SubmitAlpha2");
		if (document.mutual1.mutcode.options[document.mutual1.mutcode.selectedIndex].value=="all")
		{
			alert("Select a Fund");
			document.mutual1.mutcode.focus();
		}
		else if (document.mutual1.classes.options[document.mutual1.classes.selectedIndex].value=="all")
		{
			alert("Select a Category");
			document.mutual1.classes.focus();
		}
		else if (document.mutual1.scheme.options[document.mutual1.scheme.selectedIndex].value=="all")
		{
			alert("Select a Scheme");
			document.mutual1.scheme.focus();
		}
		else
		{
			//PageUrl="performanceinout.asp?id=19&opt=8&schcode="+ document.mutual1.scheme.options[document.mutual1.scheme.selectedIndex].value+"&Modopt=MF"
			PageUrl="Whtinout.asp?id=4&pageid=19&mutcode="+ document.mutual1.mutcode.options[document.mutual1.mutcode.selectedIndex].value+"&class="+document.mutual1.classes.options[document.mutual1.classes.selectedIndex].value+"&schcode="+ document.mutual1.scheme.options[document.mutual1.scheme.selectedIndex].value+"&Modopt=MF&opt=yes"
			//alert(PageUrl);
			document.getElementById("MutualInner").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
			var ajax = new Ajax.Updater('MutualInner',PageUrl);
	
		}
		return false;
	}
		
function SubmitAlphanew2()
	{
		//alert("SubmitAlphanew2");
		if (document.mutual1.scheme.options[document.mutual1.scheme.selectedIndex].value=="all")
		{
			alert("Select a scheme")
		}
		else
		{
			//PageUrl="performanceinout.asp?id=19&opt=8&scheme="+ document.mutual1.scheme.options[document.mutual1.scheme.selectedIndex].value+"&Modopt=MF"
			PageUrl="Whtinout.asp?id=4&pageid=19&scheme="+ document.mutual1.scheme.options[document.mutual1.scheme.selectedIndex].value+"&Modopt=MF&opt=yes"
			//alert(PageUrl);
			document.getElementById("MutualInner").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
			var ajax = new Ajax.Updater('MutualInner',PageUrl);
	
		}
		return false;
	}
	
function changeSchemeHold()
{

//document.location="mf_holdings.asp?id=12&Compcode="+document.getElementById('Compname').value+"&SType="+ document.getElementById('drp_stype').value;
PageUrl="mf_holdings.asp?id=12&Compcode="+document.getElementById('Compname').value+"&SType="+ document.getElementById('drp_stype').value;
document.getElementById("MutualInner").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
		var ajax = new Ajax.Updater('MutualInner',PageUrl);

}
function ChangeCatHold()
{

//document.location="mf_holdings.asp?id=12&Compcode="+document.getElementById('Compname').value+"&SType="+ document.getElementById('drp_stype').value;
PageUrl="mf_holdings.asp?id=12&Compcode="+document.getElementById('Compname').value+"&SType="+ document.getElementById('drp_stype').value;
document.getElementById("MutualInner").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
		var ajax = new Ajax.Updater('MutualInner',PageUrl);

}
function ChangePageHold()
	{
			
		if (document.getElementById('drp_scheme').value == "" || document.getElementById('drp_stype').value == "" || document.getElementById('Compname').value == "")
			{
				alert("Select All fields ");
			}
			else
			{
				//document.location="mf_holdings.asp?id=12&schcode=" + document.getElementById('drp_scheme').value +"&SType="+ document.getElementById('drp_stype').value+"&Compcode="+document.getElementById('Compname').value;
				PageUrl="mf_holdings.asp?id=12&schcode=" + document.getElementById('drp_scheme').value +"&SType="+ document.getElementById('drp_stype').value+"&Compcode="+document.getElementById('Compname').value;
				document.getElementById("MutualInner").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
		var ajax = new Ajax.Updater('MutualInner',PageUrl);
			}
		
}
function ShowPageNfo_List()
{
	var opt;
	//opt=document.frmPriceAnal.Opt.value;
	opt=document.frmPriceAnal.Opt.value;
					document.getElementById("MutualInner").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
		var ajax = new Ajax.Updater('MutualInner',opt);
	//location.href=opt;
}
function ShowPagebiggest()
{
	var opt;
	opt=document.frmPriceAnal.Opt.value;
		document.getElementById("MutualInner").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
		var ajax = new Ajax.Updater('MutualInner',opt);
	//location.href=opt;
}
function ShowPageLeast()
{
	var opt;
	opt=document.frmPriceAnal.Opt.value;
	//alert(opt);
	document.getElementById("MutualInner").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
		var ajax = new Ajax.Updater('MutualInner',opt);
	//location.href=opt;
}
/*For tab*/
function popaddress(r1,r2,r3)
		{
			 url="mf_amcdet.asp?a=7a&index=3&addressdet=" + r1 + "&mfcomp=" + r2+"&amcname="+escape(r3) 
			News=window.open(url ,"MutualFunds","status = 1, height = 350, width =500, resizable = 0,scrollbars=1")
			if(!News.focus())
			News.focus()
		}	
	function popMfOffer(r1,mnuOpt)
	{
		//location.href="mf_offer.asp?a=7a&id=2&tab=3&mutcode="+ r1 + "";
		PageUrl="mf_offer.asp?a=7a&id=2&tab=3&mutcode="+ r1 + "";
		document.getElementById("MutualInner").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
		var ajax = new Ajax.Updater('MutualInner',PageUrl);
	}
	
function popkeyPersonal(r1,r2,r3,mnuOpt)
	{
		//location.href="Mf_AmcDet.asp?a=7a&tab=4&id=5&keypersonal="+ r1 + "&mutcode=" + r2 + "&amcname=" + escape(r3)+"";
		
		PageUrl="Mf_AmcDet.asp?a=7a&tab=4&id=5&keypersonal="+ r1 + "&mutcode=" + r2 + "&amcname=" + escape(r3)+"";
		document.getElementById("MutualInner").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
		var ajax = new Ajax.Updater('MutualInner',PageUrl);
	}

function winnav(r1,r2,r3,mnuOpt)	
{
    //location.href="MF_Profile.asp?a=7a&id=2&tab=3&showpage="+ r1 + "&schcode=" + r2 + "&coname=" + r3+"";
		PageUrl="MF_Profile.asp?a=7a&id=2&tab=3&showpage="+ r1 + "&schcode=" + r2 + "&coname=" + r3+"";
		document.getElementById("MutualInner").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
		var ajax = new Ajax.Updater('MutualInner',PageUrl);
}
function pop6(r1,r2,r3,mnuOpt)
{
	//location.href="MF_Profile.asp?a=7a&id=2&tab=4&showpage="+ r1 + "&schcode=" + r2 + "&coname=" + r3+"";
		PageUrl="MF_Profile.asp?a=7a&id=2&tab=4&showpage="+ r1 + "&schcode=" + r2 + "&coname=" + r3+"";
		document.getElementById("MutualInner").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
		var ajax = new Ajax.Updater('MutualInner',PageUrl);
}
function pop3(r1,r2,r3,mnuOpt)
{
	//location.href="MF_Profile.asp?a=7a&id=2&tab=6&showpage="+ r1 + "&schcode=" + r2 + "&coname=" + r3+"";
		PageUrl="MF_Profile.asp?a=7a&id=2&tab=6&showpage="+ r1 + "&schcode=" + r2 + "&coname=" + r3+"";
		document.getElementById("MutualInner").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
		var ajax = new Ajax.Updater('MutualInner',PageUrl);
}
function pop4(r1,r2,r3,mnuOpt)
{	 
 //location.href="MF_Profile.asp?a=7a&id=2&tab=5&showpage="+ r1 + "&schcode=" + r2 + "&coname=" + r3+"";
 		PageUrl="MF_Profile.asp?a=7a&id=2&tab=5&showpage="+ r1 + "&schcode=" + r2 + "&coname=" + r3+"";
 		document.getElementById("MutualInner").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
		var ajax = new Ajax.Updater('MutualInner',PageUrl);
}
function popAMC(r1,mnuOpt)
	{
		//location.href="Mf_AmcDet.asp?a=1&tab=1&id=5&mutcode="+ r1 + "";
		PageUrl="Mf_AmcDet.asp?a=1&tab=1&id=5&mutcode="+ r1 + "";
		document.getElementById("MutualInner").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
		var ajax = new Ajax.Updater('MutualInner',PageUrl);
	}
function popaddressAMC(r1,r2,r3,mnuOpt)
	{
		//location.href="Mf_AmcDet.asp?a=1&tab=2&id=5&addressdet="+ r1 + "&mutcode=" + r2 + "&amcname=" + escape(r3)+"";
		PageUrl="Mf_AmcDet.asp?a=1&tab=2&id=5&addressdet="+ r1 + "&mutcode=" + r2 + "&amcname=" + escape(r3)+"";
		document.getElementById("MutualInner").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
		var ajax = new Ajax.Updater('MutualInner',PageUrl);
	} 
	
function popMfOfferAMC(r1,mnuOpt)
	{
		//location.href="mf_offer.asp?a=1&id=5&tab=3&mutcode="+ r1 + "";	
		PageUrl="mf_offer.asp?a=1&id=5&tab=3&mutcode="+ r1 + "";	
		document.getElementById("MutualInner").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
		var ajax = new Ajax.Updater('MutualInner',PageUrl);
	}
	
function popkeyPersonalAMC(r1,r2,r3,mnuOpt)
	{
		//location.href="Mf_AmcDet.asp?a=1&tab=4&id=5&keypersonal="+ r1 + "&mutcode=" + r2 + "&amcname=" + escape(r3)+"";
		PageUrl="Mf_AmcDet.asp?a=1&tab=4&id=5&keypersonal="+ r1 + "&mutcode=" + r2 + "&amcname=" + escape(r3)+"";
		document.getElementById("MutualInner").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
		var ajax = new Ajax.Updater('MutualInner',PageUrl);
	}

/*End tab*/
/*start DH*/
function ChangeCatport()
{

//document.location="compareportfolio.asp?id=18&cat="+document.getElementById('cat').value+"&sch1="+ document.getElementById('sch1').value+"&sch2="+ document.getElementById('sch2').value;
PageUrl="compareportfolio.asp?id=18&cat="+document.getElementById('cat').value+"&sch1="+ document.getElementById('sch1').value+"&sch2="+ document.getElementById('sch2').value;
document.getElementById("MutualInner").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
		var ajax = new Ajax.Updater('MutualInner',PageUrl);

}

function FrmSubport()
{		
if ((document.getElementById("cat").value == "" ))
{
alert("Please select Category");
document.getElementById("cat").focus();
return false;
}
else 
if ((document.getElementById("sch1").value == document.getElementById("sch2").value))
{
	alert("Please select different Scheme");
	document.getElementById("sch1").focus();
return false;
}
else
{  
cat=document.getElementById("cat").value; 
sch1=document.getElementById("sch1").value;
sch2=document.getElementById("sch2").value;

//url = "compareportfolio.asp?id=18&cat="+cat+"&sch1="+sch1+"&sch2="+sch2;
PageUrl="compareportfolio.asp?id=18&cat="+cat+"&sch1="+sch1+"&sch2="+sch2;
//document.hold.action = url
//document.hold.submit();
document.getElementById("MutualInner").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
		var ajax = new Ajax.Updater('MutualInner',PageUrl);
}
}
/*start fuction for scheme comparison page*/
function selectFund()
{  
	var requestUrl = "comparescheme.asp?id=4&pageid=17&Cat="+ document.getElementById("cat").value;
	document.getElementById("MutualInner").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
	var ajax = new Ajax.Updater('MutualInner',requestUrl);
}

function FrmSub()
{
	var cat = document.getElementById("cat")
	var sch1 = document.getElementById("sch1")
	var sch2 = document.getElementById("sch2")

	if (document.getElementById("cat").value == "" )
	{
		alert("Please Select a Category");
		document.getElementById("cat").focus();
	}
	else if (document.getElementById("sch1").value == "" )
	{
		alert("Please Select a First Scheme");
		document.getElementById("sch1").focus();
	}
	else if (document.getElementById("sch2").value == "" )
	{
		alert("Please Select a Second Scheme");
		document.getElementById("sch2").focus();
	}
	
	else if (sch1.value == sch2.value)
	{
		alert("Select Different Scheme");
		document.getElementById("sch2").focus();
	}
	
	else
	{
	var requestUrl ="../mutual/comparescheme.asp?id=4&pageid=17&opt=yes&cat="+cat.value+"&sch1="+sch1.value+"&sch2="+sch2.value
	document.getElementById("MutualInner").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
	var ajax = new Ajax.Updater('MutualInner',requestUrl);
	}
}
/*end fuction for scheme comparison page*/

function NseBseDetails()
{
   //alert(XmlHttp.responseText);
	// To make sure receiving response data from server is completed
	if(XmlHttp.readyState == 4)
	{
		// To make sure valid response is received from the server, 200 means response received is OK
		var sch1 = document.getElementById("sch1")
		var sch2 = document.getElementById("sch2")

		
		if(XmlHttp.status == 200)
		{
			//document.getElementById("sch2TD").style.display="inline";
			//document.getElementById("_ctl0_Mf_Loading").style.display="none";
		
			var strData = XmlHttp.responseText
			if(strData != "")
			{	
				var arrSchm = strData.split("|");
				sch1.length = 0; 
				sch2.length = 0; 	
				for(i=0; i<arrSchm.length-1; i++)
				{	
					var strSchm = arrSchm[i];
					var arrSchmCode = strSchm.split("~");
					sch1.options[i] = new Option();
					sch1.options[i].value = arrSchmCode[0];
					sch1.options[i].text = arrSchmCode[1];
					sch2.options[i] = new Option();
					sch2.options[i].value = arrSchmCode[0];
					sch2.options[i].text = arrSchmCode[1];
				}
			}
			else {
					sch1.length = 0;
					sch1.options[0] = new Option(); 
					sch1.options[0].value = "";
					sch1.options[0].text = "Scheme is not available";	
					sch2.length = 0;
					sch2.options[0] = new Option(); 
					sch2.options[0].value = "";
					sch2.options[0].text = "Scheme is not available";			
				 }
			document.body.style.cursor = "auto";	
		}
		else {
					sch1.length = 0;
					sch1.options[0] = new Option(); 
					sch1.options[0].value = "";
					sch1.options[0].text = "server is not ready";
					document.body.style.cursor = "auto";	
					sch2.length = 0;
					sch2.options[0] = new Option(); 
					sch2.options[0].value = "";
					sch2.options[0].text = "server is not ready";
					document.body.style.cursor = "auto";			
		}
	}
			
}


function BseOfferG()
{
		//alert("Hi");
		if(XmlHttp.readyState == 4)
		{
		
			if(XmlHttp.status == 200)
			{
				
				document.getElementById("TopG").innerHTML = XmlHttp.responseText;
				document.body.style.cursor = "auto";
			}
			
		}
}

/*End for Mutual */

  function CreateXmlHttp()
	{
		//Creating object of XMLHTTP in IE
		try
		{
			XmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch(e)
		{
			try
			{
				XmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch(oc)
			{
				XmlHttp = null;	
			}
		}
		//Creating object of XMLHTTP in Mozilla and Safari 
		if(!XmlHttp && typeof XMLHttpRequest != "undefined") 
		{
			
			XmlHttp = new XMLHttpRequest();
		}
	}
	
function NseBseDetails()
{
   //alert(XmlHttp.responseText);
	// To make sure receiving response data from server is completed
	if(XmlHttp.readyState == 4)
	{
		// To make sure valid response is received from the server, 200 means response received is OK
		var sch1 = document.getElementById("sch1")
		var sch2 = document.getElementById("sch2")

		
		if(XmlHttp.status == 200)
		{
			//document.getElementById("sch2TD").style.display="inline";
			//document.getElementById("_ctl0_Mf_Loading").style.display="none";
		
			var strData = XmlHttp.responseText
			if(strData != "")
			{	
				var arrSchm = strData.split("|");
				sch1.length = 0; 
				sch2.length = 0; 	
				for(i=0; i<arrSchm.length-1; i++)
				{	
					var strSchm = arrSchm[i];
					var arrSchmCode = strSchm.split("~");
					sch1.options[i] = new Option();
					sch1.options[i].value = arrSchmCode[0];
					sch1.options[i].text = arrSchmCode[1];
					sch2.options[i] = new Option();
					sch2.options[i].value = arrSchmCode[0];
					sch2.options[i].text = arrSchmCode[1];
				}
			}
			else {
					sch1.length = 0;
					sch1.options[0] = new Option(); 
					sch1.options[0].value = "";
					sch1.options[0].text = "Scheme is not available";	
					sch2.length = 0;
					sch2.options[0] = new Option(); 
					sch2.options[0].value = "";
					sch2.options[0].text = "Scheme is not available";			
				 }
			
			
			document.body.style.cursor = "auto";	
		}
		else {
					sch1.length = 0;
					sch1.options[0] = new Option(); 
					sch1.options[0].value = "";
					sch1.options[0].text = "server is not ready";
					document.body.style.cursor = "auto";	
					sch2.length = 0;
					sch2.options[0] = new Option(); 
					sch2.options[0].value = "";
					sch2.options[0].text = "server is not ready";
					document.body.style.cursor = "auto";			
		}
	}
			
}
function BseOfferG()
{
		//alert("Hi");
		if(XmlHttp.readyState == 4)
		{
		
			if(XmlHttp.status == 200)
			{
				
				document.getElementById("TopG").innerHTML = XmlHttp.responseText;
				document.body.style.cursor = "auto";
			}
			
		}
}
function veridat(navcode)
{	

	
	var bvalid
	bvalid=true
	
	a1=0;
	b1=0;
	c1=0;

	a1=eval(document.newsfrm.yy1.options[document.newsfrm.yy1.selectedIndex].value)
	b1=eval(document.newsfrm.mm1.options[document.newsfrm.mm1.selectedIndex].value)
	c1=eval(document.newsfrm.dd1.options[document.newsfrm.dd1.selectedIndex].value)
	
	var ddl=document.newsfrm.dd1.options[document.newsfrm.dd1.selectedIndex].value;
	var mml=document.newsfrm.mm1.options[document.newsfrm.mm1.selectedIndex].value;
	var yyl=document.newsfrm.yy1.options[document.newsfrm.yy1.selectedIndex].value;
	
	  switch(b1)
           {
           
            case 4:
                if ((c1 > 30) && bvalid)
                {  
                alert("Invalid  date format")
                bvalid = false;
                }
				break;
            case 6:
                if ((c1 > 30) && bvalid)
                {  
                alert("Invalid  date format")
                bvalid = false;
                }
				break;
            case 9:
                if ((c1 > 30) && bvalid)
                {  
                alert("Invalid  date format")
                bvalid = false;
                }
				break;
            case 11:
                if ((c1 > 30) && bvalid)
                {  
                alert("Invalid  date format")
                bvalid = false;
                }
				break;
            case 2:
                if(((a1 % 4 == 0) && (a1 %100 != 0 || a1 % 400 == 0)) && bvalid)
					{
						if (c1 > 29)
							{ 
								alert("Invalid  date format");
								bvalid = false;
								return false;
							}
					}
				else
					{
						if (c1 > 28) 
							{
								
								alert("Invalid  date format");
								bvalid = false;
								return false;
							}
					}
				break;
			}
		
        
	 if (bvalid == true) 
	{
		var HomPageUrl ="../Mutual/mf_profile.asp?tab=3&showpage=histnav&dd1="+ddl+"&mm1="+mml+"&yy1="+yyl+"&schcode="+navcode;
		document.getElementById("MutualInner").innerHTML="<table cellpadding='0' cellspacing='0' width='100%'><tr><td height='260px' align='center'><img src='../images/loading.gif'></td></tr></table>";
		var ajax = new Ajax.Updater('MutualInner',HomPageUrl);
	}
	else
	{
		return false ;
	}
}

function changeSchemefundcal()
{
	//document.location="fundrank.asp?Compcode="+document.getElementById('Compname').value+"&SType="+ document.getElementById('drp_stype').value;
	PageUrl="fundrank.asp?Compcode="+document.getElementById('Compname').value+"&SType="+ document.getElementById('drp_stype').value;
	document.getElementById("MutualInner").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
	var ajax = new Ajax.Updater('MutualInner',PageUrl);
}
function ChangeCatfundcal()
{
	//document.location="fundrank.asp?Compcode="+document.getElementById('Compname').value+"&SType="+ document.getElementById('drp_stype').value+"&Period="+document.getElementById('drp_Period').value;
	PageUrl="fundrank.asp?Compcode="+document.getElementById('Compname').value+"&SType="+ document.getElementById('drp_stype').value+"&Period="+document.getElementById('drp_Period').value;
	document.getElementById("MutualInner").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
	var ajax = new Ajax.Updater('MutualInner',PageUrl);
}
function ChangePagefundcal()
	{
			
		if (document.getElementById('drp_stype').value == "")
			{
				alert("Select a Category ");
				return false;				
			}
			else
			{
				//document.location="fundrank.asp?id=24&Compcode="+document.getElementById('Compname').value+"&SType="+ document.getElementById('drp_stype').value+"&Period="+document.getElementById('drp_Period').value;
					PageUrl="fundrank.asp?id=24&Compcode="+document.getElementById('Compname').value+"&SType="+ document.getElementById('drp_stype').value+"&Period="+document.getElementById('drp_Period').value;
					document.getElementById("MutualInner").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
					var ajax = new Ajax.Updater('MutualInner',PageUrl);

			}
		
}

function showMinSIP(sch,opt1)
		{
			PageUrl="../mutual/sipform.asp?a=30&schemecode="+opt1+"&mf_cocode="+sch;
			document.getElementById("MutualInner").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
			var ajax = new Ajax.Updater('MutualInner',PageUrl);
		}

function ValidateDatasip(sch,opt1,amt,mon,dy,yr)
		
		// Validate Date Selection
		{
			cboScheme=document.frmSIPCal.cboScheme;
				
			cboFromDay=document.frmSIPCal.cboFromDay;
			cboFromMonth=document.frmSIPCal.cboFromMonth;
			cboFromYear=document.frmSIPCal.cboFromYear;
			
			cboToDay=document.frmSIPCal.cboToDay;
			cboToMonth=document.frmSIPCal.cboToMonth;
			cboToYear=document.frmSIPCal.cboToYear;
			
			if(document.frmSIPCal.cboScheme1.value=="")
			{
				alert("Please Select Fund");
				document.frmSIPCal.cboScheme1.focus();
				return false;
			}		
			if(document.frmSIPCal.cboScheme.value=="")
			{
				alert("Please Select any Schemes/Plans");
				document.frmSIPCal.cboScheme.focus();
				return false;
			}		
			if (document.frmSIPCal.txtAmount.value=="")
			{
				alert("Enter the Investment Amount");
				document.frmSIPCal.txtAmount.focus();
				return false;
			}	
			
			if (IsNumeric(document.frmSIPCal.txtAmount.value) == false) 
			{
			  alert("Please check - non numeric value!");
			  document.frmSIPCal.txtAmount.focus();
			  return false;
			}	  		
			
			if(cboFromDay.selectedIndex==0)
			{
				alert("Select Start the Day");
				cboFromDay.focus();
				return(false);
			}

			else if(cboFromMonth.selectedIndex==0)
			{
				alert("Select Start the Month");
				cboFromMonth.focus();
				return false;
			}

			else if(cboFromYear.selectedIndex==0)
			{
				alert("Select Start the Year");
				cboFromYear.focus();
				return false;
			}
			
			else if(cboToDay.selectedIndex==0)
			{
				alert("Select the End Day");
				cboToDay.focus();
				return false;
			}
			//month should be selected
			else if(cboToMonth.selectedIndex==0)
			{
				alert("Select the End Month");
				cboToMonth.focus();
				return false;
			}
			//year should be selected
			else if(cboToYear.selectedIndex==0)
			{
				alert("Select the End Year");
				cboToYear.focus();
				return false;
			}	
			
			else 
			{
			 	 if(parseInt(yr) > parseInt(document.frmSIPCal.cboFromYear.value))
				 {
				 	alert("Invalid start Year!")
					return false;
				 }
									
			 	 if(parseInt(yr) == parseInt(document.frmSIPCal.cboFromYear.value))
				 {
						if (parseInt(document.frmSIPCal.cboFromMonth.value) < parseInt(mon))
							{
							alert("Invalid Start Month ")
							return false;
							}
						if (parseInt(document.frmSIPCal.cboFromMonth.value) == parseInt(mon ))	
						{

							if(parseInt(document.frmSIPCal.cboFromDay.value) < parseInt(dy))
							 {
							 	alert("Invalid Start Day ")
								return false;
							 }
						}
						
				 }
				 
				if (parseInt(document.frmSIPCal.cboFromYear.value) > parseInt(document.frmSIPCal.cboToYear.value ))	
				{
						alert("Invalid last year ")
						return false;
				}
				
				
				 if (parseInt(document.frmSIPCal.cboFromYear.value) ==  parseInt(document.frmSIPCal.cboToYear.value))
				 {
				 
					if (parseInt(document.frmSIPCal.cboFromMonth.value)  > parseInt(document.frmSIPCal.cboToMonth.value))
					{
						alert("Invalid last Month ")
						return false;
					}
					if (parseInt(document.frmSIPCal.cboFromMonth.value) == parseInt(document.frmSIPCal.cboToMonth.value) )	
						{												
							if(parseInt(document.frmSIPCal.cboToDay.value) < parseInt(document.frmSIPCal.cboFromDay.value)  )
							{
							alert("Invalid last Day  ")
							return false;
							}
						}							
				 }				
		}	 
		PageUrl="../mutual/sipform.asp?a=30&schemecode="+opt1+"&mf_cocode="+sch+"&cboFromMonth="+parseInt(document.frmSIPCal.cboFromMonth.value)+"&cboFromYear="+parseInt(document.frmSIPCal.cboFromYear.value)+"&cboFromDay="+parseInt(document.frmSIPCal.cboFromDay.value)+"&cboToMonth="+parseInt(document.frmSIPCal.cboToMonth.value)+"&cboToYear="+parseInt(document.frmSIPCal.cboToYear.value)+"&cboToDay="+parseInt(document.frmSIPCal.cboToDay.value)+"&txtAmount="+document.frmSIPCal.txtAmount.value;
		//alert(PageUrl);
		document.getElementById("MutualInner").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
		var ajax = new Ajax.Updater('MutualInner',PageUrl);
				
		}
		
function Sel_Shm(opt)
{
	PageUrl="../mutual/sipform.asp?a=30&mf_cocode="+opt
	document.getElementById("MutualInner").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
	var ajax = new Ajax.Updater('MutualInner',PageUrl);

}

function IsNumeric(strString)
 //  check for valid numeric strings	
{
   var strValidChars = "0123456789.";
   var strChar;
   var blnResult = true;

   if (strString.length == 0) return false;

   //  test strString consists of valid characters listed above
   for (i = 0; i < strString.length && blnResult == true; i++)
      {
      strChar = strString.charAt(i);
      if (strValidChars.indexOf(strChar) == -1)
         {
         blnResult = false;
         }
      }
   return blnResult;
}

function ChangePagecat()
	{
			
		if (document.getElementById('drp_Stype').value == "")
			{
				alert("Select a Category ");
			}
			else
			{
				var tab = document.getElementById('tab').value
				MutualPageUrl="../mutual/FundPerform.asp?a=27&tab="+tab+"&SType="+ document.getElementById('drp_stype').value;
				//alert(MutualPageUrl);
				document.getElementById("MutualInner").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
				var ajax = new Ajax.Updater('MutualInner',MutualPageUrl);

			}
		
}

function submitform(selopt,vl)
{
document.schcomp.hidsel.value =selopt;
document.schcomp.hidcode.value =vl;
if (vl!='no')
	{
		PageUrl ="../mutual/mf_compval.asp?a=7&hidcode="+vl+"&hidsel="+selopt;
		document.getElementById("MutualInner").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
		var ajax = new Ajax.Updater('MutualInner',PageUrl);
	}	
else
	{
	alert('Please Select Fund');
	document.schcomp.mfcomp.focus();
	}	
}

function Navchart(r1,r2,r3)////To get Nav interactive Chart
{
	ChartUrl="../mutual/MF_Profile.asp?tab=2&showpage="+ r1 + "&schcode=" + r2 + "&mfcompany=" + r3+"&sf=7";
	document.getElementById("MutualInner").innerHTML="<table cellpadding='0' cellspacing='0' width='100%'><tr><td height='260px' align='center'><img src='../images/loading.gif'></td></tr></table>";
	var ajax = new Ajax.Updater('MutualInner',ChartUrl);
}	

function linkpage(url)
{
	document.getElementById("MutualInner").innerHTML="<table cellpadding='0' cellspacing='0' width='100%'><tr><td height='260px' align='center'><img src='../images/loading.gif'></td></tr></table>";
	var ajax = new Ajax.Updater('MutualInner',url);
}
function Navchartbig(r1,r2,r3)////To get Nav Comparision chart
{
	BenchUrl="MF_Profile.asp?tab=2&typ=4&showpage="+ r1 + "&schcode=" + r2 + "&mfcompany=" + r3+"&tick=1";
	document.getElementById("MutualInner").innerHTML="<table cellpadding='0' cellspacing='0' width='100%'><tr><td height='260px' align='center'><img src='../images/loading.gif'></td></tr></table>";
	var ajax = new Ajax.Updater('MutualInner',BenchUrl);
}	
function ProfileAMC(r1)////To get AMC address from Profile page
{
	Amc="mf_amcdet.asp?mutcode=" + r1 +"&sf=7";
	document.getElementById("MutualInner").innerHTML="<table cellpadding='0' cellspacing='0' width='100%'><tr><td height='260px' align='center'><img src='../images/loading.gif'></td></tr></table>";
	var ajax = new Ajax.Updater('MutualInner',Amc);
}	

function chngeRes(pageurl)////To get paging option url from research page
{
	document.getElementById("ResearchinnerPage").innerHTML="<table cellpadding='0' cellspacing='0' width='100%'><tr><td height='260px' align='center'><img src='../images/loading.gif'></td></tr></table>";
	var ajax = new Ajax.Updater('ResearchinnerPage',pageurl);
}	
function chngeResL(pageurl)////To get paging option url from research page
{
	document.getElementById("ResearchinnerPageLatest").innerHTML="<table cellpadding='0' cellspacing='0' width='100%'><tr><td height='260px' align='center'><img src='../images/loading.gif'></td></tr></table>";
	var ajax = new Ajax.Updater('ResearchinnerPageLatest',pageurl);
}	
function changeChart(code) //For Technical Chart
{
	//var filter = /^\d{4}\.\d{2}\.\d{2}$/;
	var filter = /^\d{2}\/\d{2}\/\d{4}$/;
	var currentTime = new Date();
	var month = currentTime.getMonth() + 1
	var day = currentTime.getDate()
	var year = currentTime.getFullYear()
	if(eval(day) <= 9)
		day = "0"+day;
	if(eval(month) <=9)
		month = "0"+month;
	//var currentDate = year + "." + month + "." + day
	var currentDate = month + "/" + day + "/" + year;
	var NewSdate = document.getElementById("fromdate").value;
	var NewEdate = document.getElementById("todate").value;
	var arrSdate=NewSdate.split("/");
					
	var Sdate =arrSdate[1]+ "/" +arrSdate[0]+ "/" +arrSdate[2];
	
	var arrEdate=NewEdate.split("/");
	var Edate = arrEdate[1]+ "/" +arrEdate[0]+ "/" +arrEdate[2];
	 
	var Ecom=Sdate.split("/");
	 
		//var arrRow = Mq_Data.split("|");
					
	if((Sdate=="") || (Sdate=="From Date") && (Edate!=""))
	{
		alert("Please select StartDate");
		return false;
	}
	else if((Edate=="") || (Edate=="To Date") && (Sdate !=""))
	{
		alert("Please select EndDate");
		return false;
	}
	
	else if(Sdate!="" || Edate!="")
	{
		if(Date.parse(Edate) < Date.parse(Sdate))
		{
			alert("EndDate can't be less than StartDate");						
			return false;
		}
		
		else if(Date.parse(Sdate) > Date.parse(currentDate))
		{
			alert("StartDate can't be greater than CurrentDate");
			return false;
		}
		else if(Date.parse(Edate) > Date.parse(currentDate))
		{
			alert("EndDate can't be greater than CurrentDate");
			return false;
		}
		else if(Date.parse(Sdate) == Date.parse(Edate))
		{
			alert("StartDate and EndDate can't be the same");
			return false;
		}
		else if(Ecom[2] < year-5)
		{
			alert("EndDate can't be less than Current 5 years");						
			return false;
		}		
	}

	//var scrip=document.getElementById("cForm_CompanyName").value;
	document.location = "../Equity/charthist.asp?code="+code+"&exchng="+document.getElementById("exchng").value+"&ChartType="+document.getElementById("ChartType").value+"&fromdate="+Sdate+"&Todate="+Edate+"";	
	//alert(HomPageUrl);
	//document.getElementById("EQinnerPage").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
	//var ajax = new Ajax.Updater('EQinnerPage',HomPageUrl);	
  }  
  
  //For full screen Technical Chart
  function changeChartFull(code) 
{
	//var filter = /^\d{4}\.\d{2}\.\d{2}$/;
	var filter = /^\d{2}\/\d{2}\/\d{4}$/;
	var currentTime = new Date();
	var month = currentTime.getMonth() + 1
	var day = currentTime.getDate()
	var year = currentTime.getFullYear()
	if(eval(day) <= 9)
		day = "0"+day;
	if(eval(month) <=9)
		month = "0"+month;
	//var currentDate = year + "." + month + "." + day
	var currentDate = month + "/" + day + "/" + year;
	var NewSdate = document.getElementById("fromdate").value;
	var NewEdate = document.getElementById("todate").value;
	var arrSdate=NewSdate.split("/");
					
	var Sdate =arrSdate[1]+ "/" +arrSdate[0]+ "/" +arrSdate[2];
	
	var arrEdate=NewEdate.split("/");
	var Edate = arrEdate[1]+ "/" +arrEdate[0]+ "/" +arrEdate[2];
	 
	var Ecom=Sdate.split("/");
	 
		//var arrRow = Mq_Data.split("|");
					
	if((Sdate=="") || (Sdate=="From Date") && (Edate!=""))
	{
		alert("Please select StartDate");
		return false;
	}
	
	else if((Edate=="") || (Edate=="To Date") && (Sdate !=""))
	{
		alert("Please select EndDate");
		return false;
	}
	
	else if(Sdate!="" || Edate!="")
	{
		if(Date.parse(Edate) < Date.parse(Sdate))
		{
			alert("EndDate can't be less than StartDate");						
			return false;
		}
		
		else if(Date.parse(Sdate) > Date.parse(currentDate))
		{
			alert("StartDate can't be greater than CurrentDate");
			return false;
		}
		else if(Date.parse(Edate) > Date.parse(currentDate))
		{
			alert("EndDate can't be greater than CurrentDate");
			return false;
		}
	
		else if(Date.parse(Sdate) == Date.parse(Edate))
		{
			alert("StartDate and EndDate can't be the same");
			return false;
		}
	
		else if(Ecom[2] < year-5)
		{
			alert("EndDate can't be less than Current 5 years");						
			return false;
		}		
	}

	//var scrip=document.getElementById("cForm_CompanyName").value;
	HomPageUrl = "../Equity/charthistfull.asp?code="+code+"&exchng="+document.getElementById("exchng").value+"&ChartType="+document.getElementById("ChartType").value+"&fromdate="+Sdate+"&Todate="+Edate+"";	
	//alert(HomPageUrl);
	document.location = HomPageUrl;
	
	//document.getElementById("EQinnerPage").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
	//var ajax = new Ajax.Updater('EQinnerPage',HomPageUrl);	
  }  
  
  function changeChartFullDemo(code) 
{
	//var filter = /^\d{4}\.\d{2}\.\d{2}$/;
	var filter = /^\d{2}\/\d{2}\/\d{4}$/;
	var currentTime = new Date();
	var month = currentTime.getMonth() + 1
	var day = currentTime.getDate()
	var year = currentTime.getFullYear()
	if(eval(day) <= 9)
		day = "0"+day;
	if(eval(month) <=9)
		month = "0"+month;
	//var currentDate = year + "." + month + "." + day
	var currentDate = month + "/" + day + "/" + year;
	var NewSdate = document.getElementById("fromdate").value;
	var NewEdate = document.getElementById("todate").value;
	var arrSdate=NewSdate.split("/");
					
	var Sdate =arrSdate[1]+ "/" +arrSdate[0]+ "/" +arrSdate[2];
	
	var arrEdate=NewEdate.split("/");
	var Edate = arrEdate[1]+ "/" +arrEdate[0]+ "/" +arrEdate[2];
	 
	var Ecom=Sdate.split("/");
	 
		//var arrRow = Mq_Data.split("|");
					
	if((Sdate=="") || (Sdate=="From Date") && (Edate!=""))
	{
		alert("Please select StartDate");
		return false;
	}
	
	else if((Edate=="") || (Edate=="To Date") && (Sdate !=""))
	{
		alert("Please select EndDate");
		return false;
	}
	
	else if(Sdate!="" || Edate!="")
	{
		if(Date.parse(Edate) < Date.parse(Sdate))
		{
			alert("EndDate can't be less than StartDate");						
			return false;
		}
		
		else if(Date.parse(Sdate) > Date.parse(currentDate))
		{
			alert("StartDate can't be greater than CurrentDate");
			return false;
		}
		else if(Date.parse(Edate) > Date.parse(currentDate))
		{
			alert("EndDate can't be greater than CurrentDate");
			return false;
		}
	
		else if(Date.parse(Sdate) == Date.parse(Edate))
		{
			alert("StartDate and EndDate can't be the same");
			return false;
		}
	
		else if(Ecom[2] < year-5)
		{
			alert("EndDate can't be less than Current 5 years");						
			return false;
		}		
	}

	//var scrip=document.getElementById("cForm_CompanyName").value;
	document.location = "../Equity/charthistdemo.asp?code="+code+"&exchng="+document.getElementById("exchng").value+"&ChartType="+document.getElementById("ChartType").value+"&fromdate="+Sdate+"&Todate="+Edate+"";	
	//alert(HomPageUrl);
	//document.getElementById("EQinnerPage").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
	//var ajax = new Ajax.Updater('EQinnerPage',HomPageUrl);	
  }  
  
  
  function PFforNewuser(code)
{
	 	 open("../portfolio/login.asp?loginid=Portfolio&compcode="+ code +"","PortFolio");
}
function PFforOldUser(code,baseprice,ptid)
{	
 	// alert(ptid);
	 open("../portfolio/TransAdd.asp?loginid=Portfolio&compcode="+ code +"&bprice="+ baseprice +"&portid="+ ptid +"&create=pf&Srchtype=ST","PortFolio");

}

function ChangeSector() //for Industry classification 
{

var pageurl = "../Equity/Industry.asp?Sector="+document.getElementById('cmbSecCode').value;
	document.getElementById("EQinnerPage").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
	var ajax = new Ajax.Updater('EQinnerPage',pageurl);	

}

function checkIndquote() // for Industry classification 
	{
		var sect = document.getElementById("cmbSecCode").value;
		var indcode = document.getElementById("cmbIndCode").value;
		if(sect==0)
		{
			alert("Please Select Sector");
			return false;
		}
		if(indcode==0)
		{
			alert("Please Select An Industry");
			return false;
		}		
		else
		{	
		var	url = "../Equity/Industry.asp?Sector="+sect+"&Industry="+indcode;			
		document.getElementById("EQinnerPage").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
		var ajax = new Ajax.Updater('EQinnerPage',url);	
		return false;
		}
	}  

function ChangeEX() // for Monthly Adjusted Unadjusted High Low
{
var Indexcode =  document.getElementById("Group").value;
var code = document.getElementById("QuotesCode").value;
var Group = document.getElementById("Group").options[document.getElementById("Group").selectedIndex].text;
//document.location="Comp_Info.asp?page=MA&a=15&Exchg="+document.getElementById("drp_Exchg").value+"&code="+ document.getElementById("Hid_code").value+"&Group="+Group+"&Indexcode="+Indexcode;
		var url ="../profile/monthlyadj.asp?Exchg="+document.getElementById("drp_Exchg").value+"&code="+ document.getElementById("QuotesCode").value+"&Indexcode="+Indexcode;
		//alert(url);
		document.getElementById("EQinnerPage").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
		var ajax = new Ajax.Updater('EQinnerPage',url);	


}


	var DayArray = new Array(31,28,31,30,31,30,31,31,30,31,30,31);
	var DayArrayLeap =new Array(31,29,31,30,31,30,31,31,30,31,30,31);
	var MonthName = new Array("jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec");
	
	ChangeDay = function()
	{
		if(document.getElementById("drp_Fmonth").value =="2" &&  document.getElementById("drp_Fyear").value % 4 == 0 || document.getElementById("drp_Fyear%>").value %400 == 0)
		{
			document.getElementById("drp_Fday").options.length = DayArrayLeap[document.getElementById("drp_Fmonth").value-1]
			for (i=1;i<=DayArrayLeap[document.getElementById("drp_Fmonth").value-1];i++)
			{
				document.getElementById("drp_Fday").options[i-1].innerText=i;
				document.getElementById("drp_Fday").options[i-1].value=i;
			}
		}
		else 
		{
			document.getElementById("drp_Fday").options.length = DayArray[document.getElementById("drp_Fmonth").value-1]
			for (i=1;i<=DayArray[document.getElementById("drp_Fmonth").value-1];i++)
			{
				document.getElementById("drp_Fday").options[i-1].innerText=i;
				document.getElementById("drp_Fday").options[i-1].value=i;
			}
		}
	}
	
	ChangeDay1 = function ()
	{
		if(document.getElementById("drp_Tmonth").value =="2" &&  document.getElementById("drp_Tyear").value % 4 == 0 || document.getElementById("drp_Tyear").value %400 == 0)
		{
			document.getElementById("drp_Tday").options.length = DayArrayLeap[document.getElementById("drp_Tmonth").value-1]
			for (i=1;i<=DayArrayLeap[document.getElementById("drp_Tmonth").value-1];i++)
			{
				document.getElementById("drp_Tday").options[i-1].innerText=i;
				document.getElementById("drp_Tday").options[i-1].value=i;
			}
		}
		else 
		{
			document.getElementById("drp_Tday").options.length = DayArray[document.getElementById("drp_Tmonth").value-1]
			for (i=1;i<=DayArray[document.getElementById("drp_Tmonth").value-1];i++)
			{
				document.getElementById("drp_Tday").options[i-1].innerText=i;
				document.getElementById("drp_Tday").options[i-1].value=i;
			}
		}
	}
	
	AdjUnAdj = function()
	{
		var d = new Date();
		var currdate = d.getDate();
		var currmon = d.getMonth();
		var curryear = d.getFullYear();
		
		if(String(currdate).length == 1)
		{
			var cdate = "0" + currdate;
		}
		else
		{
			var cdate = currdate;
		}
		
		
		if(String(currmon).length == 1)
		{
			var cmon = parseInt(currmon) + 1;
			cmon = "0" + cmon;
		}
		else
		{
			var cmon = currmon;
			cmon += 1;
		}
		var CDate1 = curryear +"."+cmon+"."+cdate;
		var code = document.getElementById("QuotesCode").value;
		var Exchg =  document.getElementById("drp_Exchg").value;
		var adj = document.getElementById("Drp_adjusttype").value;
		var Indexcode =  document.getElementById("Group").value;

		var drp_Fday = 	document.getElementById("drp_Fday").value;
		var drp_Fmonth = document.getElementById("drp_Fmonth").value;
		var drp_Fyear = document.getElementById("drp_Fyear").value;
		
		var drp_Tday = 	document.getElementById("drp_Tday").value;
		var drp_Tmonth = document.getElementById("drp_Tmonth").value;
		var drp_Tyear = document.getElementById("drp_Tyear").value;
		
		var drp_Fmonth1 = document.getElementById("drp_Fmonth").value;
		var drp_Tmonth1 = document.getElementById("drp_Tmonth").value;
		
		
		var Group = document.getElementById("Group").options[document.getElementById("Group").selectedIndex].text;
		var Fdate = drp_Fmonth+"/"+drp_Fday+"/"+drp_Fyear;
		
		var Tdate = drp_Tmonth+"/"+drp_Tday+"/"+drp_Tyear;
				
		//var AdjHighLow = document.getElementById("AdjHighLow");
		
		var Fdate1 =  drp_Fyear +"."+drp_Fmonth1+"."+drp_Fday;
		var Tdate1 =  drp_Tyear +"."+drp_Tmonth1+"."+drp_Tday;

		//if(Tdate1 > CDate1)
		//{
		//alert(Tdate1)
		//alert (Tdate1 < CDate1)
		//	alert("To date cannot be greater than Current date");
		//}
		
		if(Fdate1 > Tdate1)
		{
			alert("From Date cannot be greater than To Date");
		}
		else
		{
			var drp_period = document.getElementById("drp_period").value;
			if(drp_period == "dly")
			{
				StrUrl = "../profile/monthlyadj.asp?code="+code+"&FDate="+Fdate+"&EDate="+Tdate+"&Exchg="+Exchg+"&Indexcode="+Indexcode+"&Group="+Group+"&Period="+drp_period;
				document.getElementById("EQinnerPage").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
				var ajax = new Ajax.Updater('EQinnerPage',StrUrl);	
			}
			else
			{
				StrUrl = "../profile/monthlyadj.asp?code="+code+"&FDate="+Fdate+"&EDate="+Tdate+"&Exchg="+Exchg+"&Indexcode="+Indexcode+"&Group="+Group+"&Period="+drp_period+"&adj="+adj;
				document.getElementById("EQinnerPage").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
				var ajax = new Ajax.Updater('EQinnerPage',StrUrl);	
			}
		}
	}
//Monthly Adjusted and Unadjusted End	
	
	//Peer comparision starts
var count;
		var Co_Codes;
		CheckCheckedCounter = function (ChkBox)
		{	

			CheckCounterInStart(ChkBox);
			//if pressed back then take how many companies checked
			if (ChkBox.checked)
			{
				if (count < 4)
				{
					Co_Codes = Co_Codes + ChkBox.id +",";
					count++;
				}
				else
				{
					ChkBox.checked = false;
					alert("You can Select Maximum 4 Companies.");
				}
				
				Co_Codes = Co_Codes.substring(0,Co_Codes.length -1); 
			}
			else if (count>0)
			{
				Co_Codes = Co_Codes.replace(ChkBox.id+",","")
				count--;
			}
			 
			var txtcocode = document.getElementById("Co_Code")
			txtcocode.value = Co_Codes;
			document.getElementById("txtCoCodes").value=txtcocode.value;
		}
		
		CheckCounterInStart = function (ChkBox)
		{
			count=0;
			Co_Codes="";
			var x=document.getElementsByName("CompCode");
			
			for (var j=0;j<x.length;j++)
			{
				if (x[j].checked && x[j].id != ChkBox.id )
				{
					Co_Codes = Co_Codes + x[j].id +",";
					count++;
				}
			}
			
		}
	Validate=function ()
		{

			if (count=0)
			{
				alert("Select at least one company");
				return false;					
			}
			else
			{
				var cocodes = document.getElementById("txtCoCodes").value;
				var Fcode = document.getElementById("Fcode").value;
				//alert(Fcode);
				opttype =  document.getElementById("drp_PeerType").value;
				var Pageurl = "../profile/peercompare.asp?pageOpt=19&Option="+opttype+"&Fcode="+Fcode+"&CoCodetxt="+cocodes+"&opt="+opttype;
				//alert(Url_Data);
				//var ajax = new Ajax.Updater('PeerCompanyData',Url_Data,{evalScripts: true});
				
				document.getElementById("EQinnerPage").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
				var ajax = new Ajax.Updater('EQinnerPage',Pageurl);	
				return true;
			}
		}
		
/*function CheckBoxValidation1(peer,code)
	{//alert(code);
		
		var Option = document.getElementById("PeerSelDrop").value;
		//alert(Option)
		var Peerurl = "../profile/PeerCompare.asp?pageOpt=19&CoCodetxt="+peer+"&Fcode="+code+"&Option="+Option
		document.getElementById("EQinnerPage").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
		var ajax = new Ajax.Updater('EQinnerPage',Peerurl);	
	}	
  //Peer comparision Ends
  */
  function CheckBoxValidation(code)
	{

		var Option = document.getElementById("PeerSelDrop").value;
		var ch = document.getElementById("ch").value;

		var check;
		var cnt = 0;
		var ch1=0;
		for (var i = 0; i<=document.getElementsByName("chkSelected").length-1;i++)
		{

			if(document.getElementsByName("chkSelected").item(i).checked==true)
			{
			if(ch1==0)
			{
				ch1=document.getElementsByName("chkSelected").item(i).value;
			}
			else
			{
			ch1=document.getElementsByName("chkSelected").item(i).value+ "," + ch1;
			}
			if (cnt==4)
			 {
			 alert("Select only four company");
			 return false;
			 }
			check=true;
			cnt++;
			}
		}
		
			if(ch!="" && ch!=="0") 
			{
			ch1=ch1+","
			//alert(ch1);
			document.getElementById("ch").value=ch1
			cnt=cnt+1;
			
			}
			else
			{
				ch1=ch1+","
				document.getElementById("ch").value=ch1
				cnt=cnt+1;
			}
		 if (cnt==1)
		 {
			 alert("Select atleast one company");
			// alert(cnt);
			 return false;
		 }
		else
		 {
		 	//alert(document.Form1.action="../profile/PeerCompare.asp?pageOpt=19&finid=2&code="+code+"&Option="+Option);
		 	//document.Form1.submit();
		 	StUrl="../profile/PeerCompare.asp?pageOpt=19&finid=2&code="+code+"&ch="+ch1+"&Option="+Option;
			
		//alert(StUrl);
 		document.getElementById("EQinnerPage").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
		var ajax = new Ajax.Updater('EQinnerPage',StUrl);	
		}
	 }




var check=0;

function chkbox(chk)
{
//alert(chk);
var ch = document.getElementById("ch").value;

		
        var a1 = new Array();
		a1=ch.split(",");
		a1.join("");
		
		for (var i = 0; i<=document.getElementsByName("chkSelected").length-1;i++)
		{
		for (j=0;j<=a1.length;j++)
		{
		va="0" + document.getElementsByName("chkSelected").item(i).value; 
		if(va==a1[j] || document.getElementsByName("chkSelected").item(i).value==a1[j] )
			{
				//sr[i]=document.getElementsByName("chkSelected").item(i).value
					
				//alert(document.getElementsByName("chkSelected").item(i).value);
				var xx = document.getElementsByName("chkSelected").item(i);
				xx.checked = true;

			}
		}
					
		}
}

function countchk(url)
{

var Option = document.getElementById("PeerSelDrop").value;
		//var sr = new Array (25); 
		var ch = document.getElementById("ch").value;
		
		for (var i = 0; i<=document.getElementsByName("chkSelected").length-1;i++)
		{
			
		if(document.getElementsByName("chkSelected").item(i).checked==true)
			{
				//sr[i]=document.getElementsByName("chkSelected").item(i).value
					
				check= document.getElementsByName("chkSelected").item(i).value+","+ check;
				
					
			}
		
		}
		
		if(ch!="" )
		{
		check=ch+check;
		document.getElementById("ch").value=check;
		}
		
		else
		{
		document.getElementById("ch").value=check
		}
		
		
var url1=url

 //document.Form1.action=url1
 //document.Form1.submit();
 		document.getElementById("EQinnerPage").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
		var ajax = new Ajax.Updater('EQinnerPage',url1);	

}
function CheckBoxValidation1(peer,code)
	{
		
		var Option = document.getElementById("PeerSelDrop").value;

		StrUrl="../profile/PeerCompare.asp?pageOpt=19&finid=2&ch="+peer+"&code="+code+"&Option="+Option
		alert(StrUrl);
 		document.getElementById("EQinnerPage").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
		var ajax = new Ajax.Updater('EQinnerPage',StrUrl);	
		//document.Form1.action="../profile/PeerCompare.asp?pageOpt=19&finid=2&ch="+peer+"&code="+code+"&Option="+Option
		//document.Form1.submit();		
  }
 function showSectionTop (InstType,Sym)
 {
	//alert(id);
	//alert(id2);
	var DerivativesPageUrl="../Derivatives/fomktreport.asp?InstType="+InstType+"&Sym="+Sym
	//alert(DerivativesPageUrl);
 	document.getElementById("DerivativesInner").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
	var ajax = new Ajax.Updater('DerivativesInner',DerivativesPageUrl);
 }
  function DropNSEcurrency(Sym)
 {
	//alert(id);
	//alert(id2);
	var DerivativesPageUrl="../Derivatives/Nsecurrency.asp?Sym="+Sym
	//alert(DerivativesPageUrl);
 	document.getElementById("DerivativesInner").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
	var ajax = new Ajax.Updater('DerivativesInner',DerivativesPageUrl);
 }
   function DropMCXcurrency(Sym)
 {
	//alert(id);
	//alert(id2);
	var DerivativesPageUrl="../Derivatives/Mcxcurrency.asp?Sym="+Sym
	//alert(DerivativesPageUrl);
 	document.getElementById("DerivativesInner").innerHTML="<table cellpadding='0' cellspacing='0' width='100%' height='400' align='center'><tr><td align='center'><img src='../images/loading.gif'></td></tr><tr><td class='warning' align='center'>Please Wait .......</td></tr></table>";
	var ajax = new Ajax.Updater('DerivativesInner',DerivativesPageUrl);
 }
 //share holding pattern 
 

    function showdetails(id)
    {
        if(id=="")
        {
            for(var i=1;i<=3;i++)
            {
                document.getElementById("tdMain"+i).style.display="none";
            }
        }
        else
        {
            if(document.getElementById("tdMain"+id).style.display=="inline")
            {
                document.getElementById("tdMain"+id).style.display="none";
                document.getElementById("imgMain"+id).src='../images/TickerPlus.gif';
                if(id=="1")
                {
                    document.getElementById("tdSub11").style.display="none";
                    document.getElementById("tdSub12").style.display="none";    
                    document.getElementById("imgSub11").src='../images/TickerPlus.gif';
                    document.getElementById("imgSub12").src='../images/TickerPlus.gif';       
                }
                else if(id=="2")
                {
                    document.getElementById("tdSub21").style.display="none";           
                    document.getElementById("tdSub22").style.display="none";  
                    document.getElementById("imgSub21").src='../images/TickerPlus.gif';
                    document.getElementById("imgSub22").src='../images/TickerPlus.gif';    
                }
            }
            else
            {
                document.getElementById("tdMain"+id).style.display="inline";
                document.getElementById("imgMain"+id).src='../images/TickerMinus.gif';
            }
            
        }
        
    }
    function showSubdetails(id)
    {
        if(id=="")
        {            
           document.getElementById("tdSub11").style.display="none";
           document.getElementById("tdSub12").style.display="none";           
           document.getElementById("tdSub21").style.display="none";           
           document.getElementById("tdSub22").style.display="none";                      
        }
        else
        {
            if(document.getElementById("tdSub"+id).style.display=="inline")
            {
                document.getElementById("tdSub"+id).style.display="none";
                document.getElementById("imgSub"+id).src='../images/TickerPlus.gif';
            }
            else
            {
                document.getElementById("tdSub"+id).style.display="inline";
                document.getElementById("imgSub"+id).src='../images/TickerMinus.gif';
            }
            
        }        
    }
    function hideblankrow()
    {
        for(var j=1;j<=53;j++)
        {
            var rowCells=document.getElementById("tr"+j).cells;
		    if(rowCells[1].innerHTML=="0" && (rowCells[2].innerHTML=="0" ||rowCells[2].innerHTML=="0.00")&&rowCells[3].innerHTML=="0" && rowCells[4].innerHTML=="0")
		        document.getElementById("tr"+j).style.display="none";
		    else
		        document.getElementById("tr"+j).style.display="inline";
        } 
    }


//share holding pattern ends