
var xmlHttp

function GetXmlHttpObject(handler)
{ 
var objXmlHttp=null

if (navigator.userAgent.indexOf("Opera")>=0)
{
alert("This example doesn't work in Opera") 
return 
}
if (navigator.userAgent.indexOf("MSIE")>=0)
{ 
var strName="Msxml2.XMLHTTP"
if (navigator.appVersion.indexOf("MSIE 5.5")>=0)
{
strName="Microsoft.XMLHTTP"
} 
try
{ 
objXmlHttp=new ActiveXObject(strName)
objXmlHttp.onreadystatechange=handler 
return objXmlHttp
} 
catch(e)
{ 
alert("Error. Scripting for ActiveX might be disabled") 
return 
} 
} 
if (navigator.userAgent.indexOf("Mozilla")>=0)
{
objXmlHttp=new XMLHttpRequest()
objXmlHttp.onload=handler
objXmlHttp.onerror=handler 
return objXmlHttp
}
} 

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();
		}
	}
//**** 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);
	}		



function getSchemeResp1(ig_)
{
	// 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
		if(XmlHttp.status == 200)
		{
	
			//var availSchemes   = document.getElementById(ig_);
			var strData = XmlHttp.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 = "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 SelectScheme6(ig_,ig_a,ig_b)
	{

	//	var fund = document.getElementById("Base11_drp_FundHouse");
	//	var category = document.getElementById("Base11_drp_Category");
		var scheme = document.getElementById("_ctl0_drp_Scheme");		
		var TopHold=document.getElementById("Top10Hold");
		//alert(scheme.value )
		CreateXmlHttp();
		document.body.style.cursor = "progress";
		var requestUrl = "MF_SchemeData2.aspx?IpTrack="+ window.location.hostname +"&timeStamp="+ new Date().getTime() +"&Scheme="+scheme.value;
		//alert(requestUrl);
		 if(XmlHttp)	
		 {
			XmlHttp.onreadystatechange = function(){getSchemeResp3(scheme)};
			XmlHttp.open("GET", requestUrl,  true);
			XmlHttp.send(null);
		}
	}
	
	function getSchemeResp3(ig_)
	{
		var TopHold=document.getElementById("Top10Hold");
		// To make sure receiving response data from server is completed
		if(XmlHttp.readyState == 1)
		{
		TopHold.innerHTML = "<img src='../netimages/loading1.gif'>";
		}
		else if(XmlHttp.readyState == 4)
		{
			// To make sure valid response is received from the server, 200 means response received is OK
			if(XmlHttp.status == 200)
			{
				//var availSchemes   = document.getElementById(ig_);
			
				TopHold.innerHTML = XmlHttp.responseText
				document.body.style.cursor = "auto";
			//	alert(TopHold.innerHTML);
			}			
		}
	}
	function SelectScheme1(ig_,ig_a,ig_b)
	{
		//alert("a");
		var fund = document.getElementById("drp_FundHouse");
		var category = document.getElementById("drp_Category");
		CreateXmlHttp();
		document.body.style.cursor = "progress";
		var requestUrl = "MF_CategoryData.aspx?IpTrack="+ window.location.hostname +"&timeStamp="+ new Date().getTime() +"&Fund="+ fund.value;// +"&Category="+category.value;
		//alert(requestUrl);
		if(XmlHttp)	{
		            //alert("sdfsdfsf");
					XmlHttp.onreadystatechange = function(){getSchemeResp1(category)};
					XmlHttp.open("GET", requestUrl, true);
					XmlHttp.send(null);
				}
	}	
function SelectCatagory(ig_,ig_a,ig_b)
	{
		//alert("a");
		var fund = document.getElementById("_ctl0_drp_FundHouse");
		var category = document.getElementById("_ctl0_drp_Category");
	
		CreateXmlHttp();
		document.body.style.cursor = "progress";
		var requestUrl = "MF_CategoryData.aspx?IpTrack="+ window.location.hostname +"&timeStamp="+ new Date().getTime() +"&Fund="+ fund.value;// +"&Category="+category.value;
	//	alert(requestUrl);
		if(XmlHttp)	{
		            //alert("sdfsdfsf");
					XmlHttp.onreadystatechange = function(){getSchemeResp1(category)};
					XmlHttp.open("GET", requestUrl, true);
					XmlHttp.send(null);
				}
	}	
	function ShowCalendar()
	{
	
		Calendar.setup({
		button         :   "image1",
		inputField     :   "From_Date",   
		ifFormat       :   "%m/%d/%Y", 
		eventName	   :   "click",
		singleClick	   :   true 
					});
	}
	function ShowCalendar1()
	{
		Calendar.setup({
		button         :   "image2",
		inputField     :   "To_Date",   
		ifFormat       :   "%m/%d/%Y", 
		eventName	   :   "click",
		singleClick	   :   true 
					});
	}
	
	/*	function ChangePage_scheme(PageNo,category,period)
	{
	    alert();
		alert(PageNo);
		alert(category);
		alert(period);
		var Last =document.getElementById("Lastpage");
		var Prev=document.getElementById("PrevPage");
		var Next=document.getElementById("NextPage");
		
		var StrUrl = "AjaxSchemeSynopsis.aspx?Category="+category+"&period="+period+"&PageNo=0";
	
		if(PageNo == "L")
		{
			var StrUrl = "AjaxSchemeSynopsis.aspx?Category="+category+"&period="+period+"&PageNo="+Last.value;
		}
		else if (PageNo =="P")
		{
			var StrUrl = "AjaxSchemeSynopsis.aspx?Category="+category+"&period="+period+"&PageNo="+Prev.value;
		}
		else if (PageNo =="N")
		{
			var StrUrl = "AjaxSchemeSynopsis.aspx?Category="+category+"&period="+period+"&PageNo="+Next.value;
		}
		alert(StrUrl);
		var ajax = new Ajax.Updater('tdSchemeSynopsis',StrUrl);
}*/

//historical Nav start ......

	
			
		//historical nav end 
		
		
		//scheme synopsis
	function ChangePage_scheme(PageNo)
	{
		var Last =document.getElementById("Lastpage");
		var Prev=document.getElementById("PrevPage");
		var Next=document.getElementById("NextPage");
		
		var category=document.getElementById("category").value;
		var period=document.getElementById("period").value;	
		
		var StrUrl = "AjaxSchemeSynopsis.aspx?Category="+category+"&period="+period+"&PageNo=0";
	
		if(PageNo == "L")
		{
			var StrUrl = "AjaxSchemeSynopsis.aspx?Category="+category+"&period="+period+"&PageNo="+Last.value;
		}
		else if (PageNo =="P")
		{
			var StrUrl = "AjaxSchemeSynopsis.aspx?Category="+category+"&period="+period+"&PageNo="+Prev.value;
		}
		else if (PageNo =="N")
		{
			var StrUrl = "AjaxSchemeSynopsis.aspx?Category="+category+"&period="+period+"&PageNo="+Next.value;
		}
		//tdSchemeSynopsis.innerHTML="<img src='../images/loading.gif'>";
		tdSchemeSynopsis.innerHTML="<table cellpadding='0' cellspacing='0' border='0' width='100%' height='457px'><tr><td align='center' valign='middle'><img src='../images/loading.gif' align='absmiddle'></td></tr></table>";
		var ajax = new Ajax.Updater('tdSchemeSynopsis',StrUrl);		
	}

function Category_Sorting(category,period,PageNo,FieldName,Order)
	{
	
	  if(Order=="Desc")
	  {
	    //alert(document.getElementById("img_1"));
	    document.getElementById("img_1").src="../images/dn.gif";	 
	  }
	  else
	  {
		//alert();	   
		document.getElementById("img_1").src="../images/up1.gif";	   
	  }
	//  alert(document.getElementById("img_1"));
		var Url = "AjaxSchemeSynopsis.aspx?Category="+category+"&period="+period+"&PageNo=0&FieldName="+FieldName+"&Order="+Order;
		//alert(Url);
		var tdSchemeSynopsis = document.getElementById("tdSchemeSynopsis");
		//tdSchemeSynopsis.innerHTML = "<img src='../images/loading.gif'>";
		tdSchemeSynopsis.innerHTML="<table cellpadding='0' cellspacing='0' border='0' width='100%' height='457px'><tr><td align='center' valign='middle'><img src='../images/loading.gif' align='absmiddle'></td></tr></table>";
		var ajax = new Ajax.Updater('tdSchemeSynopsis',Url,{evalScripts: true});
		
	}
	
	
	//for find a fund popup
	function SelectSchemebase()
	{
	   //alert("mffund");
		var fund = document.getElementById("drp_FundHouse");
		var category = document.getElementById("drp_Category");
		var scheme = document.getElementById("drp_Scheme");
		//alert(fund);
		
		CreateXmlHttp();
		document.body.style.cursor = "progress";
		var requestUrl = "MF_SchemeData.aspx?IpTrack="+ window.location.hostname +"&timeStamp="+ new Date().getTime() +"&Fund="+ fund.value +"&Category="+category.value;
		//alert(requestUrl)
		if(XmlHttp)	{
					XmlHttp.onreadystatechange = function(){getSchemeResp(scheme)};
					XmlHttp.open("GET", requestUrl,  true);
					XmlHttp.send(null);
				}
	}
	function SelectScheme()
	{
	   //alert("mffund");
		var fund = document.getElementById("LatestNAV1_drp_FundHouse");
		var category = document.getElementById("LatestNAV1_drp_Category");
		var scheme = document.getElementById("LatestNAV1_drp_Scheme");
		//alert(fund);
		
		CreateXmlHttp();
		document.body.style.cursor = "progress";
		var requestUrl = "MF_SchemeData.aspx?IpTrack="+ window.location.hostname +"&timeStamp="+ new Date().getTime() +"&Fund="+ fund.value +"&Category="+category.value;
		//alert(requestUrl)
		if(XmlHttp)	{
					XmlHttp.onreadystatechange = function(){getSchemeResp(scheme)};
					XmlHttp.open("GET", requestUrl,  true);
					XmlHttp.send(null);
				}
	}
	function SelectSchemeHist()
	{
	   //alert("mffund");
		var fund = document.getElementById("_ctl0_drp_FundHouse");
		var category = document.getElementById("_ctl0_drp_Category");
		var scheme = document.getElementById("_ctl0_drp_Scheme");
		//alert(fund);
		
		CreateXmlHttp();
		document.body.style.cursor = "progress";
		var requestUrl = "MF_SchemeData.aspx?IpTrack="+ window.location.hostname +"&timeStamp="+ new Date().getTime() +"&Fund="+ fund.value +"&Category="+category.value;
		//alert(requestUrl)
		if(XmlHttp)	{
					XmlHttp.onreadystatechange = function(){getSchemeResp(scheme)};
					XmlHttp.open("GET", requestUrl,  true);
					XmlHttp.send(null);
				}
	}
	function getSchemeResp(ig_)
{
	
	// 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
		if(XmlHttp.status == 200)
		{
			//alert(ig_)
			//var availSchemes   = document.getElementById(ig_);
			var strData = XmlHttp.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 findfund()
 {
 //alert();
	var wind_new1;
	url="../Mutualfund/FindAFund.aspx"
	wind_new1 =  window.open(url,"","status=1,height=350,titlebar=no,width=540,resizable=0,scrollbars=1,left=200,top=100")
	wind_new1.focus();
 }
 
 function historicaldata(fund,category,MfCode,Str_Period,Str_PeriodCnt)
{
	//alert(Str_PeriodCnt);
	//document.getElementById("schemetext").style.display="inline";
	var schtxt1=document.getElementById("_ctl0_drp_Scheme")
	var schtxt=schtxt1.options[schtxt1.selectedIndex].text;	
		//alert(MfCode);
	if(fund=="")
	{
		alert("Please Select a Fund");
	}
	else if(category=="")
	{
		alert("Please Select a Category");
	}
	else if(MfCode=="")
	{
		alert("Please Select a Scheme");
	}
	else
	{
		var url="HistoricalNAVData.aspx?fund="+fund+"&category="+category+"&mfcode="+MfCode+"&Str_Period="+Str_Period+"&Str_PeriodCnt="+Str_PeriodCnt+"&schtxt="+schtxt;
		//document.getElementById('histnav').innerHTML = "<table cellpadding=0  cellspacing=0 border=0 width='100%'><tr><td align=center><img src='../images/loading.gif'></td></tr></table>";
		//alert(url);
		var ajax = new Ajax.Updater('histnav',url);
	}
	//alert(url);
}
function ChangePage_Historical(PageNo,mfcode,fund,category,period,periodcnt,schtxt)
{

	var Last =document.getElementById("Lastpage");
	var Prev=document.getElementById("PrevPage");
	var Next=document.getElementById("NextPage");
	var histnav=document.getElementById("histnav");
	
	var StrUrl = "HistoricalNAVData.aspx?mfcode="+mfcode+"&PageNo=0"+"&fund="+fund+"&category="+category+"&Str_Period="+period+"&Str_PeriodCnt="+periodcnt+"&schtxt="+schtxt;
	
	if(PageNo == "L")
	{
		var StrUrl = "HistoricalNAVData.aspx?mfcode="+mfcode+"&PageNo="+Last.value+"&fund="+fund+"&category="+category+"&Str_Period="+period+"&Str_PeriodCnt="+periodcnt+"&schtxt="+schtxt;
	}
	else if (PageNo =="P")
	{
		var StrUrl = "HistoricalNAVData.aspx?mfcode="+mfcode+"&PageNo="+Prev.value+"&fund="+fund+"&category="+category+"&Str_Period="+period+"&Str_PeriodCnt="+periodcnt+"&schtxt="+schtxt;
	}
	else if (PageNo =="N")
	{
	
		var StrUrl = "HistoricalNAVData.aspx?mfcode="+mfcode+"&PageNo="+Next.value+"&fund="+fund+"&category="+category+"&Str_Period="+period+"&Str_PeriodCnt="+periodcnt+"&schtxt="+schtxt;
		
	}
	//alert(StrUrl);
	var ajax = new Ajax.Updater('histnav',StrUrl);
}
function Top10hold()
{
	var drp_FundHouse = document.getElementById("_ctl0_drp_FundHouse");
	var drp_Category = document.getElementById("_ctl0_drp_Category");
	var drp_Scheme	= document.getElementById("_ctl0_drp_Scheme");
	if (drp_FundHouse.value == "")
		{
			alert("Select a fund house");
			//return false;
		}
		else if (drp_Category.value == "")
		{
			alert("Select a category");
			//return false;
		}
		else if (drp_Scheme.value == "")
		{
			alert("Select a scheme");
			//return false;
		}
		else
		{
			var url ="Top10Holdingsdata.aspx?mfcode="+drp_Scheme.value+"&category="+drp_Category.value+"&fund="+drp_FundHouse.value;
			//document.write(url);
			//alert(url);
			document.getElementById('td_hold').innerHTML = "<img src='../images/loading.gif'>";
			var ajax = new Ajax.Updater('td_hold',url);
		}
	
}
function B_Scheme(id,Mf_Category)
{
	if(id=="34")
	{
		var url ="BiggestSchData.aspx?Mf_Category="+Mf_Category;
	}
	else
	{
		var url ="LeastVolatileData.aspx?Mf_Category="+Mf_Category;
	}
	
	document.getElementById('td_big').innerHTML = "<img src='../images/loading.gif'>";
	
	var ajax = new Ajax.Updater('td_big',url);
}
SchemeCompareData=function (id,CatId,sch1,sch2,sch3,sch4,sch5)
{
	var drp_Category=document.getElementById("_ctl0_drp_Category").value;
	if(drp_Category == "")
	{
	alert("Please Select the Category");
	return false;
	}
	else if(sch1== sch2)
	{
		alert("Please Select different Schemes");
		return false;
	}
	/*else if(sch1 == sch3)
	{
		alert("Please Select different Schemes");
		return false;
	}
	else if(sch1 == sch4)
	{
		alert("Please Select different Schemes");
		return false;
	}
		else if(sch1 == sch5)
	{
		alert("Please Select different Schemes");
		return false;
	}*/
	else
	{
		if(id=="36")
		{
			var url="SchemeComparisonData.aspx?CatId="+CatId+"&sch1="+sch1+"&sch2="+sch2+"&sch3="+sch3+"&sch4="+sch4+"&sch5="+sch5
			//alert(url);
		}
		else
		{
			var url="portfoliocomparisondata.aspx?CatId="+CatId+"&sch1="+sch1+"&sch2="+sch2
		}
			
				//alert(url);
		var ajax = new Ajax.Updater('ScThCompId',url,{evalScripts: true});
	}
	
}
function SelectScheme2()
	{
		var category = document.getElementById("_ctl0_drp_Category");
		CreateXmlHttp();
		document.body.style.cursor = "progress";
		//document.getElementById("_ctl0_Mf_Loading").style.display="inline";
		
		
		var requestUrl = "SelectSchemeData.aspx?Category="+category.value;
	//			alert(requestUrl);
		if(XmlHttp)	
		{
			XmlHttp.onreadystatechange = function(){getSchemeResp2()};
			XmlHttp.open("GET", requestUrl,  true);
			XmlHttp.send(null);
		}
	}

function getSchemeResp2()
{
	
	// 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 Scheme1 = document.getElementById("_ctl0_Drp_Scheme1")
		var Scheme2 = document.getElementById("_ctl0_Drp_Scheme2")
		
	//	alert(Scheme1);
		
		if(XmlHttp.status == 200)
		{
			
		//	document.getElementById("SchemeTD").style.display="inline";
			//document.getElementById("_ctl0_Mf_Loading").style.display="none";
		
			var strData = XmlHttp.responseText
			
			if(strData != "")
			{	
				var arrSchm = strData.split("|");
				Scheme1.length = 0; 
				Scheme2.length = 0; 	
				
				for(i=0; i<arrSchm.length-1; i++)
				{	
					var strSchm = arrSchm[i];
					var arrSchmCode = strSchm.split("~");
					Scheme1.options[i] = new Option();
					Scheme1.options[i].value = arrSchmCode[0];
					Scheme1.options[i].text = arrSchmCode[1];
					Scheme2.options[i] = new Option();
					Scheme2.options[i].value = arrSchmCode[0];
					Scheme2.options[i].text = arrSchmCode[1];
					
				}
			}
			else {
					Scheme1.length = 0;
					Scheme1.options[0] = new Option(); 
					Scheme1.options[0].value = "";
					Scheme1.options[0].text = "Scheme is not available";	
					Scheme2.length = 0;
					Scheme2.options[0] = new Option(); 
					Scheme2.options[0].value = "";
					Scheme2.options[0].text = "Scheme is not available";
							
				 }
			
			
			document.body.style.cursor = "auto";	
		}
		else {
					Scheme1.length = 0;
					Scheme1.options[0] = new Option(); 
					Scheme1.options[0].value = "";
					Scheme1.options[0].text = "server is not ready";
					document.body.style.cursor = "auto";	
					Scheme2.length = 0;
					Scheme2.options[0] = new Option(); 
					Scheme2.options[0].value = "";
					Scheme2.options[0].text = "server is not ready";
					document.body.style.cursor = "auto";	
					
							
		}
	}
}



function SelectScheme2_Port()
	{
		var category = document.getElementById("_ctl0_drp_Category");
		CreateXmlHttp();
		document.body.style.cursor = "progress";
		//document.getElementById("_ctl0_Mf_Loading").style.display="inline";
		
		
		var requestUrl = "SelectSchemeData.aspx?Category="+category.value;
	//			alert(requestUrl);
		if(XmlHttp)	
		{
			XmlHttp.onreadystatechange = function(){getSchemeResp2_Port()};
			XmlHttp.open("GET", requestUrl,  true);
			XmlHttp.send(null);
		}
	}

function getSchemeResp2_Port()
{
	
	// 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 Scheme1 = document.getElementById("_ctl0_Drp_Scheme1")
		var Scheme2 = document.getElementById("_ctl0_Drp_Scheme2")
		var Scheme3 = document.getElementById("_ctl0_Drp_Scheme3")
		var Scheme4 = document.getElementById("_ctl0_Drp_Scheme4")
		var Scheme5 = document.getElementById("_ctl0_Drp_Scheme5")
		
	//	alert(Scheme1);
		
		if(XmlHttp.status == 200)
		{
			
		//	document.getElementById("SchemeTD").style.display="inline";
			//document.getElementById("_ctl0_Mf_Loading").style.display="none";
		
			var strData = XmlHttp.responseText
			
			if(strData != "")
			{	
				var arrSchm = strData.split("|");
				Scheme1.length = 0; 
				Scheme2.length = 0; 	
				Scheme3.length = 0;
				Scheme4.length = 0;
				Scheme5.length = 0;
				for(i=0; i<arrSchm.length-1; i++)
				{	
					var strSchm = arrSchm[i];
					var arrSchmCode = strSchm.split("~");
					Scheme1.options[i] = new Option();
					Scheme1.options[i].value = arrSchmCode[0];
					Scheme1.options[i].text = arrSchmCode[1];
					Scheme2.options[i] = new Option();
					Scheme2.options[i].value = arrSchmCode[0];
					Scheme2.options[i].text = arrSchmCode[1];
					Scheme3.options[i] = new Option();
					Scheme3.options[i].value = arrSchmCode[0];
					Scheme3.options[i].text = arrSchmCode[1];
					Scheme4.options[i] = new Option();
					Scheme4.options[i].value = arrSchmCode[0];
					Scheme4.options[i].text = arrSchmCode[1];
					Scheme5.options[i] = new Option();
					Scheme5.options[i].value = arrSchmCode[0];
					Scheme5.options[i].text = arrSchmCode[1];
				}
			}
			else {
					Scheme1.length = 0;
					Scheme1.options[0] = new Option(); 
					Scheme1.options[0].value = "";
					Scheme1.options[0].text = "Scheme is not available";	
					Scheme2.length = 0;
					Scheme2.options[0] = new Option(); 
					Scheme2.options[0].value = "";
					Scheme2.options[0].text = "Scheme is not available";
					Scheme3.length = 0;
					Scheme3.options[0] = new Option(); 
					Scheme3.options[0].value = "";
					Scheme3.options[0].text = "Scheme is not available";
					Scheme4.length = 0;
					Scheme4.options[0] = new Option(); 
					Scheme4.options[0].value = "";
					Scheme4.options[0].text = "Scheme is not available";
					Scheme5.length = 0;
					Scheme5.options[0] = new Option(); 
					Scheme5.options[0].value = "";
					Scheme5.options[0].text = "Scheme is not available";			
				 }
			
			
			document.body.style.cursor = "auto";	
		}
		else {
					Scheme1.length = 0;
					Scheme1.options[0] = new Option(); 
					Scheme1.options[0].value = "";
					Scheme1.options[0].text = "server is not ready";
					document.body.style.cursor = "auto";	
					Scheme2.length = 0;
					Scheme2.options[0] = new Option(); 
					Scheme2.options[0].value = "";
					Scheme2.options[0].text = "server is not ready";
					document.body.style.cursor = "auto";	
					Scheme3.length = 0;
					Scheme3.options[0] = new Option(); 
					Scheme3.options[0].value = "";
					Scheme3.options[0].text = "server is not ready";
					document.body.style.cursor = "auto";	
					Scheme4.length = 0;
					Scheme4.options[0] = new Option(); 
					Scheme4.options[0].value = "";
					Scheme4.options[0].text = "server is not ready";
					document.body.style.cursor = "auto";	
					Scheme5.length = 0;
					Scheme5.options[0] = new Option(); 
					Scheme5.options[0].value = "";
					Scheme5.options[0].text = "server is not ready";
					document.body.style.cursor = "auto";			
		}
	}
}	
InOut_Schemedata=function(fund,category,mfcode)
{	
	if(fund=="")
	{
		alert("Please Select a Fund");
	}
	else if(category=="")
	{
		alert("Please Select a Category");
	}
	else if(mfcode=="")
	{
		alert("Please Select a Scheme");
	}
	else
	{
		var inouturl ="inoutdata.aspx?mfcode="+mfcode;
	//	alert(inouturl);
		//document.getElementById('inout').innerHTML = "<table cellpadding=0  cellspacing=0 border=0 width='100%'><tr><td align=center><img src='../images/loading.gif'></td></tr></table>";
		var ajax = new Ajax.Updater('inout',inouturl,{evalScripts: true});
	}
}
function FundRank(Fund,Category,Period)
{
	var url="FundRankingData.aspx?Fund="+Fund+"&Category="+Category+"&Period="+Period;
	//alert(url);
	document.getElementById('td_fundrank').innerHTML = "<table cellpadding=0  cellspacing=0 border=0 width='100%'><tr><td align=center><img src='../images/loading.gif'></td></tr></table>";
	var ajax = new Ajax.Updater('td_fundrank',url);
}
function FundSelect(FundType,AMCCODE,CatCode,SchAge,FRetCode,FRetValue,RankCode,RankValue,IndCode,IndValue,AssetSize,LatNav)
{
//alert(IndCode);
//alert(IndValue);
	if(IndValue!="Any" && IndCode=="Any")
	{
		alert("Select any Sector Holdings..! ");
		document.getElementById("_ctl0_DrpSec").focus();
		return; 
	}
	else
	{
		var url="FundSelectorData.aspx?FundType="+FundType+"&AMCCODE="+AMCCODE+"&CatCode="+CatCode+"&SchAge="+SchAge+"&FRetCode="+FRetCode+"&FRetValue="+FRetValue+"&RankCode="+RankCode+"&RankValue="+RankValue+"&IndCode="+IndCode+"&IndValue="+IndValue+"&AssetSize="+AssetSize+"&LatNav="+LatNav+"   ";
		document.getElementById('td_Selector').innerHTML = "<table cellpadding=0  cellspacing=0 border=0 width='100%'><tr><td align=center><img src='../images/loading.gif'></td></tr></table>";
		var ajax = new Ajax.Updater('td_Selector',url);
	}
	return;
		
}
function ChangePage_FundRanking(PageNo,Fund,Category,Period)
{

	var Last =document.getElementById("Lastpage");
	var Prev=document.getElementById("PrevPage");
	var Next=document.getElementById("NextPage");
	
	var StrUrl = "FundRankingData.aspx?Fund="+Fund+"&Category="+Category+"&Period="+Period+"&PageNo="+0;
	
	if(PageNo == "L")
	{
		var StrUrl = "FundRankingData.aspx?Fund="+Fund+"&Category="+Category+"&Period="+Period+"&PageNo="+Last.value;
	}
	else if (PageNo =="P")
	{
		var StrUrl = "FundRankingData.aspx?Fund="+Fund+"&Category="+Category+"&Period="+Period+"&PageNo="+Prev.value;
	}
	else if (PageNo =="N")
	{
		
		var StrUrl = "FundRankingData.aspx?Fund="+Fund+"&Category="+Category+"&Period="+Period+"&PageNo="+Next.value;
		
		
	}
	var ajax = new Ajax.Updater('td_fundrank',StrUrl);
}

function ChangePage_FundSelect(PageNo,FundType,AMCCODE,CatCode,SchAge,FRetCode,FRetValue,RankCode,RankValue,IndCode,IndValue,AssetSize,LatNav,Field,Order)
{

	var Last =document.getElementById("Lastpage");
	var Prev=document.getElementById("PrevPage");
	var Next=document.getElementById("NextPage");
	
	
	var StrUrl="FundSelectorData.aspx?FundType="+FundType+"&AMCCODE="+AMCCODE+"&CatCode="+CatCode+"&SchAge="+SchAge+"&FRetCode="+FRetCode+"&FRetValue="+FRetValue+"&RankCode="+RankCode+"&RankValue="+RankValue+"&IndCode="+IndCode+"&IndValue="+IndValue+"&AssetSize="+AssetSize+"&LatNav="+LatNav+"&PageNo=0&FieldName="+Field+"&Order="+Order;
	if(PageNo == "L")
	{
		var StrUrl = "FundSelectorData.aspx?FundType="+FundType+"&AMCCODE="+AMCCODE+"&CatCode="+CatCode+"&SchAge="+SchAge+"&FRetCode="+FRetCode+"&FRetValue="+FRetValue+"&RankCode="+RankCode+"&RankValue="+RankValue+"&IndCode="+IndCode+"&IndValue="+IndValue+"&AssetSize="+AssetSize+"&LatNav="+LatNav+"&PageNo="+Last.value+"&FieldName="+Field+"&Order="+Order;
		
	}
	else if (PageNo =="P")
	{
		var StrUrl = "FundSelectorData.aspx?FundType="+FundType+"&AMCCODE="+AMCCODE+"&CatCode="+CatCode+"&SchAge="+SchAge+"&FRetCode="+FRetCode+"&FRetValue="+FRetValue+"&RankCode="+RankCode+"&RankValue="+RankValue+"&IndCode="+IndCode+"&IndValue="+IndValue+"&AssetSize="+AssetSize+"&LatNav="+LatNav+"&PageNo="+Prev.value+"&FieldName="+Field+"&Order="+Order;
		
	}
	else if (PageNo =="N")
	{
		
		var StrUrl = "FundSelectorData.aspx?FundType="+FundType+"&AMCCODE="+AMCCODE+"&CatCode="+CatCode+"&SchAge="+SchAge+"&FRetCode="+FRetCode+"&FRetValue="+FRetValue+"&RankCode="+RankCode+"&RankValue="+RankValue+"&IndCode="+IndCode+"&IndValue="+IndValue+"&AssetSize="+AssetSize+"&LatNav="+LatNav+"&PageNo="+Next.value+"&FieldName="+Field+"&Order="+Order;
		
		
	}
	
	var ajax = new Ajax.Updater('td_Selector',StrUrl);
}
