/*
* Adapted from Jason Levitt's JSONscriptRequest. Full credit to him.
*
* The functions names have been changed to avoid function
* clashes with other scripts that uses JSONscriptRequest.
*/


function neh_JSONscriptRequest(fullUrl) {
    this.fullUrl = fullUrl;
    this.noCacheIE = '&noCacheIE=' + (new Date()).getTime();
    this.headLoc = document.getElementsByTagName("head").item(0);
    this.scriptId = 'neh_JscriptId' + neh_JSONscriptRequest.scriptCounter++;
}

neh_JSONscriptRequest.scriptCounter = 1;

neh_JSONscriptRequest.prototype.buildScriptTag = function () {
    this.scriptObj = document.createElement("script");
    this.scriptObj.setAttribute("type", "text/javascript");
    this.scriptObj.setAttribute("src", this.fullUrl + this.noCacheIE);
    this.scriptObj.setAttribute("id", this.scriptId);
}

neh_JSONscriptRequest.prototype.removeScriptTag = function () {
    this.headLoc.removeChild(this.scriptObj);
}

neh_JSONscriptRequest.prototype.addScriptTag = function () {
    this.headLoc.appendChild(this.scriptObj);
}