function ChangeTeam(id, url1, url2, url3) {
    if (id == 1) {
        window.location = url1;
    }
    else if(id==2) {
        window.location = url2;
    }
    else if(id == 3)
        window.location = url3;
}
function PopupCompetition() {
    URL = document.getElementById("UrlCompetitor").value;
    window.open(URL, "",
     "scrollbar=yes,resizable=1,HEIGHT=956,WIDTH=993,left=100,top=100");
}
function CalculHeightFlash() {
    countValue = document.getElementById('countValue').value;
    RowNb = parseInt(countValue) / 5;
    RowNb = Math.ceil(RowNb);
    maxHeight = RowNb * 170 + 193;
    maxHeight = maxHeight + "px";
    window.document['team'].SetVariable("height", maxHeight);
}
 function convertVolume() {
    vei = document.getElementById('select').value;
    insertedValue = document.getElementById('Lengde').value;
    if (vei == "" || insertedValue == "") {
        document.getElementById('alertAllFill').className = 'alertAllFillB';
    }
    else {
        document.getElementById('alertAllFill').className = 'alertAllFill';
        var meter, yard, fot, foot, tommer, alen, favn, mannshoyde, pilskudd, nautisk
        num2 = parseFloat(document.lengdemaal.Lengde.value)
        num3 = parseFloat(document.lengdemaal.Lengde.value)
        num4 = parseFloat(document.lengdemaal.Lengde.value)
        num5 = parseFloat(document.lengdemaal.Lengde.value)
        num6 = parseFloat(document.lengdemaal.Lengde.value)
        num7 = parseFloat(document.lengdemaal.Lengde.value)
        num8 = parseFloat(document.lengdemaal.Lengde.value)
        num9 = parseFloat(document.lengdemaal.Lengde.value)
        num10 = parseFloat(document.lengdemaal.Lengde.value)
        num11 = parseFloat(document.lengdemaal.Lengde.value)
        num12 = parseFloat(document.lengdemaal.Lengde.value)
        num13 = parseFloat(document.lengdemaal.Lengde.value)
        num14 = parseFloat(document.lengdemaal.Lengde.value)
        num15 = parseFloat(document.lengdemaal.Lengde.value)
        num16 = parseFloat(document.lengdemaal.Lengde.value)
        num17 = parseFloat(document.lengdemaal.Lengde.value)
        num18 = parseFloat(document.lengdemaal.Lengde.value)
        num19 = parseFloat(document.lengdemaal.Lengde.value)
        num20 = parseFloat(document.lengdemaal.Lengde.value)
        num21 = parseFloat(document.lengdemaal.Lengde.value)
        num22 = parseFloat(document.lengdemaal.Lengde.value)
        num23 = parseFloat(document.lengdemaal.Lengde.value)
        num24 = parseFloat(document.lengdemaal.Lengde.value)

        if (vei == 1) {
            //fra liter
            liter = Math.round((num2 * 1) * 100000) / 100000
            kmeter = Math.round((num24) * 100) / 100000
            pint1 = Math.round((num3 * 2.11338) * 100000) / 100000
            pint2 = Math.round((num4 * 1.81617) * 100000) / 100000
            gallon1 = Math.round((num5 * 0.26417) * 100000) / 100000
            gallon2 = Math.round((num6 * 0.22702) * 100000) / 100000
            barrel1 = Math.round((num7 * 0.00839) * 100000) / 100000
            barrel2 = Math.round((num8 * 0.00629) * 100000) / 100000
            ktommer = Math.round((num9 * 61.02376) * 100000) / 100000
            alegallon = Math.round((num10 * 0.21645) * 100000) / 100000
            jumfru = Math.round((num11 * 12.19512) * 100000) / 100000
            anker = Math.round((num12 * 0.02590405139364) * 100000) / 100000
            bolle = Math.round((num13 * 0.3703703703704) * 100000) / 100000
            eske = Math.round((num14 * 0.06172839506173) * 100000) / 100000
            fat = Math.round((num15 * 0.001079341299592) * 100000) / 100000
            favngml = Math.round((num16 * 0.0004497211728728) * 100000) / 100000
            favnny = Math.round((num17 * 0.0004166666666667) * 100000) / 100000
            korntonne = Math.round((num18 * 0.00719579765417) * 100000) / 100000
            kfot = Math.round((num19 * 0.03237293622532) * 100000) / 100000
            oksehode = Math.round((num20 * 0.004317789291883) * 100000) / 100000
            fisktonne = Math.round((num21 * 0.008635578583765) * 100000) / 100000
            oltonne = Math.round((num22 * 0.007610929294467) * 100000) / 100000
            skrull = Math.round((num23 * 0.3323915572544) * 100000) / 100000
        }
        if (vei == 2) {
            //fra pint1
            liter = Math.round((num2 * 0.47318) * 100000) / 100000
            kmeter = Math.round(liter * 100) / 100000
            pint1 = Math.round((num3 * 1) * 100000) / 100000
            pint2 = Math.round((num4 * 0.85937) * 100000) / 100000
            gallon1 = Math.round((num5 * 0.125) * 100000) / 100000
            gallon2 = Math.round((num6 * 0.10742) * 100000) / 100000
            barrel1 = Math.round((num7 * 0.00397) * 100000) / 100000
            barrel2 = Math.round((num8 * 0.00298) * 100000) / 100000
            ktommer = Math.round((num9 * 28.87501) * 100000) / 100000
            alegallon = Math.round((num10 * 0.1024188740312) * 100000) / 100000
            jumfru = Math.round((num11 * 5.770434238992) * 100000) / 100000
            anker = Math.round((num12 * 0.07615637318784) * 100000) / 100000
            bolle = Math.round((num13 * 0.1752502485923) * 100000) / 100000
            eske = Math.round((num14 * 0.02920837476507) * 100000) / 100000
            fat = Math.round((num15 * 0.0005107180436079) * 100000) / 100000
            favngml = Math.round((num16 * 0.0002127971174138) * 100000) / 100000
            favnny = Math.round((num17 * 0.0001971565293511) * 100000) / 100000
            korntonne = Math.round((num18 * 0.003404876384749) * 100000) / 100000
            kfot = Math.round((num19 * 0.01531808582697) * 100000) / 100000
            oksehode = Math.round((num20 * 0.002043072845868) * 100000) / 100000
            fisktonne = Math.round((num21 * 0.004086145692209) * 100000) / 100000
            oltonne = Math.round((num22 * 0.003601306577142) * 100000) / 100000
            skrull = Math.round((num23 * 0.1572795982048) * 100000) / 100000
        }
        if (vei == 3) {
            //fra pint2 
            liter = Math.round((num2 * 0.55061) * 100000) / 100000
            kmeter = Math.round(liter * 100) / 100000
            pint1 = Math.round((num3 * 1.16365) * 100000) / 100000
            pint2 = Math.round((num4 * 1) * 100000) / 100000
            gallon1 = Math.round((num5 * 0.14546) * 100000) / 100000
            gallon2 = Math.round((num6 * 0.125) * 100000) / 100000
            barrel1 = Math.round((num7 * 0.00462) * 100000) / 100000
            barrel2 = Math.round((num8 * 0.00346) * 100000) / 100000
            ktommer = Math.round((num9 * 33.60032) * 100000) / 100000
            alegallon = Math.round((num10 * 0.119179) * 100000) / 100000
            jumfru = Math.round((num11 * 6.60731) * 100000) / 100000
            anker = Math.round((num12 * 0.01426301028703) * 100000) / 100000
            bolle = Math.round((num13 * 0.203929351531) * 100000) / 100000
            eske = Math.round((num14 * 0.03398822525479) * 100000) / 100000
            fat = Math.round((num15 * 0.0005942953022019) * 100000) / 100000
            favngml = Math.round((num16 * 0.0002476206368347) * 100000) / 100000
            favnny = Math.round((num17 * 0.0002294205201055) * 100000) / 100000
            korntonne = Math.round((num18 * 0.00396207274319) * 100000) / 100000
            kfot = Math.round((num19 * 0.01782483810712) * 100000) / 100000
            oksehode = Math.round((num20 * 0.002377414719437) * 100000) / 100000
            fisktonne = Math.round((num21 * 0.004754829439425) * 100000) / 100000
            oltonne = Math.round((num22 * 0.004190648063783) * 100000) / 100000
            skrull = Math.round((num23 * 0.1830178657582) * 100000) / 100000
        }
        if (vei == 4) {
            //fra gallon1
            liter = Math.round((num2 * 3.78541) * 100000) / 100000
            kmeter = Math.round(liter * 100) / 100000
            pint1 = Math.round((num3 * 8) * 100000) / 100000
            pint2 = Math.round((num4 * 6.87494) * 100000) / 100000
            gallon1 = Math.round((num5 * 1) * 100000) / 100000
            gallon2 = Math.round((num6 * 0.85937) * 100000) / 100000
            barrel1 = Math.round((num7 * 0.03175) * 100000) / 100000
            barrel2 = Math.round((num8 * 0.02381) * 100000) / 100000
            ktommer = Math.round((num9 * 231.00007) * 100000) / 100000
            alegallon = Math.round((num10 * 0.81935) * 100000) / 100000
            jumfru = Math.round((num11 * 46.16356) * 100000) / 100000
            anker = Math.round((num12 * 0.1780836751891) * 100000) / 100000
            bolle = Math.round((num13 * 2.546200813763) * 100000) / 100000
            eske = Math.round((num14 * 0.4243668022893) * 100000) / 100000
            fat = Math.round((num15 * 0.007420193173381) * 100000) / 100000
            favngml = Math.round((num16 * 0.003091717118108) * 100000) / 100000
            favnny = Math.round((num17 * 0.002864475910903) * 100000) / 100000
            korntonne = Math.round((num18 * 0.04946925377423) * 100000) / 100000
            kfot = Math.round((num19 * 0.2225555907122) * 100000) / 100000
            oksehode = Math.round((num20 * 0.02968368823732) * 100000) / 100000
            fisktonne = Math.round((num21 * 0.05936737648151) * 100000) / 100000
            oltonne = Math.round((num22 * 0.05232317677712) * 100000) / 100000
            skrull = Math.round((num23 * 2.285106264636) * 100000) / 100000
        }
        if (vei == 5) {
            //fra gallon2
            liter = Math.round((num2 * 4.404881) * 100000) / 100000
            kmeter = Math.round(liter * 100) / 100000
            pint1 = Math.round((num3 * 9.30918) * 100000) / 100000
            pint2 = Math.round((num4 * 8) * 100000) / 100000
            gallon1 = Math.round((num5 * 1.16365) * 100000) / 100000
            gallon2 = Math.round((num6 * 1) * 100000) / 100000
            barrel1 = Math.round((num7 * 0.03694) * 100000) / 100000
            barrel2 = Math.round((num8 * 0.02771) * 100000) / 100000
            ktommer = Math.round((num9 * 268.80258) * 100000) / 100000
            alegallon = Math.round((num10 * 0.953438291581) * 100000) / 100000
            jumfru = Math.round((num11 * 53.71790963147) * 100000) / 100000
            anker = Math.round((num12 * 0.03014307154427) * 100000) / 100000
            bolle = Math.round((num13 * 0.4309789384898) * 100000) / 100000
            eske = Math.round((num14 * 0.07182982308086) * 100000) / 100000
            fat = Math.round((num15 * 0.001255968091742) * 100000) / 100000
            favngml = Math.round((num16 * 0.0005233149539779) * 100000) / 100000
            favnny = Math.round((num17 * 0.0004848513050258) * 100000) / 100000
            korntonne = Math.round((num18 * 0.008373340533181) * 100000) / 100000
            kfot = Math.round((num19 * 0.03767054496317) * 100000) / 100000
            oksehode = Math.round((num20 * 0.005024365862201) * 100000) / 100000
            fisktonne = Math.round((num21 * 0.01004873172557) * 100000) / 100000
            oltonne = Math.round((num22 * 0.008856405615742) * 100000) / 100000
            skrull = Math.round((num23 * 0.3867851533728) * 100000) / 100000
        }
        if (vei == 6) {
            //fra barrel1
            liter = Math.round((num2 * 119.24048) * 100000) / 100000
            kmeter = Math.round(liter * 100) / 100000
            pint1 = Math.round((num3 * 252) * 100000) / 100000
            pint2 = Math.round((num4 * 216.56049) * 100000) / 100000
            gallon1 = Math.round((num5 * 31.5) * 100000) / 100000
            gallon2 = Math.round((num6 * 27.07006) * 100000) / 100000
            barrel1 = Math.round((num7 * 1) * 100000) / 100000
            barrel2 = Math.round((num8 * 0.75) * 100000) / 100000
            ktommer = Math.round((num9 * 7276.50219) * 100000) / 100000
            alegallon = Math.round((num10 * 22, 18077964266) * 100000) / 100000
            jumfru = Math.round((num11 * 1249.690308609) * 100000) / 100000
            anker = Math.round((num12 * 0.7012466538441) * 100000) / 100000
            bolle = Math.round((num13 * 10.02626882431) * 100000) / 100000
            eske = Math.round((num14 * 1.671044804034) * 100000) / 100000
            fat = Math.round((num15 * 0.0292187682458) * 100000) / 100000
            favngml = Math.round((num16 * 0.012174368489448) * 100000) / 100000
            favnny = Math.round((num17 * 0.01127955240931) * 100000) / 100000
            korntonne = Math.round((num18 * 0.1947969045479) * 100000) / 100000
            kfot = Math.round((num19 * 0.8763653553059) * 100000) / 100000
            oksehode = Math.round((num20 * 0.1168865536275) * 100000) / 100000
            fisktonne = Math.round((num21 * 0.2337731072821) * 100000) / 100000
            oltonne = Math.round((num22 * 0.2060349023822) * 100000) / 100000
            skrull = Math.round((num23 * 8.9981471915) * 100000) / 100000
        }
        if (vei == 7) {
            //fra barrel2
            liter = Math.round((num2 * 158.9873) * 100000) / 100000
            kmeter = Math.round(liter * 100) / 100000
            pint1 = Math.round((num3 * 336) * 100000) / 100000
            pint2 = Math.round((num4 * 288.74731) * 100000) / 100000
            gallon1 = Math.round((num5 * 42) * 100000) / 100000
            gallon2 = Math.round((num6 * 36.09341) * 100000) / 100000
            barrel1 = Math.round((num7 * 1.33333) * 100000) / 100000
            barrel2 = Math.round((num8 * 1) * 100000) / 100000
            ktommer = Math.round((num9 * 9702.00268) * 100000) / 100000
            alegallon = Math.round((num10 * 1.092476255333) * 100000) / 100000
            jumfru = Math.round((num11 * 61.55141777333) * 100000) / 100000
            anker = Math.round((num12 * 0.03453873519067) * 100000) / 100000
            bolle = Math.round((num13 * 0.4938271604933) * 100000) / 100000
            eske = Math.round((num14 * 0.082304526748) * 100000) / 100000
            fat = Math.round((num15 * 0.001439121732) * 100000) / 100000
            favngml = Math.round((num16 * 0.0005996282293333) * 100000) / 100000
            favnny = Math.round((num17 * 0.0005555555546667) * 100000) / 100000
            korntonne = Math.round((num18 * 0.009594396872) * 100000) / 100000
            kfot = Math.round((num19 * 0.04316391496667) * 100000) / 100000
            oksehode = Math.round((num20 * 0.005757052388) * 100000) / 100000
            fisktonne = Math.round((num21 * 0.01151410477733) * 100000) / 100000
            oltonne = Math.round((num22 * 0.01014790572533) * 100000) / 100000
            skrull = Math.round((num23 * 0.4431887430053) * 100000) / 100000
        }
        if (vei == 8) {
            //fra ktommer
            liter = Math.round((num2 * 0.01639) * 100000) / 100000
            kmeter = Math.round(liter * 100) / 100000
            pint1 = Math.round((num3 * 0.03463) * 100000) / 100000
            pint2 = Math.round((num4 * 0.02976) * 100000) / 100000
            gallon1 = Math.round((num5 * 0.00433) * 100000) / 100000
            gallon2 = Math.round((num6 * 0.00372) * 100000) / 100000
            barrel1 = Math.round((num7 * 0.00014) * 100000) / 100000
            barrel2 = Math.round((num8 * 0.0001) * 100000) / 100000
            ktommer = Math.round((num9 * 1) * 100000) / 100000
            alegallon = Math.round((num10 * 0.00008445163612344) * 100000) / 100000
            jumfru = Math.round((num11 * 0.00475814752094) * 100000) / 100000
            anker = Math.round((num12 * 0.000002669969515304) * 100000) / 100000
            bolle = Math.round((num13 * 0.00003817463080416) * 100000) / 100000
            eske = Math.round((num14 * 0.000006362438467292) * 100000) / 100000
            fat = Math.round((num15 * 0.0000001112493301228) * 100000) / 100000
            favngml = Math.round((num16 * 0.00000004635343720602) * 100000) / 100000
            favnny = Math.round((num17 * 0.00000004294645958601) * 100000) / 100000
            korntonne = Math.round((num18 * 0.0000007416816807146) * 100000) / 100000
            kfot = Math.round((num19 * 0.000003336727198781) * 100000) / 100000
            oksehode = Math.round((num20 * 0.0000004450410326005) * 100000) / 100000
            fisktonne = Math.round((num21 * 0.0000008900820653041) * 100000) / 100000
            oltonne = Math.round((num22 * 0.0000007844699228634) * 100000) / 100000
            skrull = Math.round((num23 * 0.00003426009744763) * 100000) / 100000
        }
        if (vei == 9) {
            //fra alegallon
            liter = Math.round((num2 * 4.620004620005) * 100000) / 100000
            pint1 = Math.round((num3 * 9.76384670827) * 100000) / 100000
            pint2 = Math.round((num4 * 8.390744782952) * 100000) / 100000
            gallon1 = Math.round((num5 * 1.220488717727) * 100000) / 100000
            gallon2 = Math.round((num6 * 1.048873724772) * 100000) / 100000
            barrel1 = Math.round((num7 * 0.03877904722569) * 100000) / 100000
            barrel2 = Math.round((num8 * 0.02910162728113) * 100000) / 100000
            ktommer = Math.round((num9 * 281.9300661183) * 100000) / 100000
            alegallon = Math.round((num10 * 1) * 100000) / 100000
            jumfru = Math.round((num11 * 56.34154164934) * 100000) / 100000
            anker = Math.round((num12 * 0.1196768371125) * 100000) / 100000
            bolle = Math.round((num13 * 1.711112822222) * 100000) / 100000
            eske = Math.round((num14 * 0.2851854703673) * 100000) / 100000
            fat = Math.round((num15 * 0.004986561787942) * 100000) / 100000
            favngml = Math.round((num16 * 0.002077713892354) * 100000) / 100000
            favnny = Math.round((num17 * 0.001925001921922) * 100000) / 100000
            korntonne = Math.round((num18 * 0.0332446184061) * 100000) / 100000
            kfot = Math.round((num19 * 0.1495631149226) * 100000) / 100000
            oksehode = Math.round((num20 * 0.01994820647263) * 100000) / 100000
            fisktonne = Math.round((num21 * 0.03989641294987) * 100000) / 100000
            oltonne = Math.round((num22 * 0.03516252850081) * 100000) / 100000
            skrull = Math.round((num23 * 1.535650530164) * 100000) / 100000
        }
        if (vei == 10) {
            //fra jumfru
            liter = Math.round((num2 * 0.08200001312) * 100000) / 100000
            pint1 = Math.round((num3 * 0.1732971877276) * 100000) / 100000
            pint2 = Math.round((num4 * 0.1489259638282) * 100000) / 100000
            gallon1 = Math.round((num5 * 0.02166194346591) * 100000) / 100000
            gallon2 = Math.round((num6 * 0.0186156429785) * 100000) / 100000
            barrel1 = Math.round((num7 * 0.0006879801100768) * 100000) / 100000
            barrel2 = Math.round((num8 * 0.0005157800825248) * 100000) / 100000
            ktommer = Math.round((num9 * 5.003949120632) * 100000) / 100000
            alegallon = Math.round((num10 * 0.01774965073177) * 100000) / 100000
            jumfru = Math.round((num11 * 1) * 100000) / 100000
            anker = Math.round((num12 * 0.002124132554087) * 100000) / 100000
            bolle = Math.round((num13 * 0.0303703752296) * 100000) / 100000
            eske = Math.round((num14 * 0.005061729204879) * 100000) / 100000
            fat = Math.round((num15 * 0.00008850600067896) * 100000) / 100000
            favngml = Math.round((num16 * 0.00003687714200434) * 100000) / 100000
            favnny = Math.round((num17 * 0.00003416667207867) * 100000) / 100000
            korntonne = Math.round((num18 * 0.0005900555020369) * 100000) / 100000
            kfot = Math.round((num19 * 0.002654581195183) * 100000) / 100000
            oksehode = Math.round((num20 * 0.0003540587785114) * 100000) / 100000
            fisktonne = Math.round((num21 * 0.0007081175571048) * 100000) / 100000
            oltonne = Math.round((num22 * 0.0006240963019634) * 100000) / 100000
            skrull = Math.round((num23 * 0.02725611205581) * 100000) / 100000
        }
        if (vei == 11) {
            //fra anker
            liter = Math.round((num2 * 38.60400000095) * 100000) / 100000
            pint1 = Math.round((num3 * 81.58492152201) * 100000) / 100000
            pint2 = Math.round((num4 * 70.11142668173) * 100000) / 100000
            gallon1 = Math.round((num5 * 10.19801868025) * 100000) / 100000
            gallon2 = Math.round((num6 * 8.763880080216) * 100000) / 100000
            barrel1 = Math.round((num7 * 0.323887560008) * 100000) / 100000
            barrel2 = Math.round((num8 * 0.242819160006) * 100000) / 100000
            ktommer = Math.round((num9 * 2355.761231098) * 100000) / 100000
            alegallon = Math.round((num10 * 8.355835800206) * 100000) / 100000
            jumfru = Math.round((num11 * 470.7804124916) * 100000) / 100000
            anker = Math.round((num12 * 1) * 100000) / 100000
            bolle = Math.round((num13 * 14.29777777812) * 100000) / 100000
            eske = Math.round((num14 * 2.382962962994) * 100000) / 100000
            fat = Math.round((num15 * 0.04166689150762) * 100000) / 100000
            favngml = Math.round((num16 * 0.01736103612432) * 100000) / 100000
            favnny = Math.round((num17 * 0.01608499997466) * 100000) / 100000
            korntonne = Math.round((num18 * 0.2777865726419) * 100000) / 100000
            kfot = Math.round((num19 * 1.249724830061) * 100000) / 100000
            oksehode = Math.round((num20 * 0.1666839377939) * 100000) / 100000
            fisktonne = Math.round((num21 * 0.3333678756263) * 100000) / 100000
            oltonne = Math.round((num22 * 0.2938123144728) * 100000) / 100000
            skrull = Math.round((num23 * 12.83164367655) * 100000) / 100000
        }
        if (vei == 12) {
            //fra bolle
            liter = Math.round((num2 * 2.700000000003) * 100000) / 100000
            pint1 = Math.round((num3 * 5.706126000006) * 100000) / 100000
            pint2 = Math.round((num4 * 4.903659000005) * 100000) / 100000
            gallon1 = Math.round((num5 * 0.7132590000007) * 100000) / 100000
            gallon2 = Math.round((num6 * 0.6129540000006) * 100000) / 100000
            barrel1 = Math.round((num7 * 0.02265300000002) * 100000) / 100000
            barrel2 = Math.round((num8 * 0.01698300000002) * 100000) / 100000
            ktommer = Math.round((num9 * 164.7641520002) * 100000) / 100000
            alegallon = Math.round((num10 * 0.584419104006) * 100000) / 100000
            jumfru = Math.round((num11 * 32.92682400003) * 100000) / 100000
            anker = Math.round((num12 * 0.06994093876117) * 100000) / 100000
            bolle = Math.round((num13 * 1) * 100000) / 100000
            eske = Math.round((num14 * 0.1666666666649) * 100000) / 100000
            fat = Math.round((num15 * 0.002914221507303) * 100000) / 100000
            favngml = Math.round((num16 * 0.001214247164401) * 100000) / 100000
            favnny = Math.round((num17 * 0.001124999998201) * 100000) / 100000
            korntonne = Math.round((num18 * 0.01942865366582) * 100000) / 100000
            kfot = Math.round((num19 * 0.08740692780759) * 100000) / 100000
            oksehode = Math.round((num20 * 0.01165803108571) * 100000) / 100000
            fisktonne = Math.round((num21 * 0.02331606217412) * 100000) / 100000
            oltonne = Math.round((num22 * 0.02054950909382) * 100000) / 100000
            skrull = Math.round((num23 * 0.8974572045867) * 100000) / 100000
        }
        if (vei == 13) {
            //fra eske
            liter = Math.round((num2 * 16.20000000019) * 100000) / 100000
            pint1 = Math.round((num3 * 34.2367560004) * 100000) / 100000
            pint2 = Math.round((num4 * 29.42195400035) * 100000) / 100000
            gallon1 = Math.round((num5 * 4.27955400005) * 100000) / 100000
            gallon2 = Math.round((num6 * 3.677724000043) * 100000) / 100000
            barrel1 = Math.round((num7 * 0.1359180000016) * 100000) / 100000
            barrel2 = Math.round((num8 * 0.1018980000012) * 100000) / 100000
            ktommer = Math.round((num9 * 988.5849120117) * 100000) / 100000
            alegallon = Math.round((num10 * 3.506490000041) * 100000) / 100000
            jumfru = Math.round((num11 * 197.5609440023) * 100000) / 100000
            anker = Math.round((num12 * 0.4196456325716) * 100000) / 100000
            bolle = Math.round((num13 * 6.000000000065) * 100000) / 100000
            eske = Math.round((num14 * 1) * 100000) / 100000
            fat = Math.round((num15 * 0.01748532904401) * 100000) / 100000
            favngml = Math.round((num16 * 0.007285482986486) * 100000) / 100000
            favnny = Math.round((num17 * 0.00674999998928) * 100000) / 100000
            korntonne = Math.round((num18 * 0.1165719219962) * 100000) / 100000
            kfot = Math.round((num19 * 0.5244415668512) * 100000) / 100000
            oksehode = Math.round((num20 * 0.06994818651503) * 100000) / 100000
            fisktonne = Math.round((num21 * 0.1398963730463) * 100000) / 100000
            oltonne = Math.round((num22 * 0.1232970545643) * 100000) / 100000
            skrull = Math.round((num23 * 5.384743227578) * 100000) / 100000
        }
        if (vei == 14) {
            //fra fat
            liter = Math.round((num2 * 926.4910005079) * 100000) / 100000
            pint1 = Math.round((num3 * 1958.027550653) * 100000) / 100000
            pint2 = Math.round((num4 * 1682.665160392) * 100000) / 100000
            gallon1 = Math.round((num5 * 244.7511276042) * 100000) / 100000
            gallon2 = Math.round((num6 * 210.3319869353) * 100000) / 100000
            barrel1 = Math.round((num7 * 7.773259494261) * 100000) / 100000
            barrel2 = Math.round((num8 * 5.827628393195) * 100000) / 100000
            ktommer = Math.round((num9 * 56537.96445715) * 100000) / 100000
            alegallon = Math.round((num10 * 200.5389770599) * 100000) / 100000
            jumfru = Math.round((num11 * 11298.66893011) * 100000) / 100000
            anker = Math.round((num12 * 23.99987049231) * 100000) / 100000
            bolle = Math.round((num13 * 343.1448150026) * 100000) / 100000
            eske = Math.round((num14 * 57.19080249981) * 100000) / 100000
            fat = Math.round((num15 * 1) * 100000) / 100000
            favngml = Math.round((num16 * 0.4166626185959) * 100000) / 100000
            favnny = Math.round((num17 * 0.3860379162606) * 100000) / 100000
            korntonne = Math.round((num18 * 6.666841767907) * 100000) / 100000
            kfot = Math.round((num19 * 29.99323407248) * 100000) / 100000
            oksehode = Math.round((num20 * 4.000392920201) * 100000) / 100000
            fisktonne = Math.round((num21 * 8.000785841328) * 100000) / 100000
            oltonne = Math.round((num22 * 7.051457496393) * 100000) / 100000
            skrull = Math.round((num23 * 307.9577864406) * 100000) / 100000
        }
        if (vei == 15) {
            //fra favngml
            liter = Math.round((num2 * 2223.600004316) * 100000) / 100000
            pint1 = Math.round((num3 * 4699.31177712) * 100000) / 100000
            pint2 = Math.round((num4 * 4038.435619838) * 100000) / 100000
            gallon1 = Math.round((num5 * 587.40841314) * 100000) / 100000
            gallon2 = Math.round((num6 * 504.8016729797) * 100000) / 100000
            barrel1 = Math.round((num7 * 18.65600403621) * 100000) / 100000
            barrel2 = Math.round((num8 * 13.98644402714) * 100000) / 100000
            ktommer = Math.round((num9 * 135692.4329994) * 100000) / 100000
            alegallon = Math.round((num10 * 481.2982209341) * 100000) / 100000
            jumfru = Math.round((num11 * 27117.06888463) * 100000) / 100000
            anker = Math.round((num12 * 57.60024878927) * 100000) / 100000
            bolle = Math.round((num13 * 823.5555571531) * 100000) / 100000
            eske = Math.round((num14 * 137.259259524) * 100000) / 100000
            fat = Math.round((num15 * 2.400023317114) * 100000) / 100000
            favngml = Math.round((num16 * 1) * 100000) / 100000
            favnny = Math.round((num17 * 0.9265000003158) * 100000) / 100000
            korntonne = Math.round((num18 * 16.00057569449) * 100000) / 100000
            kfot = Math.round((num19 * 71.98446112962) * 100000) / 100000
            oksehode = Math.round((num20 * 9.601036286101) * 100000) / 100000
            fisktonne = Math.round((num21 * 19.20207257443) * 100000) / 100000
            oltonne = Math.round((num22 * 16.92366241098) * 100000) / 100000
            skrull = Math.round((num23 * 739.1058681445) * 100000) / 100000
        }
        if (vei == 16) {
            //fra favnny
            liter = Math.round((num2 * 2399.99999808) * 100000) / 100000
            pint1 = Math.round((num3 * 5072.111995942) * 100000) / 100000
            pint2 = Math.round((num4 * 4358.807996513) * 100000) / 100000
            gallon1 = Math.round((num5 * 634.0079994928) * 100000) / 100000
            gallon2 = Math.round((num6 * 544.8479995641) * 100000) / 100000
            barrel1 = Math.round((num7 * 20.13599998389) * 100000) / 100000
            barrel2 = Math.round((num8 * 15.09599998792) * 100000) / 100000
            ktommer = Math.round((num9 * 146457.0238828) * 100000) / 100000
            alegallon = Math.round((num10 * 519.4799995844) * 100000) / 100000
            jumfru = Math.round((num11 * 29268.28797659) * 100000) / 100000
            anker = Math.round((num12 * 62.16972329346) * 100000) / 100000
            bolle = Math.round((num13 * 888.8888881769) * 100000) / 100000
            eske = Math.round((num14 * 148.1481480279) * 100000) / 100000
            fat = Math.round((num15 * 2.590419115528) * 100000) / 100000
            favngml = Math.round((num16 * 1.079330811937) * 100000) / 100000
            favnny = Math.round((num17 * 1) * 100000) / 100000
            korntonne = Math.round((num18 * 17.26991435578) * 100000) / 100000
            kfot = Math.round((num19 * 77.69504687784) * 100000) / 100000
            oksehode = Math.round((num20 * 10.36269429011) * 100000) / 100000
            fisktonne = Math.round((num21 * 20.72538858262) * 100000) / 100000
            oltonne = Math.round((num22 * 18.26623029099) * 100000) / 100000
            skrull = Math.round((num23 * 797.7397367714) * 100000) / 100000
        }
        if (vei == 17) {
            //fra korntonne
            liter = Math.round((num2 * 138.9700000033) * 100000) / 100000
            pint1 = Math.round((num3 * 293.6964186069) * 100000) / 100000
            pint2 = Math.round((num4 * 252.393144906) * 100000) / 100000
            gallon1 = Math.round((num5 * 36.71170490087) * 100000) / 100000
            gallon2 = Math.round((num6 * 31.54896940075) * 100000) / 100000
            barrel1 = Math.round((num7 * 1.165958300028) * 100000) / 100000
            barrel2 = Math.round((num8 * 0.8741213000206) * 100000) / 100000
            ktommer = Math.round((num9 * 8480.4719274) * 100000) / 100000
            alegallon = Math.round((num10 * 30.08005650071) * 100000) / 100000
            jumfru = Math.round((num11 * 1694.75582644) * 100000) / 100000
            anker = Math.round((num12 * 3.59988602217) * 100000) / 100000
            bolle = Math.round((num13 * 51.47037037153) * 100000) / 100000
            eske = Math.round((num14 * 8.57839506183) * 100000) / 100000
            fat = Math.round((num15 * 0.1499960603256) * 100000) / 100000
            favngml = Math.round((num16 * 0.06249775127432) * 100000) / 100000
            favnny = Math.round((num17 * 0.05790416657539) * 100000) / 100000
            korntonne = Math.round((num18 * 1) * 100000) / 100000
            kfot = Math.round((num19 * 4.498866947295) * 100000) / 100000
            oksehode = Math.round((num20 * 0.6000431777844) * 100000) / 100000
            fisktonne = Math.round((num21 * 1.200086355708) * 100000) / 100000
            oltonne = Math.round((num22 * 1.057690844012) * 100000) / 100000
            skrull = Math.round((num23 * 46.19245471268) * 100000) / 100000
        }
        if (vei == 18) {
            //fra kfot
            liter = Math.round((num2 * 30.8900000003) * 100000) / 100000
            kmeter = Math.round(liter * 100) / 100000
            pint1 = Math.round((num3 * 65.28230820064) * 100000) / 100000
            pint2 = Math.round((num4 * 56.10149130055) * 100000) / 100000
            gallon1 = Math.round((num5 * 8.16021130008) * 100000) / 100000
            gallon2 = Math.round((num6 * 7.012647800068) * 100000) / 100000
            barrel1 = Math.round((num7 * 0.2591671000025) * 100000) / 100000
            barrel2 = Math.round((num8 * 0.1942981000019) * 100000) / 100000
            ktommer = Math.round((num9 * 1885.023946418) * 100000) / 100000
            alegallon = Math.round((num10 * 6.686140500065) * 100000) / 100000
            jumfru = Math.round((num11 * 376.7072568037) * 100000) / 100000
            anker = Math.round((num12 * 0.8001761475376) * 100000) / 100000
            bolle = Math.round((num13 * 11.44074074084) * 100000) / 100000
            eske = Math.round((num14 * 1.906790123453) * 100000) / 100000
            fat = Math.round((num15 * 0.03334085272644) * 100000) / 100000
            favngml = Math.round((num16 * 0.01389188700322) * 100000) / 100000
            favnny = Math.round((num17 * 0.01287083331287) * 100000) / 100000
            korntonne = Math.round((num18 * 0.2222781895342) * 100000) / 100000
            kfot = Math.round((num19 * 1) * 100000) / 100000
            oksehode = Math.round((num20 * 0.1333765112003) * 100000) / 100000
            fisktonne = Math.round((num21 * 0.2667530224315) * 100000) / 100000
            oltonne = Math.round((num22 * 0.235101605894) * 100000) / 100000
            skrull = Math.round((num23 * 10.26757520368) * 100000) / 100000
        }
        if (vei == 19) {
            //fra oksehode
            liter = Math.round((num2 * 231.6000000473) * 100000) / 100000
            pint1 = Math.round((num3 * 489.4588081) * 100000) / 100000
            pint2 = Math.round((num4 * 420.624972086) * 100000) / 100000
            gallon1 = Math.round((num5 * 61.18177201251) * 100000) / 100000
            gallon2 = Math.round((num6 * 52.57841332675) * 100000) / 100000
            barrel1 = Math.round((num7 * 1.943124000397) * 100000) / 100000
            barrel2 = Math.round((num8 * 1.456764000298) * 100000) / 100000
            ktommer = Math.round((num9 * 14133.10281889) * 100000) / 100000
            alegallon = Math.round((num10 * 50.12982001025) * 100000) / 100000
            jumfru = Math.round((num11 * 2824.389792577) * 100000) / 100000
            anker = Math.round((num12 * 5.999378303845) * 100000) / 100000
            bolle = Math.round((num13 * 85.77777779522) * 100000) / 100000
            eske = Math.round((num14 * 14.29629629905) * 100000) / 100000
            fat = Math.round((num15 * 0.2499754448995) * 100000) / 100000
            favngml = Math.round((num16 * 0.1041554234565) * 100000) / 100000
            favnny = Math.round((num17 * 0.09649999986532) * 100000) / 100000
            korntonne = Math.round((num18 * 1.666546737007) * 100000) / 100000
            kfot = Math.round((num19 * 7.497572031243) * 100000) / 100000
            oksehode = Math.round((num20 * 1) * 100000) / 100000
            fisktonne = Math.round((num21 * 2.000000000232) * 100000) / 100000
            oltonne = Math.round((num22 * 1.762691224851) * 100000) / 100000
            skrull = Math.round((num23 * 76.98188467576) * 100000) / 100000
        }
        if (vei == 20) {
            //fra fisktonne
            liter = Math.round((num2 * 115.8000000103) * 100000) / 100000
            pint1 = Math.round((num3 * 244.7294040217) * 100000) / 100000
            pint2 = Math.round((num4 * 210.3124860186) * 100000) / 100000
            gallon1 = Math.round((num5 * 30.59088600271) * 100000) / 100000
            gallon2 = Math.round((num6 * 26.28891600233) * 100000) / 100000
            barrel1 = Math.round((num7 * 0.9715620000861) * 100000) / 100000
            barrel2 = Math.round((num8 * 0.7283820000645) * 100000) / 100000
            ktommer = Math.round((num9 * 7066.551408626) * 100000) / 100000
            alegallon = Math.round((num10 * 25.06563491022) * 100000) / 100000
            jumfru = Math.round((num11 * 1412.194896125) * 100000) / 100000
            anker = Math.round((num12 * 2.999689151575) * 100000) / 100000
            bolle = Math.round((num13 * 42.88888889265) * 100000) / 100000
            eske = Math.round((num14 * 7.148148148697) * 100000) / 100000
            fat = Math.round((num15 * 0.1249877224353) * 100000) / 100000
            favngml = Math.round((num16 * 0.05207771172221) * 100000) / 100000
            favnny = Math.round((num17 * 0.04824999992707) * 100000) / 100000
            korntonne = Math.round((num18 * 0.833273368407) * 100000) / 100000
            kfot = Math.round((num19 * 3.748786015187) * 100000) / 100000
            oksehode = Math.round((num20 * 0.4999999999421) * 100000) / 100000
            fisktonne = Math.round((num21 * 1) * 100000) / 100000
            oltonne = Math.round((num22 * 0.8813456123233) * 100000) / 100000
            skrull = Math.round((num23 * 38.49094233342) * 100000) / 100000
        }
        if (vei == 21) {
            //fra oltonne
            liter = Math.round((num2 * 131.3900000081) * 100000) / 100000
            pint1 = Math.round((num3 * 277.676998217) * 100000) / 100000
            pint2 = Math.round((num4 * 238.6265763146) * 100000) / 100000
            gallon1 = Math.round((num5 * 34.70929630213) * 100000) / 100000
            gallon2 = Math.round((num6 * 29.82815780183) * 100000) / 100000
            barrel1 = Math.round((num7 * 1.102362100068) * 100000) / 100000
            barrel2 = Math.round((num8 * 0.8264431000507) * 100000) / 100000
            ktommer = Math.round((num9 * 8017.911826892) * 100000) / 100000
            alegallon = Math.round((num10 * 28.43936550174) * 100000) / 100000
            jumfru = Math.round((num11 * 1602.316816898) * 100000) / 100000
            anker = Math.round((num12 * 3.403533312735) * 100000) / 100000
            bolle = Math.round((num13 * 48.6629629659) * 100000) / 100000
            eske = Math.round((num14 * 8.110493827562) * 100000) / 100000
            fat = Math.round((num15 * 0.1418146532843) * 100000) / 100000
            favngml = Math.round((num16 * 0.0590888647927) * 100000) / 100000
            favnny = Math.round((num17 * 0.0547458332491) * 100000) / 100000
            korntonne = Math.round((num18 * 0.9454558538171) * 100000) / 100000
            kfot = Math.round((num19 * 4.253480090864) * 100000) / 100000
            oksehode = Math.round((num20 * 0.5673143349793) * 100000) / 100000
            fisktonne = Math.round((num21 * 1.13462867009) * 100000) / 100000
            oltonne = Math.round((num22 * 1) * 100000) / 100000
            skrull = Math.round((num23 * 43.67292671028) * 100000) / 100000
        }
        if (vei == 22) {
            //fra skrull
            liter = Math.round((num2 * 3.008500000004) * 100000) / 100000
            pint1 = Math.round((num3 * 6.358103730009) * 100000) / 100000
            pint2 = Math.round((num4 * 5.463947445007) * 100000) / 100000
            gallon1 = Math.round((num5 * 0.7947554450011) * 100000) / 100000
            gallon2 = Math.round((num6 * 0.6829896700009) * 100000) / 100000
            barrel1 = Math.round((num7 * 0.02524131500003) * 100000) / 100000
            barrel2 = Math.round((num8 * 0.01892346500003) * 100000) / 100000
            ktommer = Math.round((num9 * 183.5899819602) * 100000) / 100000
            alegallon = Math.round((num10 * 0.6511898250009) * 100000) / 100000
            jumfru = Math.round((num11 * 36.68901852005) * 100000) / 100000
            anker = Math.round((num12 * 0.07793233861595) * 100000) / 100000
            bolle = Math.round((num13 * 1.11425925926) * 100000) / 100000
            eske = Math.round((num14 * 0.1857098765413) * 100000) / 100000
            fat = Math.round((num15 * 0.003247198298046) * 100000) / 100000
            favngml = Math.round((num16 * 0.001352986145964) * 100000) / 100000
            favnny = Math.round((num17 * 0.001253541664663) * 100000) / 100000
            korntonne = Math.round((num18 * 0.02164855724209) * 100000) / 100000
            kfot = Math.round((num19 * 0.09739397863304) * 100000) / 100000
            oksehode = Math.round((num20 * 0.01299006908199) * 100000) / 100000
            fisktonne = Math.round((num21 * 0.02598013816699) * 100000) / 100000
            oltonne = Math.round((num22 * 0.02289748078103) * 100000) / 100000
            skrull = Math.round((num23 * 1) * 100000) / 100000
        }
        if (vei == 23) {
            //fra kmeter
            liter = Math.round((num2 * 1000) * 100000) / 100000
            kmeter = Math.round((num24 * 1) * 100000) / 100000
            pint1 = Math.round((1000 * num3 * 2.11338) * 100000) / 100000
            pint2 = Math.round((1000 * num4 * 1.81617) * 100000) / 100000
            gallon1 = Math.round((1000 * num5 * 0.26417) * 100000) / 100000
            gallon2 = Math.round((1000 * num6 * 0.22702) * 100000) / 100000
            barrel1 = Math.round((1000 * num7 * 0.00839) * 100000) / 100000
            barrel2 = Math.round((1000 * num8 * 0.00629) * 100000) / 100000
            ktommer = Math.round((1000 * num9 * 61.02376) * 100000) / 100000
            alegallon = Math.round((1000 * num10 * 0.21645) * 100000) / 100000
            jumfru = Math.round((1000 * num11 * 12.19512) * 100000) / 100000
            anker = Math.round((1000 * num12 * 0.02590405139364) * 100000) / 100000
            bolle = Math.round((1000 * num13 * 0.3703703703704) * 100000) / 100000
            eske = Math.round((1000 * num14 * 0.06172839506173) * 100000) / 100000
            fat = Math.round((1000 * num15 * 0.001079341299592) * 100000) / 100000
            favngml = Math.round((1000 * num16 * 0.0004497211728728) * 100000) / 100000
            favnny = Math.round((1000 * num17 * 0.0004166666666667) * 100000) / 100000
            korntonne = Math.round((1000 * num18 * 0.00719579765417) * 100000) / 100000
            kfot = Math.round((1000 * num19 * 0.03237293622532) * 100000) / 100000
            oksehode = Math.round((1000 * num20 * 0.004317789291883) * 100000) / 100000
            fisktonne = Math.round((1000 * num21 * 0.008635578583765) * 100000) / 100000
            oltonne = Math.round((1000 * num22 * 0.007610929294467) * 100000) / 100000
            skrull = Math.round((1000 * num23 * 0.3323915572544) * 100000) / 100000
        }

        document.lengdemaal.Lengde2.value = liter
        document.lengdemaal.Lengde3.value = pint1
        document.lengdemaal.Lengde4.value = pint2
        document.lengdemaal.Lengde5.value = gallon1
        document.lengdemaal.Lengde6.value = gallon2
        document.lengdemaal.Lengde7.value = barrel1
        document.lengdemaal.Lengde8.value = barrel2
        document.lengdemaal.Lengde9.value = ktommer
        document.lengdemaal.Lengde10.value = alegallon
        document.lengdemaal.Lengde11.value = jumfru
        document.lengdemaal.Lengde12.value = anker
        document.lengdemaal.Lengde13.value = bolle
        document.lengdemaal.Lengde14.value = eske
        document.lengdemaal.Lengde15.value = fat
        document.lengdemaal.Lengde16.value = favngml
        document.lengdemaal.Lengde17.value = favnny
        document.lengdemaal.Lengde18.value = korntonne
        document.lengdemaal.Lengde19.value = kfot
        document.lengdemaal.Lengde20.value = oksehode
        document.lengdemaal.Lengde21.value = fisktonne
        document.lengdemaal.Lengde22.value = oltonne
        document.lengdemaal.Lengde23.value = skrull
        document.lengdemaal.Lengde24.value = kmeter
    }
}
function resetvalue() {
	document.lengdemaal.Lengde.value=""
	document.lengdemaal.select.selectedIndex="0"
	document.lengdemaal.Lengde2.value=""
	document.lengdemaal.Lengde3.value=""
	document.lengdemaal.Lengde4.value=""
	document.lengdemaal.Lengde5.value=""
	document.lengdemaal.Lengde6.value=""
	document.lengdemaal.Lengde7.value=""
	document.lengdemaal.Lengde8.value=""
	document.lengdemaal.Lengde9.value=""
	document.lengdemaal.Lengde10.value=""
	document.lengdemaal.Lengde11.value=""
	document.lengdemaal.Lengde12.value=""
	document.lengdemaal.Lengde13.value=""
	document.lengdemaal.Lengde14.value=""
	document.lengdemaal.Lengde15.value=""
	document.lengdemaal.Lengde16.value=""
	document.lengdemaal.Lengde17.value=""
	document.lengdemaal.Lengde18.value=""
	document.lengdemaal.Lengde19.value=""
	document.lengdemaal.Lengde20.value=""
	document.lengdemaal.Lengde21.value=""
	document.lengdemaal.Lengde22.value=""
	document.lengdemaal.Lengde23.value=""
	document.lengdemaal.Lengde24.value=""
}
function convert() {
    vei = document.getElementById('select').value;
        var meter , yard , fot , foot , tommer , alen , favn , mannshoyde , pilskudd , nautisk
		num2=parseFloat(document.lengdemaal.Lengde.value)
		num3=parseFloat(document.lengdemaal.Lengde.value)
		num4=parseFloat(document.lengdemaal.Lengde.value)
		num5=parseFloat(document.lengdemaal.Lengde.value)
		num6=parseFloat(document.lengdemaal.Lengde.value)
		num7=parseFloat(document.lengdemaal.Lengde.value)
		num8=parseFloat(document.lengdemaal.Lengde.value)
		num9=parseFloat(document.lengdemaal.Lengde.value)
		num10=parseFloat(document.lengdemaal.Lengde.value)
		num11=parseFloat(document.lengdemaal.Lengde.value)
		num12=parseFloat(document.lengdemaal.Lengde.value)
		num13=parseFloat(document.lengdemaal.Lengde.value)
		num14=parseFloat(document.lengdemaal.Lengde.value)
		num15=parseFloat(document.lengdemaal.Lengde.value)
		num16=parseFloat(document.lengdemaal.Lengde.value)
		num17=parseFloat(document.lengdemaal.Lengde.value)
		num18=parseFloat(document.lengdemaal.Lengde.value)
		num19=parseFloat(document.lengdemaal.Lengde.value)
		num20=parseFloat(document.lengdemaal.Lengde.value)
		num21=parseFloat(document.lengdemaal.Lengde.value)
		num22=parseFloat(document.lengdemaal.Lengde.value)
		num23=parseFloat(document.lengdemaal.Lengde.value)


if (vei==1) {
//fra kvmeter
	Kvmeter=Math.round((num2*1)*100000)/100000
	Town=Math.round((num3*0.0000000107251)*100000)/100000
	Miles=Math.round((num4*0.0000003861022)*100000)/100000
	Acres=Math.round((num5*0.0002471044)*100000)/100000
	Yards=Math.round((num6*1.1959899890900)*100000)/100000
	Feet=Math.round((num7*10.7639104167000)*100000)/100000
	Km2=Math.round((num8*0.000001)*100000)/100000
	Ha=Math.round((num9*0.0001)*100000)/100000
	Maal=Math.round((num10* 0.001)*100000)/100000
	Rode=Math.round((num11* 0.1015950421619)*100000)/100000
	
	    }
if (vei==2) {
//fra Town
	Kvmeter=Math.round((num2*93239571.9678568585)*100000)/100000
	Town=Math.round((num3*1)*100000)/100000
	Miles=Math.round((num4*36.0000015320194)*100000)/100000
	Acres=Math.round((num5*23039.9056179262610)*100000)/100000
	Yards=Math.round((num6*111513594.6605933940000)*100000)/100000
	Feet=Math.round((num7*1003622399.9534637600000)*100000)/100000
	Km2=Math.round((num8*93.2395719678569)*100000)/100000
	Ha=Math.round((num9*9323.95719678569)*100000)/100000
	Maal=Math.round((num10* 93239.5719678569)*100000)/100000
	Rode=Math.round((num11* 9472678.245148)*100000)/100000
	        }
if (vei==3) {
//fra miles 
	Kvmeter=Math.round((num2*2589987.9999984716300)*100000)/100000
	Town=Math.round((num3*0.0277777765957)*100000)/100000
	Miles=Math.round((num4*1)*100000)/100000
	Acres=Math.round((num5*639.9973510399416)*100000)/100000
	Yards=Math.round((num6*3097599.7198614030000)*100000)/100000
	Feet=Math.round((num7*27878398.8123115483)*100000)/100000
	Km2=Math.round((num8*2.5899879999985)*100000)/100000
	Ha=Math.round((num9*258.99879999985)*100000)/100000
	Maal=Math.round((num10*2589.9879999985)*100000)/100000
	Rode=Math.round((num11*263129.940059)*100000)/100000	        }      
if (vei==4) {
//fra acres
	Kvmeter=Math.round((num2*4046.8730000053280)*100000)/100000
	Town=Math.round((num3*0.0000434029556)*100000)/100000
	Miles=Math.round((num4*0.0015625064672)*100000)/100000
	Acres=Math.round((num5*1)*100000)/100000
	Yards=Math.round((num6*4840.0195951249878)*100000)/100000
	Feet=Math.round((num7*43560.1784398193293)*100000)/100000
	Km2=Math.round((num8*0.0040468730000)*100000)/100000
	Ha=Math.round((num9*0.40468730000)*100000)/100000
	Maal=Math.round((num10*4.0468730000)*100000)/100000
	Rode=Math.round((num11* 411.1422330593)*100000)/100000
	        }      
if (vei==5) {
//fra yards
	Kvmeter=Math.round((num2*0.8361273999968)*100000)/100000
	Town=Math.round((num3*0.0000000089675)*100000)/100000
	Miles=Math.round((num4*0.0000003228306)*100000)/100000
	Acres=Math.round((num5*0.0002066107338)*100000)/100000
	Yards=Math.round((num6*1)*100000)/100000
	Feet=Math.round((num7*9.0000004305136)*100000)/100000
	Km2=Math.round((num8*0.0000008361274)*100000)/100000
	Ha=Math.round((num9*0.00008361274)*100000)/100000
	Maal=Math.round((num10*0.0008361274)*100000)/100000
	Rode=Math.round((num11* 0.08494639845456)*100000)/100000
	        }
if (vei==6) {
//fra feet
	Kvmeter=Math.round((num2*0.0929030400001)*100000)/100000
	Town=Math.round((num3*0.0000000009964)*100000)/100000
	Miles=Math.round((num4*0.0000000358701)*100000)/100000
	Acres=Math.round((num5*0.0000229567471)*100000)/100000
	Yards=Math.round((num6*0.1111111057961)*100000)/100000
	Feet=Math.round((num7*1)*100000)/100000
	Km2=Math.round((num8*0.0000000929030)*100000)/100000
	Ha=Math.round((num9*0.00000929030)*100000)/100000
	Maal=Math.round((num10*0.0000929030)*100000)/100000
	Rode=Math.round((num11* 0.009438488265685)*100000)/100000
        }
if (vei==7) {
//fra km2
	Kvmeter=Math.round((num2*1000000)*100000)/100000
	Town=Math.round((num3*0.01072505996)*100000)/100000
	Miles=Math.round((num4*0.3861021749910)*100000)/100000
	Acres=Math.round((num5*247.104369225)*100000)/100000
	Yards=Math.round((num6*1195989.98909)*100000)/100000
	Feet=Math.round((num7*10763910.4167000)*100000)/100000
	Km2=Math.round((num8*1)*100000)/100000
	Ha=Math.round((num9*100)*100000)/100000
	Maal=Math.round((num10*1000)*100000) /100000
	Rode=Math.round((num11* 101595.042161)*100000)/100000
        }
if (vei==8) {
//fra ha
	Kvmeter=Math.round((num2*10000)*100000)/100000
	Town=Math.round((num3*0.000107251)*100000)/100000
	Miles=Math.round((num4*0.003861022)*100000)/100000
	Acres=Math.round((num5*2.471044)*100000)/100000
	Yards=Math.round((num6*11959.899890900)*100000)/100000
	Feet=Math.round((num7*107639.104167000)*100000)/100000
	Km2=Math.round((num8*0.01)*100000)/100000
	Ha=Math.round((num9*1)*100000)/100000
	Maal=Math.round((num10*10)*100000)/100000
	Rode=Math.round((num11*1015.950421619)*100000)/100000
        }
if (vei==9) {
//fra maal
	Kvmeter=Math.round((num2*1000)*100000)/100000
	Town=Math.round((num3*0.0000107251)*100000)/100000
	Miles=Math.round((num4*0.0003861022)*100000)/100000
	Acres=Math.round((num5*0.2471044)*100000)/100000
	Yards=Math.round((num6*1195.9899890900)*100000)/100000
	Feet=Math.round((num7*10763.9104167000)*100000)/100000
	Km2=Math.round((num8*0.001)*100000)/100000
	Ha=Math.round((num9*0.1)*100000)/100000
	Maal=Math.round((num10*1)*100000)/100000
	Rode=Math.round((num11*101.5950421619)*100000)/100000
	}
	if (vei==10) {
//fra rode
	Kvmeter=Math.round((num2*9.842999999994)*100000)/100000
	Town=Math.round((num3* 0.0000001055661749999)*100000)/100000
	Miles=Math.round((num4* 0.000003800401985998)*100000)/100000
	Acres=Math.round((num5* 0.002432248609199)*100000)/100000
	Yards=Math.round((num6* 11.77212946261)*100000)/100000
	Feet=Math.round((num7* 105.9491702315)*100000)/100000
	Km2=Math.round((num8* 0.000009842999999994)*100000)/100000
	Ha=Math.round((num9* 0.0009842999999994)*100000)/100000
	Maal=Math.round((num10*0.009842999999994)*100000)/100000
	Rode=Math.round((num11*1)*100000)/100000
	}



		document.lengdemaal.Lengde2.value=Kvmeter
		document.lengdemaal.Lengde3.value=Town
		document.lengdemaal.Lengde4.value=Miles
		document.lengdemaal.Lengde5.value=Acres
		document.lengdemaal.Lengde6.value=Yards
		document.lengdemaal.Lengde7.value=Feet
		document.lengdemaal.Lengde8.value=Km2
		document.lengdemaal.Lengde9.value=Ha
		document.lengdemaal.Lengde10.value=Maal
		document.lengdemaal.Lengde11.value=Rode
}
function resetvalue() {
                document.lengdemaal.Lengde.value=""
                document.lengdemaal.select.selectedIndex="0"
                document.lengdemaal.Lengde2.value=""
                document.lengdemaal.Lengde3.value=""
                document.lengdemaal.Lengde4.value=""
                document.lengdemaal.Lengde5.value=""
                document.lengdemaal.Lengde6.value=""
                document.lengdemaal.Lengde7.value=""
                document.lengdemaal.Lengde8.value=""
                document.lengdemaal.Lengde9.value=""
                document.lengdemaal.Lengde10.value=""
				document.lengdemaal.Lengde11.value=""
				
}
function convertWeight() {
    vei = document.getElementById('select').value;
    insertedValue = document.getElementById('Vekt').value;
    if (vei == "" || insertedValue == "") {
        document.getElementById('alertAllFill').className = 'alertAllFillB';
    }
    else {
        document.getElementById('alertAllFill').className = 'alertAllFill';
        var kilo, bismerpund, drittel, foot, tommer, alen, favn, mannshoyde, pilskudd, nautisk
        num2 = parseFloat(document.lengdemaal.Vekt.value)
        num3 = parseFloat(document.lengdemaal.Vekt.value)
        num4 = parseFloat(document.lengdemaal.Vekt.value)
        num5 = parseFloat(document.lengdemaal.Vekt.value)
        num6 = parseFloat(document.lengdemaal.Vekt.value)
        num7 = parseFloat(document.lengdemaal.Vekt.value)
        num8 = parseFloat(document.lengdemaal.Vekt.value)
        num9 = parseFloat(document.lengdemaal.Vekt.value)
        num10 = parseFloat(document.lengdemaal.Vekt.value)
        num11 = parseFloat(document.lengdemaal.Vekt.value)
        num12 = parseFloat(document.lengdemaal.Vekt.value)
        num13 = parseFloat(document.lengdemaal.Vekt.value)
        num14 = parseFloat(document.lengdemaal.Vekt.value)
        num15 = parseFloat(document.lengdemaal.Vekt.value)
        num16 = parseFloat(document.lengdemaal.Vekt.value)
        num17 = parseFloat(document.lengdemaal.Vekt.value)
        num18 = parseFloat(document.lengdemaal.Vekt.value)
        num19 = parseFloat(document.lengdemaal.Vekt.value)
        num20 = parseFloat(document.lengdemaal.Vekt.value)


        if (vei == 1) {

            //fra kilo

            kilo = Math.round((num2 * 1) * 100000) / 100000
            bismerpund = Math.round((num3 * 0.1673024158469) * 100000) / 100000
            drittel = Math.round((num4 * 0.02) * 100000) / 100000
            karat = Math.round((num5 * 52.08333333333) * 100000) / 100000
            lest = Math.round((num6 * 0.3384094754653) * 100000) / 100000
            marksalg = Math.round((num7 * 4) * 100000) / 100000
            pundsalg = Math.round((num8 * 2.007628990163) * 100000) / 100000
            skippund = Math.round((num9 * 0.006273840594258) * 100000) / 100000
            skipslast = Math.round((num10 * 0.0003860824981082) * 100000) / 100000
            skruppel = Math.round((num11 * 806.4516129032) * 100000) / 100000
            kornspann = Math.round((num12 * 0.111111111111111) * 100000) / 100000
            unsesolv = Math.round((num13 * 34.12969283276) * 100000) / 100000
            otting = Math.round((num14 * 0.07142857142857) * 100000) / 100000
            longtonn = Math.round((num15 * 0.0009842519685039) * 100000) / 100000
            grains = Math.round((num16 * 16666.66666667) * 100000) / 100000
            stone = Math.round((num17 * 0.157331655129) * 100000) / 100000
            poundsbr = Math.round((num18 * 2.202643171806) * 100000) / 100000
            ouncesbr = Math.round((num19 * 35.23608174771) * 100000) / 100000
            talent = Math.round((num20 * 0.03797660641045) * 100000) / 100000
        }
        if (vei == 2) {
            //fra bismerpund
            kilo = Math.round((num2 * 5.97720) * 100000) / 100000
            bismerpund = Math.round((num3 * 1) * 100000) / 100000
            drittel = Math.round((num4 * 0.119544) * 100000) / 100000
            karat = Math.round((num5 * 311.3125000016) * 100000) / 100000
            lest = Math.round((num6 * 2.02274111676) * 100000) / 100000
            marksalg = Math.round((num7 * 23.9088) * 100000) / 100000
            pundsalg = Math.round((num8 * 12) * 100000) / 100000
            skippund = Math.round((num9 * 0.03749999999866) * 100000) / 100000
            skipslast = Math.round((num10 * 0.002307692307058) * 100000) / 100000
            skruppel = Math.round((num11 * 4820.322580671) * 100000) / 100000
            kornspann = Math.round((num12 * 0.6641333333362) * 100000) / 100000
            unsesolv = Math.round((num13 * 204) * 100000) / 100000
            otting = Math.round((num14 * 0.4269428571417) * 100000) / 100000
            longtonn = Math.round((num15 * 0.005883070863161) * 100000) / 100000
            grains = Math.round((num16 * 99620.00000055) * 100000) / 100000
            stone = Math.round((num17 * 0.940402769042) * 100000) / 100000
            poundsbr = Math.round((num18 * 13.16563876659) * 100000) / 100000
            ouncesbr = Math.round((num19 * 210.6131078235) * 100000) / 100000
            talent = Math.round((num20 * 0.2269937718351) * 100000) / 100000
        }
        if (vei == 3) {
            //fra drittel 
            kilo = Math.round((num2 * 50) * 100000) / 100000
            bismerpund = Math.round((num3 * 8.3651207923) * 100000) / 100000
            drittel = Math.round((num4 * 1) * 100000) / 100000
            karat = Math.round((num5 * 2604.166666667) * 100000) / 100000
            lest = Math.round((num6 * 16.92047377325) * 100000) / 100000
            marksalg = Math.round((num7 * 200) * 100000) / 100000
            pundsalg = Math.round((num8 * 100.3814495082) * 100000) / 100000
            skippund = Math.round((num9 * 0.3136920297) * 100000) / 100000
            skipslast = Math.round((num10 * 0.0193041249) * 100000) / 100000
            skruppel = Math.round((num11 * 40322.58064516) * 100000) / 100000
            kornspann = Math.round((num12 * 5.55555555555) * 100000) / 100000
            unsesolv = Math.round((num13 * 1706.484641638) * 100000) / 100000
            otting = Math.round((num14 * 3.5714285714) * 100000) / 100000
            longtonn = Math.round((num15 * 0.0492125984) * 100000) / 100000
            grains = Math.round((num16 * 833333.3333335) * 100000) / 100000
            stone = Math.round((num17 * 7.86658275645) * 100000) / 100000
            poundsbr = Math.round((num18 * 110.1321585903) * 100000) / 100000
            ouncesbr = Math.round((num19 * 1761.804087386) * 100000) / 100000
            talent = Math.round((num20 * 1.8988303205) * 100000) / 100000
        }
        if (vei == 4) {
            //fra karat
            kilo = Math.round((num2 * 0.01920) * 100000) / 100000
            bismerpund = Math.round((num3 * 0.003212206384243) * 100000) / 100000
            drittel = Math.round((num4 * 0.000384) * 100000) / 100000
            karat = Math.round((num5 * 1) * 100000) / 100000
            lest = Math.round((num6 * 0.006497461928928) * 100000) / 100000
            marksalg = Math.round((num7 * 0.0768) * 100000) / 100000
            pundsalg = Math.round((num8 * 0.03854647661113) * 100000) / 100000
            skippund = Math.round((num9 * 0.0001204577394048) * 100000) / 100000
            skipslast = Math.round((num10 * 0.0000074127839616) * 100000) / 100000
            skruppel = Math.round((num11 * 15.48387096774) * 100000) / 100000
            kornspann = Math.round((num12 * 0.002133333333331) * 100000) / 100000
            unsesolv = Math.round((num13 * 0.655290102389) * 100000) / 100000
            otting = Math.round((num14 * 0.001371428571418) * 100000) / 100000
            longtonn = Math.round((num15 * 0.0000188976377856) * 100000) / 100000
            grains = Math.round((num16 * 320) * 100000) / 100000
            stone = Math.round((num17 * 0.003020767778477) * 100000) / 100000
            poundsbr = Math.round((num18 * 0.04229074889868) * 100000) / 100000
            ouncesbr = Math.round((num19 * 0.6765327695561) * 100000) / 100000
            talent = Math.round((num20 * 0.000729150843072) * 100000) / 100000
        }
        if (vei == 5) {
            //fra lest
            kilo = Math.round((num2 * 2.955) * 100000) / 100000
            bismerpund = Math.round((num3 * 0.4943786388254) * 100000) / 100000
            drittel = Math.round((num4 * 0.05910000000005) * 100000) / 100000
            karat = Math.round((num5 * 153.9062500001) * 100000) / 100000
            lest = Math.round((num6 * 1) * 100000) / 100000
            marksalg = Math.round((num7 * 11.82) * 100000) / 100000
            pundsalg = Math.round((num8 * 5.932543665937) * 100000) / 100000
            skippund = Math.round((num9 * 0.01853919895529) * 100000) / 100000
            skipslast = Math.round((num10 * 0.001140873781591) * 100000) / 100000
            skruppel = Math.round((num11 * 2383.064516131) * 100000) / 100000
            kornspann = Math.round((num12 * 0.3283333333333) * 100000) / 100000
            unsesolv = Math.round((num13 * 100.8532423209) * 100000) / 100000
            otting = Math.round((num14 * 0.2110714285699) * 100000) / 100000
            longtonn = Math.round((num15 * 0.002908464565443) * 100000) / 100000
            grains = Math.round((num16 * 49250.00000006) * 100000) / 100000
            stone = Math.round((num17 * 0.4649150409066) * 100000) / 100000
            poundsbr = Math.round((num18 * 6.508810572693) * 100000) / 100000
            ouncesbr = Math.round((num19 * 104.1226215646) * 100000) / 100000
            talent = Math.round((num20 * 0.1122208719417) * 100000) / 100000
        }
        if (vei == 6) {
            //fra marksalg
            kilo = Math.round((num2 * 0.25) * 100000) / 100000
            bismerpund = Math.round((num3 * 0.0418256039615) * 100000) / 100000
            drittel = Math.round((num4 * 0.005) * 100000) / 100000
            karat = Math.round((num5 * 13.02083333333) * 100000) / 100000
            lest = Math.round((num6 * 0.08460236886625) * 100000) / 100000
            marksalg = Math.round((num7 * 1) * 100000) / 100000
            pundsalg = Math.round((num8 * 0.5019072475408) * 100000) / 100000
            skippund = Math.round((num9 * 0.0015684601485) * 100000) / 100000
            skipslast = Math.round((num10 * 0.0000965206245) * 100000) / 100000
            skruppel = Math.round((num11 * 201.6129032258) * 100000) / 100000
            kornspann = Math.round((num12 * 0.02777777777775) * 100000) / 100000
            unsesolv = Math.round((num13 * 8.53242320819) * 100000) / 100000
            otting = Math.round((num14 * 0.017857142857) * 100000) / 100000
            longtonn = Math.round((num15 * 0.000246062992) * 100000) / 100000
            grains = Math.round((num16 * 4166.666666668) * 100000) / 100000
            stone = Math.round((num17 * 0.03933291378225) * 100000) / 100000
            poundsbr = Math.round((num18 * 0.5506607929515) * 100000) / 100000
            ouncesbr = Math.round((num19 * 8.809020436928) * 100000) / 100000
            talent = Math.round((num20 * 0.0094941516025) * 100000) / 100000
        }
        if (vei == 7) {
            //fra pundsalg
            kilo = Math.round((num2 * 0.4981) * 100000) / 100000
            bismerpund = Math.round((num3 * 0.08333333333288) * 100000) / 100000
            drittel = Math.round((num4 * 0.009961999999998) * 100000) / 100000
            karat = Math.round((num5 * 25.94270833333) * 100000) / 100000
            lest = Math.round((num6 * 0.1685617597291) * 100000) / 100000
            marksalg = Math.round((num7 * 1.9924) * 100000) / 100000
            pundsalg = Math.round((num8 * 1) * 100000) / 100000
            skippund = Math.round((num9 * 0.003124999999871) * 100000) / 100000
            skipslast = Math.round((num10 * 1.923076922538e-4) * 100000) / 100000
            skruppel = Math.round((num11 * 401.693548387) * 100000) / 100000
            kornspann = Math.round((num12 * 0.05534444444438) * 100000) / 100000
            unsesolv = Math.round((num13 * 16.99999999999) * 100000) / 100000
            otting = Math.round((num14 * 0.03557857142828) * 100000) / 100000
            longtonn = Math.round((num15 * 0.0004902559052607) * 100000) / 100000
            grains = Math.round((num16 * 8301.666666667) * 100000) / 100000
            stone = Math.round((num17 * 0.07836689741974) * 100000) / 100000
            poundsbr = Math.round((num18 * 1.097136563876) * 100000) / 100000
            ouncesbr = Math.round((num19 * 17.55109231853) * 100000) / 100000
            talent = Math.round((num20 * 0.01891614765282) * 100000) / 100000
        }
        if (vei == 8) {
            //fra skippund
            kilo = Math.round((num2 * 159.392) * 100000) / 100000
            bismerpund = Math.round((num3 * 26.66666666762) * 100000) / 100000
            drittel = Math.round((num4 * 3.187840000131) * 100000) / 100000
            karat = Math.round((num5 * 8301.666667008) * 100000) / 100000
            lest = Math.round((num6 * 53.93976311554) * 100000) / 100000
            marksalg = Math.round((num7 * 637.568) * 100000) / 100000
            pundsalg = Math.round((num8 * 320) * 100000) / 100000
            skippund = Math.round((num9 * 1) * 100000) / 100000
            skipslast = Math.round((num10 * 0.06153846152375) * 100000) / 100000
            skruppel = Math.round((num11 * 128541.9354892) * 100000) / 100000
            kornspann = Math.round((num12 * 17.71022222293) * 100000) / 100000
            unsesolv = Math.round((num13 * 5440) * 100000) / 100000
            otting = Math.round((num14 * 11.38514285752) * 100000) / 100000
            longtonn = Math.round((num15 * 0.1568818896899) * 100000) / 100000
            grains = Math.round((num16 * 2656533.333443) * 100000) / 100000
            stone = Math.round((num17 * 25.07740717535) * 100000) / 100000
            poundsbr = Math.round((num18 * 351.0837004549) * 100000) / 100000
            ouncesbr = Math.round((num19 * 5616.349542162) * 100000) / 100000
            talent = Math.round((num20 * 6.053167249152) * 100000) / 100000
        }
        if (vei == 9) {
            //fra skipslast
            kilo = Math.round((num2 * 2590.12) * 100000) / 100000
            bismerpund = Math.round((num3 * 433.3333334525) * 100000) / 100000
            drittel = Math.round((num4 * 51.80240001452) * 100000) / 100000
            karat = Math.round((num5 * 134902.0833711) * 100000) / 100000
            lest = Math.round((num6 * 876.5211506275) * 100000) / 100000
            marksalg = Math.round((num7 * 10360.48) * 100000) / 100000
            pundsalg = Math.round((num8 * 5200) * 100000) / 100000
            skippund = Math.round((num9 * 16.25) * 100000) / 100000
            skipslast = Math.round((num10 * 1) * 100000) / 100000
            skruppel = Math.round((num11 * 2088806.4517) * 100000) / 100000
            kornspann = Math.round((num12 * 287.7911111226) * 100000) / 100000
            unsesolv = Math.round((num13 * 88400) * 100000) / 100000
            otting = Math.round((num14 * 185.0085714347) * 100000) / 100000
            longtonn = Math.round((num15 * 2.549330707446) * 100000) / 100000
            grains = Math.round((num16 * 43168666.66845) * 100000) / 100000
            stone = Math.round((num17 * 407.5078665994) * 100000) / 100000
            poundsbr = Math.round((num18 * 5705.110132392) * 100000) / 100000
            ouncesbr = Math.round((num19 * 91265.68006013) * 100000) / 100000
            talent = Math.round((num20 * 98.36396779872) * 100000) / 100000
        }
        if (vei == 10) {
            //fra skruppel
            kilo = Math.round((num2 * 0.00124) * 100000) / 100000
            bismerpund = Math.round((num3 * 0.000207454995649) * 100000) / 100000
            drittel = Math.round((num4 * 0.0000248) * 100000) / 100000
            karat = Math.round((num5 * 0.06458333333333) * 100000) / 100000
            lest = Math.round((num6 * 0.0004196277495766) * 100000) / 100000
            marksalg = Math.round((num7 * 0.00496) * 100000) / 100000
            pundsalg = Math.round((num8 * 0.002489459947802) * 100000) / 100000
            skippund = Math.round((num9 * 0.00000777956233656) * 100000) / 100000
            skipslast = Math.round((num10 * 0.00000047874229752) * 100000) / 100000
            skruppel = Math.round((num11 * 1) * 100000) / 100000
            kornspann = Math.round((num12 * 0.0001377777777776) * 100000) / 100000
            unsesolv = Math.round((num13 * 0.04232081911262) * 100000) / 100000
            otting = Math.round((num14 * 0.00008857142857072) * 100000) / 100000
            longtonn = Math.round((num15 * 0.00000122047244032) * 100000) / 100000
            grains = Math.round((num16 * 20.66666666667) * 100000) / 100000
            stone = Math.round((num17 * 0.00019509125236) * 100000) / 100000
            poundsbr = Math.round((num18 * 0.00273127753304) * 100000) / 100000
            ouncesbr = Math.round((num19 * 0.04369274136716) * 100000) / 100000
            talent = Math.round((num20 * 0.0000470909919484) * 100000) / 100000
        }
        if (vei == 11) {
            //fra kornspann
            kilo = Math.round((num2 * 9) * 100000) / 100000
            bismerpund = Math.round((num3 * 1.505721742616) * 100000) / 100000
            drittel = Math.round((num4 * 0.18) * 100000) / 100000
            karat = Math.round((num5 * 468.75) * 100000) / 100000
            lest = Math.round((num6 * 3.045685279188) * 100000) / 100000
            marksalg = Math.round((num7 * 36) * 100000) / 100000
            pundsalg = Math.round((num8 * 18.06866091149) * 100000) / 100000
            skippund = Math.round((num9 * 0.05646456534606) * 100000) / 100000
            skipslast = Math.round((num10 * 0.003474742482003) * 100000) / 100000
            skruppel = Math.round((num11 * 7258.064516136) * 100000) / 100000
            kornspann = Math.round((num12 * 1) * 100000) / 100000
            unsesolv = Math.round((num13 * 307.1672354951) * 100000) / 100000
            otting = Math.round((num14 * 0.6428571428526) * 100000) / 100000
            longtonn = Math.round((num15 * 0.008858267712009) * 100000) / 100000
            grains = Math.round((num16 * 150000) * 100000) / 100000
            stone = Math.round((num17 * 1.415984896162) * 100000) / 100000
            poundsbr = Math.round((num18 * 19.82378854627) * 100000) / 100000
            ouncesbr = Math.round((num19 * 317.1247357297) * 100000) / 100000
            talent = Math.round((num20 * 0.3417894576903) * 100000) / 100000
        }
        if (vei == 12) {
            //fra unsesolv
            kilo = Math.round((num2 * 0.0293) * 100000) / 100000
            bismerpund = Math.round((num3 * 0.004901960784288) * 100000) / 100000
            drittel = Math.round((num4 * 0.00586) * 100000) / 100000
            karat = Math.round((num5 * 1.526041666667) * 100000) / 100000
            lest = Math.round((num6 * 0.009915397631126) * 100000) / 100000
            marksalg = Math.round((num7 * 0.1172) * 100000) / 100000
            pundsalg = Math.round((num8 * 0.05882352941178) * 100000) / 100000
            skippund = Math.round((num9 * 0.001838235294042) * 100000) / 100000
            skipslast = Math.round((num10 * 0.000113122171914) * 100000) / 100000
            skruppel = Math.round((num11 * 23.62903225807) * 100000) / 100000
            kornspann = Math.round((num12 * 0.003255555555553) * 100000) / 100000
            unsesolv = Math.round((num13 * 1) * 100000) / 100000
            otting = Math.round((num14 * 0.002092857142841) * 100000) / 100000
            longtonn = Math.round((num15 * 0.000288385826624) * 100000) / 100000
            grains = Math.round((num16 * 488.3333333335) * 100000) / 100000
            stone = Math.round((num17 * 0.00460981749528) * 100000) / 100000
            poundsbr = Math.round((num18 * 0.06453744493392) * 100000) / 100000
            ouncesbr = Math.round((num19 * 1.032417195208) * 100000) / 100000
            talent = Math.round((num20 * 0.001112714567813) * 100000) / 100000
        }
        if (vei == 13) {
            //fra otting
            kilo = Math.round((num2 * 14) * 100000) / 100000
            bismerpund = Math.round((num3 * 2.342233821844) * 100000) / 100000
            drittel = Math.round((num4 * 0.28) * 100000) / 100000
            karat = Math.round((num5 * 729.1666666666) * 100000) / 100000
            lest = Math.round((num6 * 4.73773265651) * 100000) / 100000
            marksalg = Math.round((num7 * 56) * 100000) / 100000
            pundsalg = Math.round((num8 * 28.10680586228) * 100000) / 100000
            skippund = Math.round((num9 * 0.087833768316) * 100000) / 100000
            skipslast = Math.round((num10 * 0.005405154972) * 100000) / 100000
            skruppel = Math.round((num11 * 11290.32258064) * 100000) / 100000
            kornspann = Math.round((num12 * 1.555555555554) * 100000) / 100000
            unsesolv = Math.round((num13 * 477.8156996586) * 100000) / 100000
            otting = Math.round((num14 * 0.07142857142857) * 100000) / 100000
            longtonn = Math.round((num15 * 0.013779527552) * 100000) / 100000
            grains = Math.round((num16 * 233333.3333334) * 100000) / 100000
            stone = Math.round((num17 * 2.202643171806) * 100000) / 100000
            poundsbr = Math.round((num18 * 30.83700440528) * 100000) / 100000
            ouncesbr = Math.round((num19 * 493.3051444679) * 100000) / 100000
            talent = Math.round((num20 * 0.53167248974) * 100000) / 100000
        }
        if (vei == 14) {
            //fra longtonn
            kilo = Math.round((num2 * 1016) * 100000) / 100000
            bismerpund = Math.round((num3 * 169.9792545866) * 100000) / 100000
            drittel = Math.round((num4 * 20.32) * 100000) / 100000
            karat = Math.round((num5 * 52916.66669376) * 100000) / 100000
            lest = Math.round((num6 * 343.8240272485) * 100000) / 100000
            marksalg = Math.round((num7 * 4064) * 100000) / 100000
            pundsalg = Math.round((num8 * 2039.75105505) * 100000) / 100000
            skippund = Math.round((num9 * 6.374222046768) * 100000) / 100000
            skipslast = Math.round((num10 * 0.3922598181688) * 100000) / 100000
            skruppel = Math.round((num11 * 819354.8391292) * 100000) / 100000
            kornspann = Math.round((num12 * 112.8888889466) * 100000) / 100000
            unsesolv = Math.round((num13 * 34675.76793584) * 100000) / 100000
            otting = Math.round((num14 * 72.571428572) * 100000) / 100000
            longtonn = Math.round((num15 * 1) * 100000) / 100000
            grains = Math.round((num16 * 16933333.34201) * 100000) / 100000
            stone = Math.round((num17 * 159.8489616929) * 100000) / 100000
            poundsbr = Math.round((num18 * 2237.885463701) * 100000) / 100000
            ouncesbr = Math.round((num19 * 35799.859074) * 100000) / 100000
            talent = Math.round((num20 * 38.58423213232) * 100000) / 100000
        }
        if (vei == 15) {
            //fra grains
            kilo = Math.round((num2 * 0.00006) * 100000) / 100000
            bismerpund = Math.round((num3 * 0.001003814495076) * 100000) / 100000
            drittel = Math.round((num4 * 0.0000012) * 100000) / 100000
            karat = Math.round((num5 * 0.003125) * 100000) / 100000
            lest = Math.round((num6 * 0.0000203045685279) * 100000) / 100000
            marksalg = Math.round((num7 * 0.00024) * 100000) / 100000
            pundsalg = Math.round((num8 * 0.0001204577394098) * 100000) / 100000
            skippund = Math.round((num9 * 0.00000037643043564) * 100000) / 100000
            skipslast = Math.round((num10 * 0.00000002316494988) * 100000) / 100000
            skruppel = Math.round((num11 * 0.04838709677419) * 100000) / 100000
            kornspann = Math.round((num12 * 0.00000666666666666) * 100000) / 100000
            unsesolv = Math.round((num13 * 0.002047781569966) * 100000) / 100000
            otting = Math.round((num14 * 0.00000428571428568) * 100000) / 100000
            longtonn = Math.round((num15 * 0.00000005905511808) * 100000) / 100000
            grains = Math.round((num16 * 1) * 100000) / 100000
            stone = Math.round((num17 * 0.00000943989930774) * 100000) / 100000
            poundsbr = Math.round((num18 * 0.0001321585903084) * 100000) / 100000
            ouncesbr = Math.round((num19 * 0.002114164904863) * 100000) / 100000
            talent = Math.round((num20 * 0.0000022785963846) * 100000) / 100000
        }
        if (vei == 16) {
            //fra stone
            kilo = Math.round((num2 * 6.356) * 100000) / 100000
            bismerpund = Math.round((num3 * 1.063374155117) * 100000) / 100000
            drittel = Math.round((num4 * 0.12712) * 100000) / 100000
            karat = Math.round((num5 * 331.0416666666) * 100000) / 100000
            lest = Math.round((num6 * 2.150930626056) * 100000) / 100000
            marksalg = Math.round((num7 * 25.424) * 100000) / 100000
            pundsalg = Math.round((num8 * 12.76048986148) * 100000) / 100000
            skippund = Math.round((num9 * 0.03987653081546) * 100000) / 100000
            skipslast = Math.round((num10 * 0.002453940357288) * 100000) / 100000
            skruppel = Math.round((num11 * 5125.806451613) * 100000) / 100000
            kornspann = Math.round((num12 * 0.7062222222215) * 100000) / 100000
            unsesolv = Math.round((num13 * 216.928327645) * 100000) / 100000
            otting = Math.round((num14 * 0.4539999999964) * 100000) / 100000
            longtonn = Math.round((num15 * 0.006255905508608) * 100000) / 100000
            grains = Math.round((num16 * 105933.3333334) * 100000) / 100000
            stone = Math.round((num17 * 1) * 100000) / 100000
            poundsbr = Math.round((num18 * 14) * 100000) / 100000
            ouncesbr = Math.round((num19 * 223.9605355884) * 100000) / 100000
            talent = Math.round((num20 * 0.241379310342) * 100000) / 100000
        }
        if (vei == 17) {
            //fra poundsbr
            kilo = Math.round((num2 * 0.454) * 100000) / 100000
            bismerpund = Math.round((num3 * 0.07595529679408) * 100000) / 100000
            drittel = Math.round((num4 * 0.00908) * 100000) / 100000
            karat = Math.round((num5 * 23.64583333333) * 100000) / 100000
            lest = Math.round((num6 * 0.1536379018611) * 100000) / 100000
            marksalg = Math.round((num7 * 1.816) * 100000) / 100000
            pundsalg = Math.round((num8 * 0.911463561534) * 100000) / 100000
            skippund = Math.round((num9 * 0.002848323629676) * 100000) / 100000
            skipslast = Math.round((num10 * 0.000175281454092) * 100000) / 100000
            skruppel = Math.round((num11 * 366.1290322581) * 100000) / 100000
            kornspann = Math.round((num12 * 0.05044444444439) * 100000) / 100000
            unsesolv = Math.round((num13 * 15.49488054607) * 100000) / 100000
            otting = Math.round((num14 * 0.03242857142831) * 100000) / 100000
            longtonn = Math.round((num15 * 0.000446850393472) * 100000) / 100000
            grains = Math.round((num16 * 7566.666666668) * 100000) / 100000
            stone = Math.round((num17 * 0.07142857142857) * 100000) / 100000
            poundsbr = Math.round((num18 * 1) * 100000) / 100000
            ouncesbr = Math.round((num19 * 15.99718111346) * 100000) / 100000
            talent = Math.round((num20 * 0.01724137931014) * 100000) / 100000
        }
        if (vei == 18) {
            //fra ouncesbr
            kilo = Math.round((num2 * 0.02838) * 100000) / 100000
            bismerpund = Math.round((num3 * 0.004748042561709) * 100000) / 100000
            drittel = Math.round((num4 * 0.0005676) * 100000) / 100000
            karat = Math.round((num5 * 1.478125) * 100000) / 100000
            lest = Math.round((num6 * 0.009604060913697) * 100000) / 100000
            marksalg = Math.round((num7 * 0.11352) * 100000) / 100000
            pundsalg = Math.round((num8 * 0.05697651074083) * 100000) / 100000
            skippund = Math.round((num9 * 0.0001780515960577) * 100000) / 100000
            skipslast = Math.round((num10 * 0.00001095702129324) * 100000) / 100000
            skruppel = Math.round((num11 * 22.88709677419) * 100000) / 100000
            kornspann = Math.round((num12 * 0.00315333333333) * 100000) / 100000
            unsesolv = Math.round((num13 * 0.9686006825937) * 100000) / 100000
            otting = Math.round((num14 * 0.002027142857127) * 100000) / 100000
            longtonn = Math.round((num15 * 0.00002793307085184) * 100000) / 100000
            grains = Math.round((num16 * 473) * 100000) / 100000
            stone = Math.round((num17 * 0.004465072372561) * 100000) / 100000
            poundsbr = Math.round((num18 * 0.06251101321585) * 100000) / 100000
            ouncesbr = Math.round((num19 * 1) * 100000) / 100000
            talent = Math.round((num20 * 0.001077776089916) * 100000) / 100000
        }
        if (vei == 19) {
            //fra talent
            kilo = Math.round((num2 * 26.332) * 100000) / 100000
            bismerpund = Math.round((num3 * 4.405407214057) * 100000) / 100000
            drittel = Math.round((num4 * 0.52664) * 100000) / 100000
            karat = Math.round((num5 * 1371.458333333) * 100000) / 100000
            lest = Math.round((num6 * 8.910998307944) * 100000) / 100000
            marksalg = Math.round((num7 * 105.328) * 100000) / 100000
            pundsalg = Math.round((num8 * 52.86488656897) * 100000) / 100000
            skippund = Math.round((num9 * 0.1652027705212) * 100000) / 100000
            skipslast = Math.round((num10 * 0.01016632433734) * 100000) / 100000
            skruppel = Math.round((num11 * 21235.48387097) * 100000) / 100000
            kornspann = Math.round((num12 * 2.925777777775) * 100000) / 100000
            unsesolv = Math.round((num13 * 898.7030716722) * 100000) / 100000
            otting = Math.round((num14 * 1.880857142842) * 100000) / 100000
            longtonn = Math.round((num15 * 0.02591732282138) * 100000) / 100000
            grains = Math.round((num16 * 438866.6666668) * 100000) / 100000
            stone = Math.round((num17 * 4.142857142857) * 100000) / 100000
            poundsbr = Math.round((num18 * 58) * 100000) / 100000
            ouncesbr = Math.round((num19 * 927.8365045807) * 100000) / 100000
            talent = Math.round((num20 * 1) * 100000) / 100000
        }

        document.lengdemaal.Vekt2.value = kilo
        document.lengdemaal.Vekt3.value = bismerpund
        document.lengdemaal.Vekt4.value = drittel
        document.lengdemaal.Vekt5.value = karat
        document.lengdemaal.Vekt6.value = lest
        document.lengdemaal.Vekt7.value = marksalg
        document.lengdemaal.Vekt8.value = pundsalg
        document.lengdemaal.Vekt9.value = skippund
        document.lengdemaal.Vekt10.value = skipslast
        document.lengdemaal.Vekt11.value = skruppel
        document.lengdemaal.Vekt12.value = kornspann
        document.lengdemaal.Vekt13.value = unsesolv
        document.lengdemaal.Vekt14.value = otting
        document.lengdemaal.Vekt15.value = longtonn
        document.lengdemaal.Vekt16.value = grains
        document.lengdemaal.Vekt17.value = stone
        document.lengdemaal.Vekt18.value = poundsbr
        document.lengdemaal.Vekt19.value = ouncesbr
        document.lengdemaal.Vekt20.value = talent
    }
}
function resetvalue() {
                document.lengdemaal.Vekt.value=""
                document.lengdemaal.select.selectedIndex="0"
                document.lengdemaal.Vekt2.value=""
                document.lengdemaal.Vekt3.value=""
                document.lengdemaal.Vekt4.value=""
                document.lengdemaal.Vekt5.value=""
                document.lengdemaal.Vekt6.value=""
                document.lengdemaal.Vekt7.value=""
                document.lengdemaal.Vekt8.value=""
                document.lengdemaal.Vekt9.value=""
                document.lengdemaal.Vekt10.value=""
				document.lengdemaal.Vekt11.value=""
				document.lengdemaal.Vekt12.value=""
				document.lengdemaal.Vekt13.value=""
				document.lengdemaal.Vekt14.value=""
				document.lengdemaal.Vekt15.value=""
				document.lengdemaal.Vekt16.value=""
				document.lengdemaal.Vekt17.value=""
				document.lengdemaal.Vekt18.value=""
				document.lengdemaal.Vekt19.value=""
				document.lengdemaal.Vekt20.value=""

}

