1. <html><head>
  2. <script type="text/javascript">
  3. window.onload = function() {
  4. // Parse the tracking code from cookies.
  5. var trk = "sentinel_org_block";
  6. var trkInfo = "sentinel_org_block";
  7. var cookies = document.cookie.split("; ");
  8. for (var i = 0; i < cookies.length; ++i) {
  9. if ((cookies[i].indexOf("trkCode=") == 0) && (cookies[i].length > 8)) {
  10. trk = cookies[i].substring(8);
  11. }
  12. else if ((cookies[i].indexOf("trkInfo=") == 0) && (cookies[i].length > 8)) {
  13. trkInfo = cookies[i].substring(8);
  14. }
  15. }
  16. // Get the protocol for the redirect url.
  17. var protocol = "http:";
  18. if (window.location.protocol == "https:") {
  19. protocol = "https:";
  20. } else {
  21. // If "sl" cookie is set, redirect to https.
  22. for (var i = 0; i < cookies.length; ++i) {
  23. if ((cookies[i].indexOf("sl=") == 0) && (cookies[i].length > 3)) {
  24. window.location.href = "https:" + window.location.href.substring(window.location.protocol.length);
  25. return;
  26. }
  27. }
  28. }
  29. // Get the new domain. For touch.www.linkedin.com or tablet.www.linkedin.com
  30. // we strip "touch." and "tablet.". For international domains such as
  31. // fr.linkedin.com, we convert it to www.linkedin.com
  32. var domain = location.host;
  33. if (domain.substr(0, 6) == "touch.") {
  34. domain = domain.substr(6);
  35. } else if (domain.substr(0, 7) == "tablet.") {
  36. domain = domain.substr(7);
  37. } else if (domain.charAt(2) == ".") {
  38. domain = "www" + domain.substr(2);
  39. }
  40. window.location.href = "https://" + domain + "/uas/login?trk=" + trk + "&trkInfo=" + trkInfo + "&session_redirect=" +
  41. encodeURIComponent(protocol + "//" + domain +
  42. window.location.href.substr(window.location.href.search(window.location.host) +
  43. window.location.host.length));
  44. }
  45. </script>
  46. </head></html>