
	/////  SEQUENCES 
	
	function getPage(o) {
		
		o.f[o.f.length] = function(o) {
			requestPage(o);
		}
		
		o.f[o.f.length] = function (o) { 
			postPage(o);
		}
		
		o.f[o.f.length] = function (o) { 
			o.divName=o.pageInset.containerDivName;
			o.duration=o.effects.fadeOutDuration;
			fadeOut(o);
		}
		
		o.f[o.f.length] = function (o) { 
			o.divName=o.pageInset.contentDivName;
			o.content= o.xhrResponse.responseText;
			fillDiv(o);
		}
		
		o.f[o.f.length] = function (o) { 
			prePage(o);
		}
		
		o.f[o.f.length] = function (o) { 
			o.divName=o.pageInset.containerDivName;
			o.duration=o.effects.fadeOutDuration;
			fadeIn(o); 
			o.f = []; // once you are at a page, clear out the fun list
		}
		f(o);
		
	}
	
	
	function getPreloader(o) {
		o.f[o.f.length] = function (o) { 
			o.divName=o.pageInset.containerDivName;
			o.duration=o.effects.fadeOutDuration;
			fadeOut(o);
		}
		
		o.f[o.f.length] = function (o) { 
			o.divName=o.pageInset.contentDivName;
			o.content= '<p align="center">'+o.preloaderMessage+'</p>\
						<p align="center"><img src="http://mgfest.com/img/preloaders/18.gif" height="32" width="32" /></p> \
						';
			fillDiv(o);
		}
		
		o.f[o.f.length] = function (o) { 
			o.divName=o.pageInset.containerDivName;
			o.duration=o.effects.fadeOutDuration;
			fadeIn(o); 
		}
		//f(o);
		
	}

	
	///////  APP codes -------------------------------------------------------------------------------\\\
	
	function setupPageInset(o) {	
		o.divName= o.pageInset.containerDivName;
		o.content= o.pageInset.container;
		fillDiv(o);
		$(o.pageInset.containerDivName).style.display = 'block';
		
		// preload preloader image
		o.image = 'http://MGFest.com/img/preloaders/18.gif';
		o.imageHeight = 32;
		o.imageWidth = 32;
		preloadImage(o) ;
	}
	function fillPageStartContent(o) {
		o.divName= o.pageInset.contentDivName;
		o.content= o.pageInset.content;
		fillDiv(o);
	}
	
	function requestPage(o) {
		o.page = 'reg/page'+o.pageNum+'.php',
		ajaxRequest(o);	
	}
	
	
	