/*Fucntion for popup window: start here*/

function NewWindow(mypage, myname, w, h, scroll)
{
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable'
winprops = winprops + ',hotkeys=yes'
mypage = mypage
win = window.open(mypage, myname, winprops)
}
/*common function : Starts here*/
function numeric(field)
		{
			var ok = "yes";
			var temp;
			for (var i=0; i<field.value.length; i++)
			{
				temp = "" + field.value.substring(i, i+1);
				var charpos = temp.search("[^0-9]"); 
				if(charpos >= 0)
				{
					ok = "no";
				}
			}
			if (ok == "no") 
			{
				alert("Invalid entry! Only numbers are accepted!");
				field.value = ""
				field.focus();
				field.select();
			}
		}
/* common functions : Ends here */		
/*Functions to be used for calculator in Advisory Services.CalcInv_1: Starts Here*/
		function calculate_inv1(obj)
		{
			var amount=document.getElementById("amt").value;
			var t2=parseFloat(document.getElementById("t2").value);
			var roi2=parseFloat(document.getElementById("roi2").value)/100;
			var t2=parseFloat(document.getElementById("t2").value);
			var tp=document.getElementById("tp").options[document.getElementById("tp").selectedIndex].value;
			var comp=parseFloat(document.getElementById("comp").options[document.getElementById("comp").options.selectedIndex].value);
			//t2=t2/tp;
			if( isNaN(amount) ||isNaN(t2) ||isNaN(roi2) ||isNaN(t2) ||isNaN(tp) ||isNaN(comp) )
			{
				return ;
			}
			
			if(comp>0)
			{
			var roi=roi2/comp;
			var tenure=t2*comp/365*tp;
			var mt=amount*Math.pow(1+roi,tenure);
			var rt=Math.pow(1+roi2/comp,comp);
			var income=amount*roi2/comp;			
			}
			else
			{
			var rt=Math.pow(1+t2*roi2,1/t2);
			var income= amount*t2*roi2
			}
			
			document.getElementById("Matamt").value=Math.round(mt);
			document.getElementById("intper").value=Math.round((rt-1)*10000)/100;		
		}
		function cleartext_inv1()
		{
		  document.getElementById("Matamt").value="";
		  document.getElementById("intper").value="";
		}
/*Functions to be used for calculator in Advisory Services: Ends Here*/

/* Functions to be used for calculator in Advisory Services . CalcInv_2.jsp: Starts here*/
function calculate_inv2()
{
		var clCurSav;
		var amt;
		var clOpCost;
		var sav;
		var tim;
		var clComboRest;
		
		sav=parseFloat(document.getElementById("sav").value,10);
		clCurSav=parseFloat(document.getElementById("clCurSav").value,10);
		
		clComboRest = parseFloat(document.getElementById("clComboRest").options[document.getElementById("clComboRest").options.selectedIndex].value);
		
		clOpCost=parseFloat(document.getElementById("clOpCost").value,10)/100/clComboRest;
		
		clOpCost = (Math.pow((1+clOpCost),clComboRest) - 1);
		
		clSavType = parseFloat(document.getElementById("clSavType").options[document.getElementById("clSavType").options.selectedIndex].value);
		
		if 	(isNaN(sav) || isNaN(clCurSav) ||isNaN(clOpCost) )
		{
		return;
		}
		
	   if (sav<=0 || clCurSav<=0 || parseFloat(document.getElementById("clOpCost").value,10)<=0)

             {
              alert('Invalid input(s) !!!');
               return false;
              }

	   
		roi=clOpCost;
		
		if(clSavType==12)
		{	
			roi=Math.pow(1+roi,1/12)-1;
		}
		
		roi+=1;
		tim=0;
		
		if(roi<0 ||sav<0)
		{
			alert('You can not give negative figures in your Monthly Savings Interest on your savings');
			return false;
		}
		
		amt=sav*(Math.pow(roi,tim)-1)/(roi-1);
		
		do
		{
			tim+=1;
			amt=sav*(Math.pow(roi,tim)-1)/(roi-1)+clCurSav*(Math.pow(roi,tim));
		}
		while(amt<1000000)
		if(clSavType==12)
			{
					if(tim>12)
					{
						tim  = Math.round(tim/12+0.49999999) + " year(s)";
					}
					else 
					{
						tim = tim + " month(s)";
					}
			}
			else
			{
			tim  = Math.round(tim) + " year(s)";
			}  
			  
			if(document.layers)
			{
			document.getElementById("clInvTenure").value=tim;
			}
			else
			{
			document.getElementById("clInvTenure").value=tim;
			}		
	}


		function cleartext_inv2()
			{
			  document.getElementById("clInvTenure").value="";
			}
		var clViewHide;
			if (document.layers) {
				visible = 'show';	
				hidden = 'hide';
			}
			else if (document.all) {
				visible = 'visible';		
				hidden = 'hidden';		
				}
		/* Not used*/
		function clCheck_inv2(fld,typ)
		{
			if(typ=="int")
			{
				if(isNaN(fld.value))
				{
				alert('Please enter a Number in the given field');
				fld.focus();
				}
			}
		}
			/* Not used*/
		function clDisplay_inv2(clViewShow) 
		{
			if (document.layers) {	
			clcontent = document.layers[clViewShow];	
			} else if (document.all) {	
			clcontent = document.all(clViewShow).style;
		}
			clViewHide.visibility = hidden;
			clcontent.visibility = visible;
			
			clViewHide = clcontent;

}
		/* Not used*/
		function clValidate_inv2(frm)
		{
			if(isNaN(parseFloat(frm.clCurSav.value))||parseFloat(frm.clCurSav.value)<0)
			{
				alert('Savings should be greater than or equal to 0.');
				frm.clCurSav.focus();
				return false;
			}
			if(isNaN(parseFloat(frm.sav.value))||parseFloat(frm.sav.value)<=0)
			{
				alert('Your savings should be greater than 0');
				frm.sav.focus();
				return false;
			}
			if(isNaN(parseFloat(frm.clOpCost.value))||parseFloat(frm.clOpCost.value)<=0)
			{
				alert('Return on you savings should be greater than 0');
				frm.clOpCost.focus();
				return false;
			}
			return true;
		}
