function commentExecute(id, title) {
	
	$('#articleComments').html('<div align="center"><h3><img src="http://comments.sltdb.com/images/ajax-loader.gif">&nbsp;&nbsp;Loading Comments</h3></div>');
	
	var obj;

	try { 
		obj=new JSONscriptRequest('http://comments.sltdb.com/pull.php?id='+id+'&title='+title+'&random='+Math.random(99999)); 
		obj.buildScriptTag(); // Build the script tag     
		obj.addScriptTag(); // Execute (add) the script tag
	} catch(e) {
		// create a default height
	}

}

function sectionExecute(section) {
	
	var obj;

	try { 
		obj=new JSONscriptRequest('http://comments.sltdb.com/pullSection.php?section='+section+'&random='+Math.random(99999)); 
		obj.buildScriptTag(); // Build the script tag     
		obj.addScriptTag(); // Execute (add) the script tag
	} catch(e) {
		// create a default height
	}

}

function homeExecute(section) {
	
	var obj;

	try { 
		obj=new JSONscriptRequest('http://comments.sltdb.com/pullHome.php?section='+section+'&random='+Math.random(99999)); 
		obj.buildScriptTag(); // Build the script tag     
		obj.addScriptTag(); // Execute (add) the script tag
	} catch(e) {
		// create a default height
	}

}

function borkh(data) {
  var text='';

  if(data==null)
    alert('error');
  else {

	 var a = data.Article.Content;
	
	 $('#homeComments').html(data.Article.Content);
	 setTimeout('commentstate();',500);

  }
}

function borkc(data) {
  var text='';

  if(data==null)
    alert('error');
  else {

	 var a = data.Article.Content;
	
	 $('#sectionComments').html(data.Article.Content);
	 setTimeout('commentstate();',500);

  }
}

function bork(data){
  var text='';

  if(data==null)
    alert('error');
  else {

	 var a = data.Article.Content;
	
	 $('#articleComments').html(data.Article.Content);
	 setTimeout('commentstate();',500);

  }
}


// Json

function JSONscriptRequest(fullUrl)  {
    // REST request path
    this.fullUrl = fullUrl;
    // Keep IE from caching requests
    this.noCacheIE = '&noCacheIE=' + (new Date()).getTime();
    // Get the DOM location to put the script tag
    this.headLoc = document.getElementsByTagName("head").item(0);
    // Generate a unique script tag id
    this.scriptId = 'JscriptId' + JSONscriptRequest.scriptCounter++;
}

// Static script ID counter
JSONscriptRequest.scriptCounter = 1;

// buildScriptTag method
//
JSONscriptRequest.prototype.buildScriptTag = function () {

    // Create the script tag
    this.scriptObj = document.createElement("script");
   
    // Add script object attributes
    this.scriptObj.setAttribute("type", "text/javascript");
    this.scriptObj.setAttribute("charset", "utf-8");
    this.scriptObj.setAttribute("src", this.fullUrl + this.noCacheIE);
    this.scriptObj.setAttribute("id", this.scriptId);
}
 
// removeScriptTag method
//
JSONscriptRequest.prototype.removeScriptTag = function () {
    // Destroy the script tag
    this.headLoc.removeChild(this.scriptObj);  
}

// addScriptTag method
//
JSONscriptRequest.prototype.addScriptTag = function () {
    // Create the script tag
    this.headLoc.appendChild(this.scriptObj);
}
