String.prototype.startsWith = function(str)
{return (this.match("^"+str)==str)}

function JumpTo(page_link) {
  var xmlhttp=false;
/*@cc_on @*/
/*@if (@_jscript_version >= 5)
// JScript gives us Conditional compilation, we can cope with old IE versions.
// and security blocked creation of the objects.
 try {
  xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
 } catch (e) {
  try {
   xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  } catch (E) {
   xmlhttp = false;
  }
 }
@end @*/
    if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
        try {
            xmlhttp = new XMLHttpRequest();
            } catch (e) {
              xmlhttp=false;
        }
    }    
              xmlhttp.open("GET", "/portal/pls/portal/tracker?t_id=jumpto&t_page="+page_link+"&t_curl="+window.location.href);
              xmlhttp.send(null);
window.location=page_link;
}

window.onload=function(){
  clickingLinks();
}


var xmlhttp=false;
/*@cc_on @*/
/*@if (@_jscript_version >= 5)
// JScript gives us Conditional compilation, we can cope with old IE versions.
// and security blocked creation of the objects.
 try {
  xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
 } catch (e) {
  try {
   xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  } catch (E) {
   xmlhttp = false;
  }
 }
@end @*/
  function clickingLinks() 
  {
	  
    if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
        try {
            xmlhttp = new XMLHttpRequest();
            } catch (e) {
              xmlhttp=false;
        }
    }
    
    if (!xmlhttp && window.createRequest) {
        try {
            xmlhttp = window.createRequest();
        } catch (e) {
            xmlhttp=false;
        }
    }
    
      if (!document.getElementsByTagName) return;
      var anchors = document.getElementsByTagName("a");
        for (var i=0; i<anchors.length; i++) 
        {
          var anchor = anchors[i];
          if (anchor.getAttribute("href"))
          {
              anchor.onclick = function(){
              var linkText = this.innerHTML;
              
              var linkURL  = this.getAttribute('href');
              // Below condition is placed for cross browser issue
              // when this.getAttribute('href') is execute in IE gives full path
              // but in other browser it gives relative path
              if(!linkURL.startsWith("http://")){
            	  linkURL  = document.location.href+ this.getAttribute('href');
              }	   
              
              //alert("linkText - " + linkText + "\n " + "linkURL - " + linkURL);
              
//alert("/pls/portal/tracker?t_id="+linkText+"&t_page="+linkURL);
              xmlhttp.open("GET", "/portal/pls/portal/tracker?t_id="+linkText+"&t_page="+linkURL+"&t_curl="+window.location.href);
              //xmlhttp.open("GET", "tracker?t_id="+linkText+"&t_page="+linkURL+"&t_curl="+window.location.href);
              xmlhttp.send(null)
            }
          }
        }
  } 
 
