// JavaScript Document
var outerLayout;
/*$(document).ajaxError(function(e, xhr, settings, exception) {
	alert('error in: ' + settings.url + ' \\n'+'error:\\n' + exception);
});*/


$(document).ready(function(){
	
	$("#menu").kendoMenu({
		select:function(e){
			var menu_select=$("#"+e['item']['id']);
			if($.trim(menu_select.attr('dir'))!=''){
				document.title='Academia - '+ menu_select.attr('data-nom');
				$(".campos_error").remove().empty();
				$.ajax({ 
					url:menu_select.attr('dir'),
					type:'POST', 
					data:{privilegio:menu_select.attr('data-per')},
					beforeSend: function(){
						$.blockUI({message: dtsLang.globals.msg_espera });	
						$("*","#contenedor_general").remove().empty();
						if(menu_select.attr('data-nom').toLowerCase().indexOf("nota")>-1){
							$("#dialos_add_observacion,#dgConfigNotas,#dgConfigDesem,#dialog_form_recupera").window("destroy");
						}
					},
					success: function(pag){
						$("#contenedor_general").html(pag);
						$.unblockUI();	
					},
					error:function (response, textStatus, errorThrown){
						$.unblockUI();
						alert("Message: " + errorCode(response.StatusCode ,textStatus)); 
					}  
				});
			}								
		}
	});
		
	var layoutSettings_Outer = {
		name: "outerLayout" /*// NO FUNCTIONAL USE, but could be used by custom code to 'identify' a layout*/
		/*// options.defaults apply to ALL PANES - but overridden by pane-specific settings*/
		,	defaults: {
				size:					"auto"
			,	minSize:				100
			,	paneClass:				"pane" 		/*// default = 'ui-layout-pane'*/
			,	resizerClass:			"resizer"	/*// default = 'ui-layout-resizer'*/
			,	togglerClass:			"toggler"	/*// default = 'ui-layout-toggler'*/
			,	buttonClass:			"button"	/*// default = 'ui-layout-button'*/
			,	contentSelector:		".content"	/*// inner div to auto-size so only it scrolls, not the entire pane!*/
			,	contentIgnoreSelector:	"span"		/*// 'paneSelector' for content to 'ignore' when measuring room for content*/
			,	togglerLength_open:		35			/*//// WIDTH of toggler on north/south edges - HEIGHT on east/west edges*/
			,	togglerLength_closed:	35			/*// "100%" OR -1 = full height*/
			,	hideTogglerOnSlide:		true		/*// hide the toggler when pane is 'slid open'*/
			,	togglerTip_open:		"Cerrar este panel"
			,	togglerTip_closed:		"Abrir este panel"
			,	resizerTip:				"Cambie el tamaño de este panel"
			/*//	effect defaults - overridden on some panes*/
			,	fxName:					"slide"		/*// none, slide, drop, scale*/
			,	fxSpeed_open:			750
			,	fxSpeed_close:			1500
			,	fxSettings_open:		{ easing: "easeInQuint" }
			,	fxSettings_close:		{ easing: "easeOutQuint" }
		},
		south: {
			maxSize:25,
			spacing_closed:0,			/*// HIDE resizer & toggler when 'closed'*/
			slidable: false,		/*// REFERENCE - cannot slide if spacing_closed = 0*/
			initClosed:	false,
			spacing_open: 0,
			resizable:false,
		},
		north: {
			size:35,
			minSize: 35,
			spacing_open: 1,			/*// cosmetic spacing*/
			togglerLength_open: 0,			/*// HIDE the toggler button*/
			togglerLength_closed: -1,			/*// "100%" OR -1 = full width of pane*/
			resizable:false,
			slidable: false,
			fxName: "none"
		},
		center: {
			paneSelector:"#mainContent", 			/*// sample: use an ID to select pane instead of a class*/
			onresize:"innerLayout.resizeAll",	/*// resize INNER LAYOUT when center pane resizes*/
			minWidth:200,
			minHeight:200,
		}
	};	
	outerLayout = $("body").layout(layoutSettings_Outer);	
	/*$(document)[0].oncontextmenu = function() { return false; }*/
	$("#salir").click(function(){
		$.post("includes/salir.php",{},function(pag){
			document.location='index.php';
		});
	});
	 

});