
function Browser() {
  var ua, s, i;
  this.isIE    = false;
  this.isNS    = false;
  this.version = null;
  ua = navigator.userAgent;
  s = "MSIE";
  if ((i = ua.indexOf(s)) >= 0) {
    this.isIE = true;
    this.version = parseFloat(ua.substr(i + s.length));
    return;
  }

  s = "Netscape6/";
  if ((i = ua.indexOf(s)) >= 0) {
    this.isNS = true;
    this.version = parseFloat(ua.substr(i + s.length));
    return;
  }

  // Treat any other "Gecko" browser as NS 6.1.
  s = "Gecko";
  if ((i = ua.indexOf(s)) >= 0) {
    this.isNS = true;
    this.version = 6.1;
    return;
  }
}
var browser = new Browser();
var clockTimeoutID;
//Global Variables
var XmlHttp;
//Creating object of XMLHTTP For AJAX Method
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();
		}
	}
	
	//for home corp news
	function CreateXmlHttp1()
	{
		//Creating object of XMLHTTP in IE
		try
		{
			XmlHttp1 = new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch(e)
		{
			try
			{
				XmlHttp1 = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch(oc)
			{
				XmlHttp1 = null;	
			}
		}
		//Creating object of XMLHTTP in Mozilla and Safari 
		if(!XmlHttp1 && typeof XMLHttpRequest != "undefined") 
		{
			XmlHttp1 = new XMLHttpRequest();
		}
	}
	
	//for home ticker
	function CreateXmlHttp2()
	{
		//Creating object of XMLHTTP in IE
		try
		{
			XmlHttp2 = new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch(e)
		{
			try
			{
				XmlHttp2 = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch(oc)
			{
				XmlHttp2 = null;	
			}
		}
		//Creating object of XMLHTTP in Mozilla and Safari 
		if(!XmlHttp2 && typeof XMLHttpRequest != "undefined") 
		{
			XmlHttp2 = new XMLHttpRequest();
		}
	}
	
	//for news inner
	function CreateXmlHttp3()
	{
		//Creating object of XMLHTTP in IE
		try
		{
			XmlHttp3 = new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch(e)
		{
			try
			{
				XmlHttp3 = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch(oc)
			{
				XmlHttp3 = null;	
			}
		}
		//Creating object of XMLHTTP in Mozilla and Safari 
		if(!XmlHttp3 && typeof XMLHttpRequest != "undefined") 
		{
			XmlHttp3 = new XMLHttpRequest();
		}
	}
	//for NSE BSE announce
	function CreateXmlHttp4()
	{
		//Creating object of XMLHTTP in IE
		try
		{
			XmlHttp4 = new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch(e)
		{
			try
			{
				XmlHttp4 = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch(oc)
			{
				XmlHttp4 = null;	
			}
		}
		//Creating object of XMLHTTP in Mozilla and Safari 
		if(!XmlHttp4 && typeof XMLHttpRequest != "undefined") 
		{
			XmlHttp4 = new XMLHttpRequest();
		}
	}
	
	
	
//**** Function ExchngTimeClock Is used for to find out the market hours --- The ticker will automatically refresh only in market timings *****//			
function ExchngTimeClock(Exchg) {
	 var time = new Date()
	 var hour = time.getHours()
	 if (hour >= 10 && hour <= 20)
			  clockTimeoutID = setTimeout("getTickerData('"+ Exchg +"')",600000);
	}
	
//**** Function killClock Is used for killing clock timer  *****//
function killClock(){
	clearTimeout(clockTimeoutID);
	}		
	
//For Loading ticker from TickerData.aspx Using AJAX
function getTickerData(Exchg)
	{
	
	if (Exchg=="BSE")
	{	
		bf.innerHTML="<b>BSE</b>";
		bf1.innerHTML="NSE";		
	}
	else if(Exchg=="NSE")
	{
		bf.innerHTML="BSE";
		bf1.innerHTML="<b>NSE</b>";		
	}
		CreateXmlHttp2();
		document.body.style.cursor = "progress";
		document.getElementById("MarqueeId").innerHTML = " <img src='../images/home/loading1.gif'>";
		
		var requestUrl = "../TickerData.aspx?Exchg="+ Exchg +"&IpTrack="+ window.location.hostname +"&timeStamp="+new Date().getTime();
		if(XmlHttp2)	{
					XmlHttp2.onreadystatechange = function(){getDataResponse(Exchg);};
					XmlHttp2.open("GET", requestUrl,  true);
					XmlHttp2.send(null);
				}
	}
	
	//Called when response comes back from server Only For Ticker
function getDataResponse(Exchg)
{
	
	// To make sure receiving response data from server is completed
	if(XmlHttp2.readyState == 4)
	{
		// To make sure valid response is received from the server, 200 means response received is OK
		if(XmlHttp2.status == 200)
		{			
		
			var arrCol,Time,Code,CompName,ClPrice,DiffVal,DiffImg;
			var ExchgDet="",stkDet="";
			var MarqueeId = document.getElementById("MarqueeId");
			var Mq_Data = XmlHttp2.responseText;
			
			if(Mq_Data != "")
			var arrRow = Mq_Data.split("|");
				for(i=0; i<arrRow.length-1; i++)
				 {
					arrCol = arrRow[i].split("~");
						CompName = arrCol[1];
						ClPrice  = arrCol[2];
						DiffVal  = arrCol[3];
						if(DiffVal>0) 
						{
							DiffImg= "<img align='absmiddle' src='../images/home/up-arraw.gif'>";
							clss = "<span class='bse1'>"
						}
						else if(DiffVal<0) 
						{
							clss = "<span class='bse1'>"
							DiffImg="<img align='absmiddle' src='../images/home/down-arraw.gif'>";
						}
						else 
						{
							clss = "<span class='bse1'>"
							DiffImg= "<img align='absmiddle' src='../images/home/up-arraw.gif'>";						
						}
						per="%";
						//if(i==0)ExchgDet = arrCol[0] +" &nbsp; "+ CompName +"&nbsp; "+ ClPrice +" " + DiffImg + "&nbsp;(" + clss + DiffVal + per+"</span>) &nbsp;&nbsp;&nbsp;";else stkDet += "<a target=_parent href='http://www.hdfcsec.com/Common/DetailedQuote_Investor.aspx?Query=http://www.hdfcsec.cmlinks.com/DetailedQuote02.aspx?code="+ arrCol[0] +"' class=TickerLink>" + CompName +"</a>&nbsp; "+ ClPrice +" "+ DiffImg +"&nbsp("+ clss + DiffVal + per+"</span>)  &nbsp;";
						if(i==0)ExchgDet = arrCol[0] +"&nbsp; "+ DiffImg + " " + CompName + ":" + ClPrice + "&nbsp;(" + clss + DiffVal + per+"</span>) &nbsp;&nbsp;&nbsp;";else stkDet += "&nbsp;" + DiffImg + " " + CompName +":"+ ClPrice +"&nbsp("+ clss + DiffVal + per+"</span>)  &nbsp;";
				}
				if(browser.isIE)
					MarqueeId.innerHTML = "<marquee onmouseover='this.stop();' id='marq' onmouseout='this.start();' trueSpeed scrollAmount='2' scrollDelay='35' direction='left' loop='repeat' width='100%'>" + ExchgDet + stkDet + "</marquee>";
				else
					MarqueeId.innerHTML = ExchgDet + stkDet;				
				document.body.style.cursor = "auto";
				ExchngTimeClock(Exchg);
	
		}
		else
			MarqueeId.innerHTML = "<img src='../images/home/loading1.gif'>";
	}
}


//For news inner page using AJAX
function NewsHotMar(newsid)
{
	if(newsid=='hot')
	{
	document.getElementById("ht").className = "tabsection06";
	document.getElementById("ht").style.cursor = "";
	document.getElementById("mar").className = "tabsection07";
	document.getElementById("mar").style.cursor = "hand";
	document.getElementById("moreLink1").innerHTML = "<img src=../images/bullet_more01.gif align=absmiddle> &nbsp;<a target=_parent href=http://www.hdfcsec.com/News/IntNews.aspx?Heading=StocksinAction&Query=http://www.hdfcsec.cmlinks.com/NewsHotList.aspx?secid=2&subsecid=>More</a>";
	}
else
	{
	document.getElementById("ht").className = "tabsection07";
	document.getElementById("ht").style.cursor = "hand";
	document.getElementById("mar").className = "tabsection06";
	document.getElementById("mar").style.cursor = "";
	document.getElementById("moreLink1").innerHTML = "<img src=../images/bullet_more01.gif align=absmiddle> &nbsp;<a target=_parent href=http://www.hdfcsec.com/News/IntNews.aspx?Heading=MarketNews&Query=http://www.hdfcsec.cmlinks.com/NewsHotList.aspx?secid=4&subsecid=14,15>More</a>";
	}
	
//var currDivObj;
//currDivObj = document.getElementById("NewsH");
//currDivObj.innerHTML="<img src=../CommonImgs/loading7.gif>";
CreateXmlHttp1();

document.body.style.cursor = "progress";
var reqUrl="../NewsInnerDataHot.aspx?NewsId="+ newsid +"&IpTrack="+ window.location.hostname +"&timeStamp="+new Date().getTime();

if(XmlHttp1)	{
				XmlHttp1.onreadystatechange = function(){NewsHotMarDetails();};
				XmlHttp1.open("GET", reqUrl, true);
				XmlHttp1.send(null);
			}
}

function NewsHotMarDetails()
{
// To make sure receiving response data from server is completed
if(XmlHttp1.readyState == 4)
		{
			// To make sure valid response is received from the server, 200 means response received is OK
			if(XmlHttp1.status == 200)
			{
			var strNewsData = XmlHttp1.responseText;
			//var a=document.getElementById("NH");
			
			document.getElementById("NH").innerHTML = strNewsData;
			document.body.style.cursor="auto";
			}
			else
				document.getElementById("NH").innerHTML = "<img src='../images/loading7.gif'>";
		}
}


// For Corporate News Section

function NewsCorporate(newsid)
{
	if(newsid=='Trd_corN')
	{
	document.getElementById("CN").className = "tabsection06";	
	document.getElementById("CR").className = "tabsection07";
	document.getElementById("moreCorpNewsRes").innerHTML = "<img src=../images/bullet_more01.gif align=absmiddle> &nbsp;<a target=_parent href='http://www.hdfcsec.com/News/IntNews.aspx?Heading=CorporateNews&Query=http://www.hdfcsec.cmlinks.com/NewsHotList.aspx?secid=8&subsecid=0'>More</a>";
	}
	if(newsid=='Trd_corR')
	{
	document.getElementById("CN").className = "tabsection07";	
	document.getElementById("CR").className = "tabsection06";
	document.getElementById("moreCorpNewsRes").innerHTML = "<img src=../images/bullet_more01.gif align=absmiddle> &nbsp;<a target=_parent href='http://www.hdfcsec.com/News/IntNews.aspx?Heading=CorporateResults&Query=http://www.hdfcsec.cmlinks.com/NewsHotList.aspx?secid=7&subsecid=20'>More</a>";
	}
		
	if(newsid=='corN')
	{
	document.getElementById("CN").className = "tabsection06";
	document.getElementById("CN").style.cursor = "";
	document.getElementById("CR").className = "tabsection07";
	document.getElementById("CR").style.cursor = "hand"; 
	document.getElementById("moreLink2").innerHTML = "<img src=../images/bullet_more01.gif align=absmiddle> &nbsp;<a target=_parent href=http://www.hdfcsec.com/News/IntNews.aspx?Heading=CorporateNews&Query=http://www.hdfcsec.cmlinks.com/NewsHotList.aspx?secid=8&subsecid=0>More</a>";	
	}
	if(newsid=='corR')
	{
	document.getElementById("CN").className = "tabsection07";
	document.getElementById("CN").style.cursor = "hand";
	document.getElementById("CR").className = "tabsection06";
	document.getElementById("CR").style.cursor = "";
	document.getElementById("moreLink2").innerHTML = "<img src=../images/bullet_more01.gif align=absmiddle> &nbsp;<a target=_parent href=http://www.hdfcsec.com/News/IntNews.aspx?Heading=CorporateResults&Query=http://www.hdfcsec.cmlinks.com/NewsHotList.aspx?secid=7&subsecid=20>More</a>";
	}
	
//var currDivObj;
//currDivObj = document.getElementById("NewsH");
//currDivObj.innerHTML="<img src=../CommonImgs/loading7.gif>";
CreateXmlHttp2();

document.body.style.cursor = "progress";
var reqUrl="../NewsInnerDataHot.aspx?NewsId="+ newsid +"&IpTrack="+ window.location.hostname +"&timeStamp="+new Date().getTime();

if(XmlHttp2)	{
				XmlHttp2.onreadystatechange = function(){NewsCorporateDetails();};
				XmlHttp2.open("GET", reqUrl, true);
				XmlHttp2.send(null);
			}
}

function NewsCorporateDetails()
{
// To make sure receiving response data from server is completed
if(XmlHttp2.readyState == 4)
		{
			// To make sure valid response is received from the server, 200 means response received is OK
			if(XmlHttp2.status == 200)
			{
			var strNewsData = XmlHttp2.responseText;
			//var a=document.getElementById("NH");
			document.getElementById("Cor").innerHTML = strNewsData;
			document.body.style.cursor="auto";
			}
			else
				document.getElementById("Cor").innerHTML = "<img src='../images/loading7.gif'>";
		}
}


//For Economy & Foreign Mkts

function NewsEcoFor(newsid)
{
	if(newsid=='eco')
	{
	document.getElementById("EC").className = "tabsection06";
	document.getElementById("EC").style.cursor = "";
	document.getElementById("For").className = "tabsection07";
	document.getElementById("For").style.cursor = "hand"; //
	document.getElementById("moreLink3").innerHTML = "<img src=../images/bullet_more01.gif align=absmiddle> &nbsp;<a target=_parent href=http://www.hdfcsec.com/News/IntNews.aspx?Heading=EconomyNews&Query=http://www.hdfcsec.cmlinks.com/NewsHotList.aspx?secid=12&subsecid=44,45>More</a>";
	}
else
	{
	document.getElementById("EC").className = "tabsection07";
	document.getElementById("EC").style.cursor = "hand";
	document.getElementById("For").className = "tabsection06";
	document.getElementById("For").style.cursor = "";
	document.getElementById("moreLink3").innerHTML = "<img src=../images/bullet_more01.gif align=absmiddle> &nbsp;<a target=_parent href=http://www.hdfcsec.com/News/IntNews.aspx?Heading=InternationalMarkets&Query=http://www.hdfcsec.cmlinks.com/NewsHotList.aspx?secid=1&subsecid=8>More</a>";
	}
	
//var currDivObj;
//currDivObj = document.getElementById("NewsH");
//currDivObj.innerHTML="<img src=../CommonImgs/loading7.gif>";
CreateXmlHttp3();

document.body.style.cursor = "progress";
var reqUrl="../NewsInnerDataHot.aspx?NewsId="+ newsid +"&IpTrack="+ window.location.hostname +"&timeStamp="+new Date().getTime();

if(XmlHttp3)	{
				XmlHttp3.onreadystatechange = function(){NewsEcoForDetails();};
				XmlHttp3.open("GET", reqUrl, true);
				XmlHttp3.send(null);
			}
}

function NewsEcoForDetails()
{
// To make sure receiving response data from server is completed
if(XmlHttp3.readyState == 4)
		{
			// To make sure valid response is received from the server, 200 means response received is OK
			if(XmlHttp3.status == 200)
			{
			var strNewsData = XmlHttp3.responseText;
			//var a=document.getElementById("NH");
			
			document.getElementById("Eco").innerHTML = strNewsData;
			document.body.style.cursor="auto";
			}
			else
				document.getElementById("Eco").innerHTML = "<img src='../images/loading7.gif'>";
		}
}
//for NSE BSE announcement

function Announcement(Exchg)
{
document.getElementById("NseBse").innerHTML = "<img src='../images/loading7.gif'>";
if(Exchg=='bse')
{
	document.getElementById("bse").className = "tabsection06";
	document.getElementById("bse").style.cursor = "";
	document.getElementById("nse").className = "tabsection07";
	document.getElementById("nse").style.cursor = "hand";
	document.getElementById("moreBseNseAnn").innerHTML = "<img src=../images/bullet_more01.gif align=absmiddle> &nbsp;<a target=_parent href=http://www.hdfcsec.com/Equity/IntEquity.aspx?Heading=CorporateAnnouncement&Query=http://www.hdfcsec.cmlinks.com/Bulletin/announcements.aspx?Exchg=bse>More</a>";
}
else
{	
	document.getElementById("nse").className = "tabsection06";
	document.getElementById("nse").style.cursor = "";
	document.getElementById("bse").className = "tabsection07";
	document.getElementById("bse").style.cursor = "hand";
	document.getElementById("moreBseNseAnn").innerHTML = "<img src=../images/bullet_more01.gif align=absmiddle> &nbsp;<a target=_parent href=http://www.hdfcsec.com/Equity/IntEquity.aspx?Heading=CorporateAnnouncement&Query=http://www.hdfcsec.cmlinks.com/Bulletin/announcements.aspx?Exchg=nse>More</a>";
}
CreateXmlHttp4();

document.body.style.cursor = "progress";
var reqUrl="../AnnounceData.aspx?Exchg="+ Exchg +"&IpTrack="+ window.location.hostname +"&timeStamp="+new Date().getTime();

if(XmlHttp4)	{
				XmlHttp4.onreadystatechange = function(){AnnounceDetails();};
				XmlHttp4.open("GET", reqUrl, true);
				XmlHttp4.send(null);
			}
}

function AnnounceDetails()
{
// To make sure receiving response data from server is completed
if(XmlHttp4.readyState == 4)
		{
			// To make sure valid response is received from the server, 200 means response received is OK
			if(XmlHttp4.status == 200)
			{
			var strAnnoData = XmlHttp4.responseText;
			//var a=document.getElementById("NH");
			
			document.getElementById("NseBse").innerHTML = strAnnoData;
			document.body.style.cursor="auto";
			}
			else
				document.getElementById("NseBse").innerHTML = "<img src='../images/loading7.gif'>";
		}
}


/*for search company*/

	
function SearchQuote()
	{
	
		
		var SrchQuote = document.getElementById("txt_Symbol").value;
		var PageId = document.getElementById("DD_Options").value;	
		
		if(SrchQuote =="" || SrchQuote=="Enter Company Name")
		{
			alert("Please enter company name ..!!!");
			return false;
		}
		
		else
		{
					var strReplaceAll =SrchQuote;
					var intIndexOfMatch = strReplaceAll.indexOf( "'" );
					while (intIndexOfMatch != -1)
					{
						strReplaceAll = strReplaceAll.replace( "'", "" )
						intIndexOfMatch = strReplaceAll.indexOf( "'" );
						
					}
					var StrUrl = "CompSearch.aspx?schtxt="+strReplaceAll+"&id="+PageId;
					window.location = StrUrl;
		}
				
   }
   
function Event(e,id)
{
		if(e.keyCode==13)	
		{
			//var Scripid = document.getElementById(id);
			var boolval = SearchQuote();
			if(boolval)
			return true;
			else
			return false;
		}	
}

function EnterScript1(e,id)
{
	if(e.keyCode==13)	
	{
		var Scripid = document.getElementById(id);
		Scripid.click();
	}
}


function Compempty()
{
	if (document.getElementById("txt_Symbol").value=="Enter Company Name")
	{
  		document.getElementById("txt_Symbol").value="";
	}
}

function Compfill()
{
	var getquote=document.getElementById("txt_Symbol").value;
	if (getquote=="")
	{
		document.getElementById("txt_Symbol").value="Enter Company Name";
	}
}


function Compempty1()
{
	if (document.getElementById("txt_Quote2").value=="Change Company")
	{
  		document.getElementById("txt_Quote2").value="";
	}
}

function Compfill1()
{
	var getquote=document.getElementById("txt_Quote2").value;
	if (getquote=="")
	{
		document.getElementById("txt_Quote2").value="Change Company";
	}
}

function CompValidate()
{					
		var SrchQuote = document.getElementById("txt_Quote2").value;
	//	var PageId = document.getElementById("DD_Options").value;
		if(SrchQuote =="" || SrchQuote=="Enter Company Name...!!!" || SrchQuote=="Change Company")
		{
			alert("Please enter company name ..!!!");
			return false;
		}
		else 
		{
				var strReplaceAll =SrchQuote;
				var intIndexOfMatch = strReplaceAll.indexOf( "'" );
				while (intIndexOfMatch != -1)
				{
					strReplaceAll = strReplaceAll.replace( "'", "" )
					intIndexOfMatch = strReplaceAll.indexOf( "'" );
					
				}
				var StrUrl = "../Profiles/CompSearch.aspx?id=13&schtxt="+strReplaceAll;
				//var StrUrl = "../Profiles/CompSearch.aspx?schtxt="+strReplaceAll+"&id=13";						
				window.location=StrUrl;
		}		
}

 //This is for bulletin
 function ShowA2Z(redUrl_,Index)
 {
 	var A2ZIndexId = document.getElementById("A2ZTd");
	if(A2ZIndexId.innerHTML=="")
	{
		var A2Z="";A2ZClass ="";
			for(i=65; i<=90; i++)				
			{
				var Alpha = String.fromCharCode(i);
				A2ZClass = (Index==Alpha) ? "IndexLinkSel" : "IndexLink";
				A2Z += "<a href='"+redUrl_+"&Index="+ Alpha +"' class="+ A2ZClass+ ">"+ Alpha +"</a>";
			}
			A2ZClass = (Index=="0-9") ? "IndexLinkSel" : "IndexLink";	
			A2ZIndexId.innerHTML = A2Z + "<a href='"+redUrl_+"&Index=0-9' class="+ A2ZClass +">0-9</a>";
	}
	else
		A2ZIndexId.innerHTML = "";			
}


//Mutual Fund



function CreateXmlHttpNew()
	{
		//Creating object of XMLHTTP in IE
		try
		{
			XmlHttpCom = new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch(e)
		{
			try
			{
				XmlHttpCom = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch(oc)
			{
				XmlHttpCom = null;	
			}
		}
		//Creating object of XMLHTTP in Mozilla and Safari 
		if(!XmlHttpCom && typeof XMLHttpRequest != "undefined") 
		{
			XmlHttpCom = new XMLHttpRequest();
		}
		
	}


function SelectNewScheme()
	{
		var fund = document.getElementById("_ctl0_drp_FundHouse");
		var category = document.getElementById("_ctl0_drp_Category");
		var scheme = document.getElementById("_ctl0_drp_Scheme");
		scheme.length = 0;
		scheme.options[0] = new Option(); 
		scheme.options[0].value = "";
		scheme.options[0].text = "Select Scheme";	
		CreateXmlHttpNew();		
		document.body.style.cursor = "progress";
		var requestUrl = "MF_CategoryData.aspx?Fund="+ fund.value;
		if(XmlHttpCom)	{
					XmlHttpCom.onreadystatechange = function(){getSchemeResp1(category);};
					XmlHttpCom.open("GET", requestUrl,  true);
					XmlHttpCom.send(null);
				}
	}
	
	
	
	function getSchemeResp1(ig_)
{
	
	// To make sure receiving response data from server is completed
	if(XmlHttpCom.readyState == 4)
	{
		// To make sure valid response is received from the server, 200 means response received is OK
		if(XmlHttpCom.status == 200)
		{
			//alert(ig_)
			//var availSchemes   = document.getElementById(ig_);
			var strData = XmlHttpCom.responseText
			if(strData != "") {	
				var arrSchm = strData.split("|");
					ig_.length = 0;
					ig_.options[0] = new Option(); 
					ig_.options[0].value = "";
					ig_.options[0].text = "Select Category";	
				for(i=1; i<arrSchm.length; i++) {	
					var strSchm = arrSchm[i];
					var arrSchmCode = strSchm.split("~");
					ig_.options[i] = new Option();
					ig_.options[i].value = arrSchmCode[0];
					ig_.options[i].text = arrSchmCode[1];
				}
			}
			else {
					ig_.length = 0;
					ig_.options[0] = new Option(); 
					ig_.options[0].value = "";
					ig_.options[0].text = "No Categories available";			
			}
			document.body.style.cursor = "auto";
				
		}
		else {
					ig_.length = 0;
					ig_.options[0] = new Option(); 
					ig_.options[0].value = "";
					ig_.options[0].text = "server is not ready";
					document.body.style.cursor = "auto";		
		}
	}
}



function SelectScheme(ig_,ig_a,ig_b)
	{

		
		var fund = document.getElementById("_ctl0_drp_FundHouse");
		var category = document.getElementById("_ctl0_drp_Category");
		var scheme = document.getElementById("_ctl0_drp_Scheme");
		
		CreateXmlHttpNew();
		document.body.style.cursor = "progress";
		var requestUrl = "MF_SchemeData.aspx?IpTrack="+ window.location.hostname +"&timeStamp="+ new Date().getTime() +"&Fund="+ fund.value +"&Category="+category.value;
		
		if(XmlHttpCom)	{
					XmlHttpCom.onreadystatechange = function(){getSchemeResp(scheme)};
					XmlHttpCom.open("GET", requestUrl,  true);
					XmlHttpCom.send(null);
				}
	}
	
//Called when response comes back from server Only For MF_SchemeData
function getSchemeResp(ig_)
{

	// To make sure receiving response data from server is completed
	if(XmlHttpCom.readyState == 4)
	{
		// To make sure valid response is received from the server, 200 means response received is OK
		if(XmlHttpCom.status == 200)
		{
			//alert(ig_)
			//var availSchemes   = document.getElementById(ig_);
			var strData = XmlHttpCom.responseText
			if(strData != "") {	
				var arrSchm = strData.split("|");
				ig_.length = 0; 	
				for(i=0; i<arrSchm.length-1; i++) {	
					var strSchm = arrSchm[i];
					var arrSchmCode = strSchm.split("~");
					ig_.options[i] = new Option();
					ig_.options[i].value = arrSchmCode[0];
					ig_.options[i].text = arrSchmCode[1];
				}
			}
			else {
					ig_.length = 0;
					ig_.options[0] = new Option(); 
					ig_.options[0].value = "";
					ig_.options[0].text = "Scheme is not available";			
			}
			document.body.style.cursor = "auto";	
		}
		else {
					ig_.length = 0;
					ig_.options[0] = new Option(); 
					ig_.options[0].value = "";
					ig_.options[0].text = "server is not ready";
					document.body.style.cursor = "auto";		
		}
	}
}





function redUrl_FandO(ig_,ig_a,ig_b){
		var in_="",s_="";
		var qr_Str = ig_a.split("|");
		in_ = "&InstName="+ qr_Str[0]
		if(qr_Str.length==2)
			s_ = "&Symbol="+ qr_Str[1]
		document.location = ig_+ig_b+in_+s_;
}

function OptChange_FandO(ig_,ig_a){
		var Index = document.getElementById(ig_);
		Index.length = 0;
		for(var i=0; i < arrFAO.length; i++)
		{
			Index.options[i] = new Option(); 
			Index.options[i].value = arrFAOCode[i];
			Index.options[i].text = arrFAO[i];
			if(ig_a==arrFAOCode[i])
				Index.options[i].selected = true;
		}
}


/*function Reckoner(url,opt,title)
{
    window.scroll(0,0);
	var Win;
	Win = document.getElementById("cm_window2").style.display='inline';

	var currentDivObj,currentTitle
	currentTitle = document.getElementById("Title");

	if(opt=="in")
	{
		currentDivObj = document.getElementById("NLIDetails");
		currentDivObj.innerHTML ="<table cellspacing=0 cellpadding=0 height=140px align='center'><tr><td><img src=../images/loading1.gif ></td></tr></table>";
	}
	
	CreateXmlHttp();
	document.body.style.cursor = "progress";
	var requestUrl = url;

	if(XmlHttp)
	{
		XmlHttp.onreadystatechange = function(){NLIDetails(opt);};
		XmlHttp.open("GET", requestUrl,  true);
		XmlHttp.send(null);
	}   
}

function NLIDetails(opt)
{
	// To make sure receiving response data from server is completed
	//alert(XmlHttp.readyState)
	if(XmlHttp.readyState == 4)
	{
		// To make sure valid response is received from the server, 200 means response received is OK
		//alert(XmlHttp.responseText)
		if(XmlHttp.status == 200)
		{
			if(opt=="in")
			{
				document.getElementById("NLIDetails").innerHTML = XmlHttp.responseText;				
				document.body.style.cursor = "auto";
			}
		}
		else
		{
			if(opt=="in")
			{
				document.getElementById("NLIDetails").innerHTML = "<img src='../images/loading1.gif'>";
		    }
		}

	}
}


var XmlHttp;
//Creating object of XMLHTTP For AJAX Method
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 Newspopup() 					
    {	
	    var strUrl="../IPO/iporating.aspx";
	   // document.getElementById("NewsId").innerHTML="<table cellpadding='0' cellspacing='0' width='100%'><tr><td align='center'><img src='../images/loadig1.gif'></td></tr></table>";
	    var newWin=window.open(strUrl,'FavWindow','x=0,y=0,toolbar=no,titlebar=no,location=no,directories=no,status=no,scrollbars=no,resizable=0,copyhistory=no,width=500,height=210,screenX=0,screenY=0,left=260,top=50');	
	    newWin.focus();
    }	