function showAppraisalDialog(){$("#appVin").val("");$("#appColor").val("");$("#appOdometer").val("");$("#appName").val("");$("#appPhone").val("");$("#appZip").val("");$("#appTransmission").val("");$("#appCondition").val("");$("#appFeatures").val("");$("#appOkButton").show();$("#appLoader").hide();$("#lightboxAppraisal").dialog({width:580,title:"Free car appraisal service",modal:true,resizable:false})}function validateAppraisalForm(){if(!$("#appVin").val()){alert("Please type the VIN.");return}if($("#appVin").val().length!=17){alert("The VIN value is incorrect.");return}if(!$("#appTransmission").val()){alert("Please specify the transmission.");return}if(!$("#appColor").val()){alert("Please specify the exterior color.");return}if(!$("#appOdometer").val()){alert("Please specify the odometer reading.");return}if(!$("#appCondition").val()){alert("Please specify the condition of the vehicle.");return}if(!$("#appName").val()){alert("Please type your name.");return}if(!$("#appPhone").val()){alert("Please type your e-mail address or phone number.");return}if(!$("#appZip").val()){alert("Please type the ZIP code.");return}if($("#appZip").val().search(/(^\d{5}$)|(^\d{5}-\d{4}$)/)==-1){alert("The ZIP code value is incorrect.");return}$("#appLoader").show();$("#appOkButton").hide();$("#appForm").ajaxSubmit({success:processAppFormSubmitResult})}function processAppFormSubmitResult(b,c,d,a){$("#appOkButton").show();$("#appLoader").hide();if(c=="success"&&b.substr(0,3)=="~ok"){$("#lightboxAppraisal").dialog("close");$("#lightboxAppraisalFinished").dialog({width:500,modal:true,buttons:{Ok:function(){$(this).dialog("close")}}});return}};
