function isName(text){
	//var regExp = /^\s*[A-Za-zÑñÇçáéíóúäëïöüàèìòùâêîôû·ÁÉÍÓÚÄËÏÖÜÀÈÌÒÙÂÊÎÔÛªº\.]+(\s)?/;
	var regExp = /^\s*[A-Za-zÑñÇçáéíóúäëïöüàèìòùâêîôû·ÁÉÍÓÚÄËÏÖÜÀÈÌÒÙÂÊÎÔÛªº\.\- ]+\s*$/;
	return regExp.test(text);
}

function isLatinCharset(text){
	//var regExp = /^\s*[A-Za-zÑñÇçáéíóúäëïöüàèìòùâêîôû·ÁÉÍÓÚÄËÏÖÜÀÈÌÒÙÂÊÎÔÛªº\.]+(\s)?/;
	var regExp = /^\s*[A-Za-zÑñÇçáéíóúäëïöüàèìòùâêîôû·ÁÉÍÓÚÄËÏÖÜÀÈÌÒÙÂÊÎÔÛªº\. ]+\s*$/;
	return regExp.test(text);
}


function isNumberSymbol(text) {
    var regExp = /^\s*[0-9A-Za-zÑñÇçáéíóúäëïöüàèìòùâêîôû·ÁÉÍÓÚÄËÏÖÜÀÈÌÒÙÂÊÎÔÛªº\.]+(\s)?/;
	return regExp.test(text);    
}

function isNumber(text){
	var regExp =/^\d+$/;
	return regExp.test(text);
}

function isEmail(text){
	var regExp = /^([0-9a-zA-Z]+[-._+&amp;])*[0-9a-zA-Z]+@([-0-9a-zA-Z]+[.])+[a-zA-Z]{2,6}$/;
	return regExp.test(text);
}

function isDate(text){
	var regExp = /^((0[1-9]|[12][0-9]|3[01])\/(0[1-9]|1[0-2])\/(19[0-9][0-9]|2[0-9][0-9][0-9]))$/;
	return regExp.test(text);
}

function isDia(text){
	var regExp = /^(0[1-9]|[12][0-9]|3[01])$/;
	return regExp.test(text);
}
function isMes(text){
	var regExp = /^(0[1-9]|1[0-2])$/;
	return regExp.test(text);
}
function isAno(text){
	var regExp = /^(19[0-9][0-9]|2[0-9][0-9][0-9])$/;
	return regExp.test(text);
}

function isTelefono(text){
	var regExp = /^[9]{1}[0-9]{8}$/;
	return regExp.test(text);
}

function isMovil(text){
	var regExp = /^[6]{1}[0-9]{8}$/;
	return regExp.test(text);
}

function isAnoNoSuperiorActual(text){
	var result = isNumber(text);
	if(result && text.length == 4){
		var currentTime = new Date();
		var currentYear = currentTime.getFullYear();
		
		var year = parseInt(text);
		
		if(year <= currentYear && year > 1910) return true;
		else return false;
	}else{
		return false;
	}
}

function isMatricula(text){
	//var regExp = /^(\d{4}[A-Z]{3})|([A-Z]{1,2}\d{4}[A-Z]{1,2})$/;
	//var regExp = /^([A-Z]{0,2})\d{4}[A-Z]{1,3}$/;
	var regExp = /^^(((VI|AB|A|AL|AV|BA|PM|IB|B|BU|CC|CA|CS|CR|CO|C|CU|GE|GI|GR|GU|SS|H|HU|J|LE|L|LO|LR|LU|M|MA|MU|NA|OR|OU|O|P|GC|PO|SA|TF|S|SG|SE|SO|T|TE|TO|V|VA|BI|ZA|Z|CE|ML)\d{4}(?!.*(AA|EE|II|OO|UU))[A-Z]{1,2})|([E]\d{4}(?!.*(A|E|I|O|U|Q))[A-Z]{3})|(\d{4}(?!.*(A|E|I|O|U|Q))[A-Z]{3})|((vi|ab|a|al|av|ba|pm|ib|b|bu|cc|ca|cs|cr|co|c|cu|ge|gi|gr|gu|ss|h|hu|j|le|l|lo|lr|lu|m|ma|mu|na|or|ou|o|p|gc|po|sa|tf|s|sg|se|so|t|te|to|v|va|bi|za|z|ce|ml)\d{4}(?!.*(aa|ee|ii|oo|uu))[a-z]{1,2})|([e]\d{4}(?!.*(a|e|i|o|u|q))[a-z]{3})|(\d{4}(?!.*(a|e|i|o|u|q))[a-z]{3}))$/;
	return regExp.test(text);
}

