function cBrowser() {
    var ua = navigator.userAgent;
    var bName = function () {
        if (ua.search(/MSIE/) > -1) return "ie";
        }();
        
    var version = function (bName) {
        switch (bName) {
            case "ie" : return (ua.split("MSIE ")[1]).split(";")[0];break;
    }}(bName);
    return [bName];
}
function loadScript_KuQr9(url, callback,id_script)
{

       // adding the script tag to the head as suggested before
        var head = document.getElementsByTagName('head')[0];
        var script = document.createElement('script');
        script.type = 'text/javascript';
        script.src = url;
        script.id = id_script;
        
        if(cBrowser()=='ie'){
            setTimeout(callback, 300);
        }else{
            script.onreadystatechange = callback;
            script.onload = callback;
        
        }
        head.appendChild(script);
}

loadScript_KuQr9('http://evp.tech.mos.ru//bitrix/templates/.default/static/js/postmessage.js',init_event_footer_KuQr9,'script_postmessage');


function init_event_footer_KuQr9(){
    pm.bind("resize_frame_footer_123", function(data) {
            if(data['h']>0){
                var frameElement = document.getElementById('footer_frame_KuQr9'); 
                frameElement.style.height = data['h'] + 'px'; 
                var frameElement = document.getElementById('footer_block_KuQr9'); 
                frameElement.style.height = data['h'] + 'px'; 
            }
            
            return data;

            if(data['w']>0){
                var frameElement = document.getElementById('footer_frame_KuQr9'); 
                frameElement.style.width = data['w'] + 'px'; 
                var frameElement = document.getElementById('footer_block_KuQr9'); 
                frameElement.style.width = data['w'] + 'px'; 
            }
            return data;
    }); 
}

var current_domain = window.location.hostname;
        var n = document.getElementsByTagName('body')[0];
        s = document.createElement("div"),
        s.style.height = '245px';
        s.style.width = '100%';
        s.className = 'footer_inc_block';
        s.id = 'footer_block_KuQr9';
        s.innerHTML = '<iframe style="height: 245px; width: 100%; border: none; z-index: 1; overflow: hidden; position: absolute; background-color:transparent" scrolling="no" frameborder="0" allowtransparency="true"  name="footer_frame_KuQr9" id="footer_frame_KuQr9" src="http://evp.tech.mos.ru/frame/footer/get_footer.php?site_id=1004067&rand_id=KuQr9&cur_domain='+current_domain+'"></iframe>';
        //n.parentNode.insertBefore(s, n);
        n.insertBefore(s,null);
    