function convertDistance() {
    vei = document.getElementById('select').value;
    insertedValue = document.getElementById('Lengde').value;
    if (vei == "" || insertedValue == "") {
        document.getElementById('alertAllFill').className = 'alertAllFillB';
    }
    else {
        document.getElementById('alertAllFill').className = 'alertAllFill';
    
        var meter , yard , fot , foot , tommer , alen , favn , mannshoyde , pilskudd , nautisk
		num2=parseFloat(document.lengdemaal.Lengde.value)
		num3=parseFloat(document.lengdemaal.Lengde.value)
		num4=parseFloat(document.lengdemaal.Lengde.value)
		num5=parseFloat(document.lengdemaal.Lengde.value)
		num6=parseFloat(document.lengdemaal.Lengde.value)
		num7=parseFloat(document.lengdemaal.Lengde.value)
		num8=parseFloat(document.lengdemaal.Lengde.value)
		num9=parseFloat(document.lengdemaal.Lengde.value)
		num10=parseFloat(document.lengdemaal.Lengde.value)
		num11=parseFloat(document.lengdemaal.Lengde.value)
		num12=parseFloat(document.lengdemaal.Lengde.value)
		num13=parseFloat(document.lengdemaal.Lengde.value)
		num14=parseFloat(document.lengdemaal.Lengde.value)
		num15=parseFloat(document.lengdemaal.Lengde.value)



if (vei==1) {
//fra meter
	meter=Math.round((num2*1)*100000)/100000
	yard=Math.round((num3*1.0936133)*100000)/100000
	fot=Math.round((num4*3.1867)*100000)/100000
	foot=Math.round((num5*3.2808)*100000)/100000
	tommer=Math.round((num6*39.3700787)*100000)/100000
	alen=Math.round((num7*1.640419)*100000)/100000
	favn=Math.round((num8*0.5555556)*100000)/100000
	mannshoyde=Math.round((num9*0.60277275)*100000)/100000
	pilskudd=Math.round((num10*0.0025)*100000)/100000
	kilometer=Math.round((num11*0.001)*100000)/100000
	nautisk=Math.round((num12*0.000540)*100000)/100000
	sjo=Math.round((num13*0.0001349892)*100000)/100000
	miles=Math.round((num14*0.00062137)*100000)/100000
	maraton=Math.round((num15*0.0000236995)*100000)/100000
	    }
if (vei==2) {
//fra yard
	meter=Math.round((num2* 0.91440)*100000)/100000
	yard=Math.round((num3*1)*100000)/100000
	fot=Math.round((num4*2.914)*100000)/100000
	foot=Math.round((num5*3)*100000)/100000
	tommer=Math.round((num6*36)*100000)/100000
	alen=Math.round((num7* 1.4999991336)*100000)/100000
	favn=Math.round((num8* 0.50800004064)*100000)/100000
	mannshoyde=Math.round((num9* 0.5511754026)*100000)/100000
	pilskudd=Math.round((num10* 0.002286)*100000)/100000
	kilometer=Math.round((num11*0.0009144)*100000)/100000
	nautisk=Math.round((num12*0.000493776)*100000)/100000
	sjo=Math.round((num13*0.000123412448)*100000)/100000
	miles=Math.round((num14*0.0005681807)*100000)/100000
	maraton=Math.round((num15*0.0000216708228)*100000)/100000
        }
if (vei==3) {
//fra fot 
	meter=Math.round((num2* 0.3138)*100000)/100000
	yard=Math.round((num3*0.3431805)*100000)/100000
	fot=Math.round((num4*1)*100000)/100000
	foot=Math.round((num5*1.029528979821)*100000)/100000
	tommer=Math.round((num6*12.35449797594)*100000)/100000
	alen=Math.round((num7*0.5147704521911)*100000)/100000
	favn=Math.round((num8*0.1743357077852)*100000)/100000
	mannshoyde=Math.round((num9*0.1891526500766)*100000)/100000
	pilskudd=Math.round((num10*0.0007845106222725)*100000)/100000
	kilometer=Math.round((num11*0.0003138)*100000)/100000
	nautisk=Math.round((num12*0.000169452)*100000)/100000
	sjo=Math.round((num13*0.00004235961)*100000)/100000
	miles=Math.round((num14*0.000194985906)*100000)/100000
maraton=Math.round((num15*0.0000074369)*100000)/100000
        }      
if (vei==4) {
//fra foot
	meter=Math.round((num2*  0.3048037064131)*100000)/100000
	yard=Math.round((num3* 0.3333373872226)*100000)/100000
	fot=Math.round((num4*0.9713179712263)*100000)/100000
	foot=Math.round((num5*1)*100000)/100000
	tommer=Math.round((num6*12)*100000)/100000
	alen=Math.round((num7*0.5)*100000)/100000
	favn=Math.round((num8*0.1693354059985)*100000)/100000
	mannshoyde=Math.round((num9*0.1837273683248)*100000)/100000
	pilskudd=Math.round((num10*0.000762)*100000)/100000
	kilometer=Math.round((num11*0.000304803706413)*100000)/100000
	nautisk=Math.round((num12*0.0000164594)*100000)/100000
	sjo=Math.round((num13*0.00004114520848573)*100000)/100000
	miles=Math.round((num14*0.0001893958790538)*100000)/100000
	maraton=Math.round((num15* 0.000007223695440135)*100000)/100000
        }
if (vei==5) {
//fra tommer
	meter=Math.round((num2*0.0254)*100000)/100000
	yard=Math.round((num3*0.02777777782)*100000)/100000
	fot=Math.round((num4*0.08094218)*100000)/100000
	foot=Math.round((num5*0.08333232)*100000)/100000
	tommer=Math.round((num6*1)*100000)/100000
	alen=Math.round((num7*0.0416666426)*100000)/100000
	favn=Math.round((num8*0.01411111224)*100000)/100000
	mannshoyde=Math.round((num9*0.01531042785)*100000)/100000
	pilskudd=Math.round((num10*0.0000635)*100000)/100000
	kilometer=Math.round((num11*0.0000254)*100000)/100000
	nautisk=Math.round((num12*0.000013716)*100000)/100000
	sjo=Math.round((num13*0.00000342872568)*100000)/100000
	miles=Math.round((num14*0.000015782798)*100000)/100000
	maraton=Math.round((num15* 0.0000006019673)*100000)/100000
        }
if (vei==6) {
//fra alen
	meter=Math.round((num2*0.6096003521)*100000)/100000
	yard=Math.round((num3*0.6666670527467)*100000)/100000
	fot=Math.round((num4*1.942613442)*100000)/100000
	foot=Math.round((num5*1.999976835186)*100000)/100000
	tommer=Math.round((num6*24.00001383792)*100000)/100000
	alen=Math.round((num7*1)*100000)/100000
	favn=Math.round((num8*0.338666693739)*100000)/100000
	mannshoyde=Math.round((num9*0.3674504806393)*100000)/100000
	pilskudd=Math.round((num10*0.00152400088025)*100000)/100000
	kilometer=Math.round((num11*0.0006096003521)*100000)/100000
	nautisk=Math.round((num12*0.000329184190134)*100000)/100000
	sjo=Math.round((num13*0.0000822894638497)*100000)/100000
	miles=Math.round((num14*0.0003787873707844)*100000)/100000
	maraton=Math.round((num15*0.00001444722354459)*100000)/100000
        }
if (vei==7) {
//fra favn
	meter=Math.round((num2* 1.799999856)*100000)/100000
	yard=Math.round((num3*1.96850378252)*100000)/100000
	fot=Math.round((num4*5.736059541115)*100000)/100000
	foot=Math.round((num5*5.905439527565)*100000)/100000
	tommer=Math.round((num6*70.86613599071)*100000)/100000
	alen=Math.round((num7*2.95275396378)*100000)/100000
	favn=Math.round((num8*1)*100000)/100000
	mannshoyde=Math.round((num9*1.084990863201)*100000)/100000
	pilskudd=Math.round((num10*0.00449999964)*100000)/100000
	kilometer=Math.round((num11*0.001799999856)*100000)/100000
	nautisk=Math.round((num12*0.00097199992224)*100000)/100000
	sjo=Math.round((num13*0.0002429805405616)*100000)/100000
	miles=Math.round((num14*0.001118465910523)*100000)/100000
	maraton=Math.round((num15*0.00004265909658727)*100000)/100000
        }
if (vei==8) {
//fra mannshoyde
	meter=Math.round((num2*1.6590)*100000)/100000
	yard=Math.round((num3*1.814304620937)*100000)/100000
	fot=Math.round((num4*5.286735340972)*100000)/100000
	foot=Math.round((num5*5.442847242182)*100000)/100000
	tommer=Math.round((num6*65.31496106949)*100000)/100000
	alen=Math.round((num7*2.721455971591)*100000)/100000
	favn=Math.round((num8*0.9216667475429)*100000)/100000
	mannshoyde=Math.round((num9*1)*100000)/100000
	pilskudd=Math.round((num10*0.0041475)*100000)/100000
	kilometer=Math.round((num11*0.001659)*100000)/100000
	nautisk=Math.round((num12*0.00089586)*100000)/100000
	sjo=Math.round((num13*0.0002239470828)*100000)/100000
	miles=Math.round((num14*0.00103085283)*100000)/100000
	maraton=Math.round((num15*0.0000393174705)*100000)/100000
        }
if (vei==9) {
//fra pilskudd
	meter=Math.round((num2*400)*100000)/100000
	yard=Math.round((num3*437.44532)*100000)/100000
	fot=Math.round((num4*1274.68)*100000)/100000
	foot=Math.round((num5*1312.32)*100000)/100000
	tommer=Math.round((num6*15748.03148)*100000)/100000
	alen=Math.round((num7*656.1676)*100000)/100000
	favn=Math.round((num8*222.22224)*100000)/100000
	mannshoyde=Math.round((num9*241.1091)*100000)/100000
	pilskudd=Math.round((num10*1)*100000)/100000
	kilometer=Math.round((num11*0.4)*100000)/100000
	nautisk=Math.round((num12*0.216)*100000)/100000
	sjo=Math.round((num13*0.05399568)*100000)/100000
	miles=Math.round((num14*0.248548)*100000)/100000
	maraton=Math.round((num15*0.0094798)*100000)/100000
        }
if (vei==10) {
//fra kilometer
	yard=Math.round((num3*1093.6133)*100000)/100000
	fot=Math.round((num4*3186.7)*100000)/100000
	foot=Math.round((num5*3280.8)*100000)/100000
	tommer=Math.round((num6*39370.0787)*100000)/100000
	alen=Math.round((num7*1640.419)*100000)/100000
	favn=Math.round((num8*555.5556)*100000)/100000
	mannshoyde=Math.round((num9*602.77275)*100000)/100000
	kilometer=Math.round((num11*1)*100000)/100000
	meter=Math.round((num2*1000)*100000)/100000
	nautisk=Math.round((num12*0.540)*100000)/100000
	sjo=Math.round((num13*0.1349892008639)*100000)/100000
	miles=Math.round((num14*0.6213700339)*100000)/100000
	pilskudd=Math.round((num10*2.5)*100000)/100000
	maraton=Math.round((num15*0.0236995)*100000)/100000
}
if (vei==11) {
//fra nautisk mil
	meter=Math.round((num2* 1851.851851852)*100000)/100000
	yard=Math.round((num3*2025.2098148)*100000)/100000
	fot=Math.round((num4*5901.296296297)*100000)/100000
	foot=Math.round((num5*6075.5555555556)*100000)/100000
	tommer=Math.round((num6*72907.55314815)*100000)/100000
	alen=Math.round((num7*3037.812962963)*100000)/100000
	favn=Math.round((num8*1028.806592593)*100000)/100000
	mannshoyde=Math.round((num9*1116.2458333333)*100000)/100000
	pilskudd=Math.round((num10*4.62962962963)*100000)/100000
	kilometer=Math.round((num11*1.851851851)*100000)/100000
	nautisk=Math.round((num12*1)*100000)/100000
	sjo=Math.round((num13*0.25)*100000)/100000
	miles=Math.round((num14*1.150685185185)*100000)/100000
	maraton=Math.round((num15*0.04388796296297)*100000)/100000
}
if (vei==12) {
//fra sjømil
	meter=Math.round((num2*7408)*100000)/100000
	yard=Math.round((num3* 8101,4873264)*100000)/100000
	fot=Math.round((num4* 23607,61633971)*100000)/100000
	foot=Math.round((num5* 24304,28744457)*100000)/100000
	tommer=Math.round((num6* 291653,5430096)*100000)/100000
	alen=Math.round((num7* 12152,223952)*100000)/100000
	favn=Math.round((num8* 4115,5558848)*100000)/100000
	mannshoyde=Math.round((num9* 4465,340532)*100000)/100000
	kilometer=Math.round((num11*7.408)*100000)/100000
	nautisk=Math.round((num12*4)*100000)/100000
	sjo=Math.round((num13*1)*100000)/100000
	miles=Math.round((num14*4.60310896)*100000)/100000
	pilskudd=Math.round((num10*18.52)*100000)/100000
	maraton=Math.round((num15*0.175565896)*100000)/100000
}
if (vei==13) {
//fra miles
	meter=Math.round((num2* 1609.347087886)*100000)/100000
	yard=Math.round((num3*1760.003379628)*100000)/100000
	fot=Math.round((num4*5128.506364966)*100000)/100000
	foot=Math.round((num5*5279.945925936)*100000)/100000
	tommer=Math.round((num6*63360.12150569)*100000)/100000
	alen=Math.round((num7*2640.003540563)*100000)/100000
	favn=Math.round((num8*894.0817870188)*100000)/100000
	mannshoyde=Math.round((num9*970.0705698695)*100000)/100000
	pilskudd=Math.round((num10*4.03367719715)*100000)/100000
	kilometer=Math.round((num11*1.609347087886)*100000)/100000
	nautisk=Math.round((num12*0.8690474274584)*100000)/100000
	sjo=Math.round((num13*0.2172444759161)*100000)/100000
	miles=Math.round((num14*1)*100000)/100000
	maraton=Math.round((num15* 0.03814072130935)*100000)/100000
}
if (vei==14) {
//fra maraton

	meter=Math.round((num2*42195)*100000)/100000
	yard=Math.round((num3*46145.01358849)*100000)/100000
	fot=Math.round((num4*134463.3798663)*100000)/100000
	foot=Math.round((num5*138434.9588459)*100000)/100000
	tommer=Math.round((num6*1661220.472683)*100000)/100000
	alen=Math.round((num7*69217.50852419)*100000)/100000
	favn=Math.round((num8*23441.668542)*100000)/100000
	mannshoyde=Math.round((num9*25433.99618625)*100000)/100000
	pilskudd=Math.round((num10*105.4875)*100000)/100000
	kilometer=Math.round((num11*42.195)*100000)/100000
	nautisk=Math.round((num12*22.7853)*100000)/100000
	sjo=Math.round((num13*5.695869294)*100000)/100000
	miles=Math.round((num14*26.21870715)*100000)/100000
	maraton=Math.round((num15*1)*100000)/100000
}
		document.lengdemaal.Lengde2.value=meter
		document.lengdemaal.Lengde3.value=yard
		document.lengdemaal.Lengde4.value=fot
		document.lengdemaal.Lengde5.value=foot
		document.lengdemaal.Lengde6.value=tommer
		document.lengdemaal.Lengde7.value=alen
		document.lengdemaal.Lengde8.value=favn				
		document.lengdemaal.Lengde9.value=mannshoyde
		document.lengdemaal.Lengde10.value=pilskudd
		document.lengdemaal.Lengde11.value=kilometer
		document.lengdemaal.Lengde12.value=nautisk
		document.lengdemaal.Lengde13.value=sjo
		document.lengdemaal.Lengde14.value=miles
		document.lengdemaal.Lengde15.value=maraton
}
}

