  // --------------------------------------------------------------------------
  
  var topVal;
  var leaving;
    
  $(document).ready(function () {
	
	$("a.prompt").click(function(e) {
		topVal = null;
		topVal = e.pageY - 10 + "px";
		destiNation = $(this).attr("href");
		leaving = "<p>By following the link, you will be leaving the Hyperion Therapeutics website. Hyperion Therapeutics did not prepare the information on the linked websites, nor does it monitor or endorse the content of the linked website. Hyperion Therapeutics is not responsible for the information found on the linked site, including any information that may be about Hyperion Therapeutics. The links are provided only as citations and aids to help you locate and identify other Internet resources that may be of interest. These links are not intended to state or imply that Hyperion Therapeutics has sponsored, approved, or adopted any materials on the linked website or that it is legally authorized to use any trade name, trademark, logo, seal or copyrighted information reflected in the linked site.</p>";
		doLeave(destiNation, false);
		return false;	
	});
  
  });
  
  function doLeave(href, cancel) {
	
	var scrolledX = document.body.scrollLeft || document.documentElement.scrollLeft || self.pageXOffset;
    var scrolledY = document.body.scrollTop || document.documentElement.scrollTop || self.pageYOffset;

    if (!scrolledX) {
      scrolledX = 0;
    }

    if (!scrolledY) {
      scrolledY = 0;
    }

    var screenWidth = document.body.clientWidth || document.documentElement.clientWidth || self.innerWidth;
    var screenHeight = document.body.clientHeight || document.documentElement.clientHeight || self.innerHeight;

    var left = (scrolledX + screenWidth - $("#divFloatPop").width())/2 - 20;
    //var top = (scrolledY + screenHeight - $("#divFloatPop").height())/2;
	var top = scrolledY + 150;

    //Set the popup window to center
    $("#divFloatPop").css('top', ''+top+'px');
    $("#divFloatPop").css('left', ''+left+'px');

	$("#divFloatPop").fadeIn("normal");
	$("#divFloatPop").html(leaving);
	$("#divFloatPop").append('<div style="clear: both; height: 25px"><!-- c --></div>');
	
	if (cancel) {
		$("#divFloatPop").append('<a href="#" onclick="return stay();">Cancel</a>');
	} else {
		$("#divFloatPop").append('<a href="#" onclick="return stay();">Close</a>');	
	}
	
	if (href) {
		$("#divFloatPop").append('<a onclick="stay();" target="_blank" href="'+ destiNation +'">Continue</a>');
	} 
	
  }
  
  function stay() {
		destiNation = '';
		$("#divFloatPop").fadeOut("normal");
		return false;	  
  }

  // ------------------------------------------------------------------
