
document.write("<div id=\"spmInsertedArticleContainer\"></div>");



function ArticleViewer(callUrl) {
    this.requestURLPath = callUrl;
}

ArticleViewer.prototype.getScriptReference = function(doc) {
    doc.write('<script type="text/javascript" src="' + this.generateRequestUrl() + '"></script>'); 
} 

ArticleViewer.prototype.getQueryStringValues = function(variable) {
    var query = window.location.search.substring(1);
    var vars = query.split("&");

    for (var i = 0; i < vars.length; i++) {
        var pair = vars[i].split("=");

        if (pair[0] == variable) {
            return pair[1];
        }
    }

    return null;
}
ArticleViewer.prototype.generateRequestUrl = function() {
    var aid = this.getQueryStringValues("aid");
    var sid = this.getQueryStringValues("sid");
    var wfid = this.getQueryStringValues("wfid");

    if (aid != null && wfid != null) {
        return this.requestURLPath + "?aid=" + aid + "&wfid=" + wfid;
    }
    else if (sid != null && wfid != null) {
        return this.requestURLPath + "?sid=" + sid + "&wfid=" + wfid;
    }
    else {
        this.setControlContent("Unable to generate the article viewer");
    }
}

var message = "Right click has been disabled.  StatePoint.net";

function clickIE() {
    if (document.all)
    { alert(message); return false; } 
}

function clickNS(e) {
    if(document.layers || (document.getElementById && !document.all)) {
        if (e.which == 2 || e.which == 3) { alert(message); return false; } 
    } 
}
if (document.layers)
{ document.captureEvents(Event.MOUSEDOWN); document.onmousedown = clickNS; }
else
{ document.onmouseup = clickNS; document.oncontextmenu = clickIE; }

document.oncontextmenu = new Function("return false");var smpArticleViewer = new ArticleViewer("http://www.statepoint.net/ArticleViewer.spm");
smpArticleViewer.getScriptReference(document);
