$.browser.webkit&&($("input").attr("autocomplete","off"),$("select").attr("autocomplete","off"));$(".calculator").find(".validate-text").focusout(function(){var n=$(this);n.val()!=""?n.addClass("completed"):n.removeClass("completed")});$(".disclaimer-button").click(function(){$(".disclaimer-wrapper").hasClass("animated")?$(".disclaimer-wrapper").removeClass("animated"):$(".disclaimer-wrapper").addClass("animated")});$(".how-to-use-calc-button").click(function(){$(".how-to-use-calc-container").hasClass("animated")?$(".how-to-use-calc-container").removeClass("animated"):$(".how-to-use-calc-container").addClass("animated")});$("#Squares").change(function(){ConvertArea($("#Squares"))});$("#Sqm").change(function(){ConvertArea($("#Sqm"))});ConvertArea=function(n){var t=$("#FloorArea").val();n.attr("id")=="Squares"&&t!=""&&(t=t/9.29,t=t.toFixed(2),$("#FloorArea").val(t));n.attr("id")=="Sqm"&&t!=""&&(t=t*9.29,t=t.toFixed(0),$("#FloorArea").val(t))};$("form.calculator select").change(function(){$(this).valid()});var textLength=0;showResult=function(n){n.Result?($("#calculator-result").show(),$("#calculator-result-minimum").text(n.Result.Minimum+"*"),$("#calculator-result-maximum").text(n.Result.Maximum+"*"),$("#calculator-result-disclaimer").text(n.Disclaimer)):($("#calculator-result").hide(),$("#calc-error").show())};$("#PropertyType").change(function(){$("#PropertyType option").each(function(){$(this).text($(this).val())});$("#PropertyType option:selected").each(function(){var n=$(this).text();n.length>textLength&&$(this).text(n.substring(0,textLength)+"...")})});$(function(){var n=$(window).width();textLength=n<768?15:45;$("#PropertyType option:selected").each(function(){var n=$(this).text();n.length>textLength&&$(this).text(n.substring(0,textLength)+"...")})});$("#cons-calc-btn").click(function(){_gaq.push(["_trackEvent","Website - Construction Cost Calculator Page","Calculate","Construction Cost Calculator"])});document.addEventListener("DOMContentLoaded",function(){bindYoutubeVideo("CONSTRUCTION-COST-CALCULATOR_VIDEO_ID","https://content.bmtqs.com.au/images/construction-cost-calculator/cons-cost-calc-still.jpg","https://www.youtube.com/embed/iJyYiQjdE9g?modestbranding=1&amp;controls=2&amp;autohide=1&amp;wmode=transparent&amp;rel=0&amp;autoplay=1&amp;enablejsapi=1")})