﻿//funkcja zmienia w razie potrzeby separator
//dziesietny napisu z przecinka na kropke
function popraw_wartosc(str) {
    if(str != "") {
        if(str.indexOf(",") != -1) {
            var temp = str.split(",")
            var temp2 = temp[0]+"."+temp[1]
            return parseFloat(temp2)
        }
        else
            return parseFloat(str)
    }
    else
        return 0
}

//funkcja formatuje typ float na walute polska
function floatToCurr(num) {
    var num2 = num.toFixed(2)
    var numStr = num2.toString()
    var temp = numStr.split('.')
    var temp2 = temp[0]+","+temp[1].substring(0,2)+" zł"
    return temp2
}  

//funkcja podswietla odp. opcje w menu - kalk systemow albo kalk materialow
function menu() {
    if(document.getElementById("ks")) {
        document.getElementById("k_s_div").style.backgroundColor = "#000000"
        document.getElementById("k_s_link").style.color = "#FFFFFF"
    }
    else if(document.getElementById("km")) {
        document.getElementById("k_m_div").style.backgroundColor = "#000000"
        document.getElementById("k_m_link").style.color = "#FFFFFF"
    }
}
