var modalWindow = {
    parent:"body",
    windowId:null,
    content:null,
    width:null,
    height:null,
    close:function()
    {
        jQuery(".modal-window").remove();
        jQuery(".modal-overlay").remove();
    },
    open:function()
    {
        var modal = "";
        modal += "<div class=\"modal-overlay\"></div>";
        modal += "<div id=\"" + this.windowId + "\" class=\"modal-window\" style=\"width:" + this.width + "px; height:" + this.height + "px; margin-top:-" + (this.height / 2) + "px; margin-left:-" + (this.width / 2) + "px;\">";
        modal += this.content;
        modal += "</div>";

        jQuery(this.parent).append(modal);

        jQuery(".modal-window").append("<a class=\"close-window\"></a>");
        jQuery(".close-window").click(function(){modalWindow.close();});
        jQuery(".modal-overlay").click(function(){modalWindow.close();});
    }
};

