﻿function SystemReqObject(solId, displayDiv) {
    if (window[this.guid]) {
        return window[this.guid];
    }
    window[this.guid] = this;
    this.solId = solId;
    this.displayDiv = displayDiv;
}
SystemReqObject.prototype.guid = "26890396-CC73-4CD1-8AFD-A7434FFDBA6F";
SystemReqObject.prototype.toString = function() {
    return "[SystemReqObject]";
}
SystemReqObject.prototype.makeAjaxCall = function() {
    var successFunc = new Function("data", "textStatus", "window[\"" + this.guid + "\"].success(data, textStatus);");
    $.ajax({url: "/neptune/solution.do", dataType: "html", data: {solutionID: this.solId}, success: successFunc, type: "GET"});
}
SystemReqObject.prototype.success = function(data, textStatus) {
    var displayDiv = $("#" + this.displayDiv);
    $("div[class='primus:role:fix']", data).each(function(i) { displayDiv.append($(this).contents()); });
}
SystemReqObject.prototype.callAjaxOnReady = function() {
    $(new Function("window[\"" + this.guid + "\"].makeAjaxCall();"));
}