function setBackToTop(){jQuery(window).scroll((function(){jQuery(this).scrollTop()>220?jQuery(".back-to-top").fadeIn(500):jQuery(".back-to-top").fadeOut(500)})),jQuery(".back-to-top").click((function(e){return e.preventDefault(),jQuery("html, body").animate({scrollTop:0},500),!1}))}function sendEmail(){try{if($name=$("#cname").val(),$email=$("#cemail").val(),$phone=$("#cphone").val(),$message=$("#ccomment").val(),validateCustomerInput(),!$name||!$email&&!$phone||!$message)return $msg="Please fill required fields",$("#ERRMSG").html($msg),void setTimeout(clearERR,2e3);if($email&&!validateEmail($email))return $msg="Please enter valid e-mail address",$("#ERRMSG").html($msg),void setTimeout(clearERR,2e3);$cmp_email=$("#cmp_email").val(),$subject="Enquiry from "+$name,$phone&&($subject+=" at "+$phone),$verify=makeid(),setVerify($verify);var e={name:$name,email:$email,to:$cmp_email,subject:$subject,phone:$phone,message:$message,verify:$verify},a=JSON.stringify(e);$url="php/send.php",$.ajax({type:"POST",url:$url,data:{data:a},async:!1,cache:!1,success:function(e){msgBox(e),setTimeout((function(){location.reload()}),3e3)},error:function(e,a,t){}})}catch(e){$s="sendEmail(). Error: "+e.message}}function clearERR(){$("#ERRMSG").html(""),$('input[type="range"]').val(0).change(),$(".mandatory").removeClass("not_valid")}function validateCustomerInput(){try{return $valid=!0,$(".mandatory").each((function(e,a){$id=$(this).attr("id"),$(this).val()?$(this).removeClass("not_valid"):($(this).addClass("not_valid"),$valid=!1)})),$valid}catch(e){$s="validateCustomerInput(). Error: "+e.message}}function validateEmail(e){return!!/^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0-9]{2,4}$/.test(e)}function makeid(){for(var e="",a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",t=0;t<5;t++)e+=a.charAt(Math.floor(Math.random()*a.length));return e}function setVerify(e){$url="php/setp.php?val="+e,$.ajax({type:"GET",url:$url,async:!1,error:function(e,a,t){alert("setVerify 1:"+e.responseText+" 2:"+a+" 3:"+t)}})}$(document).ready((function(){try{$("#year").text((new Date).getFullYear()),$('[data-toggle="tooltip"]').tooltip(),setBackToTop(),$('input[type="range"]').rangeslider({polyfill:!1,onInit:function(){},onSlide:function(e,a){a<100&&$("#btnSend").addClass("disabled")},onSlideEnd:function(e,a){a<100?($("#btnSend").addClass("disabled"),$("#btnSend").removeClass("active")):($("#btnSend").removeClass("disabled"),$("#btnSend").addClass("active"))}})}catch(e){$s="ready(). Error: "+e.message}}));