/* Functions to be used for calculator in Advisory Services . CalcInv_2.jsp: Ends here*/

/* Functions to be used for calculator in Advisory Services . CalcInv_3.jsp: Starts here*/
function calculate_inv3(obj)
	{
		var amount=document.getElementById("amt").value;
		var t2=parseFloat(document.getElementById("t2").value);
		var roi2=parseFloat(document.getElementById("roi2").value)/100;
		var t2=parseFloat(document.getElementById("t2").value);
		var tp=document.getElementById("tp").value;
		var comp=parseFloat(document.getElementById("comp").options[document.getElementById("comp").options.selectedIndex].value);
		//t2=t2/tp;
		
		if(isNaN(amount) ||isNaN(t2) ||isNaN(roi2) ||isNaN(tp))
		{
			return;
		}
		if(comp>0)
		{
		var roi=roi2/comp;
		var tenure=t2*comp/365*tp;
		var mt=amount*Math.pow(1+roi,tenure);
		var rt=Math.pow(1+roi2/comp,comp);
		var income=amount*roi2/comp;

		}
		else
		{
		var rt=Math.pow(1+t2*roi2,1/t2);
		var income= amount*t2*roi2
		}
		
		var mattamtt;
		document.getElementById("Matamt").value=Math.round(income);
		document.getElementById("intper").value=Math.round((rt-1)*10000)/100;					
	}
	function cleartext_inv3()
	{
	  document.getElementById("Matamt").value="";
	  document.getElementById("intper").value="";
	}
/* Functions to be used for calculator in Advisory Services . CalcInv_3.jsp: Ends here*/

