if(typeof(gum)==="undefined"){var gum={templates:{cat9395:{lightboxContent:'<h2><em>Attention:</em> Gumtree policies on Pets for Sale</h2><p>This category is to help animal lovers re-home much loved pets. Please note some of our posting rules:</p><p><strong>Animals are only to be re-homed from the age of 8 weeks</strong></p><p><strong>We don\'t accept ads from:</strong></p><ul><li>commercial breeders &amp; stud services</li><li>puppy farms</li><li>individuals involved in animal welfare abuses of any kind</li></ul><p>We work closely with law enforcement. If you suspect any animal welfare issues connected with an ad on Gumtree, please report it to us.</p><form id="terms-and-cons" name="terms_and_cons" action="#" method="get"><p><label for="terms-and-cons-check"><input id="terms-and-cons-check" type="checkbox" name="terms_and_cons_check"/>I have read and agree to </label><a href="http://gumtree.force.com/Help/articles/General_Information/Pets" target="_blank">Gumtree pets policies</a></p></form>',lightboxError:'<p><em class="policy-error">* Please accept Gumtrees pet policies</em></p>'}},browserHasStyleProperty:function(propName){var prefixes=["Moz","Webkit","Khtml","O","Ms"];
element=document.documentElement,prefixed=0;if(typeof element.style[propName]=="string"){return true}propName=propName.charAt(0).toUpperCase()+propName.slice(1);for(var i=0,l=prefixes.length;i<l;i++){prefixed=prefixes[i]+propName;if(typeof element.style[prefixed]=="string"){return true}}return false}}}var ie="NA";if($.browser.msie&&$.browser.version<8){ie=IEVersion()}if(ie.DocMode<8){DD_roundies.addRule("div.global form#search","0 10px 10px 0");DD_roundies.addRule("form#search button.submit","4px");DD_roundies.addRule(".section, .column h2","10px");DD_roundies.addRule("div#sidebar div.panel.top","10px 10px 0 0");DD_roundies.addRule("div#sidebar div.panel.bottom","0 0 10px 10px");DD_roundies.addRule("ul#locale","12px 0 0 12px");DD_roundies.addRule("div#other-gumtrees h3#uk-ireland","9px 9px 0 0");DD_roundies.addRule(".directory","10px");DD_roundies.addRule(".boxout","10px");DD_roundies.addRule(".boxout h3","9px 9px 0 0");DD_roundies.addRule("div.quotes blockquote");DD_roundies.addRule("h5 strong.urgent, div.posting-description strong.urgent, form#post-an-ad strong.urgent","3px");
DD_roundies.addRule("div#global-nav #main-actions li.primary, div#global-nav #main-actions li.primary a","0 0 10px 0");DD_roundies.addRule("#gumtree-forums, div.home #main-actions li.secondary, div.home #main-actions li.secondary a, div.home #main-actions li.primary, div.home #main-actions li.primary a","12px");DD_roundies.addRule("div.home form#search","4px");DD_roundies.addRule("#gumtree-forums h2","0");DD_roundies.addRule("div#spotlight","10px");DD_roundies.addRule("div#spotlight h2","8px 8px 0 0")}$(document).ready(function(){if($.browser.msie&&$.browser.version==8){$("div#header.global form#search").css("position","absolute")}if($.browser.mozilla&&$.browser.version.substr(0,3)=="1.8"){$("ul#main-actions li.secondary a,form#search button.submit").css({background:"#84c667"});$("ul#main-actions li.primary a").css({background:"#ff8814"})}$("form#search button.submit").click(function(){if($("form#search input.text").val()==""){alert("Please enter some terms that you'd like to search for.");$("form#search input.text").focus();
return false}});var taglineWords=["white tuxedos","vintage records","warm weather","pet lizards","free stuff","Spanish lessons","opera singers","Subbuteo sets","Scottish kilts","coffee makers","theatre tickets","free stuff","yellow submarines","cinema posters","Persian cats","porcelain dolls"];var taglineIndex=Math.floor(Math.random()*taglineWords.length);$("#random-tagline-word").text(taglineWords[taglineIndex]);var keywordsLabel=$("form#search label.example");if($("form#search input.text").val()==""){keywordsLabel.removeClass("hidden")}$("form#search label.example").click(function(){$("form#search input.text").focus()});$("form#search input.text").focus(function(){if(!keywordsLabel.hasClass("hidden")){keywordsLabel.addClass("hidden")}});$("form#search input.text").blur(function(){if(keywordsLabel.hasClass("hidden")&&$(this).val()==""){keywordsLabel.removeClass("hidden")}});$("a.change-city, p.change-city a, p.close-overlay a").click(function(){$("a.change-city, p.change-city a").toggleClass("selected");$("div#change-city").toggle();
if($.browser.msie){if($.browser.version<7){$("div.home form#search select").toggle()}if($.browser.version<8){DD_roundies.addRule("#change-city","12px");DD_roundies.addRule("div#change-city h2#change-uk-ireland","10px 10px 0 0")}}return false});$("a[href='#skip']").click(function(){var scrollTime=$(document).height()/2.5;$.scrollTo("div#skip",scrollTime);return false});$("ul.adsense_open_new li.adsense_ad a").click(function(){window.open(this.href);return false});$("#press-coverage h4.group-head a").click(function(){var targetEl=$($(this).attr("href"));$(this).parent("h4").toggleClass("open").toggleClass("closed");targetEl.toggleClass("open").toggleClass("closed");return false});$("#press-releases h4.group-head a").click(function(){var targetEl=$($(this).attr("href"));$(this).parent("h4").toggleClass("open").toggleClass("closed");targetEl.toggleClass("open").toggleClass("closed");return false});$("#change-city h2 a").click(function(){var targetEl=$($(this).attr("href"));$(this).parent("h2").toggleClass("open").toggleClass("closed");
targetEl.toggleClass("show").toggleClass("hidden");return false});$("#list-postings-refinements h3 a").click(function(){var targetEl=$($(this).attr("href"));$(this).parent("h3").toggleClass("open").toggleClass("closed");targetEl.toggleClass("show").toggleClass("hidden");return false});if($("div#header.home").length>0){var docStyle=document.documentElement.style;$.getJSON("/get_homepage_features/"+siteId+"?rnd="+Math.random()*10,function(data){var totalSpotlightAds=data.items.length;$.each(data.items,function(i,ad){var adTitle=ad.title;var adLocation=ad.location;if(!("textOverflow" in docStyle||"OTextOverflow" in docStyle)){$("p.spotlight-location").ellipsis("width")}if(i<6){if(ad.thumbnail_url=="../../images/v2/artifacts/listings-no-thumb.gif"){var adClass="no-picture"}else{var adClass=" "}$("#spotlight ul").append('<li class="'+adClass+'"><a class="spotlight-picture" rel="nofollow" href="'+ad.path+'"><img width="96" height="72" alt="'+ad.title+'" src="'+ad.thumbnail_url+'" /></a><p class="spotlight-title"><a title="'+ad.title+'" rel="nofollow" href="'+ad.path+'">'+adTitle+'</a></p><p class="spotlight-location">'+adLocation+"</p></li>")
}});if(totalSpotlightAds==0){var blankSpaces=6}else{if(totalSpotlightAds<12){var blankSpaces=Math.ceil(totalSpotlightAds/6)*6-totalSpotlightAds}}for(var i=0;i<blankSpaces;i++){$("#spotlight ul").append('<li><a class="spotlight-learn-more spotlight-picture" rel="nofollow" href="#">No picture</a><p class="spotlight-title">Get your ad displayed here</p><p class="spotlight-location"><a href="#" rel="nofollow" class="spotlight-learn-more tip-for-spotlight-learn-more has-tip">Learn more</a></p></li>')}function showCarousel(){activateToolTips();$("#spotlight").css({background:"#ffffff"});$("#spotlight ul").animate({left:"0"},1000);$("p.spotlight-title a").ellipsis("height")}$("#spotlight ul").jcarousel({animation:900,easing:"swing",scroll:6,visible:6,buttonNextHTML:"<p>Next</p>",buttonPrevHTML:"<p>Previous</p>",initCallback:showCarousel,itemFirstInCallback:function(carousel,item,idx,state){$(item).addClass("first")},itemFirstOutCallback:function(carousel,item,idx,state){$(item).removeClass("first")},itemLastInCallback:function(carousel,item,idx,state){var adsInSpotlight=$("#spotlight ul li").length;
var lastVisibleAdPosition=$(item).prevAll().length+1;var loadToAd=adsInSpotlight+6;$.each(data.items,function(i,ad){if(i==adsInSpotlight&&i<loadToAd){var newAdPosition=adsInSpotlight+1;carousel.add(newAdPosition,'<a class="spotlight-picture" rel="nofollow" href="'+ad.path+'"><img width="96" height="72" alt="'+ad.title+'" src="'+ad.thumbnail_url+'" /></a></p><p class="spotlight-title"><a title="'+ad.title+'" rel="nofollow" href="'+ad.path+'">'+ad.title+'</a></p><p class="spotlight-location">'+ad.location+"</p>");adsInSpotlight++}});blankSpaces=Math.ceil($("#spotlight ul li").length/6)*6-adsInSpotlight;for(var i=0;i<blankSpaces;i++){var newAdPosition=adsInSpotlight+1;carousel.add(newAdPosition,'<a class="spotlight-learn-more spotlight-picture" rel="nofollow" href="#">No picture</a><p class="spotlight-title">Get your ad displayed here</p><p class="spotlight-location"><a href="#" rel="nofollow" class="spotlight-learn-more tip-for-spotlight-learn-more has-tip">Learn more</a></p>');adsInSpotlight++}carousel.size($("#spotlight ul li").length);
$("p.spotlight-title a").ellipsis("height");if(!("textOverflow" in docStyle||"OTextOverflow" in docStyle)){$("p.spotlight-location").ellipsis("width")}}})})}function hideLightbox(){$("#lightbox-bg").animate({opacity:"0"},200,function(){$(this).remove()});if(ie.DocMode<8){$("select").show()}}$("a.modal").click(function(e){e.preventDefault();var targetDivId=$(this).attr("href").match(/#(.+)/)[0];var targetDiv=$(targetDivId);if(targetDiv.hasClass("show")){hideLightbox();targetDiv.removeClass("show")}else{$("body").append('<div id="lightbox-bg"></div>');$("#lightbox-bg").css("height",$(document).height()+"px").animate({opacity:"0.5"},200);targetDiv.addClass("show");if(ie.DocMode<8){$("select").hide();if(ie.DocMode<7){DD_roundies.addRule("#"+targetDivId+" h3");DD_roundies.addRule("p.close a")}}var leftOffset=parseInt($(window).width()/2)-parseInt(targetDiv.width()/2)+$(window).scrollLeft();var topOffset=parseInt($(window).height()/2)-parseInt(targetDiv.height()/2)+$(window).scrollTop();targetDiv.css("left",leftOffset+"px");
targetDiv.css("top",topOffset+"px");targetDiv.appendTo("body");if(ie.DocMode<8){if($("body > ignore").length==0){DD_roundies.addRule(targetDivId);DD_roundies.addRule(targetDivId+" h3")}else{$("body > ignore").show();$("body > ignore").css("left",leftOffset+"px");$("body > ignore").css("top",topOffset+"px")}}}});$("div.modal p.close a").click(function(e){e.preventDefault();hideLightbox();if(ie.DocMode<8){$("body > ignore").hide()}var targetDiv=$(this).parents("div.modal");targetDiv.removeClass("show")});activateToolTips();$("body#view_item_page a#save_ad, div#posting ul#posting-actions a#starred").click(function(){var id=$(this).parents("li").attr("id").match(/save-ad-([0-9]+)/)[1];showposting_ToggleStarred(id);return false});$("#account-create-suggestion-button .button").click(function(e){var accountButton=$(this);jQuery.get(accountButton.attr("href"),{json:1},function(data){if(data.success){$("#main-message").html("<h2>Thank you!</h2><p><strong>Please check your email and click on the link to complete your registration. If the email does not appear in your inbox, have a look in your junk mail folder.</strong></p>")
}},"json");return false})});function open_close(el){if(el.hasClass("open")){el.removeClass("open");el.addClass("closed")}else{el.removeClass("closed");el.addClass("open")}}function google_afs_request_done(ads){return $.gtadslots.adsense.google_afs_request_done(ads)}function google_ad_request_done(ads){return $.gtadslots.adsense.google_ad_request_done(ads)}function activateAdPlacements(){$("div.ad").each(function(){var adId=$(this).parent().eq(0).attr("id");if(($(this).children("div.no-banner").length==0)||$(this).children("ul.adsense").length>0){$(this).addClass("show");$("."+adId+"-related").addClass("has-placement")}else{$(this).removeClass("show");$("."+adId+"-related").removeClass("has-placement")}})}function activateToolTips(){$(".has-tip").click(function(){var targetDivId="#"+$(this).attr("className").match(/tip-for-[a-zA-Z-]+/)[0];var targetDiv=$(targetDivId);if(targetDiv.children("p.close").length==0){targetDiv.append('<p class="close"><a href="#">Close</a></p>')}$(targetDivId+" p.close a").click(function(){var targetDiv=$(this).parents("div.tip-content");
if(ie.DocMode<7){$("body > ignore").hide()}targetDiv.removeClass("show");return false});if(targetDiv.children("div.bottom").length==0){targetDiv.append('<div class="bottom"></div>')}var offsets=$(this).offset();var leftOffset=offsets.left-200;var topOffset=offsets.top-targetDiv.height();if(topOffset<5){topOffset=5}if(targetDiv.hasClass("show")){if(targetDiv.css("left")!=leftOffset&&targetDiv.css("top")!=topOffset){targetDiv.css("left",leftOffset+"px");targetDiv.css("top",topOffset+"px")}else{targetDiv.removeClass("show")}}else{targetDiv.addClass("show");targetDiv.css("left",leftOffset+"px");targetDiv.css("top",topOffset+"px");targetDiv.appendTo("body");if(ie.DocMode<7){if($("body > ignore").length==0){DD_roundies.addRule(targetDivId+" p");DD_roundies.addRule(targetDivId+" p.close a");DD_roundies.addRule(targetDivId+" div.bottom")}else{$("body > ignore").show();$("body > ignore").css("left",leftOffset+"px");$("body > ignore").css("top",topOffset+"px")}}}return false})}var rsi_segs=[];var segs_beg=document.cookie.indexOf("rsi_segs=");
if(segs_beg>=0){segs_beg=document.cookie.indexOf("=",segs_beg)+1;if(segs_beg>0){var segs_end=document.cookie.indexOf(";",segs_beg);if(segs_end==-1){segs_end=document.cookie.length}rsi_segs=document.cookie.substring(segs_beg,segs_end).split("|")}}var segLen=20;var segQS="";if(rsi_segs.length<segLen){segLen=rsi_segs.length}for(var i=0;i<segLen;i++){segQS+=("rsi="+rsi_segs[i]+";")}var Starred=new Object();var saveitsaved="/common/images/save_it_button_saved.gif";var saveit="/common/images/save_it_button.gif";function showposting_ToggleStarred(id){if(Starred[id]){removeFromStarred(id,function(id){document.getElementById("starred").className="icon";updateSavedAdsCount(-1);$("li.save a").text("Save")})}else{$("li.save a").text("Saving");addToStarred(id,function(id){document.getElementById("starred").className="icon icon_saved";updateSavedAdsCount(1);$("li.save a").text("Saved")})}}function showposting_load(id,ispl){fillStarred(function(Starred){if(Starred[id]){document.getElementById("starred").className="icon icon_saved";
$("li.save a").text("Saved")}})}function listpostings_ToggleStarred(id){if(Starred[id]){if(document.getElementById("star_"+id)){document.getElementById("star_"+id).innerHTML="Save"}if(document.getElementById("star_fa_"+id)){document.getElementById("star_fa_"+id).innerHTML="Save"}removeFromStarred(id,function(id){if(document.getElementById("star_"+id)){document.getElementById("star_"+id).className="icon"}if(document.getElementById("star_fa_"+id)){document.getElementById("star_fa_"+id).className="icon"}});updateSavedAdsCount(-1)}else{if(document.getElementById("star_"+id)){document.getElementById("star_"+id).innerHTML="Saved"}if(document.getElementById("star_fa_"+id)){document.getElementById("star_fa_"+id).innerHTML="Saved"}addToStarred(id,function(id){if(document.getElementById("star_"+id)){document.getElementById("star_"+id).className="icon icon_saved"}if(document.getElementById("star_fa_"+id)){document.getElementById("star_fa_"+id).className="icon icon_saved"}});updateSavedAdsCount(1)}}function listpostings_starredpostings_removeAll(Starred){for(var id in Starred){listpostings_ToggleStarred(id)
}starredpostings_TryHideButton(1)}function listpostings_load(){fillStarred(function(Starred){for(var p in Starred){if(document.getElementById("star_"+p)){document.getElementById("star_"+p).className="icon icon_saved";document.getElementById("star_"+p).innerHTML="Saved"}if(document.getElementById("star_fa_"+p)){document.getElementById("star_fa_"+p).className="icon icon_saved";document.getElementById("star_fa_"+p).innerHTML="Saved"}}})}function starredpostings_TryHideButton(hideforsure){var atleastone=0;if(!hideforsure){for(var id in Starred){if(Starred[id]){atleastone=1;break}}}if(!atleastone){document.getElementById("noads").style.display="block";document.getElementById("removeall").style.display="none"}}function starredpostings_removeFromStarred(Starred,id){document.getElementById("star_removing_"+id).innerHTML="";removeFromStarred(id,function(id){document.getElementById("star_"+id).style.display="none";starredpostings_TryHideButton(0)})}function starredpostings_removeAll(Starred){for(var id in Starred){removeFromStarred(id,function(id){document.getElementById("star_"+id).style.display="none"
})}starredpostings_TryHideButton(1)}function fillStarred(callbackfunc){CheckSession();if(isAnonymous()){var A=new Array();var posting_ids=getCookie("posting_ids");if(posting_ids){A=posting_ids.split(" ");for(var i=0;i<A.length;++i){Starred[A[i]]=1}}var saved_ids=getCookie("saved_ids");if(saved_ids){A=saved_ids.split(" ");for(var i=0;i<A.length;++i){Starred[A[i]]=1}}callbackfunc(Starred)}else{ajaxcall("/cgi-bin/my_saved_ads.pl?action=getpostings",function(xml){var node=xml.getElementsByTagName("data")[0];if(node){for(i=0;i<node.getElementsByTagName("posting").length;++i){var p=node.getElementsByTagName("posting")[i].firstChild.nodeValue;Starred[p]=1}callbackfunc(Starred)}})}}function ToggleStarred(id){if(Starred[id]){removeFromStarred(id)}else{addToStarred(id)}}function addToStarred(id,callbackfunc){CheckSession();if(isAnonymous()){Starred[id]=1;updatePostingsCookie(id,callbackfunc)}else{ajaxcall("/cgi-bin/my_saved_ads.pl?action=addposting&posting_id="+id,function(xml){if(xml.getElementsByTagName("result")[0].firstChild.nodeValue!=1){alert("failed - mark posting starred")
}else{Starred[id]=1;if(callbackfunc){callbackfunc(id)}}})}}function removeFromStarred(id,callbackfunc){CheckSession();if(isAnonymous()){Starred[id]=0;updatePostingsCookie(id,callbackfunc)}else{ajaxcall("/cgi-bin/my_saved_ads.pl?action=removeposting&posting_id="+id,function(xml){if(xml.getElementsByTagName("result")[0].firstChild.nodeValue!=1){alert("failed - unmark posting starred")}else{Starred[id]=0;if(callbackfunc){callbackfunc(id)}}})}}function ajaxcall(url,callbackfunc){var request;if(window.XMLHttpRequest){request=new XMLHttpRequest()}else{request=new ActiveXObject("MSXML2.XMLHTTP.3.0")}request.open("GET",url,true);request.onreadystatechange=function(){if(request.readyState==4&&request.status==200){if(request.responseXML){callbackfunc(request.responseXML)}}};request.send(null)}function CheckSession(){var SID=getCookie("SID");var RE=new RegExp("^[au][a-f0-9]{32}","i");if(!SID.match(RE)){setCookie("SID","a"+Math.random().toString().substring(2,12)+Math.random().toString().substring(2,12)+Math.random().toString().substring(2,12)+Math.random().toString().substring(2,4))
}}function updatePostingsCookie(id,callbackfunc){var A=new Array();for(var p in Starred){if(Starred[p]){A.push(p)}}setCookie("posting_ids","");var date=new Date();date.setTime(date.getTime()+(365*24*60*60*1000));var expires="; expires="+date.toGMTString();setCookie("saved_ids",A.join(" "),expires,"/","gumtree.com");setCookie("saved_ids",A.join(" "),expires,"/","gumtree.ie");if(callbackfunc){callbackfunc(id)}}function isAnonymous(){CheckSession();var RE=new RegExp("^a","i");return getCookie("SID").match(RE)}function getCookie(c_name){if(document.cookie.length>0){c_start=document.cookie.indexOf(c_name+"=");if(c_start!=-1){c_start=c_start+c_name.length+1;c_end=document.cookie.indexOf(";",c_start);if(c_end==-1){c_end=document.cookie.length}return unescape(document.cookie.substring(c_start,c_end))}}return""}function setCookie(name,value,expires,path,domain,secure){path="/";document.cookie=name+"="+escape(value)+((expires)?"; expires="+expires:"")+((path)?"; path="+path:"")+((domain)?"; domain="+domain:"")+((secure)?"; secure":"")
};