function resetvalue() {
                document.lengdemaal.Lengde.value=""
                document.lengdemaal.select.selectedIndex="0"
                document.lengdemaal.Lengde2.value=""
                document.lengdemaal.Lengde3.value=""
                document.lengdemaal.Lengde4.value=""
                document.lengdemaal.Lengde5.value=""
                document.lengdemaal.Lengde6.value=""
                document.lengdemaal.Lengde7.value=""
                document.lengdemaal.Lengde8.value=""
                document.lengdemaal.Lengde9.value=""
                document.lengdemaal.Lengde10.value=""
				document.lengdemaal.Lengde11.value=""
				document.lengdemaal.Lengde12.value=""
				document.lengdemaal.Lengde13.value=""
				document.lengdemaal.Lengde14.value=""
				document.lengdemaal.Lengde15.value=""
}
function convert() {
    vei = document.getElementById('select').value;
        var meter , yard , fot , foot , tommer , alen , favn , mannshoyde , pilskudd , nautisk
		num2=parseFloat(document.lengdemaal.Lengde.value)
		num3=parseFloat(document.lengdemaal.Lengde.value)
		num4=parseFloat(document.lengdemaal.Lengde.value)
		num5=parseFloat(document.lengdemaal.Lengde.value)
		num6=parseFloat(document.lengdemaal.Lengde.value)
		num7=parseFloat(document.lengdemaal.Lengde.value)
		num8=parseFloat(document.lengdemaal.Lengde.value)
		num9=parseFloat(document.lengdemaal.Lengde.value)
		num10=parseFloat(document.lengdemaal.Lengde.value)
		num11=parseFloat(document.lengdemaal.Lengde.value)
		num12=parseFloat(document.lengdemaal.Lengde.value)
		num13=parseFloat(document.lengdemaal.Lengde.value)
		num14=parseFloat(document.lengdemaal.Lengde.value)
		num15=parseFloat(document.lengdemaal.Lengde.value)
		num16=parseFloat(document.lengdemaal.Lengde.value)
		num17=parseFloat(document.lengdemaal.Lengde.value)
		num18=parseFloat(document.lengdemaal.Lengde.value)
		num19=parseFloat(document.lengdemaal.Lengde.value)
		num20=parseFloat(document.lengdemaal.Lengde.value)
		num21=parseFloat(document.lengdemaal.Lengde.value)
		num22=parseFloat(document.lengdemaal.Lengde.value)
		num23=parseFloat(document.lengdemaal.Lengde.value)
		num24=parseFloat(document.lengdemaal.Lengde.value)

if (vei==1) {
//fra liter
	liter=Math.round((num2*1)*100000)/100000
	kmeter=Math.round((num24)*100)/100000
	pint1=Math.round((num3*2.11338)*100000)/100000
	pint2=Math.round((num4*1.81617)*100000)/100000
	gallon1=Math.round((num5*0.26417)*100000)/100000
	gallon2=Math.round((num6*0.22702)*100000)/100000
	barrel1=Math.round((num7*0.00839)*100000)/100000
	barrel2=Math.round((num8*0.00629)*100000)/100000
	ktommer=Math.round((num9*61.02376)*100000)/100000
	alegallon=Math.round((num10*0.21645)*100000)/100000
	jumfru=Math.round((num11*12.19512)*100000)/100000
	anker=Math.round((num12*0.02590405139364)*100000)/100000
	bolle=Math.round((num13*0.3703703703704)*100000)/100000
	eske=Math.round((num14*0.06172839506173)*100000)/100000
	fat=Math.round((num15*0.001079341299592)*100000)/100000
	favngml=Math.round((num16*0.0004497211728728)*100000)/100000
	favnny=Math.round((num17*0.0004166666666667)*100000)/100000
	korntonne=Math.round((num18*0.00719579765417)*100000)/100000
	kfot=Math.round((num19*0.03237293622532)*100000)/100000
	oksehode=Math.round((num20*0.004317789291883)*100000)/100000
	fisktonne=Math.round((num21*0.008635578583765)*100000)/100000
	oltonne=Math.round((num22*0.007610929294467)*100000)/100000
	skrull=Math.round((num23*0.3323915572544)*100000)/100000
	    }
if (vei==2) {
//fra pint1
	liter=Math.round((num2*0.47318)*100000)/100000
	kmeter=Math.round(liter*100)/100000
	pint1=Math.round((num3*1)*100000)/100000
	pint2=Math.round((num4* 0.85937)*100000)/100000
	gallon1=Math.round((num5*0.125)*100000)/100000
	gallon2=Math.round((num6*0.10742)*100000)/100000
	barrel1=Math.round((num7*0.00397)*100000)/100000
	barrel2=Math.round((num8*0.00298)*100000)/100000
	ktommer=Math.round((num9*28.87501)*100000)/100000
	alegallon=Math.round((num10* 0.1024188740312)*100000)/100000
	jumfru=Math.round((num11*5.770434238992)*100000)/100000
	anker=Math.round((num12* 0.07615637318784)*100000)/100000
	bolle=Math.round((num13*0.1752502485923)*100000)/100000
	eske=Math.round((num14* 0.02920837476507)*100000)/100000
	fat=Math.round((num15* 0.0005107180436079)*100000)/100000
	favngml=Math.round((num16* 0.0002127971174138)*100000)/100000
	favnny=Math.round((num17* 0.0001971565293511)*100000)/100000
	korntonne=Math.round((num18* 0.003404876384749)*100000)/100000
	kfot=Math.round((num19* 0.01531808582697)*100000)/100000
	oksehode=Math.round((num20* 0.002043072845868)*100000)/100000
	fisktonne=Math.round((num21* 0.004086145692209)*100000)/100000
	oltonne=Math.round((num22* 0.003601306577142)*100000)/100000
	skrull=Math.round((num23* 0.1572795982048)*100000)/100000
        }
if (vei==3) {
//fra pint2 
	liter=Math.round((num2*0.55061)*100000)/100000
	kmeter=Math.round(liter*100)/100000
	pint1=Math.round((num3*1.16365)*100000)/100000
	pint2=Math.round((num4*1)*100000)/100000
	gallon1=Math.round((num5*0.14546)*100000)/100000
	gallon2=Math.round((num6*0.125)*100000)/100000
	barrel1=Math.round((num7*0.00462)*100000)/100000
	barrel2=Math.round((num8*0.00346)*100000)/100000
	ktommer=Math.round((num9*33.60032)*100000)/100000
	alegallon=Math.round((num10*0.119179)*100000)/100000
	jumfru=Math.round((num11*6.60731)*100000)/100000
	anker=Math.round((num12* 0.01426301028703)*100000)/100000
	bolle=Math.round((num13* 0.203929351531)*100000)/100000
	eske=Math.round((num14* 0.03398822525479)*100000)/100000
	fat=Math.round((num15* 0.0005942953022019)*100000)/100000
	favngml=Math.round((num16* 0.0002476206368347)*100000)/100000
	favnny=Math.round((num17* 0.0002294205201055)*100000)/100000
	korntonne=Math.round((num18* 0.00396207274319)*100000)/100000
	kfot=Math.round((num19* 0.01782483810712)*100000)/100000
	oksehode=Math.round((num20* 0.002377414719437)*100000)/100000
	fisktonne=Math.round((num21* 0.004754829439425)*100000)/100000
	oltonne=Math.round((num22* 0.004190648063783)*100000)/100000
	skrull=Math.round((num23* 0.1830178657582)*100000)/100000
	        }      
if (vei==4) {
//fra gallon1
	liter=Math.round((num2*3.78541)*100000)/100000
	kmeter=Math.round(liter*100)/100000
	pint1=Math.round((num3*8)*100000)/100000
	pint2=Math.round((num4*6.87494)*100000)/100000
	gallon1=Math.round((num5*1)*100000)/100000
	gallon2=Math.round((num6*0.85937)*100000)/100000
	barrel1=Math.round((num7*0.03175)*100000)/100000
	barrel2=Math.round((num8*0.02381)*100000)/100000
	ktommer=Math.round((num9*231.00007)*100000)/100000
	alegallon=Math.round((num10*0.81935)*100000)/100000
	jumfru=Math.round((num11*46.16356)*100000)/100000
	anker=Math.round((num12*0.1780836751891)*100000)/100000
	bolle=Math.round((num13*2.546200813763)*100000)/100000
	eske=Math.round((num14*0.4243668022893)*100000)/100000
	fat=Math.round((num15*0.007420193173381)*100000)/100000
	favngml=Math.round((num16*0.003091717118108)*100000)/100000
	favnny=Math.round((num17*0.002864475910903)*100000)/100000
	korntonne=Math.round((num18*0.04946925377423)*100000)/100000
	kfot=Math.round((num19*0.2225555907122)*100000)/100000
	oksehode=Math.round((num20*0.02968368823732)*100000)/100000
	fisktonne=Math.round((num21*0.05936737648151)*100000)/100000
	oltonne=Math.round((num22*0.05232317677712)*100000)/100000
	skrull=Math.round((num23*2.285106264636)*100000)/100000
	        }      
if (vei==5) {
//fra gallon2
	liter=Math.round((num2*4.404881)*100000)/100000
	kmeter=Math.round(liter*100)/100000
	pint1=Math.round((num3*9.30918)*100000)/100000
	pint2=Math.round((num4*8)*100000)/100000
	gallon1=Math.round((num5*1.16365)*100000)/100000
	gallon2=Math.round((num6*1)*100000)/100000
	barrel1=Math.round((num7*0.03694)*100000)/100000
	barrel2=Math.round((num8*0.02771)*100000)/100000
	ktommer=Math.round((num9*268.80258)*100000)/100000
	alegallon=Math.round((num10*0.953438291581)*100000)/100000
	jumfru=Math.round((num11*53.71790963147)*100000)/100000
	anker=Math.round((num12*0.03014307154427)*100000)/100000
	bolle=Math.round((num13*0.4309789384898)*100000)/100000
	eske=Math.round((num14*0.07182982308086)*100000)/100000
	fat=Math.round((num15*0.001255968091742)*100000)/100000
	favngml=Math.round((num16*0.0005233149539779)*100000)/100000
	favnny=Math.round((num17*0.0004848513050258)*100000)/100000
	korntonne=Math.round((num18*0.008373340533181)*100000)/100000
	kfot=Math.round((num19*0.03767054496317)*100000)/100000
	oksehode=Math.round((num20*0.005024365862201)*100000)/100000
	fisktonne=Math.round((num21*0.01004873172557)*100000)/100000
	oltonne=Math.round((num22*0.008856405615742)*100000)/100000
	skrull=Math.round((num23*0.3867851533728)*100000)/100000
	        }
if (vei==6) {
//fra barrel1
	liter=Math.round((num2*119.24048)*100000)/100000
	kmeter=Math.round(liter*100)/100000
	pint1=Math.round((num3*252)*100000)/100000
	pint2=Math.round((num4*216.56049)*100000)/100000
	gallon1=Math.round((num5*31.5)*100000)/100000
	gallon2=Math.round((num6*27.07006)*100000)/100000
	barrel1=Math.round((num7*1)*100000)/100000
	barrel2=Math.round((num8*0.75)*100000)/100000
	ktommer=Math.round((num9*7276.50219)*100000)/100000
	alegallon=Math.round((num10* 22,18077964266)*100000)/100000
	jumfru=Math.round((num11*1249.690308609)*100000)/100000
	anker=Math.round((num12*0.7012466538441)*100000)/100000
	bolle=Math.round((num13*10.02626882431)*100000)/100000
	eske=Math.round((num14*1.671044804034)*100000)/100000
	fat=Math.round((num15*0.0292187682458)*100000)/100000
	favngml=Math.round((num16*0.012174368489448)*100000)/100000
	favnny=Math.round((num17*0.01127955240931)*100000)/100000
	korntonne=Math.round((num18*0.1947969045479)*100000)/100000
	kfot=Math.round((num19*0.8763653553059)*100000)/100000
	oksehode=Math.round((num20*0.1168865536275)*100000)/100000
	fisktonne=Math.round((num21*0.2337731072821)*100000)/100000
	oltonne=Math.round((num22*0.2060349023822)*100000)/100000
	skrull=Math.round((num23*8.9981471915)*100000)/100000
        }
if (vei==7) {
//fra barrel2
	liter=Math.round((num2*158.9873)*100000)/100000
	kmeter=Math.round(liter*100)/100000
	pint1=Math.round((num3*336)*100000)/100000
	pint2=Math.round((num4*288.74731)*100000)/100000
	gallon1=Math.round((num5*42)*100000)/100000
	gallon2=Math.round((num6*36.09341)*100000)/100000
	barrel1=Math.round((num7*1.33333)*100000)/100000
	barrel2=Math.round((num8*1)*100000)/100000
	ktommer=Math.round((num9*9702.00268)*100000)/100000
	alegallon=Math.round((num10*1.092476255333)*100000)/100000
	jumfru=Math.round((num11*61.55141777333)*100000)/100000
	anker=Math.round((num12*0.03453873519067)*100000)/100000
	bolle=Math.round((num13*0.4938271604933)*100000)/100000
	eske=Math.round((num14*0.082304526748)*100000)/100000
	fat=Math.round((num15*0.001439121732)*100000)/100000
	favngml=Math.round((num16*0.0005996282293333)*100000)/100000
	favnny=Math.round((num17*0.0005555555546667)*100000)/100000
	korntonne=Math.round((num18*0.009594396872)*100000)/100000
	kfot=Math.round((num19*0.04316391496667)*100000)/100000
	oksehode=Math.round((num20*0.005757052388)*100000)/100000
	fisktonne=Math.round((num21*0.01151410477733)*100000)/100000
	oltonne=Math.round((num22*0.01014790572533)*100000)/100000
	skrull=Math.round((num23*0.4431887430053)*100000)/100000
        }
if (vei==8) {
//fra ktommer
	liter=Math.round((num2*0.01639)*100000)/100000
	kmeter=Math.round(liter*100)/100000
	pint1=Math.round((num3*0.03463)*100000)/100000
	pint2=Math.round((num4*0.02976)*100000)/100000
	gallon1=Math.round((num5*0.00433)*100000)/100000
	gallon2=Math.round((num6*0.00372)*100000)/100000
	barrel1=Math.round((num7*0.00014)*100000)/100000
	barrel2=Math.round((num8*0.0001)*100000)/100000
	ktommer=Math.round((num9*1)*100000)/100000
	alegallon=Math.round((num10*0.00008445163612344)*100000)/100000
	jumfru=Math.round((num11*0.00475814752094)*100000)/100000
	anker=Math.round((num12*0.000002669969515304)*100000)/100000
	bolle=Math.round((num13*0.00003817463080416)*100000)/100000
	eske=Math.round((num14*0.000006362438467292)*100000)/100000
	fat=Math.round((num15*0.0000001112493301228)*100000)/100000
	favngml=Math.round((num16*0.00000004635343720602)*100000)/100000
	favnny=Math.round((num17*0.00000004294645958601)*100000)/100000
	korntonne=Math.round((num18*0.0000007416816807146)*100000)/100000
	kfot=Math.round((num19*0.000003336727198781)*100000)/100000
	oksehode=Math.round((num20*0.0000004450410326005)*100000)/100000
	fisktonne=Math.round((num21*0.0000008900820653041)*100000)/100000
	oltonne=Math.round((num22*0.0000007844699228634)*100000)/100000
	skrull=Math.round((num23*0.00003426009744763)*100000)/100000
        }
if (vei==9) {
//fra alegallon
	liter=Math.round((num2*4.620004620005)*100000)/100000
	pint1=Math.round((num3*9.76384670827)*100000)/100000
	pint2=Math.round((num4*8.390744782952)*100000)/100000
	gallon1=Math.round((num5*1.220488717727)*100000)/100000
	gallon2=Math.round((num6*1.048873724772)*100000)/100000
	barrel1=Math.round((num7*0.03877904722569)*100000)/100000
	barrel2=Math.round((num8*0.02910162728113)*100000)/100000
	ktommer=Math.round((num9*281.9300661183)*100000)/100000
	alegallon=Math.round((num10*1)*100000)/100000
	jumfru=Math.round((num11*56.34154164934)*100000)/100000
	anker=Math.round((num12*0.1196768371125)*100000)/100000
	bolle=Math.round((num13*1.711112822222)*100000)/100000
	eske=Math.round((num14*0.2851854703673)*100000)/100000
	fat=Math.round((num15*0.004986561787942)*100000)/100000
	favngml=Math.round((num16*0.002077713892354)*100000)/100000
	favnny=Math.round((num17*0.001925001921922)*100000)/100000
	korntonne=Math.round((num18*0.0332446184061)*100000)/100000
	kfot=Math.round((num19*0.1495631149226)*100000)/100000
	oksehode=Math.round((num20*0.01994820647263)*100000)/100000
	fisktonne=Math.round((num21*0.03989641294987)*100000)/100000
	oltonne=Math.round((num22*0.03516252850081)*100000)/100000
	skrull=Math.round((num23*1.535650530164)*100000)/100000
	}
	if (vei==10) {
//fra jumfru
	liter=Math.round((num2*0.08200001312)*100000)/100000
	pint1=Math.round((num3*0.1732971877276)*100000)/100000
	pint2=Math.round((num4*0.1489259638282)*100000)/100000
	gallon1=Math.round((num5*0.02166194346591)*100000)/100000
	gallon2=Math.round((num6*0.0186156429785)*100000)/100000
	barrel1=Math.round((num7*0.0006879801100768)*100000)/100000
	barrel2=Math.round((num8*0.0005157800825248)*100000)/100000
	ktommer=Math.round((num9*5.003949120632)*100000)/100000
	alegallon=Math.round((num10*0.01774965073177)*100000)/100000
	jumfru=Math.round((num11*1)*100000)/100000
	anker=Math.round((num12*0.002124132554087)*100000)/100000
	bolle=Math.round((num13*0.0303703752296)*100000)/100000
	eske=Math.round((num14*0.005061729204879)*100000)/100000
	fat=Math.round((num15*0.00008850600067896)*100000)/100000
	favngml=Math.round((num16*0.00003687714200434)*100000)/100000
	favnny=Math.round((num17*0.00003416667207867)*100000)/100000
	korntonne=Math.round((num18*0.0005900555020369)*100000)/100000
	kfot=Math.round((num19*0.002654581195183)*100000)/100000
	oksehode=Math.round((num20*0.0003540587785114)*100000)/100000
	fisktonne=Math.round((num21*0.0007081175571048)*100000)/100000
	oltonne=Math.round((num22*0.0006240963019634)*100000)/100000
	skrull=Math.round((num23*0.02725611205581)*100000)/100000
	}
if (vei==11) {
//fra anker
	liter=Math.round((num2*38.60400000095)*100000)/100000
	pint1=Math.round((num3*81.58492152201)*100000)/100000
	pint2=Math.round((num4*70.11142668173)*100000)/100000
	gallon1=Math.round((num5*10.19801868025)*100000)/100000
	gallon2=Math.round((num6*8.763880080216)*100000)/100000
	barrel1=Math.round((num7*0.323887560008)*100000)/100000
	barrel2=Math.round((num8*0.242819160006)*100000)/100000
	ktommer=Math.round((num9*2355.761231098)*100000)/100000
	alegallon=Math.round((num10*8.355835800206)*100000)/100000
	jumfru=Math.round((num11*470.7804124916)*100000)/100000
	anker=Math.round((num12*1)*100000)/100000
	bolle=Math.round((num13*14.29777777812)*100000)/100000
	eske=Math.round((num14*2.382962962994)*100000)/100000
	fat=Math.round((num15*0.04166689150762)*100000)/100000
	favngml=Math.round((num16*0.01736103612432)*100000)/100000
	favnny=Math.round((num17*0.01608499997466)*100000)/100000
	korntonne=Math.round((num18*0.2777865726419)*100000)/100000
	kfot=Math.round((num19*1.249724830061)*100000)/100000
	oksehode=Math.round((num20*0.1666839377939)*100000)/100000
	fisktonne=Math.round((num21*0.3333678756263)*100000)/100000
	oltonne=Math.round((num22*0.2938123144728)*100000)/100000
	skrull=Math.round((num23*12.83164367655)*100000)/100000
	}
if (vei==12) {
//fra bolle
	liter=Math.round((num2*2.700000000003)*100000)/100000
	pint1=Math.round((num3*5.706126000006)*100000)/100000
	pint2=Math.round((num4*4.903659000005)*100000)/100000
	gallon1=Math.round((num5*0.7132590000007)*100000)/100000
	gallon2=Math.round((num6*0.6129540000006)*100000)/100000
	barrel1=Math.round((num7*0.02265300000002)*100000)/100000
	barrel2=Math.round((num8*0.01698300000002)*100000)/100000
	ktommer=Math.round((num9*164.7641520002)*100000)/100000
	alegallon=Math.round((num10*0.584419104006)*100000)/100000
	jumfru=Math.round((num11*32.92682400003)*100000)/100000
	anker=Math.round((num12*0.06994093876117)*100000)/100000
	bolle=Math.round((num13*1)*100000)/100000
	eske=Math.round((num14*0.1666666666649)*100000)/100000
	fat=Math.round((num15*0.002914221507303)*100000)/100000
	favngml=Math.round((num16*0.001214247164401)*100000)/100000
	favnny=Math.round((num17*0.001124999998201)*100000)/100000
	korntonne=Math.round((num18*0.01942865366582)*100000)/100000
	kfot=Math.round((num19*0.08740692780759)*100000)/100000
	oksehode=Math.round((num20*0.01165803108571)*100000)/100000
	fisktonne=Math.round((num21*0.02331606217412)*100000)/100000
	oltonne=Math.round((num22*0.02054950909382)*100000)/100000
	skrull=Math.round((num23*0.8974572045867)*100000)/100000
	}
if (vei==13) {
//fra eske
	liter=Math.round((num2*16.20000000019)*100000)/100000
	pint1=Math.round((num3*34.2367560004)*100000)/100000
	pint2=Math.round((num4*29.42195400035)*100000)/100000
	gallon1=Math.round((num5*4.27955400005)*100000)/100000
	gallon2=Math.round((num6*3.677724000043)*100000)/100000
	barrel1=Math.round((num7*0.1359180000016)*100000)/100000
	barrel2=Math.round((num8*0.1018980000012)*100000)/100000
	ktommer=Math.round((num9*988.5849120117)*100000)/100000
	alegallon=Math.round((num10*3.506490000041)*100000)/100000
	jumfru=Math.round((num11*197.5609440023)*100000)/100000
	anker=Math.round((num12*0.4196456325716)*100000)/100000
	bolle=Math.round((num13*6.000000000065)*100000)/100000
	eske=Math.round((num14*1)*100000)/100000
	fat=Math.round((num15*0.01748532904401)*100000)/100000
	favngml=Math.round((num16*0.007285482986486)*100000)/100000
	favnny=Math.round((num17*0.00674999998928)*100000)/100000
	korntonne=Math.round((num18*0.1165719219962)*100000)/100000
	kfot=Math.round((num19*0.5244415668512)*100000)/100000
	oksehode=Math.round((num20*0.06994818651503)*100000)/100000
	fisktonne=Math.round((num21*0.1398963730463)*100000)/100000
	oltonne=Math.round((num22*0.1232970545643)*100000)/100000
	skrull=Math.round((num23*5.384743227578)*100000)/100000
	}
if (vei==14) {
//fra fat
	liter=Math.round((num2*926.4910005079)*100000)/100000
	pint1=Math.round((num3*1958.027550653)*100000)/100000
	pint2=Math.round((num4*1682.665160392)*100000)/100000
	gallon1=Math.round((num5*244.7511276042)*100000)/100000
	gallon2=Math.round((num6*210.3319869353)*100000)/100000
	barrel1=Math.round((num7*7.773259494261)*100000)/100000
	barrel2=Math.round((num8*5.827628393195)*100000)/100000
	ktommer=Math.round((num9*56537.96445715)*100000)/100000
	alegallon=Math.round((num10*200.5389770599)*100000)/100000
	jumfru=Math.round((num11*11298.66893011)*100000)/100000
	anker=Math.round((num12*23.99987049231)*100000)/100000
	bolle=Math.round((num13*343.1448150026)*100000)/100000
	eske=Math.round((num14*57.19080249981)*100000)/100000
	fat=Math.round((num15*1)*100000)/100000
	favngml=Math.round((num16*0.4166626185959)*100000)/100000
	favnny=Math.round((num17*0.3860379162606)*100000)/100000
	korntonne=Math.round((num18*6.666841767907)*100000)/100000
	kfot=Math.round((num19*29.99323407248)*100000)/100000
	oksehode=Math.round((num20*4.000392920201)*100000)/100000
	fisktonne=Math.round((num21*8.000785841328)*100000)/100000
	oltonne=Math.round((num22*7.051457496393)*100000)/100000
	skrull=Math.round((num23*307.9577864406)*100000)/100000
	}
if (vei==15) {
//fra favngml
	liter=Math.round((num2*2223.600004316)*100000)/100000
	pint1=Math.round((num3*4699.31177712)*100000)/100000
	pint2=Math.round((num4*4038.435619838)*100000)/100000
	gallon1=Math.round((num5*587.40841314)*100000)/100000
	gallon2=Math.round((num6*504.8016729797)*100000)/100000
	barrel1=Math.round((num7*18.65600403621)*100000)/100000
	barrel2=Math.round((num8*13.98644402714)*100000)/100000
	ktommer=Math.round((num9*135692.4329994)*100000)/100000
	alegallon=Math.round((num10*481.2982209341)*100000)/100000
	jumfru=Math.round((num11*27117.06888463)*100000)/100000
	anker=Math.round((num12*57.60024878927)*100000)/100000
	bolle=Math.round((num13*823.5555571531)*100000)/100000
	eske=Math.round((num14*137.259259524)*100000)/100000
	fat=Math.round((num15*2.400023317114)*100000)/100000
	favngml=Math.round((num16*1)*100000)/100000
	favnny=Math.round((num17*0.9265000003158)*100000)/100000
	korntonne=Math.round((num18*16.00057569449)*100000)/100000
	kfot=Math.round((num19*71.98446112962)*100000)/100000
	oksehode=Math.round((num20*9.601036286101)*100000)/100000
	fisktonne=Math.round((num21*19.20207257443)*100000)/100000
	oltonne=Math.round((num22*16.92366241098)*100000)/100000
	skrull=Math.round((num23*739.1058681445)*100000)/100000
	}
	if (vei==16) {
//fra favnny
	liter=Math.round((num2*2399.99999808)*100000)/100000
	pint1=Math.round((num3*5072.111995942)*100000)/100000
	pint2=Math.round((num4*4358.807996513)*100000)/100000
	gallon1=Math.round((num5*634.0079994928)*100000)/100000
	gallon2=Math.round((num6*544.8479995641)*100000)/100000
	barrel1=Math.round((num7*20.13599998389)*100000)/100000
	barrel2=Math.round((num8*15.09599998792)*100000)/100000
	ktommer=Math.round((num9*146457.0238828)*100000)/100000
	alegallon=Math.round((num10*519.4799995844)*100000)/100000
	jumfru=Math.round((num11*29268.28797659)*100000)/100000
	anker=Math.round((num12*62.16972329346)*100000)/100000
	bolle=Math.round((num13*888.8888881769)*100000)/100000
	eske=Math.round((num14*148.1481480279)*100000)/100000
	fat=Math.round((num15*2.590419115528)*100000)/100000
	favngml=Math.round((num16*1.079330811937)*100000)/100000
	favnny=Math.round((num17*1)*100000)/100000
	korntonne=Math.round((num18*17.26991435578)*100000)/100000
	kfot=Math.round((num19*77.69504687784)*100000)/100000
	oksehode=Math.round((num20*10.36269429011)*100000)/100000
	fisktonne=Math.round((num21*20.72538858262)*100000)/100000
	oltonne=Math.round((num22*18.26623029099)*100000)/100000
	skrull=Math.round((num23*797.7397367714)*100000)/100000
	}
	if (vei==17) {
//fra korntonne
	liter=Math.round((num2*138.9700000033)*100000)/100000
	pint1=Math.round((num3*293.6964186069)*100000)/100000
	pint2=Math.round((num4*252.393144906)*100000)/100000
	gallon1=Math.round((num5*36.71170490087)*100000)/100000
	gallon2=Math.round((num6*31.54896940075)*100000)/100000
	barrel1=Math.round((num7*1.165958300028)*100000)/100000
	barrel2=Math.round((num8*0.8741213000206)*100000)/100000
	ktommer=Math.round((num9*8480.4719274)*100000)/100000
	alegallon=Math.round((num10*30.08005650071)*100000)/100000
	jumfru=Math.round((num11*1694.75582644)*100000)/100000
	anker=Math.round((num12*3.59988602217)*100000)/100000
	bolle=Math.round((num13*51.47037037153)*100000)/100000
	eske=Math.round((num14*8.57839506183)*100000)/100000
	fat=Math.round((num15*0.1499960603256)*100000)/100000
	favngml=Math.round((num16*0.06249775127432)*100000)/100000
	favnny=Math.round((num17*0.05790416657539)*100000)/100000
	korntonne=Math.round((num18*1)*100000)/100000
	kfot=Math.round((num19*4.498866947295)*100000)/100000
	oksehode=Math.round((num20*0.6000431777844)*100000)/100000
	fisktonne=Math.round((num21*1.200086355708)*100000)/100000
	oltonne=Math.round((num22*1.057690844012)*100000)/100000
	skrull=Math.round((num23*46.19245471268)*100000)/100000
	}
	if (vei==18) {
//fra kfot
	liter=Math.round((num2*30.8900000003)*100000)/100000
	kmeter=Math.round(liter*100)/100000
	pint1=Math.round((num3*65.28230820064)*100000)/100000
	pint2=Math.round((num4*56.10149130055)*100000)/100000
	gallon1=Math.round((num5*8.16021130008)*100000)/100000
	gallon2=Math.round((num6*7.012647800068)*100000)/100000
	barrel1=Math.round((num7*0.2591671000025)*100000)/100000
	barrel2=Math.round((num8*0.1942981000019)*100000)/100000
	ktommer=Math.round((num9*1885.023946418)*100000)/100000
	alegallon=Math.round((num10*6.686140500065)*100000)/100000
	jumfru=Math.round((num11*376.7072568037)*100000)/100000
	anker=Math.round((num12*0.8001761475376)*100000)/100000
	bolle=Math.round((num13*11.44074074084)*100000)/100000
	eske=Math.round((num14*1.906790123453)*100000)/100000
	fat=Math.round((num15*0.03334085272644)*100000)/100000
	favngml=Math.round((num16*0.01389188700322)*100000)/100000
	favnny=Math.round((num17*0.01287083331287)*100000)/100000
	korntonne=Math.round((num18*0.2222781895342)*100000)/100000
	kfot=Math.round((num19*1)*100000)/100000
	oksehode=Math.round((num20*0.1333765112003)*100000)/100000
	fisktonne=Math.round((num21*0.2667530224315)*100000)/100000
	oltonne=Math.round((num22*0.235101605894)*100000)/100000
	skrull=Math.round((num23*10.26757520368)*100000)/100000
	}
	if (vei==19) {
//fra oksehode
	liter=Math.round((num2*231.6000000473)*100000)/100000
	pint1=Math.round((num3*489.4588081)*100000)/100000
	pint2=Math.round((num4*420.624972086)*100000)/100000
	gallon1=Math.round((num5*61.18177201251)*100000)/100000
	gallon2=Math.round((num6*52.57841332675)*100000)/100000
	barrel1=Math.round((num7*1.943124000397)*100000)/100000
	barrel2=Math.round((num8*1.456764000298)*100000)/100000
	ktommer=Math.round((num9*14133.10281889)*100000)/100000
	alegallon=Math.round((num10*50.12982001025)*100000)/100000
	jumfru=Math.round((num11*2824.389792577)*100000)/100000
	anker=Math.round((num12*5.999378303845)*100000)/100000
	bolle=Math.round((num13*85.77777779522)*100000)/100000
	eske=Math.round((num14*14.29629629905)*100000)/100000
	fat=Math.round((num15*0.2499754448995)*100000)/100000
	favngml=Math.round((num16*0.1041554234565)*100000)/100000
	favnny=Math.round((num17*0.09649999986532)*100000)/100000
	korntonne=Math.round((num18*1.666546737007)*100000)/100000
	kfot=Math.round((num19*7.497572031243)*100000)/100000
	oksehode=Math.round((num20*1)*100000)/100000
	fisktonne=Math.round((num21*2.000000000232)*100000)/100000
	oltonne=Math.round((num22*1.762691224851)*100000)/100000
	skrull=Math.round((num23*76.98188467576)*100000)/100000
	}
	if (vei==20) {
//fra fisktonne
	liter=Math.round((num2*115.8000000103)*100000)/100000
	pint1=Math.round((num3*244.7294040217)*100000)/100000
	pint2=Math.round((num4*210.3124860186)*100000)/100000
	gallon1=Math.round((num5*30.59088600271)*100000)/100000
	gallon2=Math.round((num6*26.28891600233)*100000)/100000
	barrel1=Math.round((num7*0.9715620000861)*100000)/100000
	barrel2=Math.round((num8*0.7283820000645)*100000)/100000
	ktommer=Math.round((num9*7066.551408626)*100000)/100000
	alegallon=Math.round((num10*25.06563491022)*100000)/100000
	jumfru=Math.round((num11*1412.194896125)*100000)/100000
	anker=Math.round((num12*2.999689151575)*100000)/100000
	bolle=Math.round((num13*42.88888889265)*100000)/100000
	eske=Math.round((num14*7.148148148697)*100000)/100000
	fat=Math.round((num15*0.1249877224353)*100000)/100000
	favngml=Math.round((num16*0.05207771172221)*100000)/100000
	favnny=Math.round((num17*0.04824999992707)*100000)/100000
	korntonne=Math.round((num18*0.833273368407)*100000)/100000
	kfot=Math.round((num19*3.748786015187)*100000)/100000
	oksehode=Math.round((num20*0.4999999999421)*100000)/100000
	fisktonne=Math.round((num21*1)*100000)/100000
	oltonne=Math.round((num22*0.8813456123233)*100000)/100000
	skrull=Math.round((num23*38.49094233342)*100000)/100000
	}
	if (vei==21) {
//fra oltonne
	liter=Math.round((num2*131.3900000081)*100000)/100000
	pint1=Math.round((num3*277.676998217)*100000)/100000
	pint2=Math.round((num4*238.6265763146)*100000)/100000
	gallon1=Math.round((num5*34.70929630213)*100000)/100000
	gallon2=Math.round((num6*29.82815780183)*100000)/100000
	barrel1=Math.round((num7*1.102362100068)*100000)/100000
	barrel2=Math.round((num8*0.8264431000507)*100000)/100000
	ktommer=Math.round((num9*8017.911826892)*100000)/100000
	alegallon=Math.round((num10*28.43936550174)*100000)/100000
	jumfru=Math.round((num11*1602.316816898)*100000)/100000
	anker=Math.round((num12*3.403533312735)*100000)/100000
	bolle=Math.round((num13*48.6629629659)*100000)/100000
	eske=Math.round((num14*8.110493827562)*100000)/100000
	fat=Math.round((num15*0.1418146532843)*100000)/100000
	favngml=Math.round((num16*0.0590888647927)*100000)/100000
	favnny=Math.round((num17*0.0547458332491)*100000)/100000
	korntonne=Math.round((num18*0.9454558538171)*100000)/100000
	kfot=Math.round((num19*4.253480090864)*100000)/100000
	oksehode=Math.round((num20*0.5673143349793)*100000)/100000
	fisktonne=Math.round((num21*1.13462867009)*100000)/100000
	oltonne=Math.round((num22*1)*100000)/100000
	skrull=Math.round((num23*43.67292671028)*100000)/100000
	}
	if (vei==22) {
//fra skrull
	liter=Math.round((num2*3.008500000004)*100000)/100000
	pint1=Math.round((num3*6.358103730009)*100000)/100000
	pint2=Math.round((num4*5.463947445007)*100000)/100000
	gallon1=Math.round((num5*0.7947554450011)*100000)/100000
	gallon2=Math.round((num6*0.6829896700009)*100000)/100000
	barrel1=Math.round((num7*0.02524131500003)*100000)/100000
	barrel2=Math.round((num8*0.01892346500003)*100000)/100000
	ktommer=Math.round((num9*183.5899819602)*100000)/100000
	alegallon=Math.round((num10*0.6511898250009)*100000)/100000
	jumfru=Math.round((num11*36.68901852005)*100000)/100000
	anker=Math.round((num12*0.07793233861595)*100000)/100000
	bolle=Math.round((num13*1.11425925926)*100000)/100000
	eske=Math.round((num14*0.1857098765413)*100000)/100000
	fat=Math.round((num15*0.003247198298046)*100000)/100000
	favngml=Math.round((num16*0.001352986145964)*100000)/100000
	favnny=Math.round((num17*0.001253541664663)*100000)/100000
	korntonne=Math.round((num18*0.02164855724209)*100000)/100000
	kfot=Math.round((num19*0.09739397863304)*100000)/100000
	oksehode=Math.round((num20*0.01299006908199)*100000)/100000
	fisktonne=Math.round((num21*0.02598013816699)*100000)/100000
	oltonne=Math.round((num22*0.02289748078103)*100000)/100000
	skrull=Math.round((num23*1)*100000)/100000
	}
	if (vei==23) {
//fra kmeter
	liter=Math.round((num2*1000)*100000)/100000
	kmeter=Math.round((num24*1)*100000)/100000
	pint1=Math.round((1000*num3*2.11338)*100000)/100000
	pint2=Math.round((1000*num4*1.81617)*100000)/100000
	gallon1=Math.round((1000*num5*0.26417)*100000)/100000
	gallon2=Math.round((1000*num6*0.22702)*100000)/100000
	barrel1=Math.round((1000*num7*0.00839)*100000)/100000
	barrel2=Math.round((1000*num8*0.00629)*100000)/100000
	ktommer=Math.round((1000*num9*61.02376)*100000)/100000
	alegallon=Math.round((1000*num10*0.21645)*100000)/100000
	jumfru=Math.round((1000*num11*12.19512)*100000)/100000
	anker=Math.round((1000*num12*0.02590405139364)*100000)/100000
	bolle=Math.round((1000*num13*0.3703703703704)*100000)/100000
	eske=Math.round((1000*num14*0.06172839506173)*100000)/100000
	fat=Math.round((1000*num15*0.001079341299592)*100000)/100000
	favngml=Math.round((1000*num16*0.0004497211728728)*100000)/100000
	favnny=Math.round((1000*num17*0.0004166666666667)*100000)/100000
	korntonne=Math.round((1000*num18*0.00719579765417)*100000)/100000
	kfot=Math.round((1000*num19*0.03237293622532)*100000)/100000
	oksehode=Math.round((1000*num20*0.004317789291883)*100000)/100000
	fisktonne=Math.round((1000*num21*0.008635578583765)*100000)/100000
	oltonne=Math.round((1000*num22*0.007610929294467)*100000)/100000
	skrull=Math.round((1000*num23*0.3323915572544)*100000)/100000
	}

	document.lengdemaal.Lengde2.value=liter
	document.lengdemaal.Lengde3.value=pint1
	document.lengdemaal.Lengde4.value=pint2
	document.lengdemaal.Lengde5.value=gallon1
	document.lengdemaal.Lengde6.value=gallon2
	document.lengdemaal.Lengde7.value=barrel1
	document.lengdemaal.Lengde8.value=barrel2
	document.lengdemaal.Lengde9.value=ktommer
	document.lengdemaal.Lengde10.value=alegallon
	document.lengdemaal.Lengde11.value=jumfru
	document.lengdemaal.Lengde12.value=anker
	document.lengdemaal.Lengde13.value=bolle
	document.lengdemaal.Lengde14.value=eske
	document.lengdemaal.Lengde15.value=fat
	document.lengdemaal.Lengde16.value=favngml
	document.lengdemaal.Lengde17.value=favnny
	document.lengdemaal.Lengde18.value=korntonne
	document.lengdemaal.Lengde19.value=kfot
	document.lengdemaal.Lengde20.value=oksehode
	document.lengdemaal.Lengde21.value=fisktonne
	document.lengdemaal.Lengde22.value=oltonne
	document.lengdemaal.Lengde23.value=skrull
	document.lengdemaal.Lengde24.value=kmeter
}