/* Functions to be used for calculator in Advisory Services . CalcFin_1.jsp: Starts here*/
		function calculate_fin1()
	{
		var tmon=0;
		var tyr=0;
		var timon=0;
		var tiyr=0;

		for(i=1;i<29;i++)
		{
				var aa1='xm'+i;
				var aa2='xa'+i;
				var mon=eval(document.getElementById(aa1));
				var yr=eval(document.getElementById(aa2));
				//mon=eval('document.tools.xm'+i)
				//var yr=eval('document.tools.xa'+i)
				if(document.getElementById(aa1).value=="" && document.getElementById(aa2).value!="")
				{
				document.getElementById(aa1).value=document.getElementById(aa2).value/12;
				}
				if(document.getElementById(aa2).value=="" && document.getElementById(aa1).value!="")
				{
				document.getElementById(aa2).value=document.getElementById(aa1).value*12;
				}
				if(mon.value && !isNaN(mon.value) && yr.value && !isNaN(yr.value))
				{
					tmon+=parseFloat(mon.value);
					tyr+=parseFloat(yr.value);
				}
		} //For Loop
			
		for(i=1;i<6;i++)
		{
				var aa1='im'+i;
				var aa2='ia'+i;
				var imon=eval(document.getElementById(aa1));
				var iyr=eval(document.getElementById(aa2));
				if(document.getElementById(aa1).value=="" && document.getElementById(aa2).value!="")
				{
				
				document.getElementById(aa1).value=document.getElementById(aa2).value/12;
				}
				if(document.getElementById(aa2).value=="" && document.getElementById(aa1).value!="")
				{
				document.getElementById(aa2).value=document.getElementById(aa1).value*12;
				}
				if(imon.value && !isNaN(imon.value) && iyr.value && !isNaN(iyr.value))
				{
				timon+=parseFloat(imon.value);
				tiyr+=parseFloat(iyr.value);
				}
				
		}
			document.getElementById("mexp").value=tmon;
			document.getElementById("yrexp").value=tyr;
			document.getElementById("imt").value=timon;
			document.getElementById("iat").value=tiyr;

			document.getElementById("dmon").value=timon-tmon;
			document.getElementById("dyr").value=tiyr-tyr;
	}
	function cleartext_fin1()
	{
	  document.getElementById("dmon").value="";
	  document.getElementById("dyr").value="";
	}
/* Functions to be used for calculator in Advisory Services . CalcFin_1.jsp: Ends here*/

/* Functions to be used for calculator in Advisory Services . CalcFin_2.jsp: Ends here*/

function calculate_fin2()
{	
	var current;
	var annuity;
	var roi;
	var tenure;
	var remain;
	var fv;
	var cost;
	var inf;
	var tp;
	var sav;
	
	tenure=parseFloat(document.getElementById("tenure").value,10);
	current=parseFloat(document.getElementById("current").value,10);
	roi=parseFloat(document.getElementById("roi").value,10)/100;
	cost=parseFloat(document.getElementById("cost").value);
	inf=parseFloat(document.getElementById("inf").value)/100;
	msavVar=parseFloat(document.getElementById("msav").value);
	
	clComboRestVar=document.getElementById("clComboRest").options[document.getElementById("clComboRest").selectedIndex].value;
	
	roi=Math.pow(1+roi/clComboRestVar,clComboRestVar)-1;
	
	clSavTypeVar = parseFloat(document.getElementById("clSavType").options[document.getElementById("clSavType").options.selectedIndex].value,10);
	
	
	if( isNaN(cost) ||isNaN(tenure) ||isNaN(current) ||isNaN(msavVar) ||isNaN(roi) ||isNaN(inf) )
	{
		return;
	}
	
	if(clSavTypeVar==12)
	{	
		roi=Math.pow(1+roi,1/12)-1;
	}
	
	fv=cost*Math.pow(1+inf,tenure)
	remain=fv-current*Math.pow((1+roi*12),tenure);
	ttr1=Math.pow(1+roi,tenure*clSavTypeVar)-1;
	tp=(msavVar*ttr1)/roi;
	
	document.getElementById("emi").value=Math.round((remain*roi)/(Math.pow((1+roi),tenure*12)-1));
	document.getElementById("fv").value=Math.round(fv);
	document.getElementById("current2").value=Math.round(tp+current*Math.pow((1+roi*12),tenure));
	if(tp+current*Math.pow((1+roi*12),tenure)<fv) 
		{
		document.getElementById("extra").value=Math.round(fv-tp-current*Math.pow((1+roi*12),tenure));
		}
		else
		{
		document.getElementById("extra").value=0
		}
		
	}

function cleartext_fin2()
{
  document.getElementById("emi").value="";
  document.getElementById("fv").value="";
  document.getElementById("current2").value="";
  document.getElementById("extra").value=""; 
}
/* Functions to be used for calculator in Advisory Services . CalcFin_2.jsp: Ends here*/

/* Functions to be used for calculator in Advisory Services . CalcFin_3.jsp: Ends here*/
function calculate_fin3()
		{
			var ta=0;
			var tl=0;
			var mon;
			var i=1;
			var aa;
			aa='a'+i;
			
			for(i=1;i<16;i++)
			{
				var aa;
				aa='a'+i;
				
				mon=eval(document.getElementById(aa));
				if (isNaN(mon.value)||!mon.value) mon.value=0;
					if(mon.value && !isNaN(mon.value) )
					{
					ta+=parseFloat(mon.value);
					}
			}
			for(i=1;i<8;i++)
			{
				var ll;
				ll='l'+i;
				mon=eval(document.getElementById(ll))
				if (isNaN(mon.value)||!mon.value) mon.value=0;
				if(mon.value && !isNaN(mon.value) )
				{
					tl+=parseFloat(mon.value);

				}
			}
			document.getElementById("ta").value=ta;
			document.getElementById("tl").value=tl;
			document.getElementById("nw").value=ta-tl;
			document.getElementById("dmon").value=ta-tl;
		}
