var digg = {
	myConn: false,
	cnt:0,
	init:	function() {
		// set and test XHConn, quitting silently if it fails
		digg.myConn = new XHConn();
		if(!digg.myConn) {
			alert("no funko");
			return;
		}

	},
	tt: function(imgid,targetId) {

		if(digg.cnt > 0) return;
		
		/* this is the function that is run
		once the Ajax call completes */
		var fnWhenDone = function(oXML) {
		    document.getElementById(targetId).innerHTML = oXML.responseText;
		};
		// use XHConn's connect method
		var uri = 'template=.ajax_digg.t&imgid='+imgid+'&func='+targetId;
		digg.myConn.connect('/o.o.i.s', 'POST', uri, fnWhenDone);
		digg.cnt++;
	},
	addEvent: function(obj, type, fn) {  // the add event function
		if (obj.addEventListener) {
			obj.addEventListener(type, fn, false);
    		} else if (obj.attachEvent) {
      			obj["e"+type+fn] = fn;
      			obj[type+fn] = function() {
        			obj["e"+type+fn](window.event);
      			};
      			obj.attachEvent("on"+type, obj[type+fn]);
    		}
  	}
};

digg.addEvent(window, 'load', function() {
		digg.init();
	}
);