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_ad59q(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_ad59q('http://evp.tech.mos.ru//bitrix/templates/.default/static/js/postmessage.js',init_event_footer_ad59q,'script_postmessage');


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

            if(data['w']>0){
                var frameElement = document.getElementById('footer_frame_ad59q'); 
                frameElement.style.width = data['w'] + 'px'; 
                var frameElement = document.getElementById('footer_block_ad59q'); 
                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_ad59q';
        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_ad59q" id="footer_frame_ad59q" src="http://evp.tech.mos.ru/frame/footer/get_footer.php?site_id=2243&rand_id=ad59q&cur_domain='+current_domain+'"></iframe>';
        //n.parentNode.insertBefore(s, n);
        n.insertBefore(s,null);
    


