function loadDoc(url) {
    ShowModalWindow(true);
    if (!$("iframe#iframe-doc").length > 0) {
        if (/iPhone|iPod|iPad/.test(navigator.userAgent)) {
            $("#box-frame").append('<div class="pane ui-layout-center" id="box-iframe"><iframe id="iframe-doc" src="" ></iframe></div>');
            $('#box-tree-int').css({ overflow: 'auto', '-webkit-overflow-scrolling': 'touch' });
        } else {
            $("#box-frame").append('<iframe id="iframe-doc" src="" class="pane ui-layout-center"></iframe>');
        }
    }
    $('iframe#iframe-doc').attr('src', url);
};

function loadSubDoc(url) {
    var src; 
    if(typeof url === "undefined"){
        src = $('iframe#iframe-sub-doc').attr('src');
    } else {
        src = url;
    }    

    $(".img-glass-hour-center").show();
    if ($("iframe#iframe-sub-doc").length > 0) {
        $("iframe#iframe-sub-doc").remove();
    }

    if (/iPhone|iPod|iPad/.test(navigator.userAgent)) {
        ShowModalWindow(true);
        $("#box-layout-east-container").empty();
        $("#box-layout-east-container").append('<div id="box-layout-east" class=""><iframe id="iframe-sub-doc" src="" ></iframe></div>');
    } else {
        $("#box-layout-east-container").append('<iframe id="iframe-sub-doc" src="" class="" style="display:none"></iframe>');
    }

    $('iframe#iframe-sub-doc').attr('src', src);
    $('iframe#iframe-sub-doc').height($('#box-layout-east-container').height());
    $('iframe#iframe-sub-doc').width($('#box-layout-east-container').width()); 
    $('iframe#iframe-sub-doc').unbind( "load" );
    $('iframe#iframe-sub-doc').load(function () {
        $(".img-glass-hour-center").hide();
        $('iframe#iframe-sub-doc').show();

        //62126
        if($('#iframe-sub-doc').contents().find('#selected-forumid').length){
            $('#iframe-sub-doc').contents().find("html, body").animate({ 
                scrollTop: $('#iframe-sub-doc').contents().find('#selected-forumid').offset().top - 10 
            });
        }
        if (/iPhone|iPod|iPad/.test(navigator.userAgent)) {
            ShowModalWindow(false);
        }
    });
};