
    function getCookie(cname) {let name = cname + '=';let decodedCookie = decodeURIComponent(document.cookie);
    let ca = decodedCookie.split(';');for(let i = 0; i
    <ca.length; i++) {
    let c = ca[i];while (c.charAt(0) == ' ') {c = c.substring(1);}
    if (c.indexOf(name) == 0) {return c.substring(name.length, c.length);}
    }return '';
    }

    CM_cookie = getCookie("CMUID");
    if(CM_cookie == ''){
    cvalue = Math.random().toString(36).substr(2, 30) + Math.random().toString(36).substr(2, 30);
    const d = new Date();
    d.setTime(d.getTime() + (30*24*60*60*1000));
    let expires = 'expires='+ d.toUTCString();
    document.cookie =  'CMUID=' + cvalue + ';' + expires + ';path=/';
    console.log('cvalue :: ',cvalue);
    }
    CM_cookie = getCookie("CMUID");
    var script_node = document.createElement('script');
    script_node.type = 'text/javascript';
    script_node.id = 'cm_data';
    script_node.src =  document.getElementById('cm_init').src.split('?')[0] + CM_cookie + '/?lang=cz';
    document.head.appendChild(script_node);

    