/* *    Complemento para poder cambiar el texto de un label en tiempo de ejecución */Ext.override(Ext.form.Field, {    setFieldLabel: function(text) {        if (this.rendered) {            var labelSeparator = this.labelSeparator;            //var labelSeparator = ':';             if (typeof labelSeparator == 'undefined') {                if (this.ownerCt && this.ownerCt.layout && typeof this.ownerCt.layout.labelSeparator != 'undefined')                    labelSeparator = this.ownerCt.layout.labelSeparator;                else                    labelSeparator = '';            }             var formItem = this.el.up('.x-form-item', 10);             if (formItem) {                var label = formItem.child('.x-form-item-label');                 if (label)                    label.update(text + labelSeparator);            }        } else            this.fieldLabel = text;    }});function miFuncion(obj, rec, idx) {	//console.log(rec);	//var productoSel = Ext.get('sel_product').dom.value;	var tmpSerial_2 = Ext.getCmp('txt_serial_2');		if (rec.data.value == 'SDT10100') {		tmpSerial_2.setDisabled(false);	} else {		tmpSerial_2.setValue();		tmpSerial_2.setDisabled(true);	}	return true;}var product = new Ext.form.ComboBox({	fieldLabel: 'Producto/Product',	disableKeyFilter: true,	forceSelection: true,	triggerAction: 'all',	//typeAhead: true,	id: 'sel_producto',	name: 'sel_producto',	emptyText: 'Seleccione/Select ...',	mode: 'local',	store: new Ext.data.ArrayStore({		idIndex: 0,		fields: ['value', 'text'],		data: [				['SPM100', 'SPM100'],				['SPM200', 'SPM200'],				['SPM250', 'SPM250'],				['SPM1000', 'SPM1000'],								['SPM1200HD', 'SPM1200HD'],				['SPM3000', 'SPM3000'],								['SPM3500', 'SPM3500'],				['SPM5000', 'SPM5000'],								['SCT010', 'SCT010'],				['SCT012', 'SCT012'],				['SCT014', 'SCT014'],				['SCT016', 'SCT016'],				['SCT018', 'SCT018'],				['SNT1005', 'SNT1005'],								['SNT1010', 'SNT1010'],								['SNT1011', 'SNT1011'],								['SNT1015', 'SNT1015'],								['SNT1020', 'SNT1020'],                ['STG52', 'STG52'],				['STV20', 'STV20'],				['STV22', 'STV22'],				['STV24', 'STV24'],                ['STV24W7', 'STV24W7'],                ['STV26', 'STV26'],                ['STV40', 'STV40'],				['SDT10100', 'SDT10100'],								['SDT8200', 'SDT8200']		]	}),	valueField: 'value',	displayField: 'text',	hiddenName: 'sel_product',	listeners: {		'beforeselect': miFuncion	}});var serial = new Ext.form.TextField({	fieldLabel: 'N&deg; de serie/Serial number',	name: 'txt_serial',	emptyText: '',	id: 'txt_serial',	width: 150,	maxLength: 18,	allowBlank: false});var serial_2 = new Ext.form.TextField({	fieldLabel: 'N&deg; de serie/Serial number',	name: 'txt_serial_2',	emptyText: '',	id: 'txt_serial_2',	width: 150,	maxLength: 18,	allowBlank: true,	disabled: true});var fec_compra = new Ext.form.DateField({	fieldLabel: 'Fecha de compra/Date of purchase',	name: 'txt_fec_compra',	emptyText: 'dd/mm/aaaa',	id: 'txt_fec_compra',	width: 100,	format: 'd/m/Y',	altFormats: 'd/m/Y',	maxValue: new Date(),	allowBlank: false});var apellido = new Ext.form.TextField({	fieldLabel: 'Apellido/Surname',	name: 'txt_apellidos',	emptyText: '',	id: 'txt_apellidos',	width: 200,	allowBlank: false});var nombre = new Ext.form.TextField({	fieldLabel: 'Nombre/Name',	name: 'txt_nombre',	emptyText: '',	id: 'txt_nombre',	width: 200,	allowBlank: false});var nombre_contacta = new Ext.form.TextField({	fieldLabel: 'Nombre/Name',	name: 'txt_nombre_contacta',	emptyText: '',	id: 'txt_nombre_contacta',	width: 200,	allowBlank: false});var profesion = new Ext.form.TextField({	fieldLabel: 'Profesi&oacute;n/Occupation',	name: 'txt_profesion',	emptyText: '',	id: 'txt_profesion',	width: 200,	allowBlank: false});var fec_nacimiento = new Ext.form.DateField({	fieldLabel: 'Fecha de nacimiento/Birth date',	name: 'txt_fec_nacimiento',	emptyText: 'dd/mm/aaaa',	id: 'txt_fec_nacimiento',	width: 100,	format: 'd/m/Y',	altFormats: 'd/m/Y',	allowBlank: false});var direccion = new Ext.form.TextField({	fieldLabel: 'Direcci&oacute;n/Address',	name: 'txt_direccion',	emptyText: '',	id: 'txt_direccion',	width: 300,	allowBlank: false});var rad_sexo = new Ext.form.RadioGroup({	fieldLabel: 'Sexo/Sex',	columns: 2,	items: [		{boxLabel: 'Hombre/Male', name: 'rad_sexo', inputValue: 0, checked: true},		{boxLabel: 'Mujer/Female', name: 'rad_sexo', inputValue: 1}	]});var cpostal = new Ext.form.TextField({	fieldLabel: 'C&oacute;digo Postal/Postal code',	name: 'txt_cpostal',	emptyText: '',	id: 'txt_cpostal',	width: 60,	allowBlank: false});var ciudad = new Ext.form.TextField({	fieldLabel: 'Ciudad/City',	name: 'txt_ciudad',	emptyText: '',	id: 'txt_ciudad',	width: 300,	allowBlank: false});var pais = new Ext.form.ComboBox({	fieldLabel: 'Pa&iacute;s/Country',	disableKeyFilter: true,	forceSelection: true,	name: 'sel_pais',	emptyText: 'Seleccione/Select ...',	mode: 'local',	store: new Ext.data.SimpleStore({		id: 0,		fields: ['value', 'text'],		data: [			["de", "Alemania"],			["ad", "Andorra"],			["at", "Austria"],			["be", "B&#233;lgica"],			["bg", "Bulgaria"],			["cy", "Chipre"],			["dk", "Dinamarca"],			["sk", "Eslovaquia"],			["si", "Eslovenia"],			["es", "Espa&ntilde;a"],			["ee", "Estonia"],			["fr", "Francia"],			["gr", "Grecia"],			["ie", "Irlanda"],			["it", "Italia"],			["lt", "Lituania"],			["lu", "Luxemburgo"],			["mt", "Malta"],			["nl", "Pa&#237;ses Bajos"],			["pl", "Polonia"],			["pt", "Portugal"],			["uk", "Reino Unido"],			["ro", "Ruman&#237;a"],			["se", "Suecia"]		]	}),	valueField: 'value',	displayField: 'text',	hiddenName: 'sel_pais'});			var telefono = new Ext.form.NumberField({	fieldLabel: 'Tel&eacute;fono/Phone number',	name: 'txt_telefono',	emptyText: '',	id: 'txt_telefono',	width: 100,	allowBlank: false});var email = new Ext.form.TextField({	fieldLabel: 'E-Mail',	name: 'txt_email',	emptyText: '',	id: 'txt_email',	width: 250,	vtype: 'email',	allowBlank: false});var email_contacta = new Ext.form.TextField({	fieldLabel: 'E-Mail',	name: 'txt_email_contacta',	emptyText: '',	id: 'txt_email_contacta',	width: 250,	vtype: 'email',	allowBlank: false});var asunto_contacta = new Ext.form.ComboBox({	fieldLabel: 'Asunto/Subject',	disableKeyFilter: true,	forceSelection: true,	name: 'sel_tipoConsulta',	emptyText: 'Seleccione/Select ...',	mode: 'local',	store: new Ext.data.SimpleStore({		id: 0,		fields: ['value', 'text'],		data: [			["0", "Consulta técnica"],			["1", "Información"],			["2", "Otros"]		]	}),	valueField: 'value',	displayField: 'text',	hiddenName: 'sel_tipoConsulta'});var confirm_email = new Ext.form.TextField({	fieldLabel: 'Confirmar/Confirm E-Mail',	name: 'txt_email_confirm',	emptyText: '',	id: 'txt_email_confirm',	width: 250,	vtype: 'email',	allowBlank: false});var rad_condGarantia = new Ext.form.RadioGroup({	fieldLabel: 'Acepto las <a href="#" id="lnk_condGarantia" name="lnk_condGarantia">condiciones de Garant&iacute;a</a>',	columns: 2,	items: [		{boxLabel: 'S&iacute;', name: 'rad_condGarantia', id: 'rad_condGarantiaSi', inputValue: 0, checked: true},		{boxLabel: 'No', name: 'rad_condGarantia', id: 'rad_condGarantiaNo', inputValue: 1}	]});var comentario_contacta = new Ext.form.TextArea({	fieldLabel: 'Comentario/Comment',	name: 'txt_comentario_contacta',	emptyText: '',	id: 'txt_comentario_contacta',	width: 375,	allowBlank: false});var codigo_asistencia = new Ext.form.TextField({	fieldLabel: 'C&oacute;digo facilitado por el t&eacute;cnico',	name: 'txt_codigo_asistencia',	emptyText: '',	id: 'txt_codigo_asistencia',	width: 270,	allowBlank: false});var form = new Ext.FormPanel({	trackLabels: true,	bodyBorder: false,	bodyStyle: 'padding: 10px; background-color: white;',	labelWidth: 200,	frame: false,	url: './procesar_garantia.php',	items: [{		id: 'img_cabecera',		xtype: 'panel',		html: '<img src="/images/cab_form.png">',		bodyBorder: false,		border: false	},{		id: 'fld_product',		xtype: 'fieldset',		title: '<span style="color: #e85b26">Datos del producto/Product data</span>',		autoHeight: true,		collapsible: true,		items: [product, serial, serial_2, fec_compra]	},{		id: 'fld_comprador',		xtype: 'fieldset',		title: '<span style="color: #e85b26">Datos del comprador/Buyer data</span>',		autoHeight: true,		collapsible: true,		items: [			apellido, nombre, profesion, fec_nacimiento, direccion, 			rad_sexo, cpostal, ciudad, pais, telefono, email, confirm_email, rad_condGarantia]	}],	buttons: [{		text: 'Enviar / Send',		handler: function () {					if(form.getForm().isValid()){						if(Ext.getCmp('txt_email').el.dom.value != Ext.getCmp('txt_email_confirm').el.dom.value){							Ext.MessageBox.alert('Error', 'La direcci&oacute;n de e-mail no coincide.<br/>The e-mail address is not the same in both field.');						} else {							var valor_radCondGarantia = Ext.getCmp('rad_condGarantiaSi').getGroupValue();							if(valor_radCondGarantia == '1'){								Ext.MessageBox.alert('Error', 'Debe aceptar las condiciones de Garant&iacute;a.');							} else {								form.getForm().submit({									waitMsg: 'Enviando datos / Sending data ...',									success: function () {										Ext.MessageBox.alert('Registro/Register', 'Los datos han sido guardados.<br/>Your data have been saved.');										form.getForm().reset();									},									failure: function () {										Ext.MessageBox.alert('Error', 'Fallo al guardar los datos.<br/>Saving data failed.');									}								});							}						}					} else						Ext.MessageBox.alert('Error', 'Algunos campos contienen informaci&oacute;n no v&aacute;lida.<br/>Some fields contains invalid data.');				 }		},{		text: 'Borrar / Reset',		handler: function () {					form.getForm().reset();				 }	}]});var form_contact = new Ext.FormPanel({	id: 'form_contact',	bodyBorder: false,	bodyStyle: 'padding: 10px; background-color: white;',	labelWidth: 140,	frame: false,	url: 'procesar_contacto.php',	items: [{		id: 'img_cabecera',		xtype: 'label',		html: '<img src="/images/cab_form.png">'	},{		id: 'fld_contacto',		xtype: 'fieldset',		title: '<span style="color: #e85b26">Comentario / Comment</span>',		autoHeight: true,		collapsible: false,		items: [			nombre_contacta, email_contacta, asunto_contacta, comentario_contacta		]	}],	buttons: [{		text: 'Enviar / Send',		handler: function () {					if(form_contact.getForm().isValid()){						form_contact.getForm().submit({							waitMsg: 'Enviando datos / Sending data ...',							success: function () {								Ext.MessageBox.alert('Contacto/Contact', 'Los datos han sido enviados.<br/>Your data have been sent.');								form_contact.getForm().reset();								vFormularioContacto.hide();							},							failure: function () {								Ext.MessageBox.alert('Error', 'Fallo al enviar los datos.<br/>Sending data failed.');							}						});					} else						Ext.MessageBox.alert('Error', 'Algunos campos contienen informaci&oacute;n no v&aacute;lida.<br/>Some fields contains invalid data.');				 }		},{		text: 'Borrar / Reset',		handler: function () {					form_contact.getForm().reset();				 }	}]});var form_asistencia = new Ext.FormPanel({	defaultType: 'textfield',	bodyBorder: false,	bodyStyle: 'padding: 10px; background-color: white;',	labelWidth: 200,	frame: false,	url: 'downloads/asistencia/Asistencia_Remota_Cliente.exe',	items: [{		id: 'img_cabecera',		xtype: 'label',		html: '<img src="images/cab_form.png">'	},{		xtype: 'container',		contentEl: 'cAsistenciaRemota',		autoHeight: true	},{		id: 'fld_contacto',		xtype: 'fieldset',		title: '<span style="color: #e85b26">C&oacute;digo</span>',		autoHeight: true,		collapsible: false,		items: [codigo_asistencia]	}],	buttons: [{		text: 'Aceptar / Accept',		handler: function () {					if(form_asistencia.getForm().isValid()){						if (Ext.getCmp('txt_codigo_asistencia').el.dom.value != 'h71j36') {							Ext.MessageBox.alert('Error', 'El c&oacute;digo introducido no es correcto.<br/>The code you entered is not valid.');						}						else {							location.href = 'downloads/asistencia/Asistencia_Remota_Cliente.exe';							vFormularioAsistencia.hide();						}					} else						Ext.MessageBox.alert('Error', 'Algunos campos contienen informaci&oacute;n no v&aacute;lida.<br/>Some fields contains invalid data.');				 }	}]});var vFormulario = new Ext.Window({	id: 'wForm',	autoShow: false,	autoScroll: false,	width: 600,	autoHeight: true,	closeAction: 'hide',	resizable: false,	border: false,	bodyBorder: false,	bodyStyle: 'background-color: white;',	hideBorders: true,	title: 'Tarjeta de registro / Register card',	items: form,	y: 0});var vFormularioContacto = new Ext.Window({	id: 'wFormContact',	autoShow: false,	autoScroll: false,	layout: 'auto',	width: 600,	autoHeight: true,	closeAction: 'hide',	resizable: false,	border: false,	bodyBorder: false,	bodyStyle: 'background-color: white;',	hideBorders: true,	title: 'Contactar / Contact',	items: form_contact,	y: 0});var vFormularioAsistencia = new Ext.Window({	id: 'wFormAsistencia',	autoShow: false,	autoScroll: false,	layout: 'auto',	width: 600,	autoHeight: true,	closeAction: 'hide',	resizable: false,	border: false,	bodyBorder: false,	bodyStyle: 'background-color: white;',	hideBorders: true,	title: 'Asistencia Remota',	items: form_asistencia,	y: 0});var vProteccionDatos = new Ext.Window({	autoScroll	: true,	autoLoad	: 'http://www.sveon.com/proteccion_datos.html',	layout      : 'fit',	width       : 600,	height      : 400,	closeAction :'hide',	plain       : true,	title		: 'Pol&iacute;tica de privacidad de datos'});var vAvisoLegal = new Ext.Window({	autoScroll	: true,	autoLoad	: 'http://www.sveon.com/aviso_legal.html',	layout      : 'fit',	width       : 500,	height      : 270,	closeAction :'hide',	plain       : true,	title		: 'Aviso Legal'});var vCondGarantia = new Ext.Window({	autoScroll	: true,	autoLoad	: 'http://www.sveon.com/condiciones_garantia.html',	layout      : 'fit',	width       : 600,	height      : 400,	closeAction :'hide',	plain       : true,	title		: 'Condiciones de Garant&iacute;a'});var vSelProduct = new Ext.Window({	autoScroll	: true,	autoLoad	: 'mapaHtml.html',	layout      : 'fit',	width       : 952,	height      : 441,	closeAction :'hide',	plain       : true,	title		: 'Drivers y Manuales',	buttons: [{		text     : 'Close',		handler  : function(){			vSelProduct.hide();		}	}]});var vBuscador = new Ext.Window({	autoScroll	: true,	contentEl	: 'divSearch',	layout      : 'form',	width       : 255,	height      : 215,	closeAction :'hide',	resizable	: false,	plain       : true,	title		: 'Actualizaciones disponibles'});

