var Administracion_facturacion_caja_nueva_view=function(){
	this.baseUrl=null;
	this.windowsId=null;
	/*Inicializar entorno*/
	this.initializeEnviroment=function(url,winId){
		this.baseUrl=url;
		this.windowsId=winId;
		/*foco*/
		$("#"+this.windowsId+" #admin_nueva_res_ducumento").focus();
		/*plugins*/
		$('#admin_nueva_res_fecha_wrapper .date').datepicker({
			language:'es',
			autoclose:true,
			format:'dd-mm-yyyy'
		});
		this.initializeListeners();
	},
	/*Eventos*/
	this.initializeListeners=function(){
		var _this=this;
		$("#"+this.windowsId+" #admin_nueva_res_ducumento").change(function(){
			$("#"+_this.windowsId+" #admin_nueva_res_resolucion").focus();
		});
		/*Submit*/
		$("#"+this.windowsId+" #admin_nueva_res_form").submit(function(){
			var sender = '#admin_nueva_res_guardar_btn';
			$(sender).attr('disabled','disabled');
			$(this).ajaxSubmit({
				success:function(action){
					toastr.options = {
					  "closeButton": true,
					  "progressBar": true,
					  "positionClass": "toast-top-right"
					}
					toastr.success('La serie de documentos  se ha '+action+' en la base de datos del sistema');
					Custombox.close(); 
				}
			});
			return false;
		});
	}

}