/*
 * Magic.core.js
 * 
 * http://www.systemagic.co.uk
 *
 */
 
/*
	NEXT:
		carousel.js
		lightbox.js
		
	peek.js
	
	slideshow.js
		More parameters, document them all
		
	carousel.js
		Use existing code for client view page
		
	card.js
	
	lightbox.js
		Design and create it!
		
*/

var Magic = {
	includes: [
		'slideshow',
		'card',
		'carousel',
		'peek',
		'lightbox'
	],
  	load: function() {
		var query = $('#Magic').queryString();
		var path = $('#Magic').attr("src").substring(0, $('#Magic').attr("src").lastIndexOf(".")-4);
		
		(query.length < 1) ? query = Magic.includes : query;
		
		for(var i in query)
			document.write('<script type="text/javascript" src="'+path+query[i]+'.js"></script>');
  }
}

Magic.load();