//popup window with the terms of use agreement
function modal(place) {
	//var features='width=360,height=300';
	var features = findCenter();
	var modalWin=window.open(place,"terms",features);
	modalWin.focus();
}

//find center of screen to put modal window into
function findCenter() {
	if (window.screen) {
		var nWidth= 380;
		var nHeight= 350;
		var nLeft = 10;
		var nTop = 10;
		nLeft=(window.screen.availWidth - nWidth)/2;
		nTop=(window.screen.availHeight - nHeight)/2;
		var features = 'width='+nWidth+',height='+nHeight+',left='+nLeft+',top='+nTop;
	}
	else {
		var features='width=380,height=350';
	}

	//return the width and height and location of the window in the center of the screen
	return features;
}

function gotoburnabymap(n){
	info=window.open("http://webmap.city.burnaby.bc.ca");
}


var popImg = null  // use this when referring to pop-up image
var picTitle = null
var imgCount = 0
var imgWinName = "popImg"

function openPopImg(picName, windowTitle, windowWidth, windowHeight){
  closePopImg()
  picTitle = windowTitle
  imgWinName = "popImg" + imgCount++ //unique name for each pop-up window
  popImg = window.open(picName, imgWinName,
           "toolbar=no,scrollbars=no,resizable=no,width=" 
           + (parseInt(windowWidth)+20)  + ",height=" 
           + (parseInt(windowHeight)+15)) 
  }

function closePopImg(){    // close pop-up window if it is open 
  if (navigator.appName != "Microsoft Internet Explorer" 
      || parseInt(navigator.appVersion) >=4) //do not close if early IE
    if(popImg != null) if(!popImg.closed) popImg.close() 
  }

function setStatus(msg){
  status = msg
  return true
  }
