// Checks if the browsers is IE or another.
// document.all will return true or false depending if its IE
// If its not IE then it adds the mouse event
if (!document.all)
document.captureEvents(Event.MOUSEMOVE)

// On the move of the mouse, it will call the function getPosition
document.onmousemove = getPosition;

// These varibles will be used to store the position of the mouse
var X = 0
var Y = 0

// This is the function that will set the position in the above varibles 
function getPosition(args) 
{
  // Gets IE browser position
  if (document.all) 
  {
	var sLeft=document.documentElement?document.documentElement.scrollLeft:document.body.scrollLeft;
	var sTop=document.documentElement?document.documentElement.scrollTop:document.body.scrollTop;
    X = event.clientX + sLeft
    Y = event.clientY + sTop
  }
  
  // Gets position for other browsers
  else 
  {  
    X = args.pageX
    Y = args.pageY
  }  
}

function popUp()
{
    var div;
    if(document.getElementById)
    // Standard way to get element
    div = document.getElementById('linkpopup'); 
    else if(document.all) 
    // Get the element in old IE's 
    div = document.all['linkpopup']; 
    
    // if the style.display value is blank we try to check it out here 
    if(div.style.display==''&&div.offsetWidth!=undefined&&div.offsetHeight!=undefined)
    {
        div.style.display = (div.offsetWidth!=0&&div.offsetHeight!=0)?'block':'none'; 
    }

    // if passed custom url and/or title then set values
    if (arguments.length > 0) {
    	
    	var overrideUrl = (arguments && arguments[0] != null) ? arguments[0] : null;
    	var overrideTitle = (arguments && arguments[1] != null) ? arguments[1] : null;

    	if (overrideUrl != null) {
			document.linkToPageFrm.textfield[0].value = overrideUrl;
		}
		if (overrideTitle != null) {
			var shortTitle = (overrideTitle.indexOf("/") > -1) ? overrideTitle.substring(overrideTitle.lastIndexOf("/")+1, overrideTitle.length) : overrideTitle;
			var newValue = "<a href=\"" + document.linkToPageFrm.textfield[0].value + "\" title=\"" + shortTitle + "\">Click here to view " + shortTitle + "</a>";
			document.linkToPageFrm.textfield[1].value = newValue;
		}
    }
    
    // If the PopUp is hidden ('none') then it will display it ('block').
    // If the PopUp is displayed ('block') then it will hide it ('none').
    div.style.display = (div.style.display==''||div.style.display=='block')?'none':'block';
    
    // Off-sets the X position and Y position
    //X = X - 300;
	X = 470;
	Y = Y + 10;
    
    // Sets the position of the DIV
    div.style.left = X+'px';
    div.style.top = Y+'px';
}

