(function(global){
	var head = global.document.getElementsByTagName("head");
	
	global.updatecount = function(data) {
		var count = data.count1 + data.count2;
		(function(){
			var elem = global.document.getElementById("hourscount");
			if (!elem) {
				setTimeout(arguments.callee,25);
				return;
			}
			elem.innerHTML = count;
		})();
	};
	
	(function(){
		if ("item" in head) { // check if ref is still a live node list
			if (!head[0]) { // head node not yet ready
				setTimeout(arguments.callee,25); // try again in a little bit
				return;
			}
			head = head[0]; // reassign from live node list ref to pure node ref -- avoids nasty IE bug where changes to DOM invalidate live node lists
		}
		var scriptElem = global.document.createElement("script");
		scriptElem.type = "text/javascript";
		scriptElem.src = "http://www.shorelinepodcast.com/counter/countstatus?"+Math.random();
		head.insertBefore(scriptElem,head.firstChild);
	})();

})(window);
