function doAjaxRequest(n,t,i,r,u,f,e){(r===undefined||r===""||r===null)&&(r="json");(f===undefined||f===""||f===null)&&(f="POST");$.ajax({url:n,type:f,dataType:r,data:i,beforeSend:function(){u!=undefined&&u!=""&&$(u).show()},complete:function(){u!=undefined&&u!=""&&$(u).hide()},success:function(data){u!=undefined&&u!=""&&$(u).hide();t!==undefined&&t!==null&&(isString(t)?eval(t+"(data);"):e===undefined?t(data):t(data,e))},error:function(){u!=undefined&&u!=""&&$(u).hide()}})}function isString(n){return typeof n=="string"||n instanceof String}function GoTo(n){$("html, body").animate({scrollTop:$("#"+n).offset().top},2e3)}function populateDropDownList(n,t,i,r){var f="",e,u;for($(n).html(f),e=t.length,u=0;u<e;u++)f+='<option value="'+t[u][i]+'" >'+t[u][r]+"<\/option>";$(n).append(f)}function validateLogin(n){try{Modernizr.svg&&(n.indexOf('id="loginForm"')>0||n.indexOf("!DOCTYPE html>")>0)&&location.reload()}catch(t){console.log(t)}}function clickProductName(n){$(".navbar-categories .dropdown-menu li a").each(function(t,i){n.toLowerCase()===$(i).html().toLowerCase()&&($("#search-bar").val(""),$(i).click())})}function ChangeCostCenter(n){try{doAjaxRequest("/SetCostCenter","SetCostCenterMain",{costCenter:$(n).val()})}catch(t){location.reload()}}function SetCostCenterMain(n){validateLogin(n);window.location.href="/"}function RequestAQuote(){doAjaxRequest("/RequestAQuoteModal","RequestAQuoteCallback",null,"HTML",null)}function RequestAQuoteCallback(n){validateLogin(n);$("#modal-connect-body").html(n);$(modal).show()}var defaultError="<label style='color:red;'>An error occurred on the server. Please contact the system administrator<\/label>";$(window).scroll(function(){});$("#return-to-top").click(function(){$("body,html").animate({scrollTop:0},500)});$("#return-to-bottom").click(function(){$("body,html").animate({scrollTop:$("footer").offset().top},500)});$(document).ready(function(){var n=$("#pendingItemsNotification");n.length>0&&n.slideDown(1e3);$("#close-Notification").click(function(){$("#pendingItemsNotification").slideUp(500)});$(".navbar-menu li.dropdown").hover(function(){$(this).addClass("open")},function(){$(this).removeClass("open")});$(".navbar-categories li.dropdown").hover(function(){$(this).addClass("open")},function(){$(this).removeClass("open")});$("#search-bar").autocomplete({source:function(n,t){$.ajax({url:"/SearchProductName",dataType:"json",data:{productName:n.term},success:function(n){t(n)}})},select:function(n,t){clickProductName(t.item.value)}});$("#search-nav").click(function(){var n=$("#search-bar").val();clickProductName(n)})});Modernizr.svg||($("#shoppingCart").attr("src","/Content/Images/General/shoppingCart.png"),$("img[src*='ipg_connect_logo.jpg']").attr("src","https://ipg.ipgconnect.com.au/Content/Images/ipg_connect_logo_sml.jpg"))