function kommacheck(Istring) { 
retval=""
var tempstring
for (var i=0;i<=Istring.length;i++) { 
tempstring =Istring.substring(i,i+1)
if(tempstring!=",") retval=retval+tempstring;
if(tempstring==",") retval=retval+".";
}
return retval 
}

function showlen(form) { 

fps=parseInt(form.speed.value,10);
hh=parseInt(form.hh.value,10);
mm=parseInt(form.mm.value,10);
ss=parseInt(form.ss.value,10);
step=parseFloat(form.format.options[form.format.selectedIndex].value)

sec = (hh*3600)+(mm*60)+ss

frm = sec*fps
ftm = sec*fps*step/1000
ftf = ftm*(1/0.30481)

ftm = Math.round(ftm*100) / 100
ftf = Math.round(ftf*10) / 10

form.footage_m.value=ftm
form.footage_f.value=ftf
form.frames.value=frm

}

function showtime(form) { 

kommacheck(form.footage_m.value)
form.footage_m.value=retval 
kommacheck(form.footage_f.value)
form.footage_f.value=retval 

fps = parseInt(form.speed.value,10);
step = parseFloat(form.format.options[form.format.selectedIndex].value);
ftm = (form.footage_m.value);
ftf = (form.footage_f.value);

frm = Math.round(ftm*1000/step)
sec = ftm*1000/step/fps

hh = Math.floor(sec/3600)
secrest = sec-(3600*hh)
mm = Math.floor(secrest/60)
ss = secrest - (60*mm)
ss = Math.round(ss)

if (hh <=9) {hh='0'+hh};
if (mm <=9) {mm='0'+mm};
if (ss <=9) {ss='0'+ss};

form.frames.value=frm
form.hh.value=hh
form.mm.value=mm
form.ss.value=ss

}

function showfoot(form) {
kommacheck(form.footage_m.value)
form.footage_m.value=retval  
ftm = form.footage_m.value;
ftf = ftm*(1/0.30481)
ftm = Math.round(ftm*100) / 100
ftf = Math.round(ftf*10) / 10
form.footage_m.value = ftm
form.footage_f.value = ftf


step = parseFloat(form.format.options[form.format.selectedIndex].value)
ftm = form.footage_m.value;
frm = Math.round(ftm*1000/step)
form.frames.value = frm;
}

function showmeter(form) { 
kommacheck(form.footage_f.value)
form.footage_f.value=retval 
ftf = form.footage_f.value;
ftm = ftf*0.30481
ftm = Math.round(ftm*100) / 100
ftf = Math.round(ftf*10) / 10
form.footage_m.value = ftm
form.footage_f.value = ftf


step = parseFloat(form.format.options[form.format.selectedIndex].value)
ftm = form.footage_m.value;
frm = Math.round(ftm*1000/step)
form.frames.value = frm;
}

function showmeterfuss(form) { 
frm = form.frames.value
step = parseFloat(form.format.options[form.format.selectedIndex].value)
ftm = frm*step/1000
ftf = ftm*(1/0.30481)
ftm =  Math.round(ftm*100) / 100
ftf = Math.round(ftf*10) / 10
form.footage_m.value = ftm
form.footage_f.value = ftf
}
