/**
 *
 * The frontend folio javascript file
 *
 **/
var folio_runner = (function(){
	//An array of all the javascript files that need to be loaded
	var _js_files = [	
		'javascript/library/jquery/plugins/jquery.json.min.js',
		'javascript/library/jquery/plugins/jquery.scrollTo.min.js',
		'javascript/library/jquery/plugins/jquery.easing.js',
		'javascript/shared/page_components/folio/animation_dispatcher.js',
		'javascript/shared/page_components/folio/view_generator.js',
		'javascript/shared/page_components/folio/views/slideshow_view.js',
		'javascript/shared/page_components/folio/views/slideshow/piclist_view.js'
	];
	
	var constructor = function(){
		this.start_loading();
	}
	
	/**
	 * Start loading the javascript files
	 **/	
	constructor.prototype.start_loading = function(){
		var self = this;
		var tl = _js_files.length;
		var c = 1;
		for(var i=0; i<tl; i++){
			$.getScript(GBL_BASE_URL+_js_files[i], function(){
				if(c==tl){
					//Start and show the folio 
					new view_generator(function(){
						$('#folio_sheet_contents').slideDown();
					});
				}
				c++;
			});
		}
	}

	return constructor;
		
})();
