// Utilizing MooTools Library http://www.mootools.net

// Custom event handler to prevent conflict between libraries using window.addEvent 
var AC = {
	addEvent: function (el, type, fn) {
		if (el.attachEvent) {
			el['e'+type+fn] = fn;
			el[type+fn] = function(){el['e'+type+fn](window.event);}
			el.attachEvent('on'+type,el[type+fn]);
		} else {
			el.addEventListener(type,fn,false);
		}
	},
	removeEvent: function (el, type, fn) {
		if (el.detachEvent) {
			el.detachEvent('on'+type,el[type+fn]);
			el[type+fn] = null;
		} else {
			el.removeEventListener(type,fn,false);
		}
	}
};


AC.addEvent(window, 'load', setup);

function setup(){

	
	var accordion = new Accordion('div.toggleHead', 'div.toggleBody', {opacity: false,show: -1,alwaysHide: true}, $('AC-Accordion'));
		
	//XML CONNECTOR
	        //var XMLurl = "http://rss.cnn.com/rss/cnn_tech.rss";
	        //var req = new Request.HTML({url: XMLurl,
		      //  method: 'get',
		        //onSuccess: function(html, re, rh, rj) {
			        //Clear the text currently inside the results div.
           //$$('.AC-TabAthleticNews .AC-BlockCt .AC-BlockText').set('text', '');
			//Inject the new DOM elements into the results div.
			//$$('.AC-TabAthleticNews .AC-BlockCt .AC-BlockText').adopt(re);


		//},
		//Our request will most likely succeed, but just in case, we'll add an
		//onFailure method which will let the user know what happened.
		//onFailure: function() {
		//	alert('There was an error retrieving the xml document.');
		//}
	//});req.send();

}