function resetvalue() {
	document.lengdemaal.Lengde.value=""
	document.lengdemaal.select.selectedIndex="0"
	document.lengdemaal.Lengde2.value=""
	document.lengdemaal.Lengde3.value=""
	document.lengdemaal.Lengde4.value=""
	document.lengdemaal.Lengde5.value=""
	document.lengdemaal.Lengde6.value=""
	document.lengdemaal.Lengde7.value=""
	document.lengdemaal.Lengde8.value=""
	document.lengdemaal.Lengde9.value=""
	document.lengdemaal.Lengde10.value=""
	document.lengdemaal.Lengde11.value=""
	document.lengdemaal.Lengde12.value=""
	document.lengdemaal.Lengde13.value=""
	document.lengdemaal.Lengde14.value=""
	document.lengdemaal.Lengde15.value=""
	document.lengdemaal.Lengde16.value=""
	document.lengdemaal.Lengde17.value=""
	document.lengdemaal.Lengde18.value=""
	document.lengdemaal.Lengde19.value=""
	document.lengdemaal.Lengde20.value=""
	document.lengdemaal.Lengde21.value=""
	document.lengdemaal.Lengde22.value=""
	document.lengdemaal.Lengde23.value=""
	document.lengdemaal.Lengde24.value=""
}
function convertTemperature() {
    vei = document.getElementById('select').value;
    insertedValue = document.getElementById('Lengde').value;
    if (vei == "" || insertedValue=="") {
        document.getElementById('alertAllFill').className = 'alertAllFillB';
    }
    else {
        document.getElementById('alertAllFill').className = 'alertAllFill';
    var meter , yard , fot , foot , tommer , alen , favn , mannshoyde , pilskudd , nautisk
		num2=parseFloat(document.lengdemaal.Lengde.value)
		num3=parseFloat(document.lengdemaal.Lengde.value)
		num4=parseFloat(document.lengdemaal.Lengde.value)

if (vei==1) {
//fra Celsius
	Celsius=Math.round((num2*1)*100000)/100000
	Farenheit=Math.round((num3*(9/5)+32)*100000)/100000
	Kelvin=Math.round((num4+273)*100000)/100000
	    }
if (vei==2) {
//fra Farenheit
	Celsius=Math.round(((num2-32)*(5/9))*100000)/100000
	Farenheit=Math.round((num3*1)*100000)/100000
	Kelvin=Math.round(((num2-32)*(5/9)+273)*100000)/100000
	   }
if (vei==3) {
//fra Kelvin 
	Celsius=Math.round((num2-273)*100000)/100000
	Farenheit=Math.round(((num3-273)*(9/5)+32)*100000)/100000
	Kelvin=Math.round((num4*1)*100000)/100000
	}

		document.lengdemaal.Lengde2.value=Celsius
		document.lengdemaal.Lengde3.value=Farenheit
		document.lengdemaal.Lengde4.value=Kelvin
}
}
function resetvalue() {
                document.lengdemaal.Lengde.value=""
                document.lengdemaal.select.selectedIndex="0"
                document.lengdemaal.Lengde2.value=""
                document.lengdemaal.Lengde3.value=""
                document.lengdemaal.Lengde4.value=""
}
oldOffer = ''
fromFlag = '';
function CreateHttpObject() {
    var objXMLHttp = null
    if (window.XMLHttpRequest) {//case for ie7+ and opera,ff,chrome,safari
        objXMLHttp = new XMLHttpRequest();
    }
    else if (window.ActiveXObject) {//case ie5 and 6
        objXMLHttp = ActiveXObject("Microsoft.XMLHTTP");
    }
    else {
        alert("Your Browser Does Not Support XMLHTTP");
        return null; //return null in case no browser support
    }
    return objXMLHttp
}
function OpenLocation1() {
	var exampleFx = new Fx.Morph('locationLabel', {
						duration: 500,
						onComplete: function(){
										isSlid=false;
										isopen = true;
									}
					});
					
					isSlid=true;
					exampleFx.start({
						'left':[-382,0]
					});
}
function CloseLocation(){
	var exampleFx = new Fx.Morph('locationLabel', {
						duration: 500,
						onComplete: function(){
										isSlid=false;
										isopen = false;
									}
					});
					isSlid=true;
					exampleFx.start({
						'left':[0,-382]
					});	
					
}
var y;
function TabOpen(id){
	y=document.getElementById(id+'S').offsetHeight;
	document.getElementById(id).style.display='block';
	document.getElementById(id+'2').style.display='block';
	document.getElementById(id+'S').style.display='none';
	}