/* Functions to be used for calculator in Advisory Services . CalcFin_3.jsp: Ends here */

/* Functions to be used for calculator in Advisory Services . CalcRet_1.jsp: Ends here */
	function calculate_ret1()
	{

		var clCurSav;
		var annuity;
		var clOpCost;
		var tenure;
		var remain;
		var clxRetReq;
		var cost;
		var clInf;
		var tp;
		var sav;
		var clAge;
		var clRetire;
		var clRetAmt;
		var clComboRest;
		var clSavType;
		
		clAge=parseFloat(document.getElementById("clAge").value,10);
		clRetire=parseFloat(document.getElementById("clRetire").value,10);
		clRetAmt=parseFloat(document.getElementById("clRetAmt").value,10);
		tenure=clRetire-clAge ;
		
		clInf=parseFloat(document.getElementById("clInf").value,10);
		clOpCost=parseFloat(document.getElementById("clOpCost").value,10);
		
		
		if(tenure<0)
		{
		alert('Retirement age should be more than your current age')
		return false;
		}
		
		clCurSav=parseFloat(document.getElementById("clCurSav").value,10);
		
		clComboRest = parseFloat(document.getElementById("clComboRest").options[document.getElementById("clComboRest").options.selectedIndex].value);
		
				
		clOpCost=parseFloat(clOpCost,10)/100/clComboRest;
		clOpCost = Math.pow((1+clOpCost),clComboRest) - 1;
		
		clOpCost1=clOpCost;
		
		clSavType = parseFloat(document.getElementById("clSavType").options[document.getElementById("clSavType").options.selectedIndex].value,10);
				
		if(clSavType==12)
		{	
			clOpCost=Math.pow(1+clOpCost,1/12)-1;
		}
		
		var c1lf_val = document.getElementById("clInf").value
		
		clInf=parseFloat(c1lf_val)/100;
		
		clxRetReq=clRetAmt*Math.pow(1+clInf,tenure);
		
		remain=clxRetReq-clCurSav*Math.pow((1+clOpCost1),tenure);
		msav_val = document.getElementById("msav").value;
		
		msavVar=parseFloat(msav_val);		
		
		tp=msavVar*(Math.pow(1+clOpCost,tenure*clSavType)-1)/clOpCost;
				
		fr1=Math.pow((1+clOpCost),tenure*clSavType-1);
		fr2=remain*clOpCost
		tresult1=Math.round(fr2/fr1);
		fr3=Math.pow((1+clOpCost1),tenure)
		fr4=tp+clCurSav;
		trseult3=fr4*fr3;
		
		document.getElementById("clxMonSav").value= Math.round((remain*clOpCost)/(Math.pow((1+clOpCost),tenure*clSavType)-1)); //Math.round((remain*clOpCost)/(Math.pow((1+clOpCost),tenure*clSavType-1));
		document.getElementById("clxRetReq").value=Math.round(clxRetReq);
		document.getElementById("clxRetWealth").value=Math.round(tp+clCurSav*Math.pow((1+clOpCost1),tenure));
	}

	function cleartext_ret1()
	{
		  document.getElementById("clxMonSav").value="";
		  document.getElementById("clxRetReq").value="";
		  document.getElementById("clxRetWealth").value="";
	}
	
	function clCheck_ret1(fld,typ)
	{
		if(typ=="int")
		{
			if(isNaN(fld.value))
			{
			alert('Please enter a Number in the given field');
			fld.value="";
			fld.focus();
			}
		}
	}
	/* Not used */
	function clValidate_ret1(frm)
	{
		if(isNaN(parseFloat(frm.clAge.value))||parseFloat(frm.clAge.value)<=0)
		{
		alert('Your age should be greater than 0 years');
		frm.clAge.focus();
		return false;
		}
		if(isNaN(parseFloat(frm.clRetire.value))||parseFloat(frm.clRetire.value)<=parseFloat(frm.clAge.value))
		{
		alert('Retirement age should be greater than your current age');
		frm.clRetire.focus();
		return false;
		}
		if(isNaN(parseFloat(frm.clCurSav.value))||parseFloat(parseFloat(frm.clCurSav.value))<0)
		{
			alert('Your current savings should be greater than 0');
			frm.clCurSav.focus();
			return false;
		}
		if(isNaN(parseFloat(frm.clRetAmt.value))||parseFloat(parseFloat(frm.clRetAmt.value))<0)
		{
			alert('Your retirement amount should be greater than or equal to 0');
			frm.clRetAmt.focus();
			return false;
		}
		if(isNaN(parseFloat(frm.msav.value))||parseFloat(parseFloat(frm.msav.value))<0)
		{
			alert('Monthly savings should be greater than or equal to 0');
			frm.msav.focus();
			return false;
		}
		
		if(isNaN(parseFloat(frm.clOpCost.value))||parseFloat(parseFloat(frm.clOpCost.value))<0)
		{
			alert('Rate of return on your investment should be greater than 0');
			frm.clOpCost.focus();
			return false;
		}
		if(isNaN(parseFloat(frm.clInf.value))||parseFloat(parseFloat(frm.clInf.value))<0)
		{
			alert('Rate of inflation should be greater than 0');
			frm.clInf.focus();
			return false;
		}
		
		return true;
	}
