function getclassifieds(d){var b="ajaxWait",a="productcategory";$sjShow(a);$sjHTML(a,"loading...");$sjShow("producttopmsg");$sjHTML("divout","");try{sjAjax.load("serviceclassifieds.asmx/getclassified",'{"dbkeyid":"'+d+'","key":"'+websvs_key+'"}',getclassifieds_loaded);$sjShow(b)}catch(c){alert("Error occurred calling Ajax: "+c);$sjHide(b)}return false}function getclassifieds_loaded(i,a){var c="</td></tr>",b="";$sjHide("ajaxWait");if(i!=200){alert("Error ocurred: "+i+"\r\n\r\n"+a);return}var g=b,e=sjAjax.jsonDotNet(a);$sjHTML("productcategory",e.category);var d=e.items;if(d==null)return;for(var h=d.length,f=0;f<h;f++){a=d[f];g+='<div class="classified"><h4 class="location">'+a[3]+"</h4><h4>"+a[1]+"</h4><table>"+(a[4]==b?b:'<tr><td class="field">Contact:</td><td class="value">'+a[4]+c)+(a[5]==b?b:'<tr><td class="field">Phone:</td><td class="value">'+a[5]+c)+(a[6]==b?b:'<tr><td class="field">Email:</td><td class="value"><a href="classifiedemail.aspx?advert='+a[6]+'">(click to send message)</a></td></tr>')+'<tr><td class="field">Description:</td><td class="value">'+a[8]+c+(a[5]==b&&a[6]==b?'<tr><td class="field">Contact:</td><td class="value"><i>Please login for contact details</i></td></tr>':b)+(a[2]==b?b:'<tr><td class="field">Price:</td><td class="value price">'+a[2]+c)+"</table><h5>Ref: "+a[7]+"</h5></div>"}if(h==0)$sjHTML("divout",'<div class="formmsg"><h5>Note:</h5><ul><li>There are no adverts placed at present.</li><li>Click <a href="classifiednew.aspx">Place New Advert</a> to place an advert.</li></ul></div>');else $sjHTML("divout",g);logimg(11,e.category)}
