function instantiateObj(ctlPage, object) {
	var instantiationObj = (window || this);
	// destroy old object
	object['obj'] = null;
	// add this page  object to object args
	object['args']['gl_ctlPage'] = ctlPage;
	// instantiate
	var obj = new instantiationObj[object['type']](object['args']);
	return obj;
}

function initPage(page) {
	if (gl_ctl_settings[page] != null
		&& typeof gl_ctl_settings[page]['init'] == 'function'
		&& gl_ctl_settings[page]['init'].length == 1) 
	{
		gl_ctl_settings[page]['init']( gl_ctl_settings[page] );		
	}
}


$(document).ready(function() {	
	initPage( $('body').attr('id') );
});
