Response = new function()
{
    var popupsInstances = new Array();

    this.redirect = function(href)
    {
        location.href = href;
        return false;
    }
    
    this.welcome = function()
    {
        return this.redirect("moebel.html");
    }
    
    this.popup = function(href)
    {
        var hash = this.getHash(href);
        if (popupsInstances[hash] == null) {
            var width  = 450;
            var height = 200;
            var left   = parseInt((screen.availWidth - width) / 2, 10);
            var top    = parseInt((screen.availHeight - height) / 2, 10);
            popupsInstances[hash] = window.open(href, hash, "top=" + top + ",left=" + left + ",height=" + height + ",width=" + width);
        }
        popupsInstances[hash].focus();
    }
    
    this.getHash = function(string)
    {
        string = "popup_" + string;
        var hash = string.replace(/[^a-z0-9]/g, "_");
        //alert(hash);
        return hash;
    }
    
    this.close = function(href)
    {
        var hash = this.getHash(href);
        popupsInstances[hash].close();
        popupsInstances[hash] = null;
    }
}
