// Конверсия времни

var chk5=true;
var D5=0;
var n5=0;
D5v=new Array(3153600000, 31536000, 2592000, 604800, 86400, 3600, 60, 1);
switch (lng) {
	case "eng":
D5n=new Array("cent.", "year", "month", "week", "day", "hour", "minute", "second");
	break;
	case "rus":
D5n=new Array("век", "год", "мес\яц", "недел\я", "день", "час", "минута", "секунда");
	break;
	default:
	break;
	}

function res5()
{D5=0;
n5=0;
chk5=true;}

function insert5()
{
chk5=true;
n5 = parseFloat(document.dim5.n.value.replace(/,/g,".")); 
if(isNaN(n5)){alert(alt08_01); document.dim5.n.focus(); return true;};
D5 = document.dim5.D.selectedIndex
n5 = Math.abs(n5);
document.dim5.na.value=n5+D5n[D5];
chk5=false;
}

function insertN5()
{
if(chk5){return true};
insert5()
}

function calc5()
{
if(chk5){return true};
Da = document.dim5.D.selectedIndex;
n_new=n5*D5v[D5]/D5v[Da];
document.dim5.n.value =n_new; 
}