function isCP(text){
    var regExp = /^([0-9]{5})$/;
	return regExp.test(text);
}


function checkForm(){
	var form = document.forms[0];
	var isErrors = false;
	var isErrorLOPD = false;
	
	resetStyles();

	if(form.particular_trato_1.options[form.particular_trato_1.selectedIndex].value == 0){
		//document.getElementById("particular_trato_1_select").style.borderColor = errorColor;
		document.getElementById("particular_trato_1").style.backgroundColor = errorColorFondo;
		isErrors =true;
	}
	
/*	if($("#particular_trato_1 :selected").val() == 0){
        $("#particular_trato_1_select").css("border: 1px solid #dc0039");
         
    }
*/	
	if(form.particular_nombre_1.value == ""){
//		document.getElementById("particular_nombre_1").style.borderColor = errorColor;
		document.getElementById("particular_nombre_1").style.background = errorColorFondo;
		isErrors = true;
	}
    if(form.particular_nombre_1.value != "" && !isName(form.particular_nombre_1.value)){
		//document.getElementById("particular_nombre_1").style.borderColor = errorColor;
		document.getElementById("particular_nombre_1").style.background = errorColorFondo;
		isErrors = true;
	}
	
	if(form.particular_apellido1_1.value == ""){
//		document.getElementById("particular_apellido1_1").style.borderColor = errorColor;
		document.getElementById("particular_apellido1_1").style.background = errorColorFondo;
		isErrors = true;
	}
    if(form.particular_apellido1_1.value != "" && !isName(form.particular_apellido1_1.value)){
//		document.getElementById("particular_apellido1_1").style.borderColor = errorColor;
		document.getElementById("particular_apellido1_1").style.background = errorColorFondo;
		$("#particular_apellido1_1").addClass("errorStyle");
		//alert($("#particular_apellido1_1").val());
		isErrors = true;
	}
	
	if(form.particular_apellido2_1.value != "" && !isName(form.particular_apellido2_1.value)){	
//		document.getElementById("particular_apellido2_1").style.borderColor = errorColor;
		document.getElementById("particular_apellido2_1").style.background = errorColorFondo;
		isErrors = true;
	}
    if(form.diaNac.value == "" || form.mesNac.value == "" || form.anoNac.value == "") {
//        document.getElementById("diaNac").style.borderColor = errorColor;
//        document.getElementById("mesNac").style.borderColor = errorColor;
//        document.getElementById("anoNac").style.borderColor = errorColor;
		document.getElementById("diaNac").style.background = errorColorFondo;
        document.getElementById("mesNac").style.background = errorColorFondo;
        document.getElementById("anoNac").style.background = errorColorFondo;
		isErrors = true;    
    }
    
	if(form.diaNac.value != "" && (form.diaNac.value.length < 2 || !isNumber(form.diaNac.value) || !isDia(form.diaNac.value))){
//		document.getElementById("diaNac").style.borderColor = errorColor;
		document.getElementById("diaNac").style.background = errorColorFondo;
		isErrors = true;
	}
	if(form.mesNac.value != "" && (form.mesNac.value.length < 2 || !isNumber(form.mesNac.value) || !isMes(form.mesNac.value))){
//		document.getElementById("mesNac").style.borderColor = errorColor;
		document.getElementById("mesNac").style.background = errorColorFondo;
		isErrors = true;
	}
	if(form.anoNac.value != "" && (form.anoNac.value.length < 4 || !isNumber(form.anoNac.value) || !isAno(form.anoNac.value) || !isAnoNoSuperiorActual(form.anoNac.value))){
//		document.getElementById("anoNac").style.borderColor = errorColor;
		document.getElementById("anoNac").style.background = errorColorFondo;
		isErrors = true;
	}

/*	if(form.particular_provincia_1.options[form.particular_provincia_1.selectedIndex].value == 0){
		document.getElementById("particular_provincia_1_select").style.borderColor = errorColor;
		isErrors = true;
	}
*/	
/*	if(form.particular_tipoVia_1.options[form.particular_tipoVia_1.selectedIndex].value == 0){
		document.getElementById("particular_tipoVia_1_select").style.borderColor = errorColor;
		isErrors = true;
	}
*/	 
/*	if(form.particular_nombreVia_1.value == "" ){
		document.getElementById("particular_nombreVia_1").style.borderColor = errorColor;
		isErrors = true;
	}
*/	
	if(form.particular_nombreVia_1.value != "" && !isNumberSymbol(form.particular_nombreVia_1.value)){
//		document.getElementById("particular_nombreVia_1").style.borderColor = errorColor;
		document.getElementById("particular_nombreVia_1").style.background = errorColorFondo;
		isErrors = true;
	}
	
/*	if(form.particular_tfnoFijo_1.value == "" && form.particular_tfnoMovil_1.value == ""){
		document.getElementById("telefono_div").style.border = "1px solid";
		document.getElementById("telefono_div").style.borderColor = errorColor;
		isErrors = true;
	}
*/	
	if(form.particular_tfnoFijo_1.value == "" && form.particular_tfnoMovil_1.value == ""){
//		document.getElementById("particular_tfnoFijo_1").style.borderColor = errorColor;
//		document.getElementById("particular_tfnoMovil_1").style.borderColor = errorColor;
		document.getElementById("particular_tfnoFijo_1").style.background = errorColorFondo;
		document.getElementById("particular_tfnoMovil_1").style.background = errorColorFondo;
		isErrors = true;
	}
    
    if(form.particular_tfnoFijo_1.value != "" && !isTelefono(form.particular_tfnoFijo_1.value)){
//		document.getElementById("particular_tfnoFijo_1").style.borderColor = errorColor;
		document.getElementById("particular_tfnoFijo_1").style.background = errorColorFondo;
		isErrors = true;
	}
	
	if(form.particular_tfnoMovil_1.value != "" && !isMovil(form.particular_tfnoMovil_1.value)){
//		document.getElementById("particular_tfnoMovil_1").style.borderColor = errorColor;
		document.getElementById("particular_tfnoMovil_1").style.background = errorColorFondo;
		isErrors = true;
	}
	
	if(form.particular_email_1.value == ""){
//		document.getElementById("particular_email_1").style.borderColor = errorColor;
		document.getElementById("particular_email_1").style.background = errorColorFondo;
		isErrors = true;
	}
    if(form.particular_email_1.value != "" && !isEmail(form.particular_email_1.value)){
		//document.getElementById("particular_email_1").style.borderColor = errorColor;
		//document.getElementById("particular_email_1").style.borderColor = errorColor;
		document.getElementById("particular_email_1").style.background = errorColorFondo;
		document.getElementById("particular_email_1").style.background = errorColorFondo;
		isErrors = true;				
	}
	
	/*
	if(form.vactual_anyoMatriculacion_1.value == ""){
		document.getElementById("vactual_anyoMatriculacion_1").style.background = errorColorFondo;
		isErrors = true;
	}
	*/

	
	
		/* Si poses coche (audi u otro) hay que poner año de compra: 127003 */
	
	if(form.vactual_marca_1.options[form.vactual_marca_1.selectedIndex].text != "* No poseo" && form.vactual_anyoMatriculacion_1.value == ""																												){
				document.getElementById("vactual_anyoMatriculacion_1").style.background = errorColorFondo;
				isErrors = true;
	}
/* Si la marca es audi hay que poner matricula anterior: 127003 */

	if(form.vactual_marca_1.options[form.vactual_marca_1.selectedIndex].text == "Audi" && form.vactual_matricula_1.value == ""){
								
		//document.getElementById("vactual_anyoMatriculacion_1").style.borderColor = errorColor;
		document.getElementById("vactual_matricula_1").style.background = errorColorFondo;
		isErrors = true;
		
	}
	

	
	/*&& form.vactual_marca_1.options[form.vactual_marca_1.selectedIndex].value != 0 && form.vactual_marca_1.options[form.vactual_marca_1.selectedIndex].value != "")*/
    
    if(form.vactual_anyoMatriculacion_1.value != "" && !isAnoNoSuperiorActual(form.vactual_anyoMatriculacion_1.value)){
		//document.getElementById("vactual_anyoMatriculacion_1").style.borderColor = errorColor;
		document.getElementById("vactual_anyoMatriculacion_1").style.background = errorColorFondo;
		isErrors = true;
	}

//* Si la marca no es audi hay que poner si lo compro de primera o segunda mano  anterior: 127003*/
/*
	if((form.vactual_marca_1.options[form.vactual_marca_1.selectedIndex].value != 162742 && form.vactual_marca_1.options[form.vactual_marca_1.selectedIndex].value != 0 && form.vactual_marca_1.options[form.vactual_marca_1.selectedIndex].value != "") && getCheckedValue(form.vactual_origenVehiculo_1) == ""){
		document.getElementById("vactual_origenVehiculo_1_div").style.border = "1px solid";
		document.getElementById("vactual_origenVehiculo_1_div").style.borderColor = errorColor;
		isErrors = true;
		
	}
*/	

	if((form.vactual_marca_1.options[form.vactual_marca_1.selectedIndex].text != "* No poseo" && form.vactual_marca_1.options[form.vactual_marca_1.selectedIndex].value != 0 && form.vactual_marca_1.options[form.vactual_marca_1.selectedIndex].value != "") && getCheckedValue(form.vactual_origenVehiculo_1) == ""){
		document.getElementById("vactual_origenVehiculo_1_div").style.border = "1px solid";
		document.getElementById("vactual_origenVehiculo_1_div").style.borderColor = errorColor;
		isErrors = true;
		
	}
	
/*	if(form.particular_codigoPostal_1.value == ""){
		document.getElementById("particular_codigoPostal_1").style.borderColor = errorColor;
		isErrors = true;
	}
*/	
	if(form.particular_codigoPostal_1.value != "" && !isCP(form.particular_codigoPostal_1.value)){
//		document.getElementById("particular_codigoPostal_1").style.borderColor = errorColor;
		document.getElementById("particular_codigoPostal_1").style.background = errorColorFondo;
		isErrors = true;
	}
	
/*	if(form.particular_numeroVia_1.value == ""){
		document.getElementById("particular_numeroVia_1").style.borderColor = errorColor;
		isErrors = true;
	}
*/	
	if(form.particular_numeroVia_1.value != "" && !isNumber(form.particular_numeroVia_1.value) ){
//		document.getElementById("particular_numeroVia_1").style.borderColor = errorColor;
		document.getElementById("particular_numeroVia_1").style.background = errorColorFondo;
		isErrors = true;
	}
	
/*	if(form.particular_localidad_1.value == ""){
		document.getElementById("particular_localidad_1").style.borderColor = errorColor;
		isErrors = true;
	}
*/	
	if(form.particular_localidad_1.value != "" && !isLatinCharset(form.particular_localidad_1.value)){
	//	document.getElementById("particular_localidad_1").style.borderColor = errorColor;
		document.getElementById("particular_localidad_1").style.background = errorColorFondo;
		isErrors = true;
	}
	
	
	if(form.vactual_matricula_1.value != "" && !isMatricula(form.vactual_matricula_1.value)){
//		document.getElementById("vactual_matricula_1").style.borderColor = errorColor;
		document.getElementById("vactual_matricula_1").style.background = errorColorFondo;
		isErrors = true;
	}
	
	if(form.vactual_marca_1.options[form.vactual_marca_1.selectedIndex].value == 0){
//		document.getElementById("vactual_marca_1_select").style.borderColor = errorColor;
		document.getElementById("vactual_marca_1").style.background = errorColorFondo;
		isErrors = true;
	}
	if(form.vactual_modelo_1.options[form.vactual_modelo_1.selectedIndex].value == 0){
//		document.getElementById("vactual_modelo_1_select").style.borderColor = errorColor;
		document.getElementById("vactual_modelo_1").style.background = errorColorFondo;
		isErrors = true;
	}
	
	/* Si tienes planeado comprar algun coche en breve, minimo indicar uno de ellos en la siguiente pregunta*/
	/*
	if((getCheckedValue(form.vfuturo_tiempoCompra_1) == "125680" || getCheckedValue(form.vfuturo_tiempoCompra_1) == "125681" || getCheckedValue(form.vfuturo_tiempoCompra_1) == "125682" || getCheckedValue(form.vfuturo_tiempoCompra_1) == "125683" ) && (form.vfuturo_marca_2.options[form.vfuturo_marca_2.selectedIndex].value == 0 && form.vfuturo_modelo_2.options[form.vfuturo_marca_2.selectedIndex].value == 0)){
		document.getElementById("vfuturo_marca_2_select").style.borderColor = errorColor;
		document.getElementById("vfuturo_modelo_2_select").style.borderColor = errorColor;
		isErrors = true;
	}*/
	
		if((getCheckedValue(form.vfuturo_tiempoCompra_1) == "161397" || getCheckedValue(form.vfuturo_tiempoCompra_1) == "161398" || getCheckedValue(form.vfuturo_tiempoCompra_1) == "161399" || getCheckedValue(form.vfuturo_tiempoCompra_1) == "161400" ) && (form.vfuturo_marca_2.options[form.vfuturo_marca_2.selectedIndex].value == 0 && form.vfuturo_modelo_2.options[form.vfuturo_marca_2.selectedIndex].value == 0)){
		//document.getElementById("vfuturo_marca_2_select").style.borderColor = errorColor;
		//document.getElementById("vfuturo_modelo_2_select").style.borderColor = errorColor;
		document.getElementById("vfuturo_marca_2").style.background = errorColorFondo;
		document.getElementById("vfuturo_modelo_2").style.background = errorColorFondo;
		isErrors = true;
	}
	
	/* Si tienes planeado comprar algun coche en breve, minimo indicar un motivo de compra */
	
	if((getCheckedValue(form.vfuturo_tiempoCompra_1) == "161397" || getCheckedValue(form.vfuturo_tiempoCompra_1) == "161398" || getCheckedValue(form.vfuturo_tiempoCompra_1) == "161399" || getCheckedValue(form.vfuturo_tiempoCompra_1) == "161400" ) && (getCheckedValue(form.vcomprado_motivoCompra_1) == "")){
	    document.getElementById("vcomprado_motivoCompra_1_div").style.border = "1px solid";
		document.getElementById("vcomprado_motivoCompra_1_div").style.borderColor = errorColor;
		isErrors = true;
	}
	
	/* Si tienes planeado comprar algun coche en breve, minimo indicar quien es el que ue compra */
	
	if((getCheckedValue(form.vfuturo_tiempoCompra_1) == "161397" || getCheckedValue(form.vfuturo_tiempoCompra_1) == "161398" || getCheckedValue(form.vfuturo_tiempoCompra_1) == "161399" || getCheckedValue(form.vfuturo_tiempoCompra_1) == "161400" ) && (getCheckedValue(form.decisor_cargo_1) == "")){
		document.getElementById("decisor_cargo_1_div").style.border = "1px solid";
        document.getElementById("decisor_cargo_1_div").style.borderColor = errorColor;
		isErrors = true;
	}
	
/*	if((getCheckedValue(form.vfuturo_tiempoCompra_1) == "125680" || getCheckedValue(form.vfuturo_tiempoCompra_1) == "125681" || getCheckedValue(form.vfuturo_tiempoCompra_1) == "125683" ) && (getCheckedValue(form.vfuturo_formaPago_1) == "")){
		document.getElementById("vfuturo_formaPago_1_div").style.border = "1px solid";
        document.getElementById("vfuturo_formaPago_1_div").style.borderColor = errorColor;
		isErrors = true;
	}
*/	
	
	
	/*si poner otros en el decisor de compra decir quien antes: 127241*/

	if(getCheckedValue(form.decisor_cargo_1) == "161407"  && form.decisorotros_cargo_1.value == ""){
	 
		document.getElementById("decisorotros_cargo_1").style.border = "1px solid";
//		document.getElementById("decisorotros_cargo_1").style.borderColor = errorColor;
		document.getElementById("decisorotros_cargo_1").style.background = errorColorFondo;
		isErrors = true;
	}  
	
/*	if(getCheckedValue(form.vactual_origenVehiculo_1) == "" ){
		document.getElementById("vactual_origenVehiculo_1_div").style.border = "1px solid";
		document.getElementById("vactual_origenVehiculo_1_div").style.borderColor = errorColor;
		isErrors = true;
	}
*/	
	if(getCheckedValue(form.vfuturo_tiempoCompra_1) == "" ){
		document.getElementById("vfuturo_tiempoCompra_1_div").style.border = "1px solid";
		document.getElementById("vfuturo_tiempoCompra_1_div").style.borderColor = errorColor;
		isErrors = true;
	}
	
	if(getCheckedValue(form.vfuturo_deseo_TD_1) == "" ){
		document.getElementById("vfuturo_deseo_TD_1_div").style.border = "1px solid";
		document.getElementById("vfuturo_deseo_TD_1_div").style.borderColor = errorColor;
		isErrors = true;
	}
	
	/*si poner otros en el tipo de compra decir quien */
	
	if(getCheckedValue(form.vfuturo_formaPago_1) == "127069"  && form.otroPago.value == ""){
		document.getElementById("otroPago").style.border = "1px solid";
//		document.getElementById("otroPago").style.borderColor = errorColor;
		document.getElementById("otroPago").style.background = errorColorFondo;
		isErrors = true;
	}
	
	/*si quieres hacer un TD debes poner provicncia anterioir: 125675 */
	
	if(getCheckedValue(form.vfuturo_deseo_TD_1) == "161392"  && form.vfuturo_provinciaTD_1.options[form.vfuturo_provinciaTD_1.selectedIndex].value == 0){
//		document.getElementById("vfuturo_provinciaTD_1_select").style.borderColor = errorColor;
		document.getElementById("vfuturo_provinciaTD_1").style.background = errorColorFondo;
		isErrors = true;
	}
	
	/*si quieres hacer un TD debes poner concesionario  anterioir: 125675 */
	
	if(getCheckedValue(form.vfuturo_deseo_TD_1) == "161392"  && form.vfuturo_Concesion_1.options[form.vfuturo_Concesion_1.selectedIndex].value == 0){
	//	document.getElementById("vfuturo_Concesion_1_select").style.borderColor = errorColor;
		document.getElementById("vfuturo_Concesion_1").style.background = errorColorFondo;
		isErrors = true;
	}
	
	/* Si las formas de pago son las que tienen select has de rellenarlo */
	
	if((getCheckedValue(form.vfuturo_formaPago_1) == "162803" || getCheckedValue(form.vfuturo_formaPago_1) == "162804")  && form.vfuturo_formaPagoDetalle_1.options[form.vfuturo_formaPagoDetalle_1.selectedIndex].value == 0){
		if(getCheckedValue(form.vfuturo_formaPago_1) == "162803") { 
//			document.getElementById("vfuturo_formaPagoDetalle_1_1_select").style.border = "solid";
//			document.getElementById("vfuturo_formaPagoDetalle_1_1_select").style.borderWidth = "1px";
			//elemento creado dinamicamente
			document.getElementById("vfuturo_formaPagoDetalle_1").style.backgroundColor = errorColorFondo;
			 
		}
		if(getCheckedValue(form.vfuturo_formaPago_1) == "162804"){ 
//			document.getElementById("vfuturo_formaPagoDetalle_1_2_select").style.border = "solid";
//			document.getElementById("vfuturo_formaPagoDetalle_1_2_select").style.borderWidth = "1px"; 
			//elemento creado dinamicamente
			document.getElementById("vfuturo_formaPagoDetalle_1").style.backgroundColor = errorColorFondo;
			}
		isErrors = true;
	}                          
	

	
	if(!form.particular_lopdGeneral_1.checked){
		isErrorLOPD = true;
	}else{
		isErrorLOPD = false;
	}
	
/*	if(form.particular_apellido1_1.value != "" && form.diaNac.value != "" && form.mesNac.value != "" && form.anoNac.value != "" && form.particular_tfnoFijo_1.value != "" && form.particular_tfnoMovil_1.value != "" && form.vactual_marca_1.options[form.vactual_marca_1.selectedIndex].value != 0 && form.vactual_modelo_1.options[form.vactual_modelo_1.selectedIndex].value != 0 && form.vactual_anyoMatriculacion_1.value != "" && form.vactual_carroceria_1.options[form.vactual_carroceria_1.selectedIndex].value != 0 && form.vactual_matricula_1.value != "" && form.vactual_origenVehiculo_1.checked && form.vfuturo_tiempoCompra_1.checked && form.vfuturo_marca_4.options[form.vfuturo_marca_4.selectedIndex].value != 0 && form.vfuturo_modelo_4.options[form.vfuturo_modelo_4.selectedIndex].value != 0 && form.vfuturo_marca_2.options[form.vfuturo_marca_2.selectedIndex].value != 0 && form.vfuturo_modelo_2.options[form.vfuturo_modelo_2.selectedIndex].value != 0 && form.vfuturo_marca_3.options[form.vfuturo_marca_3.selectedIndex].value != 0 && form.vfuturo_modelo_3.options[form.vfuturo_modelo_3.selectedIndex].value != 0){
		isPaso2 = true;
	}
*/	
	if(isErrors && isErrorLOPD){
		document.getElementById("errores").innerHTML = "<p><strong>Por favor, revisa los campos marcados. <br />Y recuerda que debes aceptar la Política de Privacidad.</strong></p>";
		Cufon.replace("#content p");
	}else if(isErrors && !isErrorLOPD){
		document.getElementById("errores").innerHTML = "<p><strong>Por favor, revisa los campos marcados.</strong></p>";
		Cufon.replace("#content p");		
	}else if(!isErrors && isErrorLOPD){
		document.getElementById("errores").innerHTML = "<p><strong>Por favor, debes aceptar la Política de Privacidad.</strong></p>";
		Cufon.replace("#content p");
	/*}else if(!isErrors && !isErrorLOPD && !isPaso2){
		document.getElementById("errores").innerHTML = "<p>Si completa todos los campos podremos atenderle con mayor eficacia.</p>";
		Cufon.replace("#content p");
		isPaso2 = true; */
	}
    else{
		document.getElementById("errores").innerHTML = "<p>Enviando datos...</p>";
		Cufon.replace("#content p");		
		enviarDatos(form);
	}
}

/*function checkFormPedidos(){
	var form = document.forms[0];
	var isErrors = false;
	var isErrorLOPD = false;
	
	resetStyles();
	
	if(form.particular_trato_1.options[form.particular_trato_1.selectedIndex].value == 0){
		document.getElementById("particular_trato_1_select").style.borderColor = errorColor;
		isErrors =true;
	}
	
	if(form.particular_nombre_1.value == ""){
		document.getElementById("particular_nombre_1").style.borderColor = errorColor;
		isErrors = true;
	}else if(form.particular_nombre_1.value != "" && !isLatinCharset(form.particular_nombre_1.value)){
		document.getElementById("particular_nombre_1").style.borderColor = errorColor;
		isErrors = true;
	}
	
	if(form.particular_apellido1_1.value == ""){
		document.getElementById("particular_apellido1_1").style.borderColor = errorColor;
		isErrors = true;
	}else if(form.particular_apellido1_1.value != "" && !isLatinCharset(form.particular_apellido1_1.value)){
		document.getElementById("particular_apellido1_1").style.borderColor = errorColor;
		isErrors = true;
	}
	
	if(form.particular_apellido2_1.value != "" && !isLatinCharset(form.particular_apellido2_1.value)){	
		document.getElementById("particular_apellido2_1").style.borderColor = errorColor;
		isErrors = true;
	}

	if(form.particular_tfnoMovil_1.value == "" && form.particular_tfnoFijo_1.value == ""){
		document.getElementById("particular_tfnoMovil_1").style.borderColor = errorColor;
        document.getElementById("particular_tfnoFijo_1").style.borderColor = errorColor;
		isErrors = true;
	}
	
	if(form.diaNac.value != "" && (form.diaNac.value.length < 2 || !isNumber(form.diaNac.value) || !isDia(form.diaNac.value))){
		document.getElementById("diaNac").style.borderColor = errorColor;
		isErrors = true;
	}
	if(form.mesNac.value != "" && (form.mesNac.value.length < 2 || !isNumber(form.mesNac.value) || !isMes(form.mesNac.value))){
		document.getElementById("mesNac").style.borderColor = errorColor;
		isErrors = true;
	}
	if(form.anoNac.value != "" && (form.anoNac.value.length < 4 || !isNumber(form.anoNac.value) || !isAno(form.anoNac.value) || !isAnoNoSuperiorActual(form.anoNac.value))){
		document.getElementById("anoNac").style.borderColor = errorColor;
		isErrors = true;
	}

	if(form.particular_provincia_1.options[form.particular_provincia_1.selectedIndex].value == 0){
		document.getElementById("particular_provincia_1_select").style.borderColor = errorColor;
		isErrors = true;
	}
	
	if(form.concesion_provincia_1.options[form.concesion_provincia_1.selectedIndex].value == 0){
		document.getElementById("concesion_provincia_1_select").style.borderColor = errorColor;
		isErrors = true;
	}

	if(form.vfuturo_Concesion_1.options[form.vfuturo_Concesion_1.selectedIndex].value == 0){
		document.getElementById("vfuturo_Concesion_1_select").style.borderColor = errorColor;
		isErrors = true;
	}

	if(form.particular_tfnoFijo_1.value != "" && !isTelefono(form.particular_tfnoFijo_1.value)){
		document.getElementById("particular_tfnoFijo_1").style.borderColor = errorColor;
		isErrors = true;
	}
	
	if(form.particular_tfnoMovil_1.value != "" && !isMovil(form.particular_tfnoMovil_1.value)){
		document.getElementById("particular_tfnoMovil_1").style.borderColor = errorColor;
		isErrors = true;
	}
	
	if(form.particular_email_1.value == ""){
		document.getElementById("particular_email_1").style.borderColor = errorColor;
		isErrors = true;
	}else if(form.particular_email_1.value != "" && !isEmail(form.particular_email_1.value)){
		document.getElementById("particular_email_1").style.borderColor = errorColor;
		isErrors = true;				
	}
	
	if(form.vactual_anyoMatriculacion_1.value != "" && !isAnoNoSuperiorActual(form.vactual_anyoMatriculacion_1.value)){
		document.getElementById("vactual_anyoMatriculacion_1").style.borderColor = errorColor;
		isErrors = true;
	}
	
	if(form.vactual_matricula_1.value != "" && !isMatricula(form.vactual_matricula_1.value)){
		document.getElementById("vactual_matricula_1").style.borderColor = errorColor;
		isErrors = true;
	}
	
	if(!form.particular_lopdGeneral_1.checked){
		isErrorLOPD = true;
	}else{
		isErrorLOPD = false;
	}
	
	if(form.particular_apellido1_1.value != "" && form.diaNac.value != "" && form.mesNac.value != "" && form.anoNac.value != "" && form.particular_tfnoFijo_1.value != "" && form.particular_tfnoMovil_1.value != "" && form.vactual_marca_1.options[form.vactual_marca_1.selectedIndex].value != 0 && form.vactual_modelo_1.options[form.vactual_modelo_1.selectedIndex].value != 0 && form.vactual_anyoMatriculacion_1.value != "" && form.vactual_carroceria_1.options[form.vactual_carroceria_1.selectedIndex].value != 0 && form.vactual_matricula_1.value != "" && form.vactual_origenVehiculo_1.checked && form.vfuturo_tiempoCompra_1.checked && form.vfuturo_marca_4.options[form.vfuturo_marca_4.selectedIndex].value != 0 && form.vfuturo_modelo_4.options[form.vfuturo_modelo_4.selectedIndex].value != 0 && form.vfuturo_marca_2.options[form.vfuturo_marca_2.selectedIndex].value != 0 && form.vfuturo_modelo_2.options[form.vfuturo_modelo_2.selectedIndex].value != 0 && form.vfuturo_marca_3.options[form.vfuturo_marca_3.selectedIndex].value != 0 && form.vfuturo_modelo_3.options[form.vfuturo_modelo_3.selectedIndex].value != 0){
		isPaso2 = true;
	}
	
	if(isErrors && isErrorLOPD){
		document.getElementById("errores").innerHTML = "<p>Por favor, revise los campos marcados. <br />Y recuerde que debe aceptar las condiciones generales</p>";
		Cufon.replace("#content p");
	}else if(isErrors && !isErrorLOPD){
		document.getElementById("errores").innerHTML = "<p>Por favor, revise los campos marcados.</p>";
		Cufon.replace("#content p");		
	}else if(!isErrors && isErrorLOPD){
		document.getElementById("errores").innerHTML = "<p>Debe aceptar las condiciones generales</p>";
		Cufon.replace("#content p");
	}else if(!isErrors && !isErrorLOPD && !isPaso2){
		document.getElementById("errores").innerHTML = "<p>Si completa todos los campos podremos atenderle con mayor eficacia.</p>";
		Cufon.replace("#content p");
		isPaso2 = true;
	}else{
		document.getElementById("errores").innerHTML = "<p>Enviando datos...</p>";
		Cufon.replace("#content p");		
		enviarDatos(form);
	}
}   */
