  if (typeof noADPURL == 'undefined') {
    noADPURL = location.href;
    re = new RegExp('(jid=|jrndo=|jident=|jsite=|jsection=)[^&]+&?','g');
    noADPURL = noADPURL.replace(re, '');
    re = new RegExp('(&|\\?)$');
    noADPURL = noADPURL.replace(re, '');
  }
  if (window.name == null || window.name.length == 0) {
         window.name = Math.round(Math.random() * 100000);
  }
  if (typeof ADPident == 'undefined' || ADPident  ==  null || ADPident == 0) ADPident = 1;
  else ADPident += 1;
  if (adpfullarticle) {
    imatemplate = false;
    if (location.search.indexOf("jsite=") != -1 ) {
      re = new RegExp('(&|\\?)(jsite=)([^&]+)&?');
      re.exec(location.search);
      linksite = RegExp.$3;
      re = new RegExp('(&|\\?)(jsection=)([^&]+)&?');
      re.exec(location.search);
      linksection = RegExp.$3;
      if (adpsite == linksite && adpsection == linksection) {
        imatemplate = true;
      }
    }
    if (location.search == null || location.search.indexOf("jident") == -1) {
      fullartnum = 0;
      document.write('<SCR\IPT LANGUAGE=\"javascript\" SRC="' + adpurl +
                     '?jsite=' + adpsite + '&jsect=' + adpsection + '&jserv=' +
                     adpserver + '&jdb=' + adpdb + '&jpart=2&jnum=1&jident=' +
                     ADPident + escape(window.name) + '&jid=' + fullartnum +
                     '&jdurl=' + escape(noADPURL)  + '&jrndo='+
                     Math.round(Math.random() * 100000) + '"><\/SCR\IPT>');
    } else if (location.search.indexOf("jident="+ADPident) == -1 && imatemplate==false) {
       document.write('<SCR\IPT LANGUAGE="javascript" SRC="' + adpurl +
                      '?jsite=' + adpsite + '&jsect=' + adpsection + '&jserv=' +
                      adpserver + '&jdb=' + adpdb + '&jpart=2&jnum=1&jident=' +
                      ADPident + escape(window.name) +  '&jdurl=' +
                      escape(noADPURL) + '&jrndo='+
                      Math.round(Math.random() * 100000) +'"><\/SCR\IPT>');
    } else {
      re = new RegExp('(&|\\?)(jid=)([^&]+)&?');
      re.exec(location.search);
      fullartnum = RegExp.$3;
      document.write('<SCR\IPT LANGUAGE=\"javascript\" SRC="' + adpurl +
                     '?jsite=' + adpsite + '&jsect=' + adpsection + '&jserv=' +
                     adpserver + '&jdb=' + adpdb + '&jpart=2&jnum=1&jident=' +
                     ADPident + escape(window.name) + '&jid=' + fullartnum +
                     '&jdurl=' + escape(noADPURL)  + '&jrndo='+
                     Math.round(Math.random() * 100000) + '"><\/SCR\IPT>');
    }
  }
  if (adparchives) {
    document.write('<SCR\IPT LANGUAGE="javascript" SRC="' + adpurl + '?jsite=' +
                   adpsite + '&jsect=' + adpsection + '&jserv=' + adpserver +
                   '&jdb=' + adpdb + '&jpart=1&jnum=' + adpNumArchives +
                   '&jid=0&jident=' + ADPident + escape(window.name));
    if (adptemplateurl.length > 0) {
      document.write('&jturl=' + escape(adptemplateurl));
    }
    if (adpnewwindow != 'no') {
      document.write('&jnew=' + adpnewwindow);
    }
    document.write('&jdurl=' + escape(noADPURL)  + '&jrndo='+
                   Math.round(Math.random() * 100000) + '"><\/SCR\IPT>');
  }