function newWin(pageToLoad,name,attributes) {
	var	newWindow = window.open(pageToLoad,name,attributes);
	newWindow.location = pageToLoad;
	newWindow.focus();
}

function autoSize() {
//	var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
	var screenHeight = screen.availHeight;
	var screenWidth = screen.availWidth;
	var arSizes = new Array();
	arSizes[0] = screenHeight - 250;
	arSizes[1] = screenWidth - 100;
	return arSizes;
}

function openMDA (whatPage) {
	var MDApage = (whatPage != undefined) ? whatPage : "mda_index.html";
	var URL = "mda/index.html?page=" + MDApage; //"downloads/bmo_ar04_mda.pdf"; 
	var name = "mda";
	var arSizes = autoSize();
	var height = arSizes[0];
	var width = arSizes[1];
	var yPos = (screen.availHeight/2) - (height/2) - 70;
	var xPos = (screen.availWidth/2) - (width/2);
	var attributes='menubar=yes,toolbar=yes,location=yes,status=yes,scrollbars=yes,resizable=yes,width='+width+',height='+height+',top='+yPos+',left='+xPos+',screenY='+yPos+',screenX='+xPos;
	newWin(URL,name,attributes);
}

//var arNotesPages = new Array(0,6,7,7,10,12,13,14,15,16,21,22,23,23,24,24,25,26,27,28,30,33,34,35,37,37,38,39);

function openNotes (id) {
	var whatNote = (id != undefined) ? id : 1;
	//var pdfPage = arNotesPages[whatNote];
	var URL = "notes/index.html?note=" + whatNote; //"downloads/bmo_ar04_cfs.pdf#page=" + pdfPage; //
	var name = "notes";
	var arSizes = autoSize();
	var height = arSizes[0];
	var width = arSizes[1];
	var yPos = (screen.availHeight/2) - (height/2) - 70;
	var xPos = (screen.availWidth/2) - (width/2);
	var attributes='menubar=yes,toolbar=yes,location=yes,status=yes,scrollbars=yes,resizable=yes,width='+width+',height='+height+',top='+yPos+',left='+xPos+',screenY='+yPos+',screenX='+xPos;
	newWin(URL,name,attributes);
}

function openSurvey() {
	var URL = '/arsurvey/surveyForm/';
	var name = 'survey';
	var attributes = 'menubar=no,toolbar=no,location=no,status=yes,scrollbars=yes,resizable=yes,width=700,height=350';	
	newWin(URL,name,attributes);
}

function openInParent(whatPage) {
	window.parent.opener.location=whatPage;
	window.parent.opener.focus();
//	window.parent.close();
}