//<!--

function replace(str, from, to) {
  var i = str.indexOf(from);
  if (!from || !str || i == -1) return str;
  var newstr = str.substring(0, i) + to;
  if (i+from.length < str.length)
  newstr += replace(str.substring(i+from.length,str.length),from,to);
  return newstr;
};

if(document.referrer) {

  var rq=document.referrer;
  var lastQuery='';
  
  rq=rq.split('?');

  if (rq.length > 1) {
  
  rq=rq[1];
  rq=rq.split('&');
  
    for (var i=0; i<rq.length; i++) {
      var thisQ=rq[i].split('=');
       if      (thisQ[0]=="q"||thisQ[0]=="p"||thisQ[0]=="query"||thisQ[0]=="qkw"||thisQ[0]=="Keywords"||thisQ[0]=="ask") {
         lastQuery = replace(thisQ[1],'+',' ');
       }
    }
      
/*
    for (var i=0; i<document.forms.length; i++) { 
       if (document.forms[i].query) {
           void(document.forms[i].query.value=unescape(lastQuery));
       }
     }
*/

   var ref = escape(document.referrer);
   var pag = document.location;
   document.writeln('<IMG name="footer" style=\"visibility:hidden; position:absolute; display:none;\" width=\"1\" height=\"1\" src=\"http://www.paneris.org/webmacro/org.paneris.feedback.controller.MailForm?mailto=colinr@paneris.org&db=none&subject='+lastQuery+'&thanksURL=http%3A%2F%2Fwww.paneris.org%2Fcolinr%2Fspacer.gif&email=colinr@paneris.org&order=searchTerm&order=searchUrl&order=entryPage&order=siteID&searchTerm='+lastQuery+'&searchUrl='+ref+'&entryPage='+pag+'&siteID=CR-PAN&mail_list=&submit=\">');

   }
   
};

//-->
