﻿function jsonScriptRequest(url){
  this.head = document.getElementsByTagName('head')[0];
  this.id = 'id' + jsonScriptRequest.scriptCounter ++;
  this.timestamp = '&timestamp=' + getTimeStamp();
  this.url = url;
}
jsonScriptRequest.scriptCounter = 1;
jsonScriptRequest.prototype.addScriptTag = function(){this.head.appendChild(this.script);};
jsonScriptRequest.prototype.buildScriptTag = function(){this.script = document.createElement('script'); this.script.id = this.id; this.script.src = this.url + this.timestamp; this.script.type = 'text/javascript';};
jsonScriptRequest.prototype.removeScriptTag = function(){this.head.removeChild(this.script);};