/* Functions to be used for calculator in Advisory Services . CalcRet_1.jsp: Ends here */

/* Functions to be used for calculator in Advisory Services . CalcRet_2.jsp: starts here */
function calculate_ret2()
{
	var current;
	var annuity;
	var roi;
	var tenure;
	var val;
	
	tenure=(parseFloat(document.getElementById("ret").value,10)-parseFloat(document.getElementById("age").value,10));
	current=parseFloat(document.getElementById("current").value,10);
	clComboRestVar=document.getElementById("clComboRest").options[document.getElementById("clComboRest").selectedIndex].value;
	
	roi=Math.pow(parseFloat(document.getElementById("clOpCost").value,10)/100/clComboRestVar +1,clComboRestVar)-1;
	
	if (roi==0) roi=0.00000001;
	val=current*Math.pow((1+roi),tenure);
	clSavTypeVar = parseFloat(document.getElementById("clSavType").options[document.getElementById("clSavType").options.selectedIndex].value,10);
	
	if(clSavTypeVar==12)
	{
	val+=parseFloat(document.getElementById("sav").value,10)*((Math.pow(Math.pow((1+roi),1/12),tenure*12)-1)/(Math.pow((1+roi),1/12)-1));
	}
	else
	{
	val+=parseFloat(document.getElementById("sav").value,10)*(Math.pow(1+roi,tenure)-1)/roi;
	}
	if(isNaN(val))
	{
		alert('One or more of the numeric fields are wrong. Please Check');
	}
	else
	{
		document.getElementById("emi").value=Math.round(val);
	}
}


function check_ret2(fld,typ)
{
	if(typ=="int")
	{
		if(isNaN(fld.value))
		{
		alert('Please enter a Number in the given field');
		fld.focus();
		}
	}
}
function cleartext_ret2()
{
  document.getElementById("emi").value="";
}

function display_ret2(viewShow) {

		if (document.layers) {
		
		content = document.layers[viewShow];
		
		} else if (document.all) {
		
		content = document.all(viewShow).style;
		
		}
		viewHide.visibility = hidden;
		content.visibility = visible;
		
		viewHide = content;

}

function validate_ret2(frm)
	{
	if(isNaN(parseFloat(frm.age.value))||parseFloat(frm.age.value)<=0)
	{
	alert('Your age should be greater than 0');
	frm.age.focus();
	return false;
	}
	if(isNaN(parseFloat(frm.ret.value))||parseFloat(frm.ret.value)<=parseFloat(frm.age.value))
	{
	alert('Your retirement age should be greater than your present age');
	frm.ret.focus();
	return false;
	}
	if(isNaN(parseFloat(frm.ret.value))||parseFloat(frm.ret.value)<=parseFloat(frm.age.value))
	{
	alert('Your retirement age should be greater than your present age');
	frm.ret.focus();
	return false;
	}
	if(isNaN(parseFloat(frm.current.value))||parseFloat(frm.current.value)<0)
	{
	alert('Current savings should be greater than or equal to 0');
	frm.current.focus();
	return false;
	}
	if(isNaN(parseFloat(frm.sav.value))||parseFloat(frm.sav.value)<0)
	{
	alert('Monthly savings should be greater than or equal to 0');
	frm.sav.focus();
	return false;
	}
	if(isNaN(parseFloat(frm.clOpCost.value))||parseFloat(frm.clOpCost.value)<0)
	{
	alert('Return on your investments should be greater than or equal to 0');
	frm.clOpCost.focus();
	return false;
	}

return true;
}
/* Functions to be used for calculator in Advisory Services . CalcRet_2.jsp: Ends here */

