
function calculateAvtal(avtalInfo) {

    var moms = 1.25;
    var fastAvgift = 0;
//    var fastAvgiftL = 3300;
//    var fastAvgiftV = 4100;
    var fastAvgiftFond = 0;
//    var fastAvgiftLFond = 5300;
//    var fastAvgiftVFond = 8100;
    var faktAvgift = 0;

    jQuery("#spotPrisRow").hide();
	jQuery("#elPrisRow").hide();
	jQuery("#fastElPrisRow").hide();
	jQuery("#mixElPrisRow").hide();
	jQuery("#rorligtElPrisRow").hide();
	jQuery("#mixElPrisTotalRow").hide();
//	jQuery("#elcertifikatRow").hide();
	jQuery("#volymPaslagRow").hide();
	jQuery("#paslagRow").hide();
    jQuery("#energiskattRow").hide();
    jQuery("#miljoPaslagRow").hide();
    jQuery("#miljoPaslagRowFond").hide();
    jQuery("#momsRow").hide();
    jQuery("#fastaRow").hide();
    jQuery("#infoTextSpotPris").hide();
    jQuery("#divComparePuffSpot").hide();
    jQuery("#divComparePuffMix").hide();
    jQuery("#divComparePuffFast").hide();
    jQuery("#divComparePuffFond").hide();
    jQuery("#fakturaRow").hide();
    jQuery("#infoText").hide();
    jQuery("#infoTextFund").hide();
    
    jQuery("#previousMonth").text(avtalInfo.spotMonth);

    //Bindningstid
    if (avtalInfo.avtalsTyp == "4") { //Fond
        jQuery("#bindningsTidFond").text(avtalInfo.bindningsTid.replace('<i>', '').replace('</i>', '').replace('Bindningstid ', '').replace('bindningstid', ''));
        jQuery("#bindningsTidRow").show();
        jQuery("#bindningsTid").text("Ingen");
        jQuery("#bindningsTidRowFond").show();
        jQuery("#bindningsTidRow").show();
        jQuery("#optionsInfoWrapperFond").show();
        jQuery("#dynamicInfoWrapperFond").show();
        jQuery(".comparePricesPuffWrapper .jmfPriserFond").show();
        if (avtalInfo.startDate != $("#rightAvtalsStart").text()) {
            jQuery("#topInfoWrapperFond").show();
            jQuery("#optionsInfoWrapper").show();
            jQuery("#dynamicInfoWrapper").show();
            jQuery(".comparePricesPuffWrapper .jmfPriser").show();
        }
        else {
            jQuery("#topInfoWrapperFond").hide();
            jQuery("#optionsInfoWrapper").hide();
            jQuery("#dynamicInfoWrapper").hide();
            jQuery(".comparePricesPuffWrapper .jmfPriser").hide();
        }
    }
    else {
        jQuery("#bindningsTid").text(avtalInfo.bindningsTid.replace('<i>', '').replace('</i>', '').replace('Bindningstid ', '').replace('bindningstid', ''));
        jQuery("#bindningsTidRow").show();
        jQuery("#optionsInfoWrapperFond").hide();
        jQuery("#dynamicInfoWrapperFond").hide();
        jQuery("#topInfoWrapperFond").hide();
        jQuery("#optionsInfoWrapper").show();
        jQuery("#dynamicInfoWrapper").show();
        jQuery(".comparePricesPuffWrapper .jmfPriser").show();
        jQuery(".comparePricesPuffWrapper .jmfPriserFond").hide();
    }
    
//    if (userInput.boendeForm == "Lägenhet") {
//        fastAvgift = fastAvgiftL;
//        fastAvgiftFond = fastAvgiftLFond;
//    }
//    else {
//        fastAvgift = fastAvgiftV;
//        fastAvgiftFond = fastAvgiftVFond;
//    }
    
    jQuery("#topInfoImage").show();
	jQuery("#topInfoImage").css('background-image', "url('" + avtalInfo.imageUrl+ "')");
 
    var label = '';
    $("#topInfoTypeWrapper .topInfoType").removeClass("mix").removeClass("fast").removeClass("chosen").removeClass("rorligt").removeClass("fond");
    $("#topInfoTypeWrapperFond .topInfoType").removeClass("mix").removeClass("fast").removeClass("chosen").removeClass("rorligt").removeClass("fond");

    var totPrisFond = 1;
    var totalkWhPriceWithFastFeeMinusFastAvgiftDiff = 1;
    var totFastAvgift = 0;
    var totFaktAvgift = 0;
    var totJmfPris = 0;
    var totJmfPrisFond = 0;

    
    if (avtalInfo.avtalsTyp == "0") { //Kampanj
        jQuery("#spotPris").text(avtalInfo.elPrisNoWind.replace(".", ","));
        jQuery("#spotPrisRow").show();
        jQuery("#spotComparePricesPuff").show();
	    jQuery("#infoTextSpotPris").show();
	    jQuery("#infoText").show();
	    jQuery("#infoTextFund").hide();
	    
	    $("#topInfoTypeWrapper .topInfoType").removeClass("mix").removeClass("fast").removeClass("fond").addClass("chosen").addClass("rorligt");
	    $("#topInfoTypeWrapperFond .topInfoType").removeClass("mix").removeClass("fast").removeClass("fond").addClass("chosen").addClass("rorligt");
	    jQuery("#divComparePuffSpot").show();
        jQuery(".comparePricesPuffWrapper .villaPricesWrapper6").hide();
	   	jQuery(".comparePricesPuffWrapper .lghPricesWrapper6").hide();
    }
    if (avtalInfo.avtalsTyp == "1") { //Rörligt
        jQuery("#spotPris").text(avtalInfo.elPrisNoWind.replace(".", ","));
        jQuery("#spotPrisRow").show();
        jQuery("#spotComparePricesPuff").show();
        jQuery("#infoTextSpotPris").show();
        jQuery("#infoText").show();
        jQuery("#infoTextFund").hide();
	    $("#topInfoTypeWrapper .topInfoType").removeClass("mix").removeClass("fast").removeClass("fond").addClass("chosen").addClass("rorligt");
	    $("#topInfoTypeWrapperFond .topInfoType").removeClass("mix").removeClass("fast").removeClass("fond").addClass("chosen").addClass("rorligt");
	    jQuery("#divComparePuffSpot").show();
	    jQuery(".comparePricesPuffWrapper .villaPricesWrapper6").hide();
	   	jQuery(".comparePricesPuffWrapper .lghPricesWrapper6").hide();
    }    
    if (avtalInfo.avtalsTyp == "2") { //Mix

        jQuery("#infoTextSpotPris").show();
        jQuery("#infoText").show();
        jQuery("#infoTextFund").hide();
        jQuery("#mixComparePricesPuff").show();
        
	    jQuery("#fastElPris").text(avtalInfo.fastElPris.replace(".", ","));
	    jQuery("#fastElPrisRow").show();

	    jQuery("#rorligtElPris").text(avtalInfo.rorligtElPris.replace(".", ","));
	    jQuery("#rorligtElPrisRow").show();

	    jQuery("#mixElPrisTotal").text(avtalInfo.elPrisNoWind.replace(".", ","));
	    jQuery("#mixElPrisTotalRow").show();

	    jQuery("#mixElPris").text(avtalInfo.elPrisNoWind.replace(".", ","));
	    jQuery("#mixElPrisRow").show();

	    $("#topInfoTypeWrapper .topInfoType").removeClass("rorligt").removeClass("fast").removeClass("fond").addClass("chosen").addClass("mix");
	    $("#topInfoTypeWrapperFond .topInfoType").removeClass("rorligt").removeClass("fast").removeClass("fond").addClass("chosen").addClass("mix");
	    jQuery("#divComparePuffMix").show();
	   	
	   	if (avtalInfo.bindningsTidManader == "12"){
	   	jQuery(".comparePricesPuffWrapper .villaPricesWrapper6").hide();
	   	jQuery(".comparePricesPuffWrapper .lghPricesWrapper6").hide();
	   	}
	   	
	   	if (avtalInfo.bindningsTidManader == "6"){
	   	jQuery(".comparePricesPuffWrapper .villaPricesWrapper").hide();
	   	jQuery(".comparePricesPuffWrapper .lghPricesWrapper").hide();
	   	}
	   	    
	}        

    if (avtalInfo.avtalsTyp == "3") { //Fast
	    jQuery("#elPris").text(avtalInfo.elPrisNoWind.replace(".", ","));
	    jQuery("#elPrisRow").show();
	    jQuery("#fastComparePricesPuff").show();
	    $("#topInfoTypeWrapper .topInfoType").removeClass("rorligt").removeClass("mix").removeClass("fond").addClass("chosen").addClass("fast");
	    $("#topInfoTypeWrapperFond .topInfoType").removeClass("rorligt").removeClass("mix").removeClass("fond").addClass("chosen").addClass("fast");
	    jQuery("#divComparePuffFast").show();
	    jQuery("#infoText").show();
	    jQuery("#infoTextFund").hide();
        
         	if (avtalInfo.bindningsTidManader == "12"){
	   	jQuery(".comparePricesPuffWrapper .villaPricesWrapper6").hide();
	   	jQuery(".comparePricesPuffWrapper .lghPricesWrapper6").hide();
	   	}
	   	
	   	if (avtalInfo.bindningsTidManader == "6"){
	   	jQuery(".comparePricesPuffWrapper .villaPricesWrapper").hide();
	   	jQuery(".comparePricesPuffWrapper .lghPricesWrapper").hide();
	   	}
	}

	if (avtalInfo.avtalsTyp == "4") { //Fond
	    jQuery("#elPrisFond").text(avtalInfo.elPrisFond.replace(".", ","));
	    jQuery("#elPrisRowFond").show();
        jQuery("#spotPris").text(avtalInfo.elPrisNoWind.replace(".", ","));
	    jQuery("#spotPrisRow").show();
	    jQuery("#spotComparePricesPuff").show();
	    jQuery("#infoTextSpotPris").show();
	    jQuery("#infoText").hide();
	    jQuery("#infoTextFund").show();
	    $("#topInfoTypeWrapper .topInfoType").removeClass("rorligt").removeClass("mix").removeClass("fast").addClass("chosen").addClass("fond");
	    $("#topInfoTypeWrapperFond .topInfoType").removeClass("rorligt").removeClass("mix").removeClass("fast").addClass("chosen").addClass("fond");
	    jQuery("#divComparePuffFond").show();
	    jQuery(".comparePricesPuffWrapper .villaPricesWrapper6").hide();
	    jQuery(".comparePricesPuffWrapper .lghPricesWrapper6").hide();
	    var lbl
	    if (avtalInfo.vind == "1") {
	        lbl = " 100% vind";
	    }
	    else {
	        lbl = " 10% vind och 90% vatten";
	    }
	    jQuery("#topInfoTypeWrapperFond .topInfoType").html("Rörligt avtal" + lbl);

	    // Totalpris
	    totPrisFond = parseFloat(avtalInfo.elPrisFond.replace(",", "."));
	    totJmfPrisFond = parseFloat(avtalInfo.elPrisFond.replace(",", "."));
	    //	    alert(parseFloat(avtalInfo.elPrisFond.replace(",", ".")));

	    if (parseFloat(avtalInfo.elcertifikatsAvgift) > 0) {
            jQuery("#elcertifikatFond").text(avtalInfo.elcertifikatsAvgift.replace(".", ","));
            jQuery("#elcertifikatRowFond").show();
            totPrisFond += parseFloat(avtalInfo.elcertifikatsAvgift.replace(",", "."));
            totJmfPrisFond += parseFloat(avtalInfo.elcertifikatsAvgift.replace(",", "."));
        }

	    if (parseFloat(avtalInfo.paslag) > 0 || avtalInfo.avtalsForm == "0") {
            jQuery("#paslagFond").text(avtalInfo.paslag.replace(".", ","));
            jQuery("#paslagRowFond").show();
            totPrisFond += parseFloat(avtalInfo.paslag.replace(",", "."));
            totJmfPrisFond += parseFloat(avtalInfo.paslag.replace(",", "."));
        }

	    if (parseFloat(avtalInfo.faktAvg.replace(",", ".")) > 0) {
            jQuery("#fakturaFond").text(avtalInfo.faktAvg.replace(".", ","));
            jQuery("#fakturaRowFond").show();
            totPrisFond += parseFloat(avtalInfo.faktAvg.replace(",", "."));
        }

	    if (parseFloat(avtalInfo.fasta) > 0 || avtalInfo.avtalsForm == "0") {
            jQuery("#fastaFond").text(avtalInfo.fasta.replace(".", ","));
            jQuery("#fastaRowFond").show();
            totPrisFond += parseFloat(avtalInfo.fasta.replace(",", "."));
        }

	    if (parseFloat(avtalInfo.energiSkatt) > 0) {
            jQuery("#energiSkattFond").text(avtalInfo.energiSkatt.replace(".", ","));
            jQuery("#energiSkattRowFond").show();
            totPrisFond += parseFloat(avtalInfo.energiSkatt.replace(",", "."));
            totJmfPrisFond += parseFloat(avtalInfo.energiSkatt.replace(",", "."));
        }

	    if (parseFloat(avtalInfo.miljoPaslag) > 0 || avtalInfo.avtalsForm == "0") {
	        jQuery("#miljoPaslagFond").text(avtalInfo.miljoPaslag.replace(".", ","));
	        jQuery("#miljoPaslagRowFond").show();
	        totPrisFond += parseFloat(avtalInfo.miljoPaslag.replace(",", "."));
	        totJmfPrisFond += parseFloat(avtalInfo.miljoPaslag.replace(",", "."));
	    }

	    if (parseFloat(avtalInfo.moms) > 0) {
	        jQuery("#momsFond").text(avtalInfo.moms.replace(".", ","));
	        jQuery("#momsRowFond").show();
	        totPrisFond += parseFloat(avtalInfo.moms.replace(",", "."));
	    }

	    totPrisFond = Math.round(totPrisFond * 100) / 100;
	    jQuery("#totalkWhPriceFond").text(totPrisFond.toString().replace(".", ","));
	}

	label = avtalInfo.productNameAlt;
    if (avtalInfo.avtalsForm == "0") {
        label = label + " Kampanj";
    }
    else if (avtalInfo.vind == "1") {
        label = label + " 100% vind";
    }
    else {
        label = label + " 10% vind och 90% vatten";
    }
    var label2 = avtalInfo.productTextLong;

    jQuery(".jmfAvtalsHeader").html(userInput.boendeForm + " " + label);

    jQuery("#topInfoTypeWrapper .topInfoType").html(label);
    jQuery("#topAvtalDesc").html(label2);

    if (avtalInfo.avtalsTyp == "4") {

        jQuery(".jmfPriser .jmfAvtalsHeader").html(userInput.boendeForm + " " + label.replace(avtalInfo.productText, "Rörligt avtal"));
        
        if (avtalInfo.vind == "1") {
            jQuery("#totalkWhPrice").text(priceRorligtTotal100);
        }
        else {
            jQuery("#totalkWhPrice").text(priceRorligtTotal9010);
        }
    }
    else {
        jQuery("#totalkWhPrice").text(avtalInfo.totalkWhPriceWithFastFee);
    }

    if (parseFloat(avtalInfo.elPrisNoWind.replace(",", ".")) > 0) {
        if (avtalInfo.avtalsTyp != "4") {
            totJmfPris = parseFloat(avtalInfo.elPrisNoWind.replace(",", "."));
        }
        else {
            totJmfPris = parseFloat(priceRorligt.replace(",", "."));
        }
    }
    
    if (parseFloat(avtalInfo.elcertifikatsAvgift) > 0) {
        jQuery("#elcertifikat").text(avtalInfo.elcertifikatsAvgift.replace(".", ","));
        jQuery("#elcertifikatRow").show();
        totJmfPris += parseFloat(avtalInfo.elcertifikatsAvgift.replace(",", "."));
    }

    if (parseFloat(avtalInfo.paslag) > 0 || avtalInfo.avtalsForm == "0") {
        if (avtalInfo.avtalsTyp != "4") {
            jQuery("#paslag").text(avtalInfo.paslag.replace(".", ","));
            totJmfPris += parseFloat(avtalInfo.paslag.replace(",", "."));
        }
        else {
            jQuery("#paslag").text(priceRorligtPaslag.replace(".", ","));
            totJmfPris += parseFloat(priceRorligtPaslag.replace(",", "."));
        }
        jQuery("#paslagRow").show();
	}
      
    if (parseFloat(avtalInfo.faktAvg.replace(",", ".")) > 0) 
    { 
	    jQuery("#fakturaavg").text(avtalInfo.faktAvg.replace(".", ","));
	    jQuery("#fakturaRow").show();
	    totFaktAvgift = parseFloat(avtalInfo.faktAvg.replace(",", "."));
	}

    if (parseFloat(avtalInfo.fasta) > 0 || avtalInfo.avtalsForm == "0") {
        if (avtalInfo.avtalsTyp != "4") {
            jQuery("#fasta").text(avtalInfo.fasta.replace(".", ","));
            jQuery("#fastaRow").show();
            totFastAvgift = parseFloat(avtalInfo.fasta.replace(",", "."));
        }
        else {
            if (avtalInfo.vind == "1") {
                jQuery("#fasta").text(priceRorligtFastAvgift100.replace(".", ","));
                jQuery("#fastaRow").show();
                totFastAvgift = parseFloat(priceRorligtFastAvgift100.replace(",", "."));
            }
            else {
                jQuery("#fasta").text(priceRorligtFastAvgift9010.replace(".", ","));
                jQuery("#fastaRow").show();
                totFastAvgift = parseFloat(priceRorligtFastAvgift9010.replace(",", "."));
            }
        }
    }
	
    if ( parseFloat(avtalInfo.energiSkatt) > 0 ) {
        jQuery("#energiSkatt").text(avtalInfo.energiSkatt.replace(".", ","));
        jQuery("#energiSkattRow").show();
        totJmfPris += parseFloat(avtalInfo.energiSkatt.replace(",", "."));
    }

	if (parseFloat(avtalInfo.miljoPaslag) > 0 || avtalInfo.avtalsForm == "0") {
	    jQuery("#miljoPaslag").text(avtalInfo.miljoPaslag.replace(".", ","));
	    jQuery("#miljoPaslagRow").show();
	    jQuery(".comparePricesPuffWrapper .vind").show();
	    jQuery(".comparePricesPuffWrapper .vindVatten").hide();
	    totJmfPris += parseFloat(avtalInfo.miljoPaslag.replace(",", "."));
	}
	else {
	    jQuery(".comparePricesPuffWrapper .vind").hide();
	    jQuery(".comparePricesPuffWrapper .vindVatten").show();
	}	
	
    if ( parseFloat(avtalInfo.moms) > 0 ) 
    {
        if (avtalInfo.avtalsTyp != "4") {
            jQuery("#moms").text(avtalInfo.moms.replace(".", ","));
            jQuery("#momsRow").show();
        }
        else {
            if (avtalInfo.vind == "1") {
                jQuery("#moms").text(priceRorligtMoms100.replace(".", ","));
                jQuery("#momsRow").show();
            }
            else {
                jQuery("#moms").text(priceRorligtMoms9010.replace(".", ","));
                jQuery("#momsRow").show();
            }
        }
    }

    if (parseFloat(avtalInfo.faktAvgPerAr) > 0) {
        faktAvgift = 100 * parseFloat(avtalInfo.faktAvgPerAr.replace(",", "."));
    }

    if (parseFloat(avtalInfo.fastAvgiftPerAr) > 0) {
        if (avtalInfo.avtalsTyp == "4") {
            fastAvgiftFond = 100 * parseFloat(avtalInfo.fastAvgiftPerAr.replace(",", "."))
            fastAvgift = 100 * parseFloat(priceRorligtFastAvgift.replace(",", "."))
        }
        else {
            fastAvgift = 100 * parseFloat(avtalInfo.fastAvgiftPerAr.replace(",", "."))
        }
    }

	//Forbrukning
	setConsumption();
	calculateCO2saveForConsumption(consumption);
	setArsforbrukning(consumption);

	pricePerMonth = calculatekWhPrice(totJmfPris, fastAvgift, 0, consumption, 2);
	pricePerMonth_f = calculatekWhPrice(totJmfPris, fastAvgift, faktAvgift, consumption, 2); 100;
	pricePerMonthFond = calculatekWhPrice(totJmfPrisFond, fastAvgiftFond, 0, consumption, 2);
	pricePerMonthFond_f = calculatekWhPrice(totJmfPrisFond, fastAvgiftFond, faktAvgift, consumption, 2);
	
	pricekWh2000 = calculatekWhPrice(totJmfPris, fastAvgift, 0, 2000, 1);
	pricekWh5000 = calculatekWhPrice(totJmfPris, fastAvgift, 0, 5000, 1);
	pricekWh20000 = calculatekWhPrice(totJmfPris, fastAvgift, 0, 20000, 1);
	pricekWh2000_f = calculatekWhPrice(totJmfPris, fastAvgift, faktAvgift, 2000, 1);
	pricekWh5000_f = calculatekWhPrice(totJmfPris, fastAvgift, faktAvgift, 5000, 1);
	pricekWh20000_f = calculatekWhPrice(totJmfPris, fastAvgift, faktAvgift, 20000, 1);

	pricekWhFond2000 = calculatekWhPrice(totJmfPrisFond, fastAvgiftFond, 0, 2000, 1);
	pricekWhFond5000 = calculatekWhPrice(totJmfPrisFond, fastAvgiftFond, 0, 5000, 1);
	pricekWhFond20000 = calculatekWhPrice(totJmfPrisFond, fastAvgiftFond, 0, 20000, 1);
	pricekWhFond2000_f = calculatekWhPrice(totJmfPrisFond, fastAvgiftFond, faktAvgift, 2000, 1);
	pricekWhFond5000_f = calculatekWhPrice(totJmfPrisFond, fastAvgiftFond, faktAvgift, 5000, 1);
	pricekWhFond20000_f = calculatekWhPrice(totJmfPrisFond, fastAvgiftFond, faktAvgift, 20000, 1);

	$(".jmfPriser .jmf2000Price").text(formatLargeNumber(pricekWh2000) + " öre/kWh");
	$(".jmfPriser .jmf5000Price").text(formatLargeNumber(pricekWh5000) + " öre/kWh");
	$(".jmfPriser .jmf20000Price").text(formatLargeNumber(pricekWh20000) + " öre/kWh");
	$(".jmfPriser .jmf2000Price_f").text(formatLargeNumber(pricekWh2000_f) + " öre/kWh");
	$(".jmfPriser .jmf5000Price_f").text(formatLargeNumber(pricekWh5000_f) + " öre/kWh");
	$(".jmfPriser .jmf20000Price_f").text(formatLargeNumber(pricekWh20000_f) + " öre/kWh");

	$(".jmfPriserFond .jmf2000Price").text(formatLargeNumber(pricekWhFond2000) + " öre/kWh");
	$(".jmfPriserFond .jmf5000Price").text(formatLargeNumber(pricekWhFond5000) + " öre/kWh");
	$(".jmfPriserFond .jmf20000Price").text(formatLargeNumber(pricekWhFond20000) + " öre/kWh");
	$(".jmfPriserFond .jmf2000Price_f").text(formatLargeNumber(pricekWhFond2000_f) + " öre/kWh");
	$(".jmfPriserFond .jmf5000Price_f").text(formatLargeNumber(pricekWhFond5000_f) + " öre/kWh");
	$(".jmfPriserFond .jmf20000Price_f").text(formatLargeNumber(pricekWhFond20000_f) + " öre/kWh");

	var totalMonthPrice = Math.round((totJmfPris * consumption + fastAvgift / 12) * moms / 10) / 100;
	var totalMonthPrice_f = Math.round((totJmfPris * consumption + (fastAvgift + faktAvgift) / 12) * moms / 10) / 100;
	var totalMonthPriceFond = Math.round((totJmfPrisFond * consumption + fastAvgiftFond / 12) * moms / 10) / 100;
	var totalMonthPriceFond_f = Math.round((totJmfPrisFond * consumption + (fastAvgiftFond + faktAvgift) / 12) * moms / 10) / 100;
	
	if (jQuery('#efakturaCheckbox').is(':checked')) {
	    //Total Price Per Month
	    jQuery("#totalMonthPrice").text(formatLargeNumber(totalMonthPrice).replace(".", ","));
	    jQuery("#totalMonthPriceFond").text(formatLargeNumber(totalMonthPriceFond).replace(".", ","));
	    jQuery(".comparePricesPuffWrapper .villaPricesWrapper .noFaktAvg").show();
	    jQuery(".comparePricesPuffWrapper .lghPricesWrapper .noFaktAvg").show();
        jQuery(".comparePricesPuffWrapper .villaPricesWrapper .faktAvg").hide();
        jQuery(".comparePricesPuffWrapper .lghPricesWrapper .faktAvg").hide();

        jQuery(".comparePricesPuffWrapper .jmfPriser .noFaktAvg").show();
        jQuery(".comparePricesPuffWrapper .jmfPriser .faktAvg").hide();
        jQuery(".comparePricesPuffWrapper .jmfPriserFond .noFaktAvg").show();
        jQuery(".comparePricesPuffWrapper .jmfPriserFond .faktAvg").hide();

        jQuery("#totalkWhPrice").text(formatLargeNumber(pricePerMonth).replace(".", ","));
        jQuery("#totalkWhPriceFond").text(formatLargeNumber(pricePerMonthFond).replace(".", ","));
    }
	else {
	    jQuery("#totalMonthPrice").text(formatLargeNumber(totalMonthPrice_f).replace(".", ","));
	    jQuery("#totalMonthPriceFond").text(formatLargeNumber(totalMonthPriceFond_f).replace(".", ","));
	    jQuery(".comparePricesPuffWrapper .villaPricesWrapper .noFaktAvg").hide();
	    jQuery(".comparePricesPuffWrapper .lghPricesWrapper .noFaktAvg").hide();
        jQuery(".comparePricesPuffWrapper .villaPricesWrapper .faktAvg").show();
        jQuery(".comparePricesPuffWrapper .lghPricesWrapper .faktAvg").show();

        jQuery(".comparePricesPuffWrapper .jmfPriser .noFaktAvg").hide();
        jQuery(".comparePricesPuffWrapper .jmfPriser .faktAvg").show();
        jQuery(".comparePricesPuffWrapper .jmfPriserFond .noFaktAvg").hide();
        jQuery(".comparePricesPuffWrapper .jmfPriserFond .faktAvg").show();

        jQuery("#totalkWhPrice").text(formatLargeNumber(pricePerMonth_f).replace(".", ","));
        jQuery("#totalkWhPriceFond").text(formatLargeNumber(pricePerMonthFond_f).replace(".", ","));
    }
}
function calculatekWhPrice(totJmfPris, fastAvgift, faktAvgift, consumptionPerYear, decimaler) {
    var moms = 1.25;
    var x = Math.pow(10, decimaler);
    var kWhPrice = (Math.round(x * (totJmfPris + ((fastAvgift + faktAvgift) / consumptionPerYear)) * moms) / x).toString().replace(".", ",");
    if (kWhPrice.indexOf(",", 0) < 0)
        kWhPrice = kWhPrice + "," + x.toString().replace("1", "");
    return kWhPrice;
}
