﻿function setAsHomePage() {
    if (document.all) {
        document.body.style.behavior = 'url(#default#homepage)';
        document.body.setHomePage('http://www.lamiafinanza.it');
    }
}

function Dettaglio(id) {
    window.open('http://www.eurotlx.com/home3/popup.php?dd=' + id, 'new', "width=550,height=650,toolbar=yes,menubar=no,location=no,scrollbars=yes,resizable=yes,top=10,left=10");
}

function bookmarkPage() {
    var bookmarkurl = "http://www.lamiafinanza.it";
    var bookmarktitle = "Per decidere come investire";
    if (document.all)
        window.external.AddFavorite(bookmarkurl, bookmarktitle);
    else if (window.sidebar) // firefox
        window.sidebar.addPanel(bookmarktitle, bookmarkurl, "");
}


function Stampa(ts, id, titolo) {
    if (ts == 'a') {
        window.open("Stampa.aspx?ts=" + ts + "&id=" + id, titolo, "width=660,height=600,toolbar=yes,menubar=yes,location=no,scrollbars=yes,resizable=yes,top=10,left=10");
    }
}

function InviaArticolo(c, a) {
    window.open("InviaArticolo.aspx?c=" + c + "&a=" + a, "Invia Articolo", "width=320,height=120,toolbar=yes,menubar=yes,location=no,scrollbars=yes,resizable=yes,top=10,left=10");
}

function RecuperaPassword() {
    window.open("RecuperaPass.aspx", "Recupera Password", "width=320,height=120,toolbar=yes,menubar=no,location=no,scrollbars=yes,resizable=yes,top=10,left=10");
}

function showZoneEditor(id_zona, cid) {
    var zoneEditorWindow = window.radopen("EditControl.aspx?zona=" + id_zona + "&cid=" + cid, null);
    zoneEditorWindow.setSize(600, 600);
    zoneEditorWindow.center();
    zoneEditorWindow.set_modal(true);
}

function showZoneEditorPanel(id_zona, cid, pos, pcid, ppos) {
    var zoneEditorWindow = window.radopen("EditControl.aspx?zona=" + id_zona + "&cid=" + cid + "&pos=" + pos + "&pcid=" + pcid + "&ppos=" + ppos, null);
    zoneEditorWindow.setSize(600, 600);
    zoneEditorWindow.center();
    zoneEditorWindow.set_modal(true);
}

function showMasterZoneEditor(mp, zn) {
    var zoneEditorWindow = window.radopen("EditMasterControl.aspx?mp=" + mp + "&zn=" + zn, null);
    zoneEditorWindow.setSize(600, 600);
    zoneEditorWindow.center();
    zoneEditorWindow.set_modal(true);
}

function caricaConfigurazioneZona(id_zona) {
    var zoneEditorWindow = window.radopen("CaricaConfigurazioneZona.aspx?id_zona=" + id_zona, null);
    zoneEditorWindow.setSize(600, 600);
    zoneEditorWindow.center();
    zoneEditorWindow.set_modal(true);
}

function Reload(sender, eventArgs) {
    location.href = location.href;
}

function ClickMyDefaultButton(e, buttonID) {
    var event = e ? e : window.event;
    var btn = document.getElementById(buttonID);
    if (btn) {
        if (event.keyCode == 13) {
            btn.click();
            return false;
        }
    }
}

function increaseArticleFont(idbox) {
    var element = document.getElementById(idbox);
    var size = 14;
    if (element == null)
        return;
    else {
        if (element.style.fontSize) {
            size = parseInt(element.style.fontSize.replace("px", ""));
        }

        element.style.fontSize = (++size) + "px";
    }
}

function decreaseArticleFont(idbox) {
    var element = document.getElementById(idbox);
    var size = 14;
    if (element == null)
        return;
    else {
        if (element.style.fontSize) {
            size = parseInt(element.style.fontSize.replace("px", ""));
        }

        element.style.fontSize = (--size) + "px";
    }
}
