function onlyDigits(e) {
  if (e.which) {
    if(e.which!=8 && e.which!=9 && (e.which<48 || e.which>57))
    return false;
  }
  else if(e.keyCode) {
    if(e.keyCode!=8 && e.keyCode!=9 && (e.keyCode<48 || e.keyCode>57))
    return false;
  }
  return true;
}

function validakm()
{
	var km = $('#ctl00_uxContentPlaceHolder_txtKM').val();

	if ((km == '') || (km == ' ')) {
		alert ('Devi indicare il chilometraggio presente sul tachimetro');
		return false;
	}

	return true;
}

jQuery(document).ready (function () {
   jQuery('#ctl00_uxContentPlaceHolder_txtKM').attr('onkeypress', 'return onlyDigits(event)'); 
   jQuery('#ctl00_uxContentPlaceHolder_miSimulador_Button1').bind('click', inviopreventivostep1);
/*
   jQuery('#ctl00_uxContentPlaceHolder_btEtapa2Siguiente').bind('click', inviopreventivostep2);
   jQuery('#ctl00_uxContentPlaceHolder_ImageButton1').bind('click', inviopreventivostep3);
*/

   $("#ctl00_uxBuscadorProvinciasList option:selected").val("Provincia");
   $('#ctl00_uxBuscadorProvinciasList').val('');
});

function inviopreventivostep1() {
jQuery.ajax({
        type: "POST",
        cache: "false",
	async: "false",
        crossDomain: "true",
        url: "http://tr.bussolino.com/CT/hmc6tG6zmm9vSYkc"
    });
};
function inviopreventivostep2() {
jQuery.ajax({
        type: "POST",
        cache: "false",
	async: "false",
        crossDomain: "true",
        url: "http://cm.bussolino.com/bannermanager.php?bannerid=t5DEF23m9Vdk4IJw"
    });
};
function inviopreventivostep3() {
jQuery.ajax({
        type: "POST",
        cache: "false",
	async: "false",
        crossDomain: "true",
        url: "http://cm.bussolino.com/bannermanager.php?bannerid=KMZquaRUIrmUHy2A"
    });
};

