﻿var xval, tval, bval, rval, lval;
function doResize() { window.resizeTo(1024, 708); }
function ensureInFrameset(parentFramesetLocation) {
    var reg = new RegExp(parentFramesetLocation, "i");
    if ((parent.location.href + "").search(reg) < 0)
        window.open(parentFramesetLocation, "_parent");
};
function isBusy(id) { obj = document.getElementById(id); try { lval.remove(); lval = ''; } catch (e) { lval = getBusyOverlay(obj, { color: 'black', opacity: 0.5, text: 'working', style: 'text-decoration:blink;font-weight:bold;font-size:12px;color:white' }, { color: '#fff', size: 128, type: 'o' }); } }
function notBusy() { try { lval.remove(); lval = ''; } catch (e) { } }
function doUI() {
    $("#accordion").accordion({ autoHeight: false });
    $("button, input:submit").button();
    // Totale news
    numNewsVert = $("#jqnewsVert").children().length;

    // Totale news orizzontali
    numNewsOrizzontal = $("#jqnewsOriz").children().length;

    // Se si è creato il div per le news a rotazione verticale
    if (numNewsVert > 0) {
        jqnewsVertical();
    }

    // Se si è creato il div per le news a rotazione orizzontale
    if (numNewsOrizzontal > 0) {
        jqnewsOrizzontal();
    }
}
function doMain() { }
function doLayout() {
    if ($(window).width() < 1000) { $('#td-content').width(800); }
    else { $('#td-toolbox').width(200); }
    cHeight = $(window).height() - ($('#header').outerHeight() + $('#bottom').outerHeight() + $('#footer').outerHeight());
    $('#content').height(cHeight);
    $('#frameWorkspace').height(50);
    $('#table-content').height($('#content').innerHeight());
    $('#frameWorkspace').height($('#content').innerHeight()-5);
}
function showDocument(dTitle, dURL, w, h) {
    $("#dialog:ui-dialog").dialog("destroy");
    $("#dlgDocument").dialog({
        title: dTitle,
        width: w,
        height: h,
        resizable: false,
        closeOnEscape: true,
        modal: true,
        show: 'slide'
    });
    document.getElementById("dlgDocumentFrame").src = dURL;
}
function showWindow(wTitle, wURL, w, h, c) { dlgWindow = dhtmlmodal.open('modWindow', 'iframe', wURL, wTitle, 'width=' + w + 'px,height=' + h + 'px,resize=1,scrolling=1,center='+c); }
function closeWindow(refresh) { if (refresh == true) { dlgWindow.hide(); window.location.href = window.location.href; } else { dlgWindow.hide(); } }

