
function popUp(strURL,strType,strHeight,strWidth,winName) 
{ 
    var strOptions=""; 
    if (strType=="console") strOptions="resizable,height="+strHeight+",width="+strWidth; 
    if (strType=="fixed") strOptions="status,height="+strHeight+",width="+strWidth; 
    if (strType=="elastic") strOptions="toolbar,menubar,scrollbars,resizable,location,height="+strHeight+",width="+strWidth; 
    if (strType=="consolescrollbars") strOptions="resizable,scrollbars,height="+strHeight+",width="+strWidth; 
    if(winName==null) winName = 'newWin';
    newwindow = window.open(strURL, winName, strOptions); 
    if (window.focus) newwindow.focus();
}


function externalLinks() {
	
	
	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.getAttribute("rel") == "external" || 
			anchor.getAttribute("rel") == "external nofollow" || 
			anchor.getAttribute("rel") == "nofollow external" )
			)
		anchor.target = "_blank";
	}
}
window.onload = function() {
	externalLinks();
	addHandlers();
}




// Use traditional event model whilst support for event registration
// amongst browsers is poor.
// window.onload = addHandlers;

function addHandlers()
{
  var objAnchor = document.getElementById('external');

  if (objAnchor)
  {
    objAnchor.firstChild.data = objAnchor.firstChild.data + ' (opens in a new window)';
    objAnchor.onclick = function(event){return launchWindow(this, event);}
    // UAAG requires that user agents handle events in a device-independent manner
    // but only some browsers do this, so add keyboard event to be sure
    objAnchor.onkeypress = function(event){return launchWindow(this, event);}
  }
}

function launchWindow(objAnchor, objEvent)
{
  var iKeyCode, bSuccess=false;

  // If the event is from a keyboard, we only want to open the
  // new window if the user requested the link (return or space)
  if (objEvent && objEvent.type == 'keypress')
  {
    if (objEvent.keyCode)
      iKeyCode = objEvent.keyCode;
    else if (objEvent.which)
      iKeyCode = objEvent.which;

    // If not carriage return or space, return true so that the user agent
    // continues to process the action
    if (iKeyCode != 13 && iKeyCode != 32)
      return true;
  }

  bSuccess = window.open(objAnchor.href);

  // If the window did not open, allow the browser to continue the default
  // action of opening in the same window
  if (!bSuccess)
    return true;

  // The window was opened, so stop the browser processing further
  return false;
}