
    ///////////////////////////////////////////////////
    // Internal Variables
    ///////////////////////////////////////////////////
    var IE = document.all ? true : false
    if (!IE) document.captureEvents(Event.MOUSEUP)

    document.onmouseup = GetMouseXY;

    var sTime = Date();

    ///////////////////////////////////////////////////
    // Capture MouseUP Events
    ///////////////////////////////////////////////////
    function GetMouseXY(e) {
      var posx = 0;
      var posy = 0;

      if (!e) var e = window.event;
      if (e.pageX || e.pageY) {
        posx = e.pageX;
        posy = e.pageY;
      }
      else if (e.clientX || e.clientY) {
        posx = e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft;
        posy = e.clientY + document.body.scrollTop + document.documentElement.scrollTop;
      }


      // Get the current page name, or user supplied page name
      var sPage;
      //sPage = HMC_DefaultPageName;

     
        var sPath = window.location.pathname;
        sPage = sPath.substring(sPath.lastIndexOf("/") + 1);

        // There"s a possibility that sPage will be NULL due to the default page of a site or virtual site
        // If that"s the case, alert user
        // i.e http:///www.somewhere.com/
        if ((sPage == "") || (sPage == null)) {
          sPage = window.location.href;
        }


        sPage = 'Something';
      


      $jQuery.ajax({
        type: "POST",
        url: getRootURL() + "ClickService.asmx/SaveClick",
        data: '{ "X":"' + posx + '", "Y":"' + posy + '", "P":"' + window.location.pathname + '" }',
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (msg) { },
        error: function (xhr, msg, e) { }
      });


      // Let the mouse event continue normally
      return true;
    }
    function getRootURL() {
      var baseURL = location.href;
      var rootURL = baseURL.substring(0, baseURL.indexOf("/", 14));

      // if the root url is localhost, don"t add the directory as cassani doesn"t use it
      if (baseURL.indexOf("localhost") != -1) {
        return rootURL + "/";
      }
      else {
        return rootURL + "/";
      }
    }
    ///////////////////////////////////////////////////
