File: //home/bibuzptr/public_html/rpl/wp-content/themes/validgrad/js/custom4b68.js
jQuery(function($) {
$(window).scroll(function(){
var sticky = $('.site > header#masthead'),
scroll = $(window).scrollTop();
if (scroll >= 100) sticky.addClass('sticky');
else sticky.removeClass('sticky');
});
$('#fileuploadfield').change(function() {
var val = $(this).val();
if(val){
var fileName = val.split("\\");
$('#uploadtextfield').text('( '+fileName[fileName.length-1]+' attached )');
if($(".remove_attachment").length<1)
$("#uploadtextfield").parent().append("<span class='remove_attachment'> X</span>");
}
});
$(document).on("click",".remove_attachment",function(){
$('#uploadtextfield').text('');
$('#fileuploadfield').val('');
$(this).remove();
});
$(document).on("click",".wpcf7-submit",function(){
var thankYouInterVal = setInterval(function() {
var thankMessage = $(".wpcf7-response-output").text();
if(thankMessage!="" && thankMessage=='Thank you for your interest. We are reviewing your request and will get back to you via email with your custom quote.'){
$(".remove_attachment").trigger("click");
$(".form-group").each(function(i,e){
$(this).removeClass('focused');
});
clearInterval(thankYouInterVal);
}
}, 100);
});
});