//-----------------------------------------------------------------------------

// create non crawlable link non pop

function selflink() {

   var l  = '';

   for (i = 0; i < arguments.length; i++) { 

      l = l + arguments[i].replace('|','/');

   }

   if (l.charAt(0)=='#') l = l.substring(1,l.length);

   window.location.href=l;//specialescape(l);

}

//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------

// create non crawlable link

function link() {

   var l = '';

   for (i = 0; i < arguments.length; i++) { 

      l = l + arguments[i].replace('|','/');

   }

   if (l.charAt(0)=='#') l = l.substring(1,l.length);

   window.open(specialescape(l));

}





// escape some character

function specialescape(s) {

    // Don't treat cgi-style URLs because of all the '&' and likewise problems

    if (s.indexOf('?') == -1) {

        var sDomain = "";

        var sQuery  = s;

      

        // Strip off domain if exists (else we would encode the ':')

        // There might be port numbers ("http://some.domain.com:8080")!

        if (s.indexOf("://") != -1) {

            // 1st slash after the domain = beginning of query string

            var n = s.indexOf("/", s.indexOf("://")+3);

            if (n > -1) {

                sDomain = s.substring(0, n);

                sQuery  = s.substring(n);

            }

        }

        

        // Unescape (does nothing if it wasn't escaped, but if it was, we avoid double escaping)

        sQuery = unescape(sQuery);

        

        // Escape, so we don't rely on the browser to do this (some IE versions don't!)

        sQuery = escape(sQuery);

        

        // Rejoin with eventual domain

        s = sDomain + sQuery;

    }

    return s;   

}


