var now = new Date()
var month = now.getMonth();
var totald = 30;
if (month == 0 
	|| month == 2
	|| month == 4
	|| month == 6
	|| month == 7
	|| month == 9
	|| month == 11) totald = 31;
if (month == 1) {
	var year = now.getYear();
	if (year % 4 == 0 && (year % 400 == 0 || year % 100 != 0))
		totald = 29;
	else
		totald = 28;
}
prevd = now.getDate() - 1;
portiond = (now.getHours() - 1) / 24;
actuald = prevd + portiond;
function calculate(form) {
	newamt = (form['amt'].value/actuald)*totald;
	newamt = Math.round(newamt*100)/100;
	form['res'].value = newamt;
}

                function link(url, anchor, minorflag) {
                        document.write('<a href="');
                        document.write(url);
                        document.write('" target="_blank">');
                        if (minorflag)
                        document.write(anchor + '</a>');
                        else
                        document.write('<b>' + anchor + '</b></a><br> ');
                }

