$(document).ready(function() { //auto complete off $("input.autocomplete-off").attr("autocomplete", "off"); //refresh captcha image $("img.change-captcha").click(function(){ var rnd = new date().gettime(); var src = $("img.captcha-img").attr("src"); if (src.indexof("?")!=-1) { var ind = src.indexof("?"); src = src.substr(0, ind); } src += "?"+rnd; $("img.captcha-img").attr("src", src); $("#verify").val(""); }); //closing divs - used on notification boxes notificationready = function(cls) { //hide button event if (!$(".canhide").find("close-notification").length) { $(".canhide").append("
").css("position", "relative"); $(".close-notification").click(function() { $(this).hide(); $(this).parent().fadeout(700); }); } //notification icon if (!$(".notification").find(".icon").length) { $(".notification").append("
").css("position", "relative"); } //notification type $(".notification").addclass(cls); } //submit form $("#frm_contact").submit(function(){ var action = $(this).attr("action"); $("#submit").attr("disabled", "disabled"); if (!$(".form-submit").find("img.preloader").length) { $("#submit").after(''); } $(".notification").fadeout(700, function() { $.post(action, { name: $("#name").val(), email: $("#email").val(), phone: $("#phone").val(), subject: $("#subject").val(), message: $("#message").val(), verify: $("#verify").val(), online_message: $("#online_message").val(), leixing: $("#leixing").val(), xzbh: $("#xzbh").val(), loupan: $("#loupan").val(), fanghao: $("#fanghao").val(), mianji: $("#mianji").val(), jiage: $("#jiage").val(), zushou: $("#zushou").val() }, function(data){ $(".notification").html(data).fadein(700); $(".form-submit img.preloader").fadeout("fast", function(){$(this).remove()}); $("#submit").removeattr("disabled"); if(data.match("success")!=null) $("#frm_contact").fadeout("slow"); } ); }); return false; }); });