// Quick way to test for Nav4 and IE4
version4 = false
if(navigator.appVersion.charAt(0) == "4") version4 = true

function displayPopup(url,name,height,width,evnt) {
 var properties = "toolbar=0,location=0,height="+height
 properties = properties+",width="+width
 if(evnt != null) {
  if(navigator.appName == "Microsoft Internet Explorer") {
  properties = properties+",left="+(evnt.screenX + 10)
   properties = properties+",top="+(evnt.screenY + 10)
  }else { // Navigator coordinates must be adjusted for scrolling
   properties = properties+",left="+(evnt.screenX - pageXOffset + 10)
   properties = properties+",top="+(evnt.screenY - pageYOffset + 10)
  }
 }
 popupHandle = open(url,name,properties)
}

function closePopup() {
 // mouseOut was introduced with JavaScript 1.1, so Navigator 2 users will
 // have to manually close the window
 if(popupHandle != null && !popupHandle.closed) popupHandle.close()
}


function OpenWin(sName) 
{
	var sFeatures;
	sFeatures = 'height=280,width=418,fullscreen=0,titlebar=1,channelmode=0,status=0,scrollbars=1,toolbar=0,location=0,directories=0,menubar=0,left=' + parseInt(screen.width/2 - (400/2)) + ',top=' + parseInt(screen.height/2 - (300/2));
	window.open(sName,null,sFeatures);
}

function Breakoff(sName) 
{
	var sFeatures;
	sFeatures = 'height=400,width=500,fullscreen=0,titlebar=1,channelmode=0,status=1,scrollbars=1,toolbar=1,location=0,directories=0,menubar=0,left=' + parseInt(screen.width/2 - (400/2)) + ',top=' + parseInt(screen.height/2 - (300/2));
	window.open(sName,null,sFeatures);
}


function openAnyWindow(url, name) {

  var l = openAnyWindow.arguments.length;
  var w = "";
  var h = "";
  var features = "";

  for (i=2; i<l; i++) {
    var param = openAnyWindow.arguments[i];
    if ( (parseInt(param) == 0) ||
      (isNaN(parseInt(param))) ) {
      features += param + ',';
    } else {
      (w == "") ? w = "width=" + param + "," :
        h = "height=" + param;
    }
  }

//  features+='left=' + parseInt(screen.width/2 - (400/2)) + ',top=' + parseInt(screen.height/2 - (300/2))
	features+='left=50,top=50'

  features += w + h;
  var code = "popupWin = window.open(url, name";
  if (l > 2) code += ", '" + features;
  code += "')";
  eval(code);
}


function SurfParentCloseMe(TargetURL)
{
	window.opener.location.href = TargetURL;
	window.close();
}


function OpenWindowCloseMe(TargetURL)
{
	openAnyWindow(TargetURL, 'remote', 600, 500, 'scrollbars', 'status', 'toolbar');
}


var phid=0;
//window.name="msnMain"; 
function MCHelp(phid)
{

	var h_win=window.open("/panehelp.asp?id=" + phid,"_helpdriver", "toolbar=0,status=0,menubar=0,width=100,height=100,left=100,top=2000,resizable=0");

}



function SymbolLookup(fieldname,formname,arg1,arg2)
	{
//	var strLink;
//	strLink = '/BI4/Investor/Quotes/FinderPopup.asp?fld=' + fieldname + '&form=' + formname + '&industry=' + arg1 + '&subgroup=' + arg2;
//	openAnyWindow(strLink,'Lookup',600,350,'status','scrollbars');
	document.location.href='/bi4/investor/quotes/finder.asp';
	}


function SymbolLookupReturnASX(code)
	{
	window.opener.document.GetQuote.asxcode.value = code;
	window.close()
	}
		
	
function DetectWindowSize()
	{
	var height, width;

	if (document.all)
	    height = document.body.offsetHeight, width = document.body.offsetWidth;
	else if (document.layers)
	    height = window.innerHeight, width = window.innerWidth;
	}
	


//PORTFOLIO//

function CancelPopup()
{
	window.close();
}

function EditPortfolio(thepid)
{
	DoHelp('','',"cportfoliomanage_portfoliomodifydetails.asp")
}


function glossaryId(id) {
  filename = "glossary.asp?glossaryId="+id;
  window.open(filename, "Glossary", "width=275,height=300,resizable=no,scrollbars=yes");
}

//
