/**
 * Called by flash local connection swf to set the status of the client window.
 * True means that the client window is present.
 */
function setClientStatus(cs) { // bool setzen fuer clientFenster offen
    window.clientStatus = cs;
}

/**
 * Opens the smeet client window when not present or tells the smeet client window
 * to change its url via flash local connection.
 */
function openSmeetWindow(url) {
    if (window.clientStatus) {
        thisMovie("clientConnection").changeRoom(url);
        return null;
    } else {
        return opensMeet(url);
    }
}

/**
 * DON'T change this method name or contract!
 * It is public smeet API which has been disclosed to partners.
 */
function opensMeet(url) {
    var ctParam = "";
    var xS = 1024, yS = 710;
    var xT = (screen.availWidth / 2) - 512;
    var yT = (screen.availHeight / 2) - 384;
    if (screen.width <= 1024) {
        xS = screen.availWidth;
        yS = screen.availHeight - 30;
        xT = 0;
        yT = 0;
    }
    var date = new Date();
    ctParam = "&ct=" + date.getTime();
    var f = window.open(url + ctParam + "&js=1", "sMeetClient", "width=" + xS + ",height=" + yS + ",left=" + xT + ",top=" + yT + ",resizable=yes");
    f.focus();
    return f;
}

function opensMeetLogin(url) {
    var xS = 1024, yS = 710;
    var xT = (screen.availWidth / 2) - 512;
    var yT = (screen.availHeight / 2) - 384;
    if (screen.width <= 1024) {
        xS = screen.availWidth;
        yS = screen.availHeight - 30;
        xT = 0;
        yT = 0;
    }
    var f = window.open(url, "Login", "width=" + xS + ",height=" + yS + ",left=" + xT + ",top=" + yT + ",resizable=yes");
    f.focus();
    return f;
}


function openHelpWindow(url) {
    var helpwindow = window.open(url, 'Hilfe', 'width=610,height=400,left=0,top=0,toolbar=no,menubar=no,location=no,status=no,resizable=yes,scrollbars=yes');
    helpwindow.focus();
    return helpwindow;
}