﻿var snapp = function() {
	if(window.console) {console.log("SNAPP");}
	return {
		guid: (typeof appconfig != 'undefined') ? appconfig.guid : "00000000-0000-0000-0000-000000000000",
		
		name: (typeof appconfig != 'undefined') ? appconfig.name : "",
		
		height: (typeof appconfig != 'undefined') ? appconfig.height : 1000,
		
		autoresize: (typeof appconfig != 'undefined') ? appconfig.autoresize : true,

		resize_app: function(h) {
			if (h) {
				snapp.height = h;
			} else {
				snapp.height = $("body").height() + 50;
			}
			if (typeof parent.snmanager != 'undefined') {
				parent.snmanager.resize_height(snapp.height);
			}
		}
	}
	
}();



$(function() {
	$(window).load(function(){
		if (snapp.autoresize) {
			setInterval('snapp.resize_app()', 500);
		} else {
			snapp.resize_app(snapp.height);  
		}
	});
});
