var http = false;
var fadeDelay = 500;

if(navigator.appName == "Microsoft Internet Explorer") {
  http = new ActiveXObject("Microsoft.XMLHTTP");
} else {
  http = new XMLHttpRequest();
} 

function getContent(objectID, contentID, contentTK, fieldNam) { 
    http.open("GET", "utilities/getContent.cfm?id=" + contentID + "&tk=" + contentTK + "&fd=" + fieldNam, true);
    http.onreadystatechange=function() {
    	if(http.readyState == 4) {
      		document.getElementById(objectID).innerHTML = http.responseText;
    	}
  	}
  	http.send(null);
}

function fadeOut(obj, cntID, cntTK, fieldNam) {
	Spry.Effect.AppearFade(obj, {duration: fadeDelay, from: 100, to: 0, toggle: false, finish: function(){fadeIn(obj, cntID, cntTK, fieldNam)}});
}

function fadeIn(obj, cntID, cntTK, fieldNam) {
	//document.getElementById(obj).innerHTML = '<p>&nbsp;</p>'
	getContent(obj, cntID, cntTK, fieldNam);
	Spry.Effect.AppearFade(obj, {duration: fadeDelay, from: 0, to: 100, toggle: false});
}

