var xhrd,galfm={};function about(){var a=new W_ifr("About Freshfords","popup.php?p=1",600,540);a.setpos("c","c");a.setbtns(4);a.open()}function events(){var a=new W_ifr("Find us at these events","popup.php?p=2",400,240);a.setpos("c","c");a.setbtns(4);a.open()}function loca(){var a=new W_ifr("Location","popup.php?p=3",600,360);a.setpos("c","c");a.setbtns(4);a.open()}
function contact(a){var b="contact.php";if(a)b+="?ref="+escape(a);var c=new T_form("Contact us",b,thanks);c.setrowbtns([["Send enquiry",function(){c.getdata("u","sendm")}]]);c.forcewidth(390);c.setinstr("If you would like further details on any of our stock items, or information on forthcoming Antique Fairs or inhouse events, or a copy of our stock catalogue, please complete our contact form:");c.setpos("c","c");c.setbtns(4);c.open()}
function thanks(a){a&&alert("Thank you for your enquiry - we will respond as soon as possible")}function dispitem(a,b){xhrd||(xhrd=new Xhrwrap);xhrd.post("item.php","id="+a,function(c){dispit2(c,b)})}
function dispit2(a,b){var c="<div class='popup' style='height:540px;overflow:auto;'>{$1}{%0%<p class='disp_title'>{$title}</p><p>{b{$descrip}}</p>{?dimensions?<p>Dimensions: {$dimensions}</p>}<p>Ref: <i>{$ourref}{$price}{*8<{$status}&&64>{$status}*<span class='cal_hol'>Sold</span> }|{{*2=={$status}*<i>Coming soon</i>}|{<b>Available</b>} <span class='clickable' id='enq_{$ourref}'>Enquire about this item</span> }} <span class='clickable' onclick='Wwwin.close()'>Close window</span></p><p>Click on the main picture above for a large version. If you would like a hi-res version of any picture, please contact us and we shall be glad to assist.</p></div>";a=
new W_tpl(b,a,c,480);a.setbtns(13);a.setpos("c","c");a.open();var e=a.tpl.get([2,0]);c=a.tpl.get([3]);var d=a.tpl.get([4]);d_ae("img_"+b,"click",function(g){d_cd(g);show_full("Image for "+b,d+e)});if(c>3)for(var f=2;f<c;f+=3){var h=d+a.tpl.get([2,f-1]),i=d+a.tpl.get([2,f-2]);setps(f,b,h,i)}d_ae("enq_"+b,"click",function(g){d_cd(g);contact(b)})}function setps(a,b,c,e){d_ae("ps_"+b+"_"+a,"click",function(d){d_cd(d);pic_switch(b,c,e)})}
function show_full(a,b){a=new W_img(a,b);a.setpos("c",5);a.setbtns(5);a.open()}function pic_switch(a,b,c){var e=document.getElementById("ah_"+a);d_cl(e);b=d_mk("img",e,"","disp_img",{id:"img_"+a,src:b});d_ae(b,"click",function(d){d_cd(d);show_full("Image for "+a,c)})}function gal_opts(){var a=new W_ifr("Gallery options","popup.php?p=4",240,280);a.setpos(20,50);a.setbtns(4);a.open()}function makefm(){var a="";for(var b in galfm)if(galfm[b]){if(a)a+="&";a+=b+"="+galfm[b]}return a}
function dispgal(a){if(window.location.href.match(/gallery/)){galfm={};if(a)galfm.q=a;gal_get()}else window.location.href="gallery.php?s="+a}function gal_go(a){galfm.p=a;gal_get()}function gal_srch(a,b){if(a){galfm.y="";galfm.w=2;galfm.t=b}else{galfm.w=0;galfm.t="";galfm.y=b}gal_get()}function gal_get(){xhrd||(xhrd=new Xhrwrap);xhrd.post("newgal.php",makefm(),function(a){d_ge("cell32").innerHTML=a})};

