window.addEvent('domready', function(){ //function for when dom is ready to be referenced by js, and create accordion
	projects = new Array('bdt', 'eip', 'slia', 'iip', 'apex', 'eis', 'phonate', 'latymer', 'slashmedia');
	
	var myXHRcon = new Array();
	
	for (i=0;i<projects.length;i++)
	{
		
		myXHRcon[i] = new XHR({method:'get', onSuccess: function(req) {
			
			$(projects[this['options']['num']] + "Content").innerHTML = req;
			$$("." + projects[this['options']['num']] + "link").each(function(s, index) {
				  s.href = "#";
			});
			
			if(this['options']['num'] == 2) {//if last request
				$('navminor').innerHTML = "";
				accordion=new Accordion(
					$$(".portfolio"), //set accordion title boxes
					$$(".portfolioContent") //set accordion content boxes
				);
				var Tips1 = new Tips($$('.Tips'), {
					initialize:function(){
						this.fx = new Fx.Style(this.toolTip, 'opacity', {duration: 250, wait: false}).set(0);
					},
					onShow: function(toolTip) {
						this.fx.start(0.9);
					},
					onHide: function(toolTip) {
						this.fx.start(0);
					}
				});
			}
		}
	, num: i/*<--so request knows which bit of array it is*/}).send('/whatwevedone/' + projects[i] + '/ajax');
	}
});