function changeTimeFrameType(toType) {
if(toType == 'day') {
$('timeFrameTypeDesc').innerHTML = " Calculations will be made for each day separately.";
$('dayMainTimeFrame').show();
$('monthMainTimeFrame').hide();
$('yearMainTimeFrame').hide();
$('customMainTimeFrame').hide();
} else if(toType == 'month') {
$('timeFrameTypeDesc').innerHTML = " Calculations will be made for each month separately.";
$('dayMainTimeFrame').hide();
$('monthMainTimeFrame').show();
$('yearMainTimeFrame').hide();
$('customMainTimeFrame').hide();
} else if(toType == 'year') {
$('timeFrameTypeDesc').innerHTML = " Calculations will be made for each year separately.";
$('dayMainTimeFrame').hide();
$('monthMainTimeFrame').hide();
$('yearMainTimeFrame').show();
$('customMainTimeFrame').hide();
} else if(toType == 'custom') {
$('timeFrameTypeDesc').innerHTML = " Calculations will be made for custom inner time intervals separately.";
$('dayMainTimeFrame').hide();
$('monthMainTimeFrame').hide();
$('yearMainTimeFrame').hide();
$('customMainTimeFrame').show();
}
}
function checkInnerSections() {
var sText = $('customMainTimeFrameInnerSections').value;
var validChars = "0123456789";
var isNumber = true;
var currChar;
for (i = 0; i < sText.length; i++) {
currChar = sText.charAt(i);
if (validChars.indexOf(currChar) == -1) {
isNumber = false;
break;
}
}
if(isNumber == false) {
$('customMainTimeFrameInnerSections').value = sText.substring(0,(sText.length)-1)
}
}