
var last_compose_win;

function open_compose_win(args)
{
    var url = "/horde/imp/compose.php?Horde=70878c0c55f9d1fb1f455e6de8c6ee8a";
    if (url.indexOf('?') == -1) {
        var glue = '?';
    } else {
        var glue = '&';
    }
    var now = new Date();
    var name = "compose_windows_" + now.getTime();
    if (args != "") {
        url = url + glue + args + "&uniq=" + now.getTime();
    } else {
        url = url + glue + "uniq=" + now.getTime();
    }
    var width = screen.width;
    if (width > 810) {
        width = 810;
    } else {
        width -= 75;
    }
    var height = screen.height;
    if (height > 725) {
        height = 650;
    } else {
        height -= 75;
    }
    param = "toolbar=no,location=no,status=yes,scrollbars=yes,resizable=yes,width=" + width + ",height=" + height + ",left=0,top=0";
    name = window.open(url, name, param);
    if (!name) {
        alert("The compose window can\'t be opened. Perhaps you have set your browser to block popup windows?");
    } else {
        if (!eval("name.opener")) {
            name.opener = self;
        }

        last_compose_win = name;
    }
}

function login() {
	w = window.open("quarantineIronport2.php","cuarentena","width=1000,height=500,left=20,top=20,resizable=1,scrollbars=1");
	w.focus();
	}

function open_quarantine_win(args)
{
	window.open("http://217.130.24.41:82/login?action=Logout","cuarentena","width=1000,height=500,left=20,top=20,resizable=1,scrollbars=1");
	window.open("http://217.130.24.41:82/login?","cuarentena","width=1000,height=500,left=20,top=20,resizable=1,scrollbars=1");
//	setTimeout('login();',10);
//	return false;
}


function open_quarantine_win_old(args)
{
    var url = "/horde/imp/quarantineIronport.php?Horde=70878c0c55f9d1fb1f455e6de8c6ee8a";
    if (url.indexOf('?') == -1) {
        var glue = '?';
    } else {
        var glue = '&';
    }
    var now = new Date();
    var name = "quarantine_windows_" + now.getTime();
    if (args != "") {
        url = url + glue + args;
    } else {
        url = url + glue;
    }
    var width = screen.width;
    width -= 75;
	
    var height = screen.height;
    height -= 75;

    param = "toolbar=no,location=no,status=yes,scrollbars=yes,resizable=yes,width=" + width + ",height=" + height + ",left=0,top=0";
    name = window.open(url, name, param);
    if (!name) {
        alert("The quarantine window can\'t be opened. Perhaps you have set your browser to block popup windows?");
    } else {
        if (!eval("name.opener")) {
            name.opener = self;
        }
    }
}



function focus_compose_win(compose_win)
{
    if (!compose_win) {
        compose_win = last_compose_win;
    }

    if (!compose_win) {
        return;
    }

    compose_win.focus();
}
