function displaySource(src, target, opt){
	if(Ext.isArray(src)){
		if(target == 'serial'){
			Ext.each(src,function(itm,idx,arr){
				if(arr[idx+1]){
					itm.opt = {
						callback: displaySource,
						args: arr[idx+1]
					}
				}
			});
			displaySource(src[0].url, src[0].target, src[0].opt);
		}else{
			Ext.each(src,function(itm,idx,arr){
				displaySource(itm.url, itm.target);	
			});
		}
		return;
	}else if(src && typeof src == 'object'){
		displaySource(src.url, src.target, src.opt);
		return;
	}

	var target = target || 'sourcecode';

	Ext.Ajax.request({
		url: src,
		callback: function(o,s,r){
			var text = Ext.util.Format.htmlEncode(r.responseText);
			if(Ext.isIE){
				text = text.replace(/\n/g,'<br />');
				text = text.replace(/ /g,'&nbsp;');
			}
			Ext.get(target).dom.innerHTML = text;
			prettyPrint();

			if(opt && opt.callback){
				opt.callback.call(this,opt.args);
			}
		}
	});
}

