{//Pestaņas----------------------------------------------------------------------------------------------------------------------------------------------------
	var tabs = Jade.Objects.Tabs();
	tabs.Location(0,5,1000,510);
	tabs.Add();
}
{//Pestaņa: Datos personales-----------------------------------------------------------------------------------------------------------------------------------
	tabs.AddTab(Jade.Lang.Get('personal_data'));
	{//Basico--------------------------------------------------------------------------------------------------------------------------------------------------
		var lblCode=Jade.Objects.Text(Jade.Lang.Get('code')+':');
		lblCode.Location(25,15,150,20);
		lblCode.SetBold(true);
		lblCode.Add(tabs.tabpages[0]);
		var txtCode=Jade.Objects.TextBox();
		txtCode.Location(125,10,250,20);
		txtCode.SetMaxLength($.Utils.Is9Digits()?9:5);
		txtCode.Add(tabs.tabpages[0]);
		txtCode.onblur=function(){ this.SetText(Jade.Strings.PadLeft(this.GetText(),'0', $.Utils.Is9Digits()?9:5)); }
		var lblCard=Jade.Objects.Text(Jade.Lang.Get('card')+':');
		lblCard.Location(390,15,150,20);
		lblCard.Add(tabs.tabpages[0]);
		var txtCard=Jade.Objects.TextBox();
		txtCard.Location(530,10,265,20);
		txtCard.SetMaxLength(10);
		txtCard.Add(tabs.tabpages[0]);
		var lblName=Jade.Objects.Text(Jade.Lang.Get('name')+':');
		lblName.Location(25,40,150,20);
		lblName.SetBold(true);
		lblName.Add(tabs.tabpages[0]);
		var txtName=Jade.Objects.TextBox();
		txtName.Location(125,35,670,20);
		txtName.Add(tabs.tabpages[0]);
		var lblSurnames=Jade.Objects.Text(Jade.Lang.Get('surnames')+':');
		lblSurnames.Location(25,65,150,20);
		lblSurnames.Add(tabs.tabpages[0]);
		var txtSurnames=Jade.Objects.TextBox();
		txtSurnames.Location(125,60,670,20);
		txtSurnames.Add(tabs.tabpages[0]);	
		var lblDni=Jade.Objects.Text(Jade.Lang.Get('dni')+':');
		lblDni.Location(25,90,150,20);
		lblDni.Add(tabs.tabpages[0]);
		var txtDni=Jade.Objects.TextBox();
		txtDni.Location(125,85,250,20);
		txtDni.Add(tabs.tabpages[0]);
		var lblBirthDate=Jade.Objects.Text(Jade.Lang.Get('birthdate')+':');
		lblBirthDate.Location(390,90,150,20);
		lblBirthDate.Add(tabs.tabpages[0]);
		var cmbBirthDate=Jade.Objects.DatePicker();
		cmbBirthDate.Location(530,85,265,20);
		cmbBirthDate.Add(tabs.tabpages[0]);
		var lblAddress = Jade.Objects.Text(Jade.Lang.Get('address')+':');
		lblAddress.Location(25,115,150,20);
		lblAddress.Add(tabs.tabpages[0]);
		var txtAddress=Jade.Objects.TextBox();
		txtAddress.Location(125,110,670,20);
		txtAddress.Add(tabs.tabpages[0]);
		var lblTown=Jade.Objects.Text(Jade.Lang.Get('town')+':');
		lblTown.Location(25,140,150,20);
		lblTown.Add(tabs.tabpages[0]);
		var txtTown=Jade.Objects.TextBox();
		txtTown.Location(125,135,670,20);
		txtTown.Add(tabs.tabpages[0]);	
		var lblCounty=Jade.Objects.Text(Jade.Lang.Get('county')+':');
		lblCounty.Location(25,165,150,20);
		lblCounty.Add(tabs.tabpages[0]);
		var txtCounty=Jade.Objects.TextBox();
		txtCounty.Location(125,160,250,20);
		txtCounty.Add(tabs.tabpages[0]);
		var lblCP=Jade.Objects.Text(Jade.Lang.Get('cp')+':');
		lblCP.Location(390,165,150,20);
		lblCP.Add(tabs.tabpages[0]);
		var txtCP=Jade.Objects.TextBox();
		txtCP.Location(530,160,265,20);
		txtCP.Add(tabs.tabpages[0]);	
		var lblTelephone=Jade.Objects.Text(Jade.Lang.Get('telephone')+':');
		lblTelephone.Location(25,190,150,20);
		lblTelephone.Add(tabs.tabpages[0]);
		var txtTelephone=Jade.Objects.TextBox();
		txtTelephone.Location(125,185,250,20);
		txtTelephone.Add(tabs.tabpages[0]);
		var lblMobile=Jade.Objects.Text(Jade.Lang.Get('mobile')+':');
		lblMobile.Location(390,190,150,20);
		lblMobile.Add(tabs.tabpages[0]);
		var txtMobile=Jade.Objects.TextBox();
		txtMobile.Location(530,185,265,20);
		txtMobile.Add(tabs.tabpages[0]);		
		var lblMail=Jade.Objects.Text(Jade.Lang.Get('mail')+':');
		lblMail.Location(25,215,150,20);
		lblMail.Add(tabs.tabpages[0]);
		var txtMail=Jade.Objects.TextBox();
		txtMail.Location(125,210,540,20);
		txtMail.Add(tabs.tabpages[0]);
		var cmdMail=Jade.Objects.Button(Jade.Lang.Get('send_mail'))
		cmdMail.Location (670,210,125,20)
		cmdMail.Add(tabs.tabpages[0])
		cmdMail.onclick=function(){ window.location = 'mailto:'+txtMail.GetText(); }
	}
	{//Departmento---------------------------------------------------------------------------------------------------------------------------------------------
		var gpDepartment=Jade.Objects.Container();
		gpDepartment.Location(10,235,980,65);
		gpDepartment.SetStyle('transparent');
		gpDepartment.Add(tabs.tabpages[0]);
		var lblDepartment=Jade.Objects.Text(COMPANY.department+':');
		lblDepartment.Location(15,15,150,20);
		lblDepartment.Add(gpDepartment);	
		var cmbDepartment=Jade.Objects.ComboBox();
		cmbDepartment.Location(115,10,360,20);
		cmbDepartment.Add(gpDepartment);
		var lblCenter=Jade.Objects.Text(COMPANY.center+':');
		lblCenter.Location(490,15,150,20);
		lblCenter.Add(gpDepartment);	
		var cmbCenter=Jade.Objects.ComboBox();
		cmbCenter.Location(605,10,360,20);
		cmbCenter.Add(gpDepartment);
		var lblSupervisor=Jade.Objects.Text(Jade.Lang.Get('supervisor')+':');
		lblSupervisor.Location(15,40,150,20);
		lblSupervisor.Add(gpDepartment);
		var cmbSupervisor=Jade.Objects.ComboBox();
		cmbSupervisor.Location(115,35,850,20);
		cmbSupervisor.Add(gpDepartment);
	}
	{//Horario-------------------------------------------------------------------------------------------------------------------------------------------------
		var gpWorkday=Jade.Objects.Container();
		gpWorkday.Location(10,305,980,40);
		gpWorkday.SetStyle('transparent');
		gpWorkday.Add(tabs.tabpages[0]);
		var lblWorkday=Jade.Objects.Text(Jade.Lang.Get('workday')+':');
		lblWorkday.Location(15,15,100,20);
		lblWorkday.Add(gpWorkday);
		var cmbWorkday=Jade.Objects.ComboBox();
		cmbWorkday.Location(115,10,650,20);
		cmbWorkday.Add(gpWorkday);
		var chkNightTurn=Jade.Objects.CheckBox(Jade.Lang.Get('night_turn'));
		chkNightTurn.Location(780,13,850,20);
		chkNightTurn.Add(gpWorkday);
	}
	{//Costes--------------------------------------------------------------------------------------------------------------------------------------------------
		var gpRates = Jade.Objects.Container();
		gpRates.Location(10,350,980,40);
		gpRates.SetStyle('transparent');
		gpRates.Add(tabs.tabpages[0]);
		var lblRate1 = Jade.Objects.Text(Jade.Lang.Get('rate')+' 1:');
		lblRate1.Location(15,15,100,20);
		lblRate1.Add(gpRates);
		var txtRate1 = Jade.Objects.TextBox();
		txtRate1.Location(115,10,100,20);
		txtRate1.Add(gpRates);
		var lblRate2 = Jade.Objects.Text(Jade.Lang.Get('rate')+' 2:');
		lblRate2.Location(230,15,100,20);
		lblRate2.Add(gpRates);
		var txtRate2 = Jade.Objects.TextBox();
		txtRate2.input.mask = "float";
		//txtRate2.input.type = "number"; txtRate2.input.step = "0.01";
		txtRate2.Location(300,10,100,20);
		txtRate2.Add(gpRates);
		var lblRate3 = Jade.Objects.Text(Jade.Lang.Get('rate')+' 3:');
		lblRate3.Location(415,15,100,20);
		lblRate3.Add(gpRates);
		var txtRate3 = Jade.Objects.TextBox();
		txtRate3.Location(485,10,100,20);
		txtRate3.Add(gpRates);
		var lblRate4 = Jade.Objects.Text(Jade.Lang.Get('rate')+' 4:');
		lblRate4.Location(600,15,100,20);
		lblRate4.Add(gpRates);
		var txtRate4 = Jade.Objects.TextBox();
		txtRate4.Location(670,10,100,20);
		txtRate4.Add(gpRates);
		var lblRate5 = Jade.Objects.Text(Jade.Lang.Get('rate')+' 5:');
		lblRate5.Location(785,15,100,20);
		lblRate5.Add(gpRates);
		var txtRate5 = Jade.Objects.TextBox();
		txtRate5.Location(855,10,100,20);
		txtRate5.Add(gpRates);		
	}
	{//Foto----------------------------------------------------------------------------------------------------------------------------------------------------
		var imgFoto=document.createElement('img');
		imgFoto.style.position='absolute';
		imgFoto.style.left='807px';
		imgFoto.style.top='10px';
		imgFoto.style.width='180px';
		imgFoto.style.height='218px';	
		imgFoto.style.border='1px solid #BBB';
		//imgFoto.src = 'get_image.php?f=Foto&t=EMPLEADOS&w=Codigo=\''+id+'\'';
		tabs.tabpages[0].appendChild(imgFoto);
	}
}
{//Pestaņa: Perfil---------------------------------------------------------------------------------------------------------------------------------------------
	tabs.AddTab(Jade.Lang.Get('profile'));
	{//Perfil--------------------------------------------------------------------------------------------------------------------------------------------------
		var lblPublicProfile=Jade.Objects.Text(Jade.Lang.Get('public_profile_assigned')+' :');
		lblPublicProfile.Location(10,15,175,20);
		lblPublicProfile.Add(tabs.tabpages[1]);
		var cmbPublicProfile=Jade.Objects.ComboBox();
		cmbPublicProfile.Location(185,10,805,20);
		cmbPublicProfile.Add(tabs.tabpages[1]);
	}
	{//Pestaņas------------------------------------------------------------------------------------------------------------------------------------------------
		var tabsPerfil=Jade.Objects.Tabs();
		tabsPerfil.Location(10,40,980,410);
		tabsPerfil.AddTab(Jade.Lang.Get('roundings'));
		tabsPerfil.AddTab(Jade.Lang.Get('auto_events'));
		tabsPerfil.AddTab(Jade.Lang.Get('absence'));
		tabsPerfil.AddTab(Jade.Lang.Get('accrual_balance'));
		tabsPerfil.AddTab(Jade.Lang.Get('breaks'));
		tabsPerfil.AddTab(Jade.Lang.Get('payrolls'));
		tabsPerfil.AddTab(Jade.Lang.Get('no_access_days'));
		tabsPerfil.AddTab(Jade.Lang.Get('access'));
		tabsPerfil.AddTab(Jade.Lang.Get('only_access_time'));
		tabsPerfil.Add(tabs.tabpages[1]);
	}
	{//Pestaņa: Redondeos--------------------------------------------------------------------------------------------------------------------------------------
		{//Controles-------------------------------------------------------------------------------------------------------------------------------------------
			var cmRoundings=Jade.Grids.ColumnModel();
			cmRoundings.Add(Jade.Grids.ComboColumn({key: 'day_type', text: Jade.Lang.Get('day_type'), width: '250'}));
			cmRoundings.Add(Jade.Grids.HourColumn({key: 'from', text: Jade.Lang.Get('from'), width: '100'}));
			cmRoundings.Add(Jade.Grids.HourColumn({key: 'to', text: Jade.Lang.Get('to'), width: '100'}));
			cmRoundings.Add(Jade.Grids.HourColumn({key: 'rounding', text: Jade.Lang.Get('rounding'), width: '100'}));
			cmRoundings.Add(Jade.Grids.ComboColumn({key: 'entry_exit', text: Jade.Lang.Get('entry_exit'), width: '200'}));
			cmRoundings.Add(Jade.Grids.ButtonColumn({key: 'button', text: '', width: '140', sortable: false}));
			cmRoundings.Add(Jade.Grids.HideColumn({key: 'key'}));
			cmRoundings.Add(Jade.Grids.HideColumn({key: 'key'}));
			cmRoundings.Add(Jade.Grids.HideColumn({key: 'ov_day_type'}));
			cmRoundings.Add(Jade.Grids.HideColumn({key: 'ov_from'}));
			cmRoundings.Add(Jade.Grids.HideColumn({key: 'ov_to'}));
			cmRoundings.Add(Jade.Grids.HideColumn({key: 'ov_rounding'}));
			cmRoundings.Add(Jade.Grids.HideColumn({key: 'ov_entry_exit'}));
			var grRoundings=Jade.Grids.Grid(cmRoundings);
			grRoundings.Location(5,40,970,338);
			grRoundings.Add(tabsPerfil.tabpages[0]);
			var cmdNewRounding=Jade.Objects.Button();
			cmdNewRounding.Location(10,10,960,20);
			cmdNewRounding.SetText(Jade.Lang.Get('new_profile_rounding'));
			cmdNewRounding.Add(tabsPerfil.tabpages[0]);
		}
		{//Eventos---------------------------------------------------------------------------------------------------------------------------------------------
			cmdNewRounding.onclick = function() {
				var row=grRoundings.NewRow(['0','0000','0000','0000','0',[$.lng('erease'), 'delete']]);
				row.ChangeStyle('editable');
				row.cells[6].value=2;
				var combo = row.cells[0].references.object;
				for(var j in aDayTypes){
					combo.AddItem(aDayTypes[j].Text,j);
				}
				combo = row.cells[4].references.object;
				combo.AddItem(Jade.Lang.Get('entry'),'0');
				combo.AddItem(Jade.Lang.Get('exit'),'1');
			}
			grRoundings.columnmodel.columns[5].oncellclick = function(cell) {
				var row=cell.references.row;
				var cell=row.cells;
				switch(Jade.Convert.ToInt(cell[6].value)){
					case 0:
						row.ChangeStyle('no-editable');
						cell[5].SetValue([$.lng('unapply'), 'unapply']);
						cell[6].value=1;
						break;
					case 1:
						row.ChangeStyle('disabled');
						cell[5].SetValue([$.lng('apply'), 'apply']);
						cell[6].value=0;
						break;
					case 2:
						if(cell[6].value==cell[7].value){
							petition.profile_rounding.del.push({daytype: cell[8].value, from: cell[9].value, to: cell[10].value, rounding: cell[11].value, entryexit: cell[12].value});
						}
						row.Delete();
						break;
				}
			}
		}
	}
	{//Pestaņa: Incidencias automaticas------------------------------------------------------------------------------------------------------------------------
		{//Controles-------------------------------------------------------------------------------------------------------------------------------------------
			var cmAutoEvents = new Jade.Grids.ColumnModel();
			cmAutoEvents.Add(new Jade.Grids.ComboColumn({key: 'day_type', text: Jade.Lang.Get('day_type'), width: '250'}));
			cmAutoEvents.Add(new Jade.Grids.HourColumn({key: 'from', text: Jade.Lang.Get('from'), width: '70'}));
			cmAutoEvents.Add(new Jade.Grids.HourColumn({key: 'to', text: Jade.Lang.Get('to'), width: '70'}));
			cmAutoEvents.Add(new Jade.Grids.ComboColumn({key: 'event', text: Jade.Lang.Get('incidence'), width: '300'}));
			cmAutoEvents.Add(new Jade.Grids.ComboColumn({key: 'entry_exit', text: Jade.Lang.Get('entry_exit'), width: '110'}));	
			cmAutoEvents.Add(new Jade.Grids.ButtonColumn({key: 'button', text: '', width: '140', sortable: false}));
			cmAutoEvents.Add(Jade.Grids.HideColumn({key: 'key'}));
			cmAutoEvents.Add(Jade.Grids.HideColumn({key: 'key'}));
			cmAutoEvents.Add(Jade.Grids.HideColumn({key: 'ov_day_type'}));
			cmAutoEvents.Add(Jade.Grids.HideColumn({key: 'ov_from'}));
			cmAutoEvents.Add(Jade.Grids.HideColumn({key: 'ov_to'}));
			cmAutoEvents.Add(Jade.Grids.HideColumn({key: 'ov_event'}));
			cmAutoEvents.Add(Jade.Grids.HideColumn({key: 'ov_entry_exit'}));
			
			var grAutoEvents = new Jade.Grids.Grid(cmAutoEvents);
			grAutoEvents.Location(5,40,970,338);
			grAutoEvents.Add(tabsPerfil.tabpages[1]);
			var cmdNewAutoEvent = Jade.Objects.Button();
			cmdNewAutoEvent.Location(10,10,960,20);
			cmdNewAutoEvent.SetText(Jade.Lang.Get('new_profile_autoevent'));
			cmdNewAutoEvent.Add(tabsPerfil.tabpages[1]);
		}
		{//Eventos---------------------------------------------------------------------------------------------------------------------------------------------
			cmdNewAutoEvent.onclick = function(){
				var row = grAutoEvents.NewRow(['0','0000','00000','0','0',[$.lng('erease'), 'delete']]);
				row.ChangeStyle('editable');
				row.cells[6].value=2;
				var combo = row.cells[0].references.object;
				for(var j in aDayTypes){
					combo.AddItem(aDayTypes[j].Text,j);
				}
				combo = row.cells[3].references.object;
				for(var j in aEvents){
					if(j>'0009') { combo.AddItem(aEvents[j].Text,j); }
				}
				combo = row.cells[4].references.object;
				combo.AddItem(Jade.Lang.Get('entry'),'0');
				combo.AddItem(Jade.Lang.Get('exit'),'0');
			}
			grAutoEvents.columnmodel.columns[5].oncellclick = function(cell){
				var row=cell.references.row;
				var cell=row.cells;
				switch(Jade.Convert.ToInt(row.cells[6].value)){
					case 0:
						row.ChangeStyle('no-editable');
						cell[5].SetValue([$.lng('unapply'), 'unapply']);
						cell[6].value=1;
						break;
					case 1:
						row.ChangeStyle('disabled');
						cell[5].SetValue([$.lng('apply'), 'apply']);
						cell[6].value=0;
						break;
					case 2:
						if(cell[6].value==cell[7].value){
							petition.profile_events.del.push({daytype: cell[8].value, from: cell[9].value, to: cell[10].value, event: cell[11].value, entryexit: cell[12].value});
						}
						row.Delete();
						break;
				}
			}	
		}
	}
	{//Pestaņa: Ausencias--------------------------------------------------------------------------------------------------------------------------------------
		{//Controles-------------------------------------------------------------------------------------------------------------------------------------------
			var optAbsence1 = Jade.Objects.Option(Jade.Lang.Get('assign_absence'));
			optAbsence1.Location(15,15,200,20);
			optAbsence1.Add(tabsPerfil.tabpages[2]);
			var optAbsence2 = Jade.Objects.Option(Jade.Lang.Get('assign_incident'));
			optAbsence2.Location(200,15,200,20);
			optAbsence2.Add(tabsPerfil.tabpages[2]);
			var cmbAbsenceIncident = Jade.Objects.ComboBox();
			cmbAbsenceIncident.Location(400,15,300,20);
			cmbAbsenceIncident.Add(tabsPerfil.tabpages[2]);
		}
		{//Eventos---------------------------------------------------------------------------------------------------------------------------------------------
			optAbsence2.onchange=function(){
				if(this.GetCheck()){ Jade.FX.Show(cmbAbsenceIncident); }
				else{ Jade.FX.Hide(cmbAbsenceIncident); }
			}
			optAbsence1.SetCheck();
			Jade.FX.Hide(cmbAbsenceIncident);
		}
	}
	{//Pestaņa: Saldos de bolsas-------------------------------------------------------------------------------------------------------------------------------
		{//Controles-------------------------------------------------------------------------------------------------------------------------------------------
			var cmAccrualBalance = new Jade.Grids.ColumnModel();
			cmAccrualBalance.Add(new Jade.Grids.ComboColumn({key: 'accrual', text: Jade.Lang.Get('accrual'), width: '350'}));
			cmAccrualBalance.Add(new Jade.Grids.TextColumn({key: 'ocurrence', text: Jade.Lang.Get('ocurrences_allowed'), width: '120'}));
			cmAccrualBalance.Add(new Jade.Grids.TimeColumn({key: 'time_allowed', text: Jade.Lang.Get('time_allowed'), width: '130'}));
			cmAccrualBalance.Add(new Jade.Grids.ComboColumn({key: 'term', text: Jade.Lang.Get('term'), width: '120'}));
			cmAccrualBalance.Add(new Jade.Grids.ComboColumn({key: 'year', text: Jade.Lang.Get('year'), width: '80'}));
			cmAccrualBalance.Add(new Jade.Grids.ButtonColumn({key: 'button', text: '', width: '140', sortable: false}));
			cmAccrualBalance.Add(new Jade.Grids.HideColumn({key: 'key'}));
			cmAccrualBalance.Add(new Jade.Grids.HideColumn({key: 'key'}));
			
			cmAccrualBalance.Add(new Jade.Grids.HideColumn({key: 'ov_accrual'}));
			cmAccrualBalance.Add(new Jade.Grids.HideColumn({key: 'ov_ocurrence'}));
			cmAccrualBalance.Add(new Jade.Grids.HideColumn({key: 'ov_time'}));
			cmAccrualBalance.Add(new Jade.Grids.HideColumn({key: 'ov_term'}));
			cmAccrualBalance.Add(new Jade.Grids.HideColumn({key: 'ov_year'}));
			
			var grAccrualBalance = new Jade.Grids.Grid(cmAccrualBalance);
			grAccrualBalance.Location(5,40,970,338);
			grAccrualBalance.Add(tabsPerfil.tabpages[3]);
			var cmdNewAccrualBalance = Jade.Objects.Button();
			cmdNewAccrualBalance.Location(10,10,960,20);
			cmdNewAccrualBalance.SetText(Jade.Lang.Get('new_profile_accrualbalance'));
			cmdNewAccrualBalance.Add(tabsPerfil.tabpages[3]);
		}
		{//Eventos---------------------------------------------------------------------------------------------------------------------------------------------
			cmdNewAccrualBalance.onclick=function(){
				var row = grAccrualBalance.NewRow(['0','0','00000','0', '0', [$.lng('erease'), 'delete']]);
				row.ChangeStyle('editable');
				row.cells[6].value=2;
				var combo = row.cells[0].references.object;
				for(var j in aAccruals){
					combo.AddItem(aAccruals[j].Text, j);
				}
				combo = row.cells[3].references.object;
				combo.AddItem(Jade.Lang.Get('term_week'), '0');
				combo.AddItem(Jade.Lang.Get('term_month'), '1');
				combo.AddItem(Jade.Lang.Get('term_year'), '2');
				
				combo = row.cells[4].references.object;
				combo.AddItem($.lng('none_m'), 'None');
				var currentYear=$.DateTime.CurrentYear();
				for(var i=currentYear-10,iLen=currentYear+10;i<=iLen;i++){
					combo.AddItem(i, i);
				}
			}
			grAccrualBalance.columnmodel.columns[5].oncellclick=function(cell){
				var row=cell.references.row;
				var cell=row.cells;
				switch(Jade.Convert.ToInt(row.cells[6].value)){
					case 0:
						row.ChangeStyle('no-editable');
						row.cells[5].SetValue([$.lng('unapply'), 'unapply']);
						row.cells[6].value=1;
						break;
					case 1:
						row.ChangeStyle('disabled');
						row.cells[5].SetValue([$.lng('apply'), 'apply']);
						row.cells[6].value=0;
						break;
					case 2:
						if(cell[6].value==cell[7].value){
							petition.profile_accruals.del.push({accrual: cell[8].value, ocurrence: cell[9].value, time: cell[10].value, term: cell[11].value});
						}
						row.Delete();
						break;
				}
			}
		}
	}
	{//Pestaņa: Interrupciones---------------------------------------------------------------------------------------------------------------------------------
		{//Controles-------------------------------------------------------------------------------------------------------------------------------------------
			var cmBreaks=new Jade.Grids.ColumnModel();
			cmBreaks.Add(new Jade.Grids.ComboColumn({key: 'day_type', text: Jade.Lang.Get('day_type'), width: '250'}));
			cmBreaks.Add(new Jade.Grids.ComboColumn({key: 'break_time', text: Jade.Lang.Get('break_time'), width: '250'}));
			cmBreaks.Add(new Jade.Grids.ButtonColumn({key: 'button', text: '', width: '140', sortable: false}));
			cmBreaks.Add(new Jade.Grids.HideColumn({key: 'key'}));
			cmBreaks.Add(new Jade.Grids.HideColumn({key: 'key'}));
			cmBreaks.Add(new Jade.Grids.HideColumn({key: 'ov_daytype'}));
			cmBreaks.Add(new Jade.Grids.HideColumn({key: 'ov_breaktime'}));
			
			var grBreaks = new Jade.Grids.Grid(cmBreaks);
			grBreaks.Location(5,40,970,338);
			grBreaks.Add(tabsPerfil.tabpages[4]);
			var cmdNewBreak = Jade.Objects.Button();
			cmdNewBreak.Location(10,10,960,20);
			cmdNewBreak.SetText(Jade.Lang.Get('new_profile_break'));
			cmdNewBreak.Add(tabsPerfil.tabpages[4]);
		}
		{//Eventos---------------------------------------------------------------------------------------------------------------------------------------------
			cmdNewBreak.onclick=function(){
				var row = grBreaks.NewRow(['0','0',[$.lng('erease'), 'delete']]);
				row.ChangeStyle('editable');
				row.cells[3].value=2;
				var combo = row.cells[0].references.object;
				for(var j in aDayTypes){
					combo.AddItem(aDayTypes[j].Text,j);
				}
				combo=row.cells[1].references.object;
				for(var j in aBreaks){
					combo.AddItem(aBreaks[j].Text,j);
				}
			}
			grBreaks.columnmodel.columns[2].oncellclick=function(cell){
				var row=cell.references.row;
				var cell=row.cells;
				switch(Jade.Convert.ToInt(row.cells[3].value)){
					case 0:
						row.ChangeStyle('no-editable');
						cell[2].SetValue([$.lng('unapply'), 'unapply']);
						cell[3].value=1;
						break;
					case 1:
						row.ChangeStyle('disabled');
						cell[2].SetValue([$.lng('apply'), 'apply']);
						cell[3].value=0;
						break;
					case 2:
						if(cell[3].value==cell[4].value){
							petition.profile_breaks.del.push({daytype: cell[5].value, breaktime: cell[6].value});
						}
						row.Delete();
						break;
				}
			}
		}
	}
	{//Pestaņa: Costes-----------------------------------------------------------------------------------------------------------------------------------------
		{//Controles-------------------------------------------------------------------------------------------------------------------------------------------
			var lblProfile_PayrollMethod=Jade.Objects.Text(Jade.Lang.Get('profile_payroll_method')+' :');
			lblProfile_PayrollMethod.Location(15,14,200,20);
			lblProfile_PayrollMethod.Add(tabsPerfil.tabpages[5]);
			var optProfile_Payroll1 = Jade.Objects.Option(Jade.Lang.Get('profile_payroll_method_1'));
			optProfile_Payroll1.Location(230,15,200,20);
			optProfile_Payroll1.Add(tabsPerfil.tabpages[5]);
			optProfile_Payroll1.SetCheck(true);
			var optProfile_Payroll2 = Jade.Objects.Option(Jade.Lang.Get('profile_payroll_method_2'));
			optProfile_Payroll2.Location(400,15,200,20);
			optProfile_Payroll2.Add(tabsPerfil.tabpages[5]);
			var cmdProfile_Compensation = Jade.Objects.Button(Jade.Lang.Get('define_payroll_compensation'));
			cmdProfile_Compensation.Location(10,35,960,20);
			cmdProfile_Compensation.Add(tabsPerfil.tabpages[5]); 
			var cmdNewPayroll = Jade.Objects.Button();
			cmdNewPayroll.Location(10,65,960,20);
			cmdNewPayroll.SetText(Jade.Lang.Get('new_profile_payroll'));
			cmdNewPayroll.Add(tabsPerfil.tabpages[5]);
			var cmPayroll = new Jade.Grids.ColumnModel();
			cmPayroll.Add(new Jade.Grids.ComboColumn({key: 'day_type', text: Jade.Lang.Get('day_type'), width: '250'}));
			cmPayroll.Add(new Jade.Grids.ComboColumn({key: 'payroll', text: Jade.Lang.Get('payroll'), width: '250'}));
			cmPayroll.Add(new Jade.Grids.ButtonColumn({key: 'button', text: '', width: '140', sortable: false}));
			cmPayroll.Add(new Jade.Grids.HideColumn({key: 'key'}));
			cmPayroll.Add(new Jade.Grids.HideColumn({key: 'key'}));
			cmPayroll.Add(new Jade.Grids.HideColumn({key: 'ov_payroll'}));
			cmPayroll.Add(new Jade.Grids.HideColumn({key: 'ov_daytype'}));
			var grPayroll = new Jade.Grids.Grid(cmPayroll);
			grPayroll.Location(5,95,970,283);
			grPayroll.Add(tabsPerfil.tabpages[5]);
		}
		{//Eventos---------------------------------------------------------------------------------------------------------------------------------------------
			optProfile_Payroll2.onchange=function(){
				if(this.checked){
					Jade.FX.Hide(grPayroll); 
					Jade.FX.Hide(cmdNewPayroll); 
				}
				else{
					Jade.FX.Show(grPayroll); 
					Jade.FX.Show(cmdNewPayroll); 
				}
			}
			cmdProfile_Compensation.onclick=function(){
				compensationWindow.Show();
			}
			cmdNewPayroll.onclick = function() {
				var row = grPayroll.AddRow(new Jade.Grids.Row(['0','0',[$.lng('erease'), 'delete']]), '');
				row.ChangeStyle('editable');
				row.cells[3].value=2;
				var combo = row.cells[0].references.object;
				
				for(var j in aDayTypes){
					combo.AddItem(aDayTypes[j].Text,j);
				}
				combo = row.cells[1].references.object;
				for(var j in aPayrolls){
					combo.AddItem(aPayrolls[j].Text,j);
				}
			}
			grPayroll.columnmodel.columns[2].oncellclick = function(cell) {
				var row=cell.references.row;
				var cell=row.cells;
				
				switch(Jade.Convert.ToInt(cell[3].value)){
					case 0:
						row.ChangeStyle('no-editable');
						cell[2].SetValue([$.lng('unapply'), 'unapply']);
						cell[3].value=1;
						break;
					case 1:
						row.ChangeStyle('disabled');
						cell[2].SetValue([$.lng('apply'), 'apply']);
						cell[3].value=0;
						break;
					case 2:
						if(cell[3].value==cell[4].value){
							petition.profile_payrolls.del.push({daytype: cell[5].value, payroll: cell[6].value});
						}
						row.Delete();
						break;
				}
			}	
		}
	}
	{//Pestaņa: Dias sin acceso--------------------------------------------------------------------------------------------------------------------------------
		{//Controles-------------------------------------------------------------------------------------------------------------------------------------------
			var cmNoAccessDays=new Jade.Grids.ColumnModel();
			cmNoAccessDays.Add(new Jade.Grids.DateColumn({key: 'from', text: Jade.Lang.Get('from'), width: '250'}));
			cmNoAccessDays.Add(new Jade.Grids.DateColumn({key: 'to', text: Jade.Lang.Get('to'), width: '250'}));
			cmNoAccessDays.Add(new Jade.Grids.ButtonColumn({key: 'button', text: '', width: '140', sortable: false}));
			cmNoAccessDays.Add(new Jade.Grids.HideColumn({key: 'key'}));
			cmNoAccessDays.Add(new Jade.Grids.HideColumn({key: 'key'}));
			cmNoAccessDays.Add(new Jade.Grids.HideColumn({key: 'ov_from'}));
			cmNoAccessDays.Add(new Jade.Grids.HideColumn({key: 'ov_to'}));
			
			var grNoAccessDays=new Jade.Grids.Grid(cmNoAccessDays);
			grNoAccessDays.Location(5,40,970,338);
			grNoAccessDays.Add(tabsPerfil.tabpages[6]);
			var cmdNewAccessDays=Jade.Objects.Button();
			cmdNewAccessDays.Location(10,10,960,20);
			cmdNewAccessDays.SetText(Jade.Lang.Get('new_profile_no_access'));
			cmdNewAccessDays.Add(tabsPerfil.tabpages[6]);
		}
		{//Eventos---------------------------------------------------------------------------------------------------------------------------------------------
			cmdNewAccessDays.onclick=function(){
				var row = grNoAccessDays.NewRow(['20000101','20000101',[$.lng('erease'), 'delete']]);
				row.ChangeStyle('editable');
				row.cells[3].value=2;
			}
			grNoAccessDays.columnmodel.columns[2].oncellclick = function(cell) {
				var row=cell.references.row;
				var cell=row.cells;
				switch(Jade.Convert.ToInt(cell[3].value)){
					case 0:
						row.ChangeStyle('no-editable');
						cell[2].SetValue([$.lng('unapply'), 'unapply']);
						cell[3].value=1;
						break;
					case 1:
						row.ChangeStyle('disabled');
						cell[2].SetValue([$.lng('apply'), 'apply']);
						cell[3].value=0;
						break;
					case 2:
						if(cell[3].value==cell[4].value){
							petition.profile_accessdays.del.push({from: cell[5].value, to: cell[6].value});
						}
						row.Delete();
						break;
				}
			}
		}
	}
	{//Pestaņa: Acceso-----------------------------------------------------------------------------------------------------------------------------------------
		{//Controles-------------------------------------------------------------------------------------------------------------------------------------------
			var cmAccess=new Jade.Grids.ColumnModel();
			cmAccess.Add(new Jade.Grids.SimpleColumn({key: 'terminal', text: Jade.Lang.Get('terminal'), width: '300'}));
			cmAccess.Add(new Jade.Grids.ComboColumn({key: 'access', text: Jade.Lang.Get('access'), width: '110'}));
			cmAccess.Add(new Jade.Grids.ComboColumn({key: 'slot1', text: Jade.Lang.Get('slot')+' 1', width: '170'}));
			cmAccess.Add(new Jade.Grids.ComboColumn({key: 'slot2', text: Jade.Lang.Get('slot')+' 2', width: '170'}));
			cmAccess.Add(new Jade.Grids.ComboColumn({key: 'slot3', text: Jade.Lang.Get('slot')+' 3', width: '170'}));
			cmAccess.Add(new Jade.Grids.HideColumn({key: 'idTerminal'}));
			cmAccess.Add(new Jade.Grids.HideColumn({key: 'tipo'}));
			var grAccess = new Jade.Grids.Grid(cmAccess);
			grAccess.Location(5,5,970,373);
			grAccess.Add(tabsPerfil.tabpages[7]);
		}
		{//Funciones-------------------------------------------------------------------------------------------------------------------------------------------
			function FillAccessCombo(cell){
				var combo = cell.references.object;
				combo.Clear();
				var id=cell.references.row.cells[5].value;
				var tipo=cell.references.row.cells[6].value;
				var access=cell.references.row.cells[1].references.object.selectedKey;
				if(tipo=='2' || access=='3'){
					combo.AddItem(Jade.Lang.Get('none_m'),'0');
					combo.SetEnabled(false);
				}
				else{
					if(access=='0'){
						combo.AddItem(Jade.Lang.Get('none_m'),'0');
						for(var j in aTerminalGroups[id].item){ combo.AddItem(aTerminalGroups[id].item[j].Text,j); }
						if(cell.index==2){ combo.SetEnabled(true); }
						else{ combo.SetEnabled(false); }
					}
					else{
						combo.AddItem(Jade.Lang.Get('none_f'),'0');
						for(var j in aTerminalSlots[id].item){ combo.AddItem(aTerminalSlots[id].item[j].Text,j); }
						combo.SetEnabled(true);
					}
				}
				combo.SetSelectedIndex(0);
			}
		}
	}
	{//Pestaņa: Horas de solo acceso---------------------------------------------------------------------------------------------------------------------------
		{//Controles-------------------------------------------------------------------------------------------------------------------------------------------
			var cmOnlyAccessTime=new Jade.Grids.ColumnModel();
			cmOnlyAccessTime.Add(new Jade.Grids.ComboColumn({key: 'day_type', text: Jade.Lang.Get('day_type'), width: '250'}));
			cmOnlyAccessTime.Add(new Jade.Grids.HourColumn({key: 'from', text: Jade.Lang.Get('from'), width: '100'}));
			cmOnlyAccessTime.Add(new Jade.Grids.HourColumn({key: 'to', text: Jade.Lang.Get('to'), width: '100'}));
			cmOnlyAccessTime.Add(new Jade.Grids.ButtonColumn({key: 'button', text: '', width: '120', sortable: false}));
			cmOnlyAccessTime.Add(new Jade.Grids.HideColumn({key: 'key'}));
			cmOnlyAccessTime.Add(new Jade.Grids.HideColumn({key: 'key'}));
			cmOnlyAccessTime.Add(new Jade.Grids.HideColumn({key: 'ov_daytype'}));
			cmOnlyAccessTime.Add(new Jade.Grids.HideColumn({key: 'ov_from'}));
			cmOnlyAccessTime.Add(new Jade.Grids.HideColumn({key: 'ov_to'}));
			var grOnlyAccessTime = new Jade.Grids.Grid(cmOnlyAccessTime);
			grOnlyAccessTime.Location(5,40,970,338);
			grOnlyAccessTime.Add(tabsPerfil.tabpages[8]);
			var cmdOnlyAccessTime = Jade.Objects.Button();
			cmdOnlyAccessTime.Location(10,10,960,20);
			cmdOnlyAccessTime.SetText(Jade.Lang.Get('new_profile_only_access_time'));
			cmdOnlyAccessTime.Add(tabsPerfil.tabpages[8]);
		}
		{//Eventos---------------------------------------------------------------------------------------------------------------------------------------------
			cmdOnlyAccessTime.onclick = function() {
				var row = grOnlyAccessTime.NewRow(['0','0000','0000',[$.lng('erease'), 'delete']]);
				row.ChangeStyle('editable');
				row.cells[4].value=2;
				var combo = row.cells[0].references.object;
				for(var j in aDayTypes){
					combo.AddItem(aDayTypes[j].Text,j);
				}
			}
			grOnlyAccessTime.columnmodel.columns[3].oncellclick = function(cell) {
				var row = cell.references.row;
				var cell=row.cells;
				switch(Jade.Convert.ToInt(cell[4].value)){
					case 0:
						row.ChangeStyle('no-editable');
						cell[3].SetValue([$.lng('unapply'), 'unapply']);
						cell[4].value=1;
						break;
					case 1:
						row.ChangeStyle('disabled');
						cell[3].SetValue([$.lng('apply'), 'apply']);
						cell[4].value=0;
						break;
					case 2:
						if(cell[4].value==cell[5].value){
							petition.profile_accesstime.del.push({daytype: cell[6].value, from: cell[7].value, to: cell[8].value});
						}
						row.Delete();
						break;
				}
			}
		}
	}
	{//Leyenda-------------------------------------------------------------------------------------------------------------------------------------------------
		var gpProfileLegend=Jade.Objects.Container();
		gpProfileLegend.Location(6,450,988,24);
		gpProfileLegend.SetStyle('transparent');
		gpProfileLegend.Add(tabs.tabpages[1]);
		var legend_1=Jade.Objects._create();
		legend_1.Location(20,6,12,12);
		legend_1.style.background='#000';
		legend_1.Add(gpProfileLegend);
		var lblLegend1 = Jade.Objects.Text(Jade.Lang.Get('public_profile_applied'));
		lblLegend1.Location(40,7,200,20);
		lblLegend1.Add(gpProfileLegend);
		var legend_2=Jade.Objects._create();
		legend_2.Location(250,6,12,12);
		legend_2.style.background='#888';
		legend_2.Add(gpProfileLegend);
		var lblLegend2 = Jade.Objects.Text(Jade.Lang.Get('public_profile_no_applied'));
		lblLegend2.Location(270,7,200,20);
		lblLegend2.Add(gpProfileLegend);
		var legend_3=Jade.Objects._create();
		legend_3.Location(480,6,12,12);
		legend_3.style.background='#70AAEE';
		legend_3.Add(gpProfileLegend);
		var lblLegend3 = Jade.Objects.Text(Jade.Lang.Get('private_profile_applied'));
		lblLegend3.Location(500,7,200,20);
		lblLegend3.Add(gpProfileLegend);
	}
	{//Ventana: Costes compensacion----------------------------------------------------------------------------------------------------------------------------
		var compensationWindow = Jade.Objects.Window(600,510);
		var gp_comp_term = Jade.Objects.Container();
		gp_comp_term.Location(10,5,580,30);
		gp_comp_term.Add(compensationWindow);
		var lbl_comp_tem = Jade.Objects.Text(Jade.Lang.Get('payroll_compensation_period')+':');
		lbl_comp_tem.Location(10,10,150,20);
		lbl_comp_tem.Add(gp_comp_term);
		var opt_compo_term_0 = Jade.Objects.Option(Jade.Lang.Get('none_m'));
		opt_compo_term_0.Location(165,9,100,20);
		opt_compo_term_0.Add(gp_comp_term);
		var opt_compo_term_1 = Jade.Objects.Option(Jade.Lang.Get('term_day'));
		opt_compo_term_1.Location(265,9,100,20);
		opt_compo_term_1.Add(gp_comp_term);
		var opt_compo_term_2 = Jade.Objects.Option(Jade.Lang.Get('term_week'));
		opt_compo_term_2.Location(365,9,100,20);
		opt_compo_term_2.Add(gp_comp_term);
		//-----------------------------------------------------------------------------------------------------------------------------------------------------
		var gp_comp_must_sum = Jade.Objects.Container();
		gp_comp_must_sum.Location(10,40,580,55);
		gp_comp_must_sum.Add(compensationWindow);
		var lbl_comp_tem = Jade.Objects.Text(Jade.Lang.Get('duty_time_must_sum')+':');
		lbl_comp_tem.Location(10,10,250,20);
		lbl_comp_tem.Add(gp_comp_must_sum);
		var opt_compo_must_0 = Jade.Objects.Option(Jade.Lang.Get('min_time_of')+':');
		opt_compo_must_0.Location(15,30,150,20);
		opt_compo_must_0.Add(gp_comp_must_sum);	
		var txt_compo_must = Jade.Objects.TimeBox(false,true);
		txt_compo_must.Location(165,25,60,20);
		txt_compo_must.Add(gp_comp_must_sum);
		var opt_compo_must_1 = Jade.Objects.Option(Jade.Lang.Get('employees_duty_time'));
		opt_compo_must_1.Location(250,30,250,20);
		opt_compo_must_1.Add(gp_comp_must_sum);
		//-----------------------------------------------------------------------------------------------------------------------------------------------------
		var gp_comp_payroll = Jade.Objects.Container();
		gp_comp_payroll.Location(10,100,580,180);
		gp_comp_payroll.Add(compensationWindow);
		var lbl_comp_payroll = Jade.Objects.Text(Jade.Lang.Get('payroll_as_duty_time')+':');
		lbl_comp_payroll.Location(10,10,250,20);
		lbl_comp_payroll.Add(gp_comp_payroll);
		var cmd_comp_payroll = Jade.Objects.Button(Jade.Lang.Get('add'));
		cmd_comp_payroll.Location(5,25,570,20);
		cmd_comp_payroll.Add(gp_comp_payroll);
		var cm_comp_payroll = new Jade.Grids.ColumnModel();
		cm_comp_payroll.Add(new Jade.Grids.ComboColumn({key: 'day_type', text: Jade.Lang.Get('payroll_item'), width: '250'}));
		var gr_comp_payroll = new Jade.Grids.Grid(cm_comp_payroll);
		gr_comp_payroll.Location(5,50,570,123);
		gr_comp_payroll.Add(gp_comp_payroll);
		//-----------------------------------------------------------------------------------------------------------------------------------------------------
		var gp_comp_comp = Jade.Objects.Container();
		gp_comp_comp.Location(10,285,580,180);
		gp_comp_comp.Add(compensationWindow);
		var lbl_comp_comp = Jade.Objects.Text(Jade.Lang.Get('compensation_table')+':');
		lbl_comp_comp.Location(10,10,250,20);
		lbl_comp_comp.Add(gp_comp_comp);
		var cmd_comp_comp = Jade.Objects.Button(Jade.Lang.Get('add'));
		cmd_comp_comp.Location(5,25,570,20);
		cmd_comp_comp.Add(gp_comp_comp);
		var cm_comp_comp = new Jade.Grids.ColumnModel();
		cm_comp_comp.Add(new Jade.Grids.ComboColumn({key: 'with', text: Jade.Lang.Get('compensate_with'), width: '225'}));
		cm_comp_comp.Add(new Jade.Grids.ComboColumn({key: 'from', text: Jade.Lang.Get('compensate_from'), width: '225'}));
		cm_comp_comp.Add(new Jade.Grids.TimeColumn({key: 'time', text: Jade.Lang.Get('min_time'), width: '80'}));
		var gr_comp_comp = new Jade.Grids.Grid(cm_comp_comp);
		gr_comp_comp.Location(5,50,570,123);
		gr_comp_comp.Add(gp_comp_comp);
		//-----------------------------------------------------------------------------------------------------------------------------------------------------
		var cmd_comp_accept = Jade.Objects.Button(Jade.Lang.Get('accept'));
		cmd_comp_accept.Location(10,480,290,20);
		cmd_comp_accept.Add(compensationWindow);
		var cmd_comp_cancel = Jade.Objects.Button(Jade.Lang.Get('cancel'));
		cmd_comp_cancel.Location(310,480,280,20);
		cmd_comp_cancel.Add(compensationWindow);
		//-----------------------------------------------------------------------------------------------------------------------------------------------------
		cmd_comp_cancel.onclick = function() {
			compensationWindow.Hide();
		}
	}
}
{//Pestaņa: Calendario-----------------------------------------------------------------------------------------------------------------------------------------
	tabs.AddTab(Jade.Lang.Get('calendar'));
	{//Controles-----------------------------------------------------------------------------------------------------------------------------------------------
		var lblPublicCalendar=Jade.Objects.Text(Jade.Lang.Get('public_calendar_assigned')+' :');
		lblPublicCalendar.Location(10,15,175,20);
		lblPublicCalendar.Add(tabs.tabpages[2]);
		var cmbPublicCalendar=Jade.Objects.ComboBox();
		cmbPublicCalendar.Location(185,10,805,20);
		cmbPublicCalendar.Add(tabs.tabpages[2]);

		var gpCalendarMonth=Jade.Objects.Container();
		gpCalendarMonth.Location(10,35,365,364);
		gpCalendarMonth.Add(tabs.tabpages[2]);
		var cmbCalendarMonth=Jade.Objects.ComboBox();
		cmbCalendarMonth.Location(10,10,230,20);
		cmbCalendarMonth.Add(gpCalendarMonth);
		var cmbCalendarYear=Jade.Objects.ComboBox();
		cmbCalendarYear.Location(250,10,105,20);
		cmbCalendarYear.Add(gpCalendarMonth);
		var calendar=Jade.Objects.CalendarMonth(48);
		calendar.Position(11,40);
		calendar.Add(gpCalendarMonth);
		calendar._public={};
		calendar._private={};
		calendar._changes={};

		var gpDayData=Jade.Objects.Container();
		gpDayData.Location(385,35,605,365);
		gpDayData.Add(tabs.tabpages[2]);
		var lblDayData_Daytype=Jade.Objects.Text(Jade.Lang.Get('day_type')+' :');
		lblDayData_Daytype.Location(15,15,200,20);
		lblDayData_Daytype.Add(gpDayData);
		var cmbDayData_Daytype=Jade.Objects.ComboBox();
		cmbDayData_Daytype.Location(200,10,390,20);
		cmbDayData_Daytype.Add(gpDayData);
		var lblDayData_Variant=Jade.Objects.Text(Jade.Lang.Get('variant')+' :');
		lblDayData_Variant.Location(15,45,200,20);
		lblDayData_Variant.Add(gpDayData);
		var cmbDayData_Variant=Jade.Objects.ComboBox();
		cmbDayData_Variant.Location(200,40,390,20);
		cmbDayData_Variant.Add(gpDayData);
		var chkDayData_Variant=Jade.Objects.CheckBox(Jade.Lang.Get('force_variant'));
		chkDayData_Variant.Location(200,70,390,20);
		chkDayData_Variant.Add(gpDayData);
		var lblDayData_Incidence=Jade.Objects.Text(Jade.Lang.Get('incidence')+' :');
		lblDayData_Incidence.Location(15,100,200,20);
		lblDayData_Incidence.Add(gpDayData);
		var cmbDayData_Incidence=Jade.Objects.ComboBox();
		cmbDayData_Incidence.Location(200,95,390,20);
		cmbDayData_Incidence.Add(gpDayData);
		var lblDayData_Workday=Jade.Objects.Text(Jade.Lang.Get('workday')+' :');
		lblDayData_Workday.Location(15,130,200,20);
		lblDayData_Workday.Add(gpDayData);
		var cmbDayData_Workday=Jade.Objects.ComboBox();
		cmbDayData_Workday.Location(200,125,390,20);
		cmbDayData_Workday.Add(gpDayData);
		var lblDayData_Comments=Jade.Objects.Text(Jade.Lang.Get('comments')+' :');
		lblDayData_Comments.Location(15,160,175,20);
		lblDayData_Comments.Add(gpDayData);
		var txtDayData_Comments=Jade.Objects.TextArea();
		txtDayData_Comments.Location(200,155,390,120);
		txtDayData_Comments.Add(gpDayData);
		var cmdCalendar_Clean=Jade.Objects.Button(Jade.Lang.Get('clean_selected_days'));
		cmdCalendar_Clean.Location(15,285,575,20);
		cmdCalendar_Clean.Add(gpDayData);
		var cmdCalendar_Apply=Jade.Objects.Button(Jade.Lang.Get('apply_changes_to_selection'));
		cmdCalendar_Apply.Location(15,310,575,20);
		cmdCalendar_Apply.Add(gpDayData);
		var cmdCalendar_Generate = Jade.Objects.Button(Jade.Lang.Get('calendar_auto_generation'));
		cmdCalendar_Generate.Location(15,335,575,20);
		//cmdCalendar_Generate.Add(gpDayData);
		
		var gpCalendarLegend=Jade.Objects.Container();
		gpCalendarLegend.Location(6,409,988,65);
		gpCalendarLegend.SetStyle('transparent');
		gpCalendarLegend.Add(tabs.tabpages[2]);
		var boxCalInfo_1=Jade.Objects._create();
		boxCalInfo_1.Location(20,11,12,12);
		boxCalInfo_1.className='leyend_box day_incidence';
		boxCalInfo_1.Add(gpCalendarLegend);
		var lblCalInfo_1=Jade.Objects.Text(Jade.Lang.Get('incidences'));
		lblCalInfo_1.Location(40,12,200,20);
		lblCalInfo_1.Add(gpCalendarLegend);
		var boxCalInfo_2=Jade.Objects._create();
		boxCalInfo_2.Location(20,31,12,12);
		boxCalInfo_2.className='leyend_box day_variant';
		boxCalInfo_2.Add(gpCalendarLegend);
		var lblCalInfo_2=Jade.Objects.Text(Jade.Lang.Get('variants'));
		lblCalInfo_2.Location(40,32,200,20);
		lblCalInfo_2.Add(gpCalendarLegend);
		var lblCalInfo_3=Jade.Objects.Text(Jade.Lang.Get('day_types')+':');
		lblCalInfo_3.Location(200,5,200,20);
		lblCalInfo_3.Add(gpCalendarLegend);
		var boxCalInfo=[];
		var txtCalInfo=[];
		for(var i=0,x=330,y=6;i<10;i++){
			var x=330+(150*(Math.floor(i/3)));
			var y=6+(19*(i%3));
			boxCalInfo[i]=Jade.Objects._create();
			boxCalInfo[i].Location(x,y,12,12);
			boxCalInfo[i].className='leyend_box daytype_'+i;
			boxCalInfo[i].Add(gpCalendarLegend);
			txtCalInfo[i]=Jade.Objects.Text(Jade.Lang.Get('variants')+i);
			txtCalInfo[i].Location(x+20,y+2,200,20);
			txtCalInfo[i].Add(gpCalendarLegend);
			Jade.FX.Hide(boxCalInfo[i]);
			Jade.FX.Hide(txtCalInfo[i]);
		}
	}
	{//Eventos-------------------------------------------------------------------------------------------------------------------------------------------------
		calendar.ondayclick=function(e,cube){
			var day = parseInt(cube.day);
			var month = parseInt(cmbCalendarMonth.selectedKey);
			var year = parseInt(cmbCalendarYear.selectedKey);
			var are_change=false;
			var are_private=false;
			var are_public=false;
			
			
			var workday = cmbWorkday.selectedKey;
			cmbDayData_Variant.Clear();
			cmbDayData_Variant.AddItem($.Lang.Get('none_f'),'');
			cmbDayData_Variant.AddItem(aWorkdays[workday].Text, 0);
			for(var i=1;i<=9;i++){
				if($.isDefined(aWorkdayVariants[workday])){
					var variant = aWorkdayVariants[workday].Variants[i];
					if($.isDefined(variant)){
						cmbDayData_Variant.AddItem(aWorkdays[variant.IdHorario].Text, i);	
					}
				}
			}
			
			
			try{ if(typeof(calendar._changes.year[year].month[month].day[day])!="undefined") { are_change = true; } }
			catch(e) { are_change=false; }
			try{ if(typeof(calendar._private.year[year].month[month].day[day])!="undefined") { are_private = true; } }
			catch(e) { are_private=false; }
			try { if(typeof(calendar._public.year[year].month[month].day[day])!="undefined") { are_public = true; } }
			catch(e) { are_public=false; }
			
			var item = {};
			if(are_change){ item = calendar._changes.year[year].month[month].day[day]; }
			else if(are_private){ item = calendar._private.year[year].month[month].day[day]; }
			else if(are_public){ item = calendar._public.year[year].month[month].day[day]; }
			if(typeof(item.Fecha)!="undefined"){
				cmbDayData_Daytype.SetSelectedKey(item.IdTipoDia);
				cmbDayData_Variant.SetSelectedKey(item.IdVariante);
				chkDayData_Variant.SetCheck(item.TipoVariante);
				cmbDayData_Incidence.SetSelectedKey(item.IdIncidencia);
				cmbDayData_Workday.SetSelectedKey(item.IdHorario);
				txtDayData_Comments.SetText(item.Observaciones);
			}
		}
		cmdCalendar_Clean.onclick=function(){
			var month=parseInt(cmbCalendarMonth.selectedKey);
			var year=parseInt(cmbCalendarYear.selectedKey);
			for(var i=0,iLen=calendar.selectedDays.length;i<iLen;i++){
				var cube = calendar.selectedDays[i];
				var day = parseInt(cube.day);
				var are_private=false;
				var item={};
				try{ 
					if(typeof(calendar._private.year[year].month[month].day[day])!="undefined"){ are_private = true; }
					else{ are_private=false; }
				}
				catch(e){ are_private=false; }
				if(are_private){
					var item=calendar._public.year[year].month[month].day[day];
					cube.SetColor(item.IdTipoDia, item.IdVariante, item.IdIncidencia);
					//----------------------------------------------------------------------------------
					if(typeof(calendar._changes.year[year])=="undefined"){
						calendar._changes.year[year]={}; 
						calendar._changes.year[year].month = new Array;
					}
					if(typeof(calendar._changes.year[year].month[month])=="undefined"){
						calendar._changes.year[year].month[month]={}; 
						calendar._changes.year[year].month[month].day=new Array;
					}
					calendar._changes.year[year].month[month].day[day]=item;
				}
			}
			
			for(var i=0,iLen=calendar.selectedDays.length;i<iLen;i++){
				var cube = calendar.selectedDays[i];
				var day = parseInt(cube.day);
				var are_private=false;
				var item={};
				
				try{
					if(typeof(calendar._private.year[year].month[month].day[day])!="undefined"){ are_private = true; }
					else{ are_private=false; }
				} catch(e){ are_private=false; }

				if(are_private){ item=calendar._private.year[year].month[month].day[day]; }
				else{ item=calendar._public.year[year].month[month].day[day]; }
				
				cube.SetColor(item.IdTipoDia, item.IdVariante, item.IdIncidencia);
				if(!$.isDefined(calendar._changes.year[year])){ calendar._changes.year[year]={month:[]};  }
				if(!$.isDefined(calendar._changes.year[year].month[month])){ calendar._changes.year[year].month[month]={day:[]};  }
				calendar._changes.year[year].month[month].day[day]={};
			}			
			
			calendar.ClearSelected();
			cmbDayData_Daytype.SetSelectedIndex(0);
			cmbDayData_Variant.SetSelectedIndex(0);
			chkDayData_Variant.SetCheck(true);
			cmbDayData_Incidence.SetSelectedIndex(0);
			cmbDayData_Workday.SetSelectedIndex(0);
			txtDayData_Comments.SetText('');
		}
		cmdCalendar_Apply.onclick=function(){
			var month=parseInt(cmbCalendarMonth.selectedKey);
			var year=parseInt(cmbCalendarYear.selectedKey);
			for(var i=0,iLen=calendar.selectedDays.length;i<iLen;i++){
				var cube=calendar.selectedDays[i];
				var day=parseInt(cube.day);
				
				cube.SetColor(cmbDayData_Daytype.selectedKey, cmbDayData_Variant.selectedKey, cmbDayData_Incidence.selectedKey);
				if(typeof(calendar._changes.year[year])=="undefined"){
					calendar._changes.year[year]={month:[]}; 
				}
				if(typeof(calendar._changes.year[year].month[month])=="undefined"){
					calendar._changes.year[year].month[month]={day:[]}; 
				}
				calendar._changes.year[year].month[month].day[day]={};
				calendar._changes.year[year].month[month].day[day].day=day;
				calendar._changes.year[year].month[month].day[day].Fecha=Jade.Strings.PadLeft(year,'0',4)+Jade.Strings.PadLeft(month,'0',2)+Jade.Strings.PadLeft(day,'0',2);
				calendar._changes.year[year].month[month].day[day].IdTipoDia=cmbDayData_Daytype.selectedKey;
				calendar._changes.year[year].month[month].day[day].IdVariante=cmbDayData_Variant.selectedKey;
				calendar._changes.year[year].month[month].day[day].TipoVariante=chkDayData_Variant.GetCheck();
				calendar._changes.year[year].month[month].day[day].IdIncidencia=cmbDayData_Incidence.selectedKey;
				calendar._changes.year[year].month[month].day[day].IdHorario=cmbDayData_Workday.selectedKey;
				calendar._changes.year[year].month[month].day[day].Observaciones=txtDayData_Comments.GetText();
			}
			calendar.ClearSelected();
			cmbDayData_Daytype.SetSelectedKey('');
			cmbDayData_Variant.SetSelectedKey('');
			chkDayData_Variant.SetCheck(true);
			cmbDayData_Incidence.SetSelectedKey('');
			cmbDayData_Workday.SetSelectedKey('');
			txtDayData_Comments.SetText('');
		}
		cmbDayData_Variant.onchange=function(){
			if(cmbDayData_Variant.selectedIndex==0){
				Jade.FX.Hide(chkDayData_Variant);
			}
			else{
				Jade.FX.Show(chkDayData_Variant);
			}
		}
		cmbDayData_Incidence.onchange=function(){
			if(cmbDayData_Incidence.selectedIndex==0){
				cmbDayData_Workday.SetEnabled(false);
			}
			else{
				cmbDayData_Workday.SetEnabled(true);
			}
		}
	}
}
{//Pestaņa: Horas estandar-------------------------------------------------------------------------------------------------------------------------------------
	tabs.AddTab(Jade.Lang.Get('dutytime'));
	{//Controles-----------------------------------------------------------------------------------------------------------------------------------------------
		var cmdCalcDutytime=Jade.Objects.Button(Jade.Lang.Get('calc_auto'));
		cmdCalcDutytime.Location(10,10,980,20);
		cmdCalcDutytime.Add(tabs.tabpages[3]);
		var lblDutytime=Jade.Objects.Text(Jade.Lang.Get('dutytime_year')+':');
		lblDutytime.Location(10,45,250,20);
		lblDutytime.Add(tabs.tabpages[3]);
		var cmbPayroll_Year = Jade.Objects.ComboBox();
		cmbPayroll_Year.Location(270,40,200,20);
		cmbPayroll_Year.Add(tabs.tabpages[3]);
		var cmDutytime=new Jade.Grids.ColumnModel();
		cmDutytime.Add(new Jade.Grids.SimpleColumn({key: 'month', text: Jade.Lang.Get('month'), width: '200', sortable: false}));
		cmDutytime.Add(new Jade.Grids.TimeColumn({key: 'dutytime', text: Jade.Lang.Get('dutytime'), width: '200', sortable: false}));
		cmDutytime.Add(new Jade.Grids.ButtonColumn({key: 'button', width: '120', sortable: false}));
		var grDutytime=new Jade.Grids.Grid(cmDutytime);
		grDutytime.Location(10,70,980,403);
		grDutytime.Add(tabs.tabpages[3]);
	}
	{//Eventos
		grDutytime.columnmodel.columns[2].oncellclick=function(cell){
			Load_Dutytime(cell.references.row.key);
		}
		cmdCalcDutytime.onclick=function(){
			for(var i=1;i<=12;i++){ Load_Dutytime(i); }
		}
		cmbPayroll_Year.onchangekey=function() {
			for(var i=0;i<=11;i++) {
				grDutytime.rows[i].cells[1].SetValue(aDutytime.year[this.selectedKey][i+1].value);
			}
		}
	}
}
{//Pestaņa: Estado---------------------------------------------------------------------------------------------------------------------------------------------
	tabs.AddTab(Jade.Lang.Get('status'));
	{//Controles-----------------------------------------------------------------------------------------------------------------------------------------------
		var cmdStatus=Jade.Objects.Button(Jade.Lang.Get('status_up'));
		cmdStatus.Location(10,10,980,20);
		cmdStatus.Add(tabs.tabpages[4]);
		var cmStatus=Jade.Grids.ColumnModel({sortable: false});
		cmStatus.Add(Jade.Grids.IconColumn({key:'status', width:26, align:'center'}));
		cmStatus.Add(Jade.Grids.DateColumn({key:'date', text:Jade.Lang.Get('date'), width:200}));
		cmStatus.Add(Jade.Grids.ButtonColumn({key:'button', width:100}));
		var grStatus=Jade.Grids.Grid(cmStatus);
		grStatus.Location(10,40,980,433);
		grStatus.Add(tabs.tabpages[4]);
	}
	{//Eventos-------------------------------------------------------------------------------------------------------------------------------------------------
		cmdStatus.onclick=function(){
			var i=grStatus.rows.length;
			var icon='status '+((i%2==0)?'up': 'down');
			var date=Jade.DateTime.toStoreDate(Jade.DateTime.Now());
			grStatus.NewRow([icon, date,''],'new');
			ChangeEmployeeStatus();
		}
		grStatus.columnmodel.columns[2].oncellclick=function(cell){
			var row=cell.references.row;
			if(row.key!='new'){
				petition.status.mod.splice(row.index,1);
				var cells=row.cells;
				petition.status.del.push({date: cells[1].value}); 
			}
			row.Delete();
			ChangeEmployeeStatus();
		}
	}
	{//Funciones-----------------------------------------------------------------------------------------------------------------------------------------------
		function ChangeEmployeeStatus(){
			var last_row = grStatus.rows.length-1;
			cmdStatus.SetText(Jade.Lang.Get((grStatus.rows.length%2==0)?'status_up':'status_down'));
			if(last_row>0) { grStatus.rows[last_row-1].cells[2].SetValue(''); }
			if(last_row>=0) { grStatus.rows[last_row].cells[2].SetValue([$.lng('erease'), 'delete']); }
		}
	}
}
{//Pestaņa: Datos en el terminal-------------------------------------------------------------------------------------------------------------------------------
	tabs.AddTab(Jade.Lang.Get('terminal_data'));
	{//Controls------------------------------------------------------------------------------------------------------------------------------------------------
		var lblAlias=Jade.Objects.Text(Jade.Lang.Get('alias')+':');
		lblAlias.Location(25,15,150,20);
		lblAlias.Add(tabs.tabpages[5]);
		var txtAlias = Jade.Objects.TextBox();
		txtAlias.Location(125,10,250,20);
		txtAlias.SetMaxLength(8);
		txtAlias.Add(tabs.tabpages[5]);
		var lblPassword = Jade.Objects.Text(Jade.Lang.Get('pass')+':');
		lblPassword.Location(25,40,150,20);
		lblPassword.Add(tabs.tabpages[5]);
		var txtPassword = Jade.Objects.TextBox('password');
		txtPassword.Location(125,35,250,20);
		txtPassword.SetMaxLength(5);
		txtPassword.Add(tabs.tabpages[5]);
		var lblPrivileges = Jade.Objects.Text(Jade.Lang.Get('privileges')+':');
		lblPrivileges.Location(25,65,150,20);
		lblPrivileges.Add(tabs.tabpages[5]);
		var cmbPrivileges = Jade.Objects.ComboBox();
		cmbPrivileges.Location(125,60,850,20);
		cmbPrivileges.Add(tabs.tabpages[5]);
		
		var hand_left=Jade.Objects._create();
		hand_left.className='img hand left';
		hand_left.Position(250,120);
		hand_left.Add(tabs.tabpages[5]);
		var hand_right=Jade.Objects._create();
		hand_right.className='img hand right';
		hand_right.Position(470,120);
		hand_right.Add(tabs.tabpages[5]);
		var finger=[];
		for(var i=0;i<10;i++){
			finger[i]=Jade.Objects._create();
			finger[i].className='img finger _'+i;
			if(i<5){ finger[i].Add(hand_right); }
			else{ finger[i].Add(hand_left); }
		}
		var lblFingerprintAlgoritm=Jade.Objects.Text(Jade.Lang.Get('fingerprint_algoritm')+':');
		lblFingerprintAlgoritm.Location(250,385,150,20);
		lblFingerprintAlgoritm.Add(tabs.tabpages[5]);
		var cmbFingerprintAlgoritm=Jade.Objects.ComboBox();
		cmbFingerprintAlgoritm.Location(400,380,270,20);
		cmbFingerprintAlgoritm.Add(tabs.tabpages[5]);
	}
}
{//Pestaņa: Notas----------------------------------------------------------------------------------------------------------------------------------------------
	tabs.AddTab(Jade.Lang.Get('notes'));
	{//Controles-----------------------------------------------------------------------------------------------------------------------------------------------
		var notes_lblPeriod=Jade.Objects.Text(Jade.Lang.Get('period')+' :');
		notes_lblPeriod.Location(10,15,100,20);
		notes_lblPeriod.Add(tabs.tabpages[6]);
		var notes_cmbMonth=Jade.Objects.ComboBox();
		notes_cmbMonth.Location(110,10,190,20);
		notes_cmbMonth.Add(tabs.tabpages[6]);
		var notes_cmbYear=Jade.Objects.ComboBox();
		notes_cmbYear.Location(310,10,100,20);
		notes_cmbYear.Add(tabs.tabpages[6]);
		var notes_cmdNew=Jade.Objects.Button(Jade.Lang.Get('new_note'));
		notes_cmdNew.Location(10,40,980,20);
		notes_cmdNew.Add(tabs.tabpages[6]);
		var cmNotes=Jade.Grids.ColumnModel({editable: false,sortable:false});
		cmNotes.Add(Jade.Grids.SimpleColumn({key: 'date', text: Jade.Lang.Get('date'), width: 110}));
		cmNotes.Add(Jade.Grids.SimpleColumn({key: 'time', text: Jade.Lang.Get('time'), width: 100}));
		cmNotes.Add(Jade.Grids.SimpleColumn({key: 'text', text: Jade.Lang.Get('text'), width: 565}));
		cmNotes.Add(Jade.Grids.ButtonColumn({key: 'edit', width: 90}));
		cmNotes.Add(Jade.Grids.ButtonColumn({key: 'delete', width: 90}));
		cmNotes.Add(Jade.Grids.HideColumn());

		var grNotes=Jade.Grids.Grid(cmNotes);
		grNotes.Location(10,70,980,403);
		grNotes.Add(tabs.tabpages[6]);
	}
	{//Ventana-------------------------------------------------------------------------------------------------------------------------------------------------
		var notesWindow=Jade.Objects.Window(450,155);
		var cmdNotes_Accept=Jade.Objects.Button();
		cmdNotes_Accept.Location(15,120,205,20);
		cmdNotes_Accept.SetText(Jade.Lang.Get('accept'));
		cmdNotes_Accept.Add(notesWindow);
		var cmdNotes_Cancel=Jade.Objects.Button();
		cmdNotes_Cancel.Location(230,120,205,20);
		cmdNotes_Cancel.SetText(Jade.Lang.Get('cancel'));
		cmdNotes_Cancel.Add(notesWindow);
		var txtNotes_Comments=Jade.Objects.TextArea();
		txtNotes_Comments.Location(15,15,420,95);
		txtNotes_Comments.Add(notesWindow);
	}
	{//Eventos-------------------------------------------------------------------------------------------------------------------------------------------------
		notes_cmdNew.onclick=function(){
			var date=Jade.DateTime.toStoreDate(Jade.DateTime.Now());
			var time=Jade.DateTime.toStoreTime(Jade.DateTime.Now());
			var row=grNotes.NewRow([$.DateTime.toShowDate(date), $.DateTime.toShowTime(time), '', [$.lng('modify'), 'edit'], [$.lng('erease'), 'delete']], 'new');
			row.cells[0].value=date;
			row.cells[1].value=time;
		}
		grNotes.columnmodel.columns[3].oncellclick=function(cell){ WindowNotes(cell.references.row); }
		grNotes.columnmodel.columns[4].oncellclick=function(cell){
			var row=cell.references.row;
			if(row.key!='new'){
				var cells=row.cells;
				petition.notes.del.push({date: cells[0].value,time: cells[1].value, text: cells[5].value}); 
			}
			row.Delete();
		}
		cmdNotes_Accept.onclick=function(){
			notesWindow.row.cells[2].SetValue(Jade.Strings.VisualTrim(txtNotes_Comments.GetText(), 550));
			notesWindow.row.cells[2].value=txtNotes_Comments.GetText();
			notesWindow.Hide();
		}
		cmdNotes_Cancel.onclick=function(){ notesWindow.Hide(); }
	}
	{//Funciones-----------------------------------------------------------------------------------------------------------------------------------------------
		function WindowNotes(row){
			notesWindow.Show();
			notesWindow.row=row;
			txtNotes_Comments.SetText(row.cells[2].value);
		}
	}
}
{//Pestaņa: Observaciones--------------------------------------------------------------------------------------------------------------------------------------
	tabs.AddTab(Jade.Lang.Get('comments'));
	var txtComments=Jade.Objects.TextArea();
	txtComments.Location(10,10,980,464);
	txtComments.Add(tabs.tabpages[7]);
}
{//Buttons-----------------------------------------------------------------------------------------------------------------------------------------------------
	var cmdOk = Jade.Objects.Button(Jade.Lang.Get('accept'));
	cmdOk.Location(0, 520, 495, 22);
	cmdOk.Add();
	cmdOk.SetEnabled(false);
	var cmdCancel = Jade.Objects.Button();
	cmdCancel.Location(505, 520, 495, 22);
	cmdCancel.SetText(Jade.Lang.Get('cancel'));
	cmdCancel.Add();
}
{//Default values----------------------------------------------------------------------------------------------------------------------------------------------
	tabs.tabs[0].onclick();
	if(!Jade.Utils.Privilege('employee_data')){ tabs.tabs[0].Hide(); }
	if(!Jade.Utils.Privilege('employee_profile')){ tabs.tabs[1].Hide(); }
	if(!Jade.Utils.Privilege('employee_calendar')){ tabs.tabs[2].Hide(); }
	if(!Jade.Utils.Privilege('employee_duty_time')){ tabs.tabs[3].Hide(); }
	if(!Jade.Utils.Privilege('employee_hiring_dismissals')){ tabs.tabs[4].Hide(); }
	if(!Jade.Utils.Privilege('employee_terminal')){ tabs.tabs[5].Hide(); }
	if(!Jade.Utils.Privilege('employee_notes')){ tabs.tabs[6].Hide(); }
	if(!Jade.Utils.Privilege('employee_notes')){ tabs.tabs[7].Hide(); }
	
	
	
	cmbPrivileges.AddItem(Jade.Lang.Get('privileges_0'),'0');
	cmbPrivileges.AddItem(Jade.Lang.Get('privileges_1'),'1');
	cmbPrivileges.AddItem(Jade.Lang.Get('privileges_2'),'2');
	cmbPrivileges.AddItem(Jade.Lang.Get('privileges_3'),'3');
	
	cmbFingerprintAlgoritm.AddItem('Biokey 10','10');
	cmbFingerprintAlgoritm.AddItem('Biokey 9','9');
	for(var i=1;i<=12;i++){
		//Calendario---------------------------------------------------------------------------------------------------------------------------------------------------------
		cmbCalendarMonth.AddItem(Jade.Lang.Get('month_'+i),i);
		//Horas estandar-----------------------------------------------------------------------------------------------------------------------------------------------------
		var row=grDutytime.NewRow([Jade.Lang.Get('month_'+i),'00000',[$.lng('recalculate'), 'apply']],i);
		row.cells[1].onendedit=function(){
			aDutytime.year[parseInt(cmbPayroll_Year.selectedKey)][this.references.row.key]=this.value;
		}
		//Notas--------------------------------------------------------------------------------------------------------------------------------------------------------------
		notes_cmbMonth.AddItem(Jade.Lang.Get('month_'+i),i);
	}
	cmbCalendarMonth.SetSelectedKey(Jade.DateTime.CurrentMonth());
	notes_cmbMonth.SetSelectedKey(Jade.DateTime.CurrentMonth());
	
	var currentYear=Jade.DateTime.CurrentYear();
	var aDutytime={first: currentYear-10, last: currentYear+10, current: currentYear, year:[]};
	for(var i=currentYear-10,iLen=currentYear+10;i<=iLen;i++){
		//Calendario
		cmbCalendarYear.AddItem(i,i);
		//Horas estandar
		aDutytime.year[i]=[];
		for(var j=1;j<=12;j++){ aDutytime.year[i][j]={value: 0, old: 0}; }
		cmbPayroll_Year.AddItem(i,i);
		//Notas
		notes_cmbYear.AddItem(i,i);
	}
	cmbCalendarYear.SetSelectedKey(currentYear);
	notes_cmbYear.SetSelectedKey(currentYear);		
	
	
}