function CColor(c){
	var est_d = ["cgrisptc","cnegroptc","cazulptc","cbordoptc","cverptc","cblanptc","cnegrotac","cazultac","cgristac" ,"cvertac","crojotac","ccelestetac","cblancotac","cazuljourney","cgrisjourney","cnegrojourney","crojojourney","cmarrjourney","cblancojourney","cverdejourney","cnegrojeepchero","cazuljeepchero","ccremajeepchero","crojojeepchero","cverdejeepchero","cgrisjeepchero","cblancojeepchero","cnegro2jeepchero","cnegrojeepcompass","cgrisjeepcompass","cazuljeepcompass","crojojeepcompass","cmetaljeepcompass","cblancojeepcompass","cnegrojeepgchero","cazuljeepgchero","cgris1jeepgchero","cverdejeepgchero","crojojeepgchero","ccrema1jeepgchero","ccrema2jeepgchero","cgris2jeepgchero","cgris3jeepgchero","crojojeepwrang","cazuljeepwrang","cverdejeepwrang","cbordojeepwrang","cgrisjeepwrang","cnaranjjeepwrang","cblancojeepwrang","cmostazjeepwrang","cnegrojeepwrang","camariljeepwrang","cbordojeepwrangu","cnegrojeepwrangu","cgrisjeepwrangu","cnaranjjeepwrangu","cblancojeepwrangu","cnegrojeeppatriot","cazuljeeppatriot","cgris1jeeppatriot","crojojeeppatriot","cgris2jeeppatriot","cblancojeeppatriot"];
	if ($.inArray(c, est_d) >= 0){
		document.getElementById('ccontautoscolor').className = c;
	}
}


function VContacto(id,m){

	var timestamp = Math.round(new Date().getTime() / 1000);
	var form = $('#'+id);

	$.post("modelo-contacto-"+m+".php?"+timestamp,form.serialize(),
	function(datos){
		var datos_p = datos.split("|");
		if (datos_p[0] == "1"){
			$('#contformbarder').css('display', 'none');
			$('#formm').css('display', 'block');
			$('#fmens').text(datos_p[1]);
			$('html, body').animate({ scrollTop: 0 }, 'slow');
		}
		else {
			$.prompt(datos_p[1],
			{buttons: {Aceptar:true}
			});
		}

	}
	);
	return false;
}

function Cimg(n){
	$('#img_g').attr('src','img/modelos/'+n+'g.jpg');
}

function CimgE(c,n){
	$('#img_g').attr('src','img/eventos/'+c+'/'+n+'g.jpg');
}

function VContactoW(id){
	var timestamp = Math.round(new Date().getTime() / 1000);
	var form = $('#'+id);
	$.post("contacto.html?"+timestamp,form.serialize(),
	function(datos){
		var datos_p = datos.split("|");
		if (datos_p[0] == "1"){
			$('#cconto').css('display', 'none');
			$('#notif_c').css('display', 'block');
			$('#msj_op').text(datos_p[1]);
			$('html, body').animate({ scrollTop: 0 }, 'slow');
		}
		else {
			$.prompt(datos_p[1],
			{buttons: {Aceptar:true}
			});
		}

	}
	);
	return false;
}

function Recargar(){
	window.location.reload();
}
function VContactoR(id){
	var timestamp = Math.round(new Date().getTime() / 1000);
	var form = $('#'+id);
	$.post("repuestos.html?"+timestamp,form.serialize(),
	function(datos){
		var datos_p = datos.split("|");
		if (datos_p[0] == "1"){
			$('#cconto').css('display', 'none');
			$('#notif_c').css('display', 'block');
			$('#msj_op').text(datos_p[1]);
			$('html, body').animate({ scrollTop: 0 }, 'slow');
		}
		else {
			$.prompt(datos_p[1],
			{buttons: {Aceptar:true}
			});
		}
	}
	);
	return false;
}
function VContactoPv(id){
	var timestamp = Math.round(new Date().getTime() / 1000);
	var form = $('#'+id);
	$.post("postventa.html?"+timestamp,form.serialize(),
	function(datos){
		var datos_p = datos.split("|");
		if (datos_p[0] == "1"){
			$('#cconto').css('display', 'none');
			$('#notif_c').css('display', 'block');
			$('#msj_op').text(datos_p[1]);
			$('html, body').animate({ scrollTop: 0 }, 'slow');
		}
		else {
			$.prompt(datos_p[1],
			{buttons: {Aceptar:true}
			});
		}
	}
	);
	return false;
}
function VContactoF(id){
	var timestamp = Math.round(new Date().getTime() / 1000);
	var form = $('#'+id);
	$.post("financiacion.html?"+timestamp,form.serialize(),
	function(datos){
		var datos_p = datos.split("|");
		if (datos_p[0] == "1"){
			$('#cconto').css('display', 'none');
			$('#notif_c').css('display', 'block');
			$('#msj_op').text(datos_p[1]);
			$('html, body').animate({ scrollTop: 0 }, 'slow');
		}
		else {
			$.prompt(datos_p[1],
			{buttons: {Aceptar:true}
			});
		}
	}
	);
	return false;
}