/* Functions to be used for calculator in Advisory Services . CalcRet_3.jsp: Starts here */
function calculate_ret3()
{

	var current;
	var amt;
	var roi;
	var sav;
	var tim;
	var t=0;
	
	if(document.getElementById("t1").value && !isNaN(parseFloat(document.getElementById("t1").value)))
	{
	t+=parseFloat(document.getElementById("t1").value);
	}
	
	if(document.getElementById("t2").value && !isNaN(parseFloat(document.getElementById("t2").value)))
	{
	t+=parseFloat(document.getElementById("t2").value);
	}
	
	if(document.getElementById("t3").value && !isNaN(parseFloat(document.getElementById("t3").value)))
	{
	t+=parseFloat(document.getElementById("t3").value);
	}
	
	if(document.getElementById("t4").value && !isNaN(parseFloat(document.getElementById("t4").value)))
	{
	t+=parseFloat(document.getElementById("t4").value);
	}
	if(document.getElementById("t5").value && !isNaN(parseFloat(document.getElementById("t5").value)))
	{
	t+=parseFloat(document.getElementById("t5").value);
	}
	if(document.getElementById("t6").value && !isNaN(parseFloat(document.getElementById("t6").value)))
	{
	t+=parseFloat(document.getElementById("t6").value);
	}
	if(document.getElementById("t7").value && !isNaN(parseFloat(document.getElementById("t7").value)))
	{
	t+=parseFloat(document.getElementById("t7").value);
	}
	
	if(!document.getElementById("roi").value || isNaN(document.getElementById("roi").value))
	{
	alert('Enter your Anual Return Savings in %');
	document.getElementById("roi").focus();
	return false;
	}
	if(!document.getElementById("retage").value || isNaN(document.getElementById("retage").value))
	{
	alert('Enter your retirement age');
	document.getElementById("retage").focus();
	return false;
	}
	if(!document.getElementById("age").value || isNaN(document.getElementById("age").value))
	{
	alert('Enter your age');
	document.getElementById("age").focus();
	return false;
	}
	
	if(document.getElementById("age").value>document.getElementById("retage").value)
	{
	alert('It appears you have already retired');
	return false;
	}
	var diff= parseFloat(document.getElementById("retage").value) - parseFloat(document.getElementById("age").value);
	
	roi=Math.pow(1+parseFloat(document.getElementById("roi").value,10)/100,1/12)-1;
	roi=roi+1;
	fr1=roi-1;
	fr2=Math.pow(roi,diff*12)-1;
	ttnew=fr2/fr1;
	
	t=Math.round(t*(ttnew));
	//alert(t);
	document.getElementById("emi").value=Math.round(t);	

}
function cleartext_ret3()
{
  document.getElementById("emi").value="";
}


function check_ret3(fld,typ)
{
	if(typ=="int")
	{
		if(isNaN(fld.value))
		{
		alert('Please enter a Number in the given field');
		fld.focus();
		}
	}
}
/* Not Used */
function display_ret3(viewShow) {

		if (document.layers) {
		
		content = document.layers[viewShow];
		
		} else if (document.all) {
		
		content = document.all(viewShow).style;
		
		}
		viewHide.visibility = hidden;
		content.visibility = visible;
		
		viewHide = content;

}
/* Not Used*/
function validate_ret3(frm)
{
	
	if(isNaN(parseFloat(frm.roi.value))||parseFloat(frm.roi.value)<0)
	{
		alert('Return on your savings should be greater than or equal to 0.');
		frm.roi.focus();
		return false;
	}
	if(isNaN(parseFloat(frm.age.value))||parseFloat(frm.age.value)<=0)
	{
		alert('Your age should be greater than 0.');
		frm.age.focus();
		return false;
	}
	if(isNaN(parseFloat(frm.retage.value))||parseFloat(frm.retage.value)<parseFloat(frm.age.value))
	{
		alert('Retirement age should be greater than your present age.');
		frm.retage.focus();
		return false;
	}
	
	return true;
}
/* Functions to be used for calculator in Advisory Services . CalcRet_3.jsp: Ends here *//* */