Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

51 lines
2.0 KiB

  1. function jsTrim(s) {return s.replace(/(^\s+)|(\s+$)/g, "");}
  2. function trackInfo(objLink)
  3. {
  4. if (!objLink) return;
  5. if (!objLink.LinkID || !objLink.href) return;
  6. // For Link Text - take innerText if available, or ALT if image
  7. var LinkText;
  8. if (objLink.innerText) LinkText = objLink.innerText; // <A>text</A> link
  9. else if (objLink.alt) LinkText = objLink.alt; // <AREA> image map link
  10. else if (objLink.all(0)) LinkText = objLink.all(0).alt; // <A><IMG ALT="..."></A> link
  11. if (!LinkText || typeof(LinkText)=="undefined") return;
  12. LinkText = jsTrim(LinkText);
  13. if (LinkText=="") return;
  14. // override link's HREF and send on its way
  15. // Sometimes with slow browser reaction and rapid clicks this can get called more than once -
  16. // ensure there's no repetition.
  17. if (objLink.href.toString().indexOf("CTRedir") < 0)
  18. objLink.href = "/isapi/CTRedir.asp?type=CT&source=WWW&sPage="
  19. + ((objLink.LinkID)?escape(objLink.LinkID):"") + "|"
  20. + ((objLink.LinkArea)?escape(objLink.LinkArea):"") + "|"
  21. + ((objLink.LinkGroup)?escape(objLink.LinkGroup):"") + "|"
  22. + escape(LinkText)
  23. + "&tPage=" + objLink.href;
  24. }
  25. function trackSearch(objLink, objText)
  26. {
  27. if (!objLink) return true;
  28. if (!objText) return true;
  29. if (!objLink.LinkID || !objLink.href || !objText.value) return true;
  30. // override link's HREF and send on its way
  31. // For Link Text - take innerText if available, or ALT if image
  32. // Sometimes with slow browser reaction and rapid clicks this can get called more than once -
  33. // ensure there's no repetition.
  34. if (objLink.href.toString().indexOf("CTRedir") < 0)
  35. objLink.href = "/isapi/CTRedir.asp?type=CT&source=WWW&sPage="
  36. + ((objLink.LinkID)?escape(objLink.LinkID):"") + "|"
  37. + ((objLink.LinkArea)?escape(objLink.LinkArea):"") + "|"
  38. + ((objLink.LinkGroup)?escape(objLink.LinkGroup):"") + "|"
  39. + "Search"
  40. + "&tPage=" + objLink.href + objText.value;
  41. objLink.click(); // click on the link to navigate - allows to have HTTP_REFERRER in CTRedir.asp
  42. return false;
  43. }