function calcOW(){var pace=document.getElementById("pace").value||"1:15";var cond=document.getElementById("cond").value;var wetsuit=document.getElementById("wetsuit").value;var p=pace.split(":");var secs=parseInt(p[0])*60+(parseInt(p[1])||0);var mult=cond==="calm"?1.03:cond==="choppy"?1.08:cond==="rough"?1.15:cond==="current"?0.92:1.12;if(wetsuit==="yes")mult*=0.95;var adj=Math.round(secs*mult);var km=adj*10;document.getElementById("r1").textContent=Math.floor(adj/60)+":"+String(adj%60).padStart(2,"0")+"/100m";document.getElementById("r2").textContent=Math.floor(km/60)+"m "+Math.round(km%60)+"s";document.getElementById("desc").innerHTML="Pool pace "+pace+"/100m adjusted for "+cond.replace("_"," ")+""+(wetsuit==="yes"?" with wetsuit":"")+": "+Math.floor(adj/60)+":"+String(adj%60).padStart(2,"0")+"/100m
Estimated 1km: "+Math.floor(km/60)+" min "+Math.round(km%60)+" sec
Open water is always slower than pool pace.";document.getElementById("results").style.display="block";}