// ===================================================================
// Author: Phil Servis
// (c)2004 Atlas Direct / Phil Servis
// Controls Information Pane
// Params:
//	infoPage_in: string - relative path to document to display.
//	nPos: 		 integer - position to display info pane. 1=TopLeft, 2=TopRight, 3=BottomLeft, 4=BottomRight
// ===================================================================

function writeInfoPane() {
var retVal
retVal = '<div name="InfoPane" runat=server id="InfoPane" style="position:absolute;top:40;left:20;width:500;height:350px;z-index:1200;visibility:hidden; background-color:whitesmoke">';
retVal = retVal + '<iframe name="InfoPaneContent" id="InfoPaneContent" style="position:absolute; left=0;width:100%;height:100%;z-index:1201; border-width=0px;" src="help/inc_loading.asp" ' + ((navigator.appName.indexOf('Explorer-TEMPORARYDISABLED')>0) ? 'onblur="InfoPane.style.visibility=\'hidden\';">' :  '>') + 'You browser can\'t display inline frames.  Please <a href="inc_ShowCoverDetail.asp" target=_blank>click here</a> to show in a seperate window.</iframe></div>';
return retVal;}

function openInfoPane(infopage_in, nPos) {
  var infoPane, infoPaneContent
  var coords= new Object();
  var posx, posy;
  var windowHeight =(window.innerHeight ? window.innerHeight + window.pageYOffset : document.body.clientHeight + document.body.scrollTop);
  var windowWidth = (window.innerWidth ? window.innerWidth + window.pageXOffset : document.body.clientWidth + document.body.scrollLeft);
  var infoPaneHeight 
  var infoPaneWidth 
  infoPaneContent = document.getElementById('InfoPaneContent');
  infoPaneContent.src=infopage_in;
  infoPane = document.getElementById('InfoPane');
  posx=0;
   do {posx=posx+1
  }
  while (infoPaneContent.readystate!='complete' && posx<250);  
  if (typeof(nPos)=='string')
  {
  	coords = getAnchorPosition(nPos);
  	posx=coords.x;
  	posy=coords.y + 20;
  } else
  {
  
  switch (nPos)  {
		case 1:
  		posx=30;
  		posy=10;
  		break;
 	case 2:
  		posx=windowWidth - (infoPane.offsetWidth);
  		posy=10;
  		break;
  	case 3:
  		posx=(window.innerWidth ? window.innerWidth + window.pageXOffset : document.body.clientWidth + document.body.scrollLeft) - (infoPane.offsetWidth);
  		posy=10;
  		break;
  	case 4:
  		posx=(window.innerWidth ? window.innerWidth + window.pageXOffset : document.body.clientWidth + document.body.scrollLeft) - (infoPane.offsetWidth);
		posy= windowHeight - (infoPane.offsetHeight);
  		break;
  	default :
  	  	posx=document.body.offsetWidth - (infoPane.offsetWidth + 40);
  	  	posy=10;
  		break; 
  };
  }
  if ((posx + (infoPane.offsetWidth))>windowWidth+10) {
  	posx = windowWidth - infoPane.offsetWidth;
  };
  if ((posy + (infoPane.offsetHeight))>windowHeight +10) {
  	posy = windowHeight - (infoPane.offsetHeight);
  	if (posy <= 0) {
  	posy=1;}
  };
  infoPane.style.left=posx; 
  infoPane.style.top=posy; 
  if (infoPane.style.height>=375) {
 	infoPane.style.height=375;   }
  infoPane.style.visibility='visible';    
  
}
