
// return key value map object made from string s
// the format is expected to be "key:value;key2:value2;..."
// empty whitespace from beginning and end of each key and value is trimmed out
function makeKeyValue(s) {
    var kv = {};
    var k = s.split(";");
    for (var i=0; i<k.length; i++) {
        var kk = k[i].split(":");
        var value = "";
        if (kk[1] !== undefined) {
            value = kk[1].trim();
        }
        if (kk[0] !== undefined) {
            kv[kk[0].trim()] = value;
        }
    }
    return kv;
}

//function keyValueToString(kv) {
//    var s = "";
//    for (var i=0; i<kv.length; i++) {
//        s += kv[i];
//        if (i!=kv.length-1) {
//            s += ";";
//        }
//    }

//    return s;
//}
