function getData()
{
	if(parent.frames.datacontainer)
	{
	frmobj=document.mycost;

	frmobj.txtInfExp.value=MonInfExp;
	frmobj.txtNonInfExp.value=MonNonInfExp;
	}
}


function getFutExp()
{
	C7=(document.mycost.txtInfExp.value*1); 

	C8=(document.mycost.txtNonInfExp.value*1); 
	C12=document.mycost.txtInfAdd.value*1;
	C13=document.mycost.txtInfDed.value*1;
	C14=document.mycost.txtNonInfAdd.value*1;
	C15=document.mycost.txtNonInfDed.value*1;
	
	TotInfExp=C7+C12-C13;
	TotNonInfExp=C8+C14-C15;
	
	
	currdate= new Date();
	currYear=currdate.getFullYear();	
			
	testYear=document.mycost.txtYear.value*1;
	diffYears=testYear-currYear;
	
	var obj;

	obj=document.mycost.selAnuInf.options;
		for(i=0;i<obj.length;i++)
		{
			if(obj[i].selected)
			{E15=(obj[i].value*1);break;} 
		}


MonFutExp=(((TotInfExp)*Math.pow((1+(E15*.01)),(diffYears)))+(TotNonInfExp));

if(MonFutExp<=0)
{
reportStr2="<br><table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" height=\"72\"><tr>";
reportStr2=reportStr2+"<td bgcolor=\"white\"  height=\"16\" valign=\"bottom\" colspan=2 align=\"left\" width=2px><img src=\"/images/insurance/tl_responsecurve.gif\"></td>";
reportStr2=reportStr2+"<td width=\"100%\" height=\"16\"><img src=\"/images/insurance/response.gif\"></td>";
reportStr2=reportStr2+"<td height=\"16\"></td></tr><tr>";
reportStr2=reportStr2+"<td bgcolor=\"#fb9c46\" width=\"2px\" colspan=3 height=\"3\"><img src=\"/images/common/blank.gif\" width=\"5px\"></td>";
reportStr2=reportStr2+"<td bgcolor=\"#fb9c46\" width=\"2px\" rowspan=3 height=\"56\"><img src=\"/images/common/blank.gif\" width=\"1px\"></td>";
reportStr2=reportStr2+"</tr><tr><td bgcolor=\"#fb9c46\" width=\"1px\" height=\"34\"><font size=\"2\" face=\"Arial\"><img src=\"/images/common/blank.gif\" width=\"1px\"></font></td>";
reportStr2=reportStr2+"<td bgcolor=\"#ffffff\" height=\"34\"><font style=\"font-size:11px;\" face=\"Arial\">&nbsp;&nbsp;</font></td>";
reportStr2=reportStr2+"<td bgcolor=\"#ffffff\" width=\"99%\" width=\"99%\" height=\"34\" class=\"tim\">";
reportStr2=reportStr2+"<b>Answer: </b>With The Values You Provided You Wont Have Any Expenses.</font>";
reportStr2=reportStr2+"</font></td></tr><tr><td bgcolor=\"#fb9c46\" width=\"1px\" ><img src=\"/images/common/blank.gif\" width=\"1px\"></td>";
reportStr2=reportStr2+"<td bgcolor=\"#fb9c46\" width=\"1px\" colspan=3 ><img src=\"/images/common/blank.gif\" width=\"1px\"></td>";
reportStr2=reportStr2+"</tr></table>";
}
else
{
MonFutExp=format(MonFutExp,'currency');
reportStr2="You will need <span  style=\"color:#ff6600;\">Rs "+MonFutExp+"</span> per month<br /> for your expenses in "+testYear +" to meet your<br /> expected cost of living.";

/*
reportStr2="<br><table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" height=\"72\"><tr>";
reportStr2=reportStr2+"<td bgcolor=\"white\"  height=\"16\" valign=\"bottom\" colspan=2 align=\"left\" width=2px><img src=\"/images/insurance/tl_responsecurve.gif\"></td>";
reportStr2=reportStr2+"<td width=\"100%\" height=\"16\"><img src=\"/images/insurance/response.gif\"></td>";
reportStr2=reportStr2+"<td height=\"16\"></td></tr><tr>";
reportStr2=reportStr2+"<td bgcolor=\"#fb9c46\" width=\"2px\" colspan=3 height=\"3\"><img src=\"/images/common/blank.gif\" width=\"5px\"></td>";
reportStr2=reportStr2+"<td bgcolor=\"#fb9c46\" width=\"2px\" rowspan=3 height=\"56\"><img src=\"/images/common/blank.gif\" width=\"1px\"></td>";
reportStr2=reportStr2+"</tr><tr><td bgcolor=\"#fb9c46\" width=\"1px\" height=\"34\"><font style=\"font-size:11px;\" face=\"Arial\"><img src=\"/images/common/blank.gif\" width=\"1px\"></font></td>";
reportStr2=reportStr2+"<td bgcolor=\"#ffffff\" height=\"34\"><font size=\"2\" face=\"Arial\">&nbsp;&nbsp;</font></td>";
reportStr2=reportStr2+"<td bgcolor=\"#ffffff\" width=\"99%\" width=\"99%\" height=\"34\">";
reportStr2=reportStr2+"<font face=\"Arial\"  style=\"font-size:11px;\"><font type=arial><b>Answer: </b>You will need <b>Rs&nbsp;"+MonFutExp+"  </b>per month for your expenses in "+testYear +" to meet your expected cost of living.</font>";
reportStr2=reportStr2+"</font></td></tr><tr><td bgcolor=\"#fb9c46\" width=\"1px\" ><img src=\"/images/common/blank.gif\" width=\"1px\"></td>";
reportStr2=reportStr2+"<td bgcolor=\"#fb9c46\" width=\"1px\" colspan=3 ><img src=\"/images/common/blank.gif\" width=\"1px\"></td>";
reportStr2=reportStr2+"</tr></table>";
*/
}


document.getElementById("ansdiv").innerHTML=reportStr2;
document.getElementById("ansdiv").style.visibility='visible';
document.getElementById("middleblock").style.visibility='hidden';
document.getElementById("bkbt").style.visibility='visible';
	 
}


function getTotExp()
{
document.mycost.txtTotExp.value=(document.mycost.txtNonInfExp.value*1)
+(document.mycost.txtInfExp.value*1);
}


function checkYear()
{
currdate=new Date();
currYear=currdate.getFullYear();

testYear=document.mycost.txtYear.value*1;

if((testYear-currYear)>100)
{alert("Enter a year which is less than 100 years From Now");
document.mycost.txtYear.value="";
document.mycost.txtYear.focus();
return(false);
}
else
{
document.mycost.txtYear1.value=testYear;
document.mycost.txtYear2.value=testYear;
}
}


function checkYr(obj)
{	
		if(obj.value.length < 4)
		{
		alert("Please enter a valid year.");
		obj.value="";
		obj.focus();
		}

}

function checkcuryear(obj)
{
var currdate=new Date();
currYear=currdate.getFullYear();



if(currYear > eval(obj.value))
{
alert("Please enter year, " + currYear +" or above.");
obj.value="";
obj.focus();

}
}

