 function contact(a) {
  var b="contact.php";
   if(a)
    b+="?ref="+escape(a);
  var c=new T_form({'title':"Contact us",
                    'url':b,
                    'retfunc':thanks,
                    'width':390,
                    'left':'c',
                    'top':'c',
                    'buttons':4});
  c.setrowbtns([["Send enquiry",function(){c.getdata("u","sendm")}]]);
  c.setinstr("If you would like further details on our stock, or information on<br />forthcoming Antique Fairs, please complete our contact form:");
  c.open();
 }

 function thanks(a){
  a&&alert("Thank you for your enquiry - we will respond as soon as possible");
 }

 function usr_login() {
    var twu = new T_form({'title':'Log in',
                          'url':'usr_login.php',
                          'retfunc':usr_logged,
                          'defaction':function(){twu.getdata('u','login');d_rm("cur_"+twu.id);},
                          'left':'c',
                          'top':'c',
                         });
    twu.setrowbtns([['Log in',twu.opts.defaction],['Forgotten password?',function(){Wwwin.close(twu.id);usr_fgt();}],['Forgotten username?',function(){Wwwin.close(twu.id);usr_fgt2();}]]);
    twu.open(1);
 }    
 function usr_logged(tx) {
   if (tx) {
    var wlh=window.location.href;var hash=wlh.indexOf("#");
    if(hash>=0)wlh=wlh.substring(0,hash);if(wlh.match(/\?/))
    window.location.href=wlh+'&login';else window.location.href=wlh+'?login';
   }
 }


