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 FundInfo*/
function CreateXmlHttpMFInfo()
{
	//Creating object of XMLHTTP in IE
	try
	{
		XmlHttpMFInfo = new ActiveXObject("Msxml2.XMLHTTP");
	}
	catch(e)
	{
		try
		{
			XmlHttpMFInfo = new ActiveXObject("Microsoft.XMLHTTP");
		} 
		catch(oc)
		{
			XmlHttpMFInfo = null;	
		}
	}
	//Creating object of XMLHTTP in Mozilla and Safari 
	if(!XmlHttpMFInfo && typeof XMLHttpRequest != "undefined") 
	{
		XmlHttpMFInfo = new XMLHttpRequest();
	}
}
//for SipCalc.ascx
function loadSipScheme(mf_code)
{
	CreateXmlHttp();
	
	//document.getElementById("MinSip").innerText="";
	document.body.style.cursor = "progress";
	if(mf_code=='')return false;
	var requestUrl = "SipCalcSchData.aspx?MF_Code="+ mf_code;
	if(XmlHttp)	{
				XmlHttp.onreadystatechange = function(){sipSchResp()}
				XmlHttp.open("GET", requestUrl,  true);
				XmlHttp.send(null);
			}
}
//Called when response comes back from server Only For sip schemes
function sipSchResp()
{
	
	if(XmlHttp.readyState == 4)
	{
		if(XmlHttp.status == 200)
		{		
		   
			var DrpScheme   = document.getElementById("Ctrl_sipCalc_DrpScheme");
			var strData = XmlHttp.responseText
			if(strData != "")
			{	
			   	
				if(strData!="NA") {
					var arrSchm = strData.split("|");
					
					var arrSCH_NAME   =eval(arrSchm[1]);
					arrMF_SCHCODE = eval(arrSchm[0]);
					arrMININVT    =eval(arrSchm[2]);
                    
						DrpScheme.length = 0;
						DrpScheme.options[0] = new Option();
						DrpScheme.options[0].value = "";
						DrpScheme.options[0].text  = "Select Scheme..";		
						
						for(i=1; i<=arrMF_SCHCODE.length; i++) {	
							DrpScheme.options[i] = new Option();
							DrpScheme.options[i].value = arrMF_SCHCODE[i-1];
							DrpScheme.options[i].text  = arrSCH_NAME[i-1].replace(/#/g,"'");
						}						
				}
				else
					fillSchDef("Scheme is not available");
			}
			else
				fillSchDef("Scheme is not available");
				document.body.style.cursor = "auto";
		}
		else
		{
			fillSchDef("server is not ready");
			document.body.style.cursor = "auto";
		}
	}
}	

/* For INOUT*/
function CreateXmlHttpINOUT()
{
	try
	{
		XmlHttpINOUT = new ActiveXObject("Msxml2.XMLHTTP");		
	}
	catch(e)
	{
		try
		{		
			XmlHttpINOUT = new ActiveXObject("Microsoft.XMLHTTP");
		}
		catch(oc)
		{
			XmlHttpINOUT = null;				
		}
	}
	if(!XmlHttpINOUT && typeof XMLHttpRequest != "undefined")
	{
		XmlHttpINOUT = new XMLHttpRequest();
	}
}	


/* For DAily Nv */
function CreateXmlHttpNAV()
{
	//Creating object of XMLHTTP in IE
	try
	{
		XmlHttpNAV = new ActiveXObject("Msxml2.XMLHTTP");
	}
	catch(e)
	{
		try
		{
			XmlHttpNAV = new ActiveXObject("Microsoft.XMLHTTP");
		} 
		catch(oc)
		{
			XmlHttpNAV = null;	
		}
	}
	//Creating object of XMLHTTP in Mozilla and Safari 
	if(!XmlHttpNAV && typeof XMLHttpRequest != "undefined") 
	{
		XmlHttpNAV = new XMLHttpRequest();
	}
}
/* For Full Portfolio */
function CreateXmlHttpFPortfolio()
{
	//Creating object of XMLHTTP in IE
	try
	{
		XmlHttpFPortfolio = new ActiveXObject("Msxml2.XMLHTTP");
	}
	catch(e)
	{
		try
		{
			XmlHttpFPortfolio = new ActiveXObject("Microsoft.XMLHTTP");
		} 
		catch(oc)
		{
			XmlHttpFPortfolio = null;	
		}
	}
	//Creating object of XMLHTTP in Mozilla and Safari 
	if(!XmlHttpFPortfolio && typeof XMLHttpRequest != "undefined") 
	{
		XmlHttpFPortfolio= new XMLHttpRequest();
	}
}
function CreateXmlHttpFPortfolio1()
{
	//Creating object of XMLHTTP in IE
	try
	{
		XmlHttpFPortfolio1 = new ActiveXObject("Msxml2.XMLHTTP");
	}
	catch(e)
	{
		try
		{
			XmlHttpFPortfolio1 = new ActiveXObject("Microsoft.XMLHTTP");
		} 
		catch(oc)
		{
			XmlHttpFPortfolio1= null;	
		}
	}
	//Creating object of XMLHTTP in Mozilla and Safari 
	if(!XmlHttpFPortfolio1 && typeof XMLHttpRequest != "undefined") 
	{
		XmlHttpFPortfolio1= new XMLHttpRequest();
	}
}
function SelectMFSchemeFPortfolio1(ig_,ig_a,ig_b)
{
	var fund = document.getElementById("cForm_drp_FundHouse");	
	var scheme = document.getElementById("cForm_drp_Scheme");		
	
	CreateXmlHttpFPortfolio1();
	document.body.style.cursor = "progress";
	var requestUrl = "MF_SchemeData.aspx?Fund="+ encodeURIComponent(fund.value);		
	if(XmlHttpFPortfolio1)	{
				XmlHttpFPortfolio1.onreadystatechange = function(){getSchemeRespFPortfolio1(scheme)};
				XmlHttpFPortfolio1.open("GET", requestUrl,  true);
				XmlHttpFPortfolio1.send(null);
			}
}
function getSchemeRespFPortfolio1(ig_)
{
	// To make sure receiving response data from server is completed
	if(XmlHttpFPortfolio1.readyState == 4)
	{
		// To make sure valid response is received from the server, 200 means response received is OK
		if(XmlHttpFPortfolio1.status == 200)
		{
			//var availSchemes   = document.getElementById(ig_);
			var strData = XmlHttpFPortfolio1.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 SelectMFSchemeFPortfolio(ig_,ig_a,ig_b)
{
	var fund = document.getElementById("cForm_drp_FundHouse");	
	var scheme = document.getElementById("cForm_drp_Scheme");		
	
	CreateXmlHttpFPortfolio();
	document.body.style.cursor = "progress";
	var requestUrl = "MF_SchemeData.aspx?Fund="+ encodeURIComponent(fund.value);		
	if(XmlHttpFPortfolio)	{
				XmlHttpFPortfolio.onreadystatechange = function(){getSchemeRespFPortfolio(scheme)};
				XmlHttpFPortfolio.open("GET", requestUrl,  true);
				XmlHttpFPortfolio.send(null);
			}
}
function getSchemeRespFPortfolio(ig_)
{
	// To make sure receiving response data from server is completed
	if(XmlHttpFPortfolio.readyState == 4)
	{
		// To make sure valid response is received from the server, 200 means response received is OK
		if(XmlHttpFPortfolio.status == 200)
		{
			//var availSchemes   = document.getElementById(ig_);
			var strData = XmlHttpFPortfolio.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 SelectMFScheme(ig_,ig_a,ig_b)
{
	var fund = document.getElementById("cForm_drp_FundHouse");
	var category = document.getElementById("cForm_drp_Category");
	var scheme = document.getElementById("cForm_drp_Scheme");		
	
	CreateXmlHttp();
	document.body.style.cursor = "progress";
	var requestUrl = "MF_SchemeData.aspx?Fund="+ encodeURIComponent(fund.value) +"&Category="+encodeURIComponent(category.value);		
	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)
		{
			//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 for Performers */
var xmlHttpPer

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 showFundPerform()
{
	var url="TopPF.aspx?id="+document.getElementById("id").value+"&fid=" + Math.random() + "&gltype=T&duration=" + document.getElementById("cForm_cmbDuration").value+ "&stype=" + document.getElementById("cForm_cmbScheme").value
	//alert(url);
	xmlHttpPer = GetXmlHttpObject(stateChanged)
	xmlHttpPer.open("GET", url , true)
	xmlHttpPer.send(null)
}

function stateChanged()
{
	if (xmlHttpPer.readyState==4 || xmlHttpPer.readyState=="complete")
	{
		document.getElementById("txtHint").innerHTML = xmlHttpPer.responseText
	}
	else
	{
		document.getElementById("txtHint").innerHTML="<img src='../images/loading.gif' width='130' height='60' align=center>";
	}
}
function showSnapChart(code,period)
{
	var period;
	var periodVal = period.substr(0,1);
	var period = period.substr(1,1)
	document.getElementById("SnapChart").src= "mfchart.aspx?MFcode="+ code +"&Period="+ period +"&PeriodVal="+periodVal;
}
function showAssetChart(code,opt)
{
	var opt;
	document.getElementById("AssetChart").src= "AssetChart.aspx?MFcode="+ code +"&opt="+opt;
}

/* Function used for Daily NAV */
function SelectScheme1(ig_,ig_a,ig_b)
{
	var fund = document.getElementById("drp_FundHouse");
	var category = document.getElementById("drp_Category");
	//var scheme = document.getElementById("_ctl0_drp_Scheme");
		
	CreateXmlHttpNAV();
	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(XmlHttpNAV)	{
				XmlHttpNAV.onreadystatechange = function(){getSchemeResp1(category)};
				XmlHttpNAV.open("GET", requestUrl,  true);
				XmlHttpNAV.send(null);
	}
}
	
function getSchemeResp1(ig_)
{
	// To make sure receiving response data from server is completed
	if(XmlHttpNAV.readyState == 4)
	{
		// To make sure valid response is received from the server, 200 means response received is OK
		if(XmlHttpNAV.status == 200)
		{
			//alert(ig_)
			//var availSchemes   = document.getElementById(ig_);
			var strData = XmlHttpNAV.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";		
		}
	}
}
/* For FundInfo */
function SelectMFSchemeMFInfo(ig_,ig_a,ig_b)
{
	var fund = document.getElementById("cForm_drp_FundHouse");
	var category = document.getElementById("cForm_drp_Category");
	var scheme = document.getElementById("cForm_drp_Scheme");		
	
	CreateXmlHttpMFInfo();
	document.body.style.cursor = "progress";
	var requestUrl = "MF_SchemeData.aspx?Fund="+ encodeURIComponent(fund.value) +"&Category="+encodeURIComponent(category.value);		
	if(XmlHttpMFInfo)	{
				XmlHttpMFInfo.onreadystatechange = function(){getSchemeRespMFInfo(scheme)};
				XmlHttpMFInfo.open("GET", requestUrl,  true);
				XmlHttpMFInfo.send(null);
			}
}
function getSchemeRespMFInfo(ig_)
{
	// To make sure receiving response data from server is completed
	if(XmlHttpMFInfo.readyState == 4)
	{
		// To make sure valid response is received from the server, 200 means response received is OK
		if(XmlHttpMFInfo.status == 200)
		{
			//var availSchemes   = document.getElementById(ig_);
			var strData = XmlHttpMFInfo.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";		
		}
	}
}

/* For Mutual Fund INOUT*/
function SelectScheme()
{						
		var fund = document.getElementById("cForm_drp_FundHouse");
		var category = document.getElementById("cForm_drp_Category");
		var scheme = document.getElementById("cForm_drp_Scheme");
													  
		CreateXmlHttpINOUT();		
		document.body.style.cursor = "progress";			
		var requestUrl = "MF_SchemeData.aspx?Fund="+ encodeURIComponent(fund.value) +"&Category="+encodeURIComponent(category.value);		
		if(XmlHttpINOUT)
		{		
					XmlHttpINOUT.onreadystatechange = function(){getSchemeRespINOUT(scheme)};
					XmlHttpINOUT.open("GET",requestUrl,  true);
					XmlHttpINOUT.send(null);
		}
}
function getSchemeRespINOUT(ig_)
{	
	// To make sure receiving response data from server is completed
	if(XmlHttpINOUT.readyState == 4)
	{		
		// To make sure valid response is received from the server, 200 means response received is OK
		if(XmlHttpINOUT.status == 200)
		{
			
			//var availSchemes   = document.getElementById(ig_);
			var strData = XmlHttpINOUT.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";		
		}		
	}			
	///document.getElementById("Loading").innerHTML = "<table height='280'><tr><td align='center' valign='middile'><img src='../images/loading.gif' width='130' height='60'></td></tr></table>";
}

function validate()
{   
	var SIPCALC    = document.getElementById("SIPCALC");
	SIPCALC.style.display='none';
	var sch_Code  = document.getElementById("Ctrl_sipCalc_DrpScheme");
	var inv_Amnt  = document.getElementById("Ctrl_sipCalc_TxtInvstAmt");
	
	var stday     = document.getElementById("Ctrl_sipCalc_drpStDay");
    var drpStmonth= document.getElementById("Ctrl_sipCalc_drpStMn");
    var drpStyear = document.getElementById("Ctrl_sipCalc_drpStYr");
    
	var edday     = document.getElementById("Ctrl_sipCalc_drpEdDay");    
	var drpEnmonth= document.getElementById("Ctrl_sipCalc_drpEdMn");
	var drpEnyear = document.getElementById("Ctrl_sipCalc_drpEdYr");
	
	var DrpAMC = document.getElementById("Ctrl_sipCalc_DrpAMC");
	
	if(drpStyear.value=="" || drpEnyear.value=="" || drpStmonth.value=="" || drpEnmonth.value=="")
	{
		alert("End Date should be Greater than Start Date") 	
		return false; 
	}
	else if(drpStyear.value==drpEnyear.value)
	{
		if (eval(drpStmonth.value)>= eval(drpEnmonth.value))
		{
			alert("End Date should be Greater than Start Date") 	
			drpStmonth.focus()
			return false; 
		}
	}			
	else if(drpStyear.value > drpEnyear.value)
	{
		alert("End Date should be Greater than Start Date") 	
		drpStyear.focus()
		return false; 
	}
	else if(drpStyear.value%4==0 && drpStmonth.value==02 && stday.value>29)  
	{
		alert("Day can't be greater than 29");
		stday.focus();
		return false;
	}
	else if(drpStmonth.value==02 && stday.value>28)  
	{
		alert("Day can't be greater than 28");
		stday.focus();
		return false;
	}
	else if((drpStmonth.value==04 || drpStmonth.value==06 || drpStmonth.value==09 || drpStmonth.value==11) && stday.value>30)  
	{
		alert("Day can't be greater than 30");
		stday.focus();
		return false;
	}
	else if(drpEnyear.value%4==0 && drpEnmonth.value==02 && edday.value>29)  
	{
		alert("Day can't be greater than 29");
		edday.focus();
		return false;
	}
	else if(drpEnmonth.value==02 && edday.value>28)  
	{
		alert("Day can't be greater than 28");
		edday.focus();
		return false;
	}
	else if((drpEnmonth.value==04 || drpEnmonth.value==06 || drpEnmonth.value==09 || drpEnmonth.value==11) && edday.value>30)  
	{
		alert("Day can't be greater than 30");
		edday.focus();
		return false;
	}
	else if(inv_Amnt.value == "")
	{
		alert("Enter Investment amount");
		inv_Amnt.focus();
		return false;
	}
	
	var SelAMC = DrpAMC.options[DrpAMC.selectedIndex].innerText;
	if (SelAMC.indexOf("Reliance")> -1)
	{
		if (inv_Amnt.value < 100)
		{
			alert("Investment amount must be greater than 100")
			inv_Amnt.focus();
			return false;
		}
	}
	else
	{
		if (inv_Amnt.value < 500)
		{
			alert("Investment amount must be greater than 500")
			inv_Amnt.focus();
			return false;
		}
	}
			
	st_Date = drpStmonth.value +"/"+ stday.value +"/"+ drpStyear.value;
	ed_Date = drpEnmonth.value +"/"+ edday.value +"/"+ drpEnyear.value;
	
	/*if(parseInt(inv_Amnt.value)<parseInt(MinInvAmt)){
		alert("Investment Amount must be greater than SIP Amount..!");
		inv_Amnt.focus();
		inv_Amnt.value="";
		return false;
	}*/
	if(sch_Code.value==""){
		alert("Kindly Select any Scheme..!");
		sch_Code.focus();
		return false;
	}
	if(SchTypeCode==""){
		alert("This Scheme is not matching with our data..  Kindly Select another Scheme..!");
		sch_Code.focus();
		return false;
	}
	
	var SchmPlan = document.getElementById("SchmPlan");
	var SchemeName = document.getElementById("SchemeName");
	var InvAmount= document.getElementById("InvAmount");
	var InvPeriod= document.getElementById("InvPeriod");
	
	SchmPlan.innerText = sch_Code.options[sch_Code.selectedIndex].text;
	SchemeName.innerText = sch_Code.options[sch_Code.selectedIndex].text;
	InvAmount.innerText = inv_Amnt.value;
	InvPeriod.innerText = stday.value +"-"+ drpStmonth.options[drpStmonth.selectedIndex].text +"-"+ drpStyear.value +" To  "+ edday.value +"-"+ drpEnmonth.options[drpEnmonth.selectedIndex].text +"-"+ drpEnyear.value;
	//document.ImgLoad.src="images/loading.gif";
	document.body.style.cursor = "progress";
	CreateXmlHttp();
	var requestUrl = "SipCalcData.aspx?sch_Code="+ sch_Code.value +"&sch_Type="+ SchTypeCode +"&st_Date="+ st_Date +"&ed_Date="+ ed_Date +"&inv_Amnt="+inv_Amnt.value;
	//alert(requestUrl);
	//document.writeln(requestUrl);
	if(XmlHttp){
				XmlHttp.onreadystatechange = function(){sipDataResp()}
				XmlHttp.open("GET", requestUrl,  true);
				XmlHttp.send(null);
			}	
}

function MinSipAmt(schCode){
	document.body.style.cursor = "progress";
	var inv_Amnt  = document.getElementById("Ctrl_sipCalc_TxtInvstAmt");
	//inv_Amnt.value="";
	CreateXmlHttp();
	//for(i=0; i<arrMF_SCHCODE.length; i++) {
	//	if(arrMF_SCHCODE[i]==schCode) {
	//		MinInvAmt = arrMININVT[i];
			//document.getElementById("MinSip").innerText =MinInvAmt;
	//	}
	//}	
	
	var requestUrl = "SipStDtData.aspx?schCode="+ schCode;
	if(XmlHttp)	{
				XmlHttp.onreadystatechange = function(){sipDtResp()}
				XmlHttp.open("GET", requestUrl,  true);
				XmlHttp.send(null);
			}
}

function sipDataResp()
{      
	if(XmlHttp.readyState == 4)
	{
		if(XmlHttp.status == 200)
		{			
			var SIPCALC    = document.getElementById("SIPCALC");
			var strData = XmlHttp.responseText
			
			if(strData != "NA")
			{	
				var Tot_InvAmt  = document.getElementById("Tot_InvAmt");
				var Tot_UnitBuy = document.getElementById("Tot_UnitBuy");
				var Inv_ValDate = document.getElementById("Inv_ValDate");
				var Inv_Val	    = document.getElementById("Inv_Val");
				var Return	    = document.getElementById("Return");
				var EntryLoad = document.getElementById("EntryLoad");
				var ExitLoad = document.getElementById("ExitLoad");
				//var Avg_Price   = document.getElementById("Avg_Price");
				//var Act_AvgPrice= document.getElementById("Act_AvgPrice");
				var TotMonth    = document.getElementById("TotMonth");
				var SIPTable    = document.getElementById("SIPTable");
				var arrStr = strData.split("|");
					SIPTable.innerHTML = arrStr[0];
					Tot_InvAmt.innerHTML = arrStr[1];
					Tot_UnitBuy.innerHTML = arrStr[2];
					Inv_ValDate.innerHTML = arrStr[3];
					Inv_Val.innerHTML = arrStr[4];
					Return.innerHTML = arrStr[5];
					//Avg_Price.innerHTML = arrStr[6];
					//Act_AvgPrice.innerHTML = arrStr[7];
					TotMonth.innerHTML = arrStr[8];
					//
					EntryLoad.innerHTML = arrStr[9];
					ExitLoad.innerHTML = arrStr[10];
					
					//
					
					
				SIPCALC.style.display='inline';
				//document.ImgLoad.src="images/spacer.gif";
			}
			else {
				SIPCALC.style.display='inline';
				SIPCALC.innerHTML="There was a problem retrieving data from the server.";
			}	
		}
	}
	document.body.style.cursor = "auto";
}

function sipDtResp()
{
	if(XmlHttp.readyState == 4)
	{
		if(XmlHttp.status == 200)
		{			
			//var DrpScheme   = document.getElementById("DrpScheme");
			var strData = XmlHttp.responseText
			if(strData != "")
			{	
				var stDy = document.getElementById("Ctrl_sipCalc_drpStDay");
				var stMn = document.getElementById("Ctrl_sipCalc_drpStMn");
				var stYr = document.getElementById("Ctrl_sipCalc_drpStYr");
				
				var arrStr = strData.split("|");
				var arrDate = arrStr[0].split("-");
					for(i=0; i<stDy.length; i++)
						if(stDy.options[i].value==arrDate[0])stDy.options[i].selected = true;
					for(i=0; i<stMn.length; i++)
						if(stMn.options[i].value==arrDate[1])stMn.options[i].selected = true;
					for(i=0; i<stYr.length; i++){
						if(stYr.options[i].value==arrDate[2])stYr.options[i].selected = true;										
				}					
				SchTypeCode = arrStr[1];
			}
		}
	}
	document.body.style.cursor = "auto";
}