function TabClose(id){
	document.getElementById(id).style.display='none';
	document.getElementById(id+'2').style.display='none';
	if (y==0){
		document.getElementById(id+'S').style.display='none';
		}
	else{
		document.getElementById(id+'S').style.display='block';
		}
}
function SubService(id, id2, picid) {
    Url = document.getElementById('Urlsend').value;
    if (id2 == 15) {
        window.location=Url;
}
else{
    classname = document.getElementById(id).className;
    ServiceCounter = document.getElementById('ServiceCount').value;
    for (i = 1; i <= ServiceCounter; i++) {
        document.getElementById('Service' + i).className = "SubDescServices";
        document.getElementById('Pic' + i).src = "images/bulletPlus.gif";
    }
    if (classname == "SubDescServices dblock") {
        document.getElementById(id).className = "SubDescServices";
        document.getElementById(picid).src = "images/bulletPlus.gif";
    }
    else {
        document.getElementById(picid).src = "images/bulletMoin.gif";
        document.getElementById(id).className = "SubDescServices dblock";
    }
}
}
function sendContact() {
    isValidText = true;
    isValuArea = true;
    isValidText = validateForm('Name', 'email@@email', 'Message', 'Country');
    if (isValidText) {
        document.getElementById('alertFill').className = 'alertFill';
        document.getElementById('PicAjax').className = 'PicAjaxB';
        contact_name = document.getElementById("Name").value;
        contact_email = document.getElementById("email").value;
        contact_subject = document.getElementById("Message").value;
        Company_Name = document.getElementById("CompanyName").value;
        contact_Country = document.getElementById("Country").value;
        contact_Tel = document.getElementById("Tel").value;
        fromFlag = 1;
        // URL = "/Home/sendContact";
        URL = document.getElementById("Urlsend").value;
        var poststr = "contact_name=" + encodeURI(contact_name) + "&Tel=" + encodeURI(contact_Tel) + "&Country=" + encodeURI(contact_Country) + "&CompanyName=" + encodeURI(Company_Name) + "&contact_email=" + encodeURI(contact_email) + "&contact_subject=" + encodeURI(contact_subject);
        //alert(poststr);
        postAjaxFile(URL, poststr);

    } else {
    document.getElementById('alertFill').className = 'alertFillB';
        // document.getElementById('error_message_contact_div').className='error_message_conract';

    }
}
function locationValue(val) {
    document.getElementById('location').value = val;
}
function whatsupply(val) {
    document.getElementById('what_supply').value = val;
}
function whereValue(val) {
    document.getElementById('where_supply').value = val;
}
function sendCompetition() {
        contact_name = document.getElementById("FullName").value;
        contact_email = document.getElementById("Email").value;
        contact_Phone = document.getElementById("Phone").value;
        Company_Name = document.getElementById("Company").value;
        contact_Designation = document.getElementById("Designation").value;
        contact_location = document.getElementById("location").value;
        contact_what = document.getElementById("what_supply").value;
        contact_where = document.getElementById("where_supply").value;
        fromFlag = 1;
        
        // URL = "/Home/sendContact";
        URL = document.getElementById("Urlsend").value;
        var poststr = "contact_location=" + encodeURI(contact_location) + "&contact_what=" + encodeURI(contact_what) + "&contact_where=" + encodeURI(contact_where) + "&contact_name=" + encodeURI(contact_name) + "&contact_email=" + encodeURI(contact_email) + "&contact_Phone=" + encodeURI(contact_Phone) + "&Company_Name=" + encodeURI(Company_Name) + "&contact_Designation=" + encodeURI(contact_Designation);
        postAjaxFile(URL, poststr);
        document.getElementById('alert_success').style.display = "block";
}
function sendQuote() {
    isValidText = true;
    isValuArea = true;
    isValidText = validateForm('Company', 'Email@@email', 'ContactPerson', 'Tel');
    var RequestBullet = "";
    quote_Quality1 = document.getElementById("Quality1").value;
    quote_Quality2 = document.getElementById("Quality2").value;
    quote_Quality3 = document.getElementById("Quality3").value;
    quote_Quality4 = document.getElementById("Quality4").value;
    quote_Quality5 = document.getElementById("Quality5").value;
    quote_Quality6 = document.getElementById("Quality6").value;
    quote_Quality7 = document.getElementById("Quality7").value;
    quote_Quality8 = document.getElementById("Quality8").value;
    quote_Quality9 = document.getElementById("Quality9").value;
    quote_Quality10 = document.getElementById("Quality10").value;
    if (quote_Quality1 == '' && quote_Quality2 == '' && quote_Quality3 == '' && quote_Quality4 == '' && quote_Quality5 == '' && quote_Quality6 == '' && quote_Quality7 == '' && quote_Quality8 == '' && quote_Quality9 == '' && quote_Quality10 == '') {
        oldClass = document.getElementById('Quality').className;
        document.getElementById('Quality').className = oldClass + " required";
        document.getElementById('alertFill').className = 'alertFillB';
    }
    else {
        oldClass = document.getElementById('Quality').className;
        document.getElementById('Quality').className = oldClass.replace(/ required/g, "");
        if (isValidText) {
            document.getElementById('alertFill').className = 'alertFill';
            document.getElementById('PicAjax').className = 'PicAjaxB';
            quote_Company = document.getElementById("Company").value;
            quote_ContactPerson = document.getElementById("ContactPerson").value;
            quote_Tel = document.getElementById("Tel").value;
            quote_Email = document.getElementById("Email").value;
            quote_VesselName = document.getElementById("VesselName").value;
            quote_Agent = document.getElementById("Agent").value;
            quote_Port = document.getElementById("Port").value;
            quote_Location = document.getElementById("Location").value;
            quote_ETA = document.getElementById("ETA").value;
            quote_ETD = document.getElementById("ETD").value;
            quote_RequestBullet1 = document.getElementById("RequestBullet1").checked;
            quote_RequestBullet2 = document.getElementById("RequestBullet2").checked;
            quote_Comments = document.getElementById("Comments").value;

            if (String(quote_RequestBullet1) == 'true') {
                RequestBullet = "Vessel working carg";
            }
            if (String(quote_RequestBullet1) == 'false' && String(quote_RequestBullet2) == 'false') {
                RequestBullet = "";
            }
            if (String(quote_RequestBullet2) == 'true') {
                RequestBullet = "Bunker call only";
            }
            fromFlag = 1;
            // URL = "/Home/sendContact";
            
            URL = document.getElementById("Urlsend").value;
            
            var poststr = "Company=" + encodeURI(quote_Company) + "&ContactPerson=" + encodeURI(quote_ContactPerson) + "&Tel=" + encodeURI(quote_Tel) + "&Email=" + encodeURI(quote_Email) + "&VesselName=" + encodeURI(quote_VesselName) + "&Agent=" + encodeURI(quote_Agent) + "&Port=" + encodeURI(quote_Port) + "&Location=" + encodeURI(quote_Location) + "&ETA=" + encodeURI(quote_ETA) + "&ETD=" + encodeURI(quote_ETD) + "&RequestBullet=" + encodeURI(RequestBullet) + "&Quality1=" + encodeURI(quote_Quality1) + "&Quality2=" + encodeURI(quote_Quality2) + "&Quality3=" + encodeURI(quote_Quality3) + "&Quality4=" + encodeURI(quote_Quality4) + "&Quality5=" + encodeURI(quote_Quality5) + "&Quality6=" + encodeURI(quote_Quality6) + "&Quality7=" + encodeURI(quote_Quality7) + "&Quality8=" + encodeURI(quote_Quality8) + "&Quality9=" + encodeURI(quote_Quality9) + "&Quality10=" + encodeURI(quote_Quality10) + "&Comments=" + encodeURI(quote_Comments);
            //alert(poststr);
            postAjaxFile(URL, poststr);
        } else {
        document.getElementById('alertFill').className = 'alertFillB';
            // document.getElementById('error_message_contact_div').className='error_message_conract';

        }
    }
}
function ConvertFuel() {
    D5 = document.getElementById('d5').value;
    D6 = document.getElementById('d6').value;
    D7 = document.getElementById('d7').value;
    D8 = document.getElementById('d8').value;
    D9 = document.getElementById('d9').value;
   
    if (D5 == "" || D6 == "" || D7 == "" || D8 == "" || D9 == "") {
        document.getElementById('alertAllFill').className = 'alertAllFillB';
 }
 else {
     document.getElementById('alertAllFill').className = 'alertAllFill';
     D5 = parseFloat(document.getElementById('d5').value);
     D6 = parseFloat(document.getElementById('d6').value);
     D7 = parseFloat(document.getElementById('d7').value);
     D8 = parseFloat(document.getElementById('d8').value);
     D9 = parseFloat(document.getElementById('d9').value);
     sum = (52.19 - 8.802 * (D5 * D5) * 0.000001) * (1 - 0.01 * (D6 + D7 + D8)) + 9.42 * (0.01 * D8);
     sum = parseInt(sum * 1000 + 0.5) / 1000;
     sum2 = D9 / sum;
     sum2 = parseInt(sum2 * 1000 + 0.5) / 1000;
     document.getElementById('Energy').value = sum;
     document.getElementById('PriceMjUSD').value = sum2
 }
}
function Bullet(id1,id2) {
//    document.getElementById(id1).checked = 1;
//    document.getElementById(id2).checked = 0;
    document.getElementById(id1).checked = 'checked';
    document.getElementById(id2).checked = '';
}
function stateChangedPost() {
    if (xmlHttpPost.readyState == 4 || xmlHttpPost.readyState == "complete") {
        if (fromFlag == 1) {
            //alert("email has been sent")
            //document.getElementById('error_message_contact_div').innerHTML = "Your email has been sent."
            document.getElementById('PicAjax').className = 'PicAjax';
            document.getElementById('alertFill').className = 'alertFill';
            document.getElementById('alertMessage').className = 'alertMessageB';
        }
    }
}
function hideMsg() {
    document.getElementById('alertFill').className = 'alertFill';
}
function postAjaxFile(urlPage, parameters) {
    xmlHttpPost = CreateHttpObject()
    if (xmlHttpPost == null) {
        alert("Browser does not support HTTP Request")
        return
    }
   
    xmlHttpPost.onreadystatechange = stateChangedPost;
    
    xmlHttpPost.open("POST", urlPage, true);
    xmlHttpPost.setRequestHeader("Content-type", "application/x-www-form-urlencoded");

    xmlHttpPost.setRequestHeader("Content-length", parameters.length);
    xmlHttpPost.setRequestHeader("Connection", "close");
    xmlHttpPost.send(parameters)

}
function validateForm() {
    isValid = true;
    var paramLength = arguments.length;
    for (i = 0; i < paramLength; i++) {
        parArray = arguments[i].split("@@")
        thislength = parArray.length;
        fieldName = parArray[0]

        if (thislength > 1) {
            fieldType = parArray[1];
            if (fieldType == 'email') {
                isValideEmail = validateEmail(document.getElementById(fieldName).value)
                if (!isValideEmail) {
                    oldClass = document.getElementById(fieldName).parentNode.className;
                    document.getElementById(fieldName).parentNode.className = oldClass + " required";
                    isValid = false;
                } else {
                oldClass = document.getElementById(fieldName).parentNode.className;

                document.getElementById(fieldName).parentNode.className = oldClass.replace(/ required/g, "");
                }

            } else if (fieldType == "confirm") {
                isValidPassword = validPassword(document.getElementById(fieldName).value, document.getElementById(fieldName + "_confirm").value)
                if (!isValidPassword) {
                    oldClass = document.getElementById(fieldName).parentNode.className
                    document.getElementById(fieldName).parentNode.className = oldClass + " required";
                    document.getElementById(fieldName + "_confirm").parentNode.className = oldClass + " required";
                    isValid = false;

                } else {

                    document.getElementById(fieldName).parentNode.className = "input_content";
                    document.getElementById(fieldName + "_confirm").parentNode.className = "input_content";
                    //isValid = true;

                }
            }
        } else {

        if (document.getElementById(fieldName).value == '') {
                oldClass = document.getElementById(fieldName).parentNode.className;
                document.getElementById(fieldName).parentNode.className = oldClass + " required";
//                document.getElementById('PicAjax').className = 'PicAjax';
//                document.getElementById('alertFill').className = 'alertFillB';
                isValid = false;
            } else {
                oldClass = document.getElementById(fieldName).parentNode.className;
               document.getElementById(fieldName).parentNode.className = oldClass.replace(/ required/g, "");
//                document.getElementById('PicAjax').className = 'PicAjaxB';
            }
        }
    }
    return isValid;
}
function validateEmail(email) {
    var isValid = true
    var email = email
    AtPos = email.indexOf("@")
    StopPos = email.lastIndexOf(".")
    if (AtPos == -1 || StopPos == -1) {

        isValid = false;
        //alert(isValid)
    }

    return isValid;
}
function onlynb(e) {
    if (window.event)
    { thisKeyCode = window.event.keyCode; } // IE hack
    else
    { thisKeyCode = e.which; }

    if (((thisKeyCode < 48) || (thisKeyCode > 57)) && (thisKeyCode != 0) && (thisKeyCode != 8)) {
       // alert("Only Numbers");
        
        if (window.event)
        { window.event.keyCode = ""; } // IE hack}
        else
        { e.preventDefault(); }

    } else {
        
    }
}	
