typeof window.GoogleAdSense=="undefined"&&(window.GoogleAdSense={}),typeof window.GoogleAdSense.Parameters=="undefined"&&(window.GoogleAdSense.Parameters={}),typeof window.GoogleAdSense.MainAdBlock=="undefined"&&(window.GoogleAdSense.MainAdBlock={}),$(document).ready(function(){window.GoogleAdSense.Init(),typeof google!="undefined"&&typeof google.ads!="undefined"&&(window.GoogleAdSense.AdCountInternational>0?new google.ads.search.Ads(GoogleAdSense.Parameters,GoogleAdSense.MainAdBlock,GoogleAdSense.SidebarAdBlock):new google.ads.search.Ads(GoogleAdSense.Parameters,GoogleAdSense.MainAdBlock))}),function(n){n.extend(window.GoogleAdSense,function(){function i(){var p=window.TradeMe.BreadCrumbs,s=n.map(p.split("|"),function(t){return n.trim(t)}),h=window.GoogleAdSense.Client,o=window.TradeMe.Query,c=window.TradeMe.SearchResultsPage,l={},a=s[0],w=window.GoogleAdSense.AdCount,v=window.GoogleAdSense.AdCountInternational,i,y;c=!c?"0":c,GoogleAdSense.Parameters.channel=t(a),GoogleAdSense.Parameters.pubId=h,GoogleAdSense.Parameters.hl="en",GoogleAdSense.Parameters.siteLinks=!0,v>0&&(GoogleAdSense.Parameters.channel+="+"+u(a),n("#google-ad-template-international").tmpl().appendTo("#SiteHeader_SidebarColumn"),GoogleAdSense.SidebarAdBlock={container:"ad-container-sidebar",number:v,fontFamily:"'Helvetica Neue', Arial, san-serif",colorDomainLink:"#008000",colorTitleLink:"#0066CC",noTitleUnderline:!0,titleBold:!0,fontSizeTitle:16,lines:2,longerHeadlines:!0,linkTarget:"_blank",detailedAttribution:!0,width:"160px",adLoadedCallback:function(t,i){if(i)try{n("#google-ads-sidebar").removeClass("hide").addClass("show")}catch(r){n("#google-ads-sidebar").removeClass("show").addClass("hide")}else n("#google-ads-sidebar").removeClass("show").addClass("hide")}});switch(h){case"trademe":i=f(o,s);break;case"trademe-browse":i=n.trim(s.join(" "));break;default:throw"This Google AdSense client type is not supported : "+h;}i=googleAdSenseUtility.cleanAndFilter(i),y=n("li.reg-second:not(:has(a))").text(),i=googleAdSenseUtility.appendRegion(i,y),GoogleAdSense.Parameters.query=i,GoogleAdSense.MainAdBlock={container:"ad-container",number:w,fontFamily:"'Helvetica Neue', Arial, san-serif",colorDomainLink:"#008000",colorTitleLink:"#0066CC",noTitleUnderline:!0,titleBold:!0,detailedAttribution:!0,fontSizeTitle:16,lines:2,longerHeadlines:!0,linkTarget:"_blank",adLoadedCallback:function(t,i){if(i)try{n("#google-ads").removeClass("hide").addClass("show")}catch(r){n("#google-ads").removeClass("show").addClass("hide")}else n("#google-ads").removeClass("show").addClass("hide")}},n.extend(window,l),r("GoogleAdSense object:",l),e(),typeof window.TradeMe.Query!="undefined"?(o=decodeURIComponent(window.TradeMe.Query),o=o.replace(/[^a-zA-Z0-9\+]+/g,""),o=encodeURIComponent(o).replace(/%2B/g," "),n(".title-for-ads").html("Sponsored links related to: "+o.replace("+"," "))):typeof window.TradeMe.Category!="undefined"&&window.TradeMe.Category!="ROOT"&&n(".title-for-ads").html("Sponsored links related to: "+window.TradeMe.Category)}function r(n,t){typeof console!="undefined"&&typeof window.TradeMe=="object"&&typeof window.TradeMe.IsAdmin=="boolean"&&window.TradeMe.IsAdmin===!0&&console.log(n,t)}function u(n){return t(n)+"-int"}function t(n){var t={"Antiques &amp; collectables":"Antiques-collectables",Art:"Art","Baby gear":"Baby-Gear",Books:"Books","Building &amp; renovation":"Building-renovation","Business, farming &amp; industry":"Business-farming-industry","Cars, bikes &amp; boats":"Cars-bikes-boats","Clothing &amp; Fashion":"Clothing-Fashion",Computers:"Computers",Crafts:"Crafts","Electronics &amp; photography":"Electronics-Photography",Flatmates:"Flatmates wanted","Flatmates wanted":"Flatmates wanted",Gaming:"Gaming","Health &amp; beauty":"Health-Beauty","Home &amp; living":"Home-Living","Jewellery &amp; watches":"Jewellery-watches",Jobs:"Jobs","Mobile phones":"Mobile-Phones","Movies &amp; TV":"Movies-TV","Music &amp; instruments":"Music-Instruments","Pets &amp; animals":"Pets-animals","Pottery &amp; glass":"Pottery-Glass","Real estate":"Property",Services:"Services",Sports:"Sports","Toys &amp; models":"Toys-Models","Travel, events &amp; activities":"Travel-events-activities","Trade Me Motors":"Motors","Trade Me Property":"Property","Trade Me Jobs":"Jobs","Chch earthquake support":"Chch-earthquake-support",QuakeMates:"quake-mates","All-categories":"All-categories"};if(typeof t[n]=="undefined")throw"This category has not been mapped to a Google AdSense channel : "+n;return t[n]}function f(t,i){var r=i.slice(0);return r.unshift(t),n.trim(r.join(" "))}function e(){n.ajax({url:("https:"==document.location.protocol?"https://ssl":"http://www")+".google.com/afsonline/show_afs_ads.js",dataType:"script",cache:!0})}return{Init:i}}())}(jQuery);var googleAdSenseUtility=function(){var n=function(n){for(var i=["trade me","residential for sale","residential to rent","all-categories"],t=0;t<i.length;t++)n=n.replace(i[t],"");return n},t=function(n){return n=$("<div/>").html(n).text(),decodeURIComponent(n)},i=function(n){var t=[];return $.each(n.split(" "),function(n,i){$.inArray(i,t)==-1&&t.push(i)}),$.trim(t.join(" "))},r=function(n,t){return t!=null&&t!=""&&(n=n+" "+t),n};return{cleanAndFilter:function(r){return r==null?"":(r=r.toLowerCase(),r=t(r),r=n(r),i(r))},appendRegion:r}